
de.tsl2.nano.service.util.BaseServiceTest Maven / Gradle / Ivy
Show all versions of tsl2.nano.serviceaccess Show documentation
/*
* File: $HeadURL$
* Id : $Id$
*
* created by: Thomas Schneider
* created on: Apr 26, 2010
*
* Copyright: (c) Thomas Schneider 2010, all rights reserved
*/
package de.tsl2.nano.service.util;
import java.util.HashSet;
import java.util.LinkedHashSet;
import java.util.Properties;
import java.util.Set;
import org.apache.commons.logging.Log;
import org.junit.After;
import de.tsl2.nano.core.log.LogFactory;
import de.tsl2.nano.execution.ScriptUtil;
import de.tsl2.nano.serviceaccess.ServiceFactory;
/**
* Base class for service tests.
*
* overwrite the {@link #getService(Class)} method, if you want to login to a special user, to get the roles, the user
* entity and the mandator entity. another way would be to create the service inside your setUp method.
*
* to do a real login, use the method {@linkplain ServiceFactory#login(String, ClassLoader, String, String)}.
*
* the creation of your test data will be done by the {@link #createTestData(String)} method, if
* {@link #CREATE_SPECIFIC_TESTDATA} is true.
*
* @author Thomas Schneider
* @version $Revision$
*/
public abstract class BaseServiceTest extends RemoteServiceRunner {
protected static final Log LOG = LogFactory.getLog(BaseServiceTest.class);
/** should be used to ask before creating the test data in setUp() */
protected static final boolean CREATE_SPECIFIC_TESTDATA = false;
/** collection of entities, created through this test and to be removed after test */
static Set