public abstract class RiceTestCase extends BaseRiceTestCase
Modifier and Type | Field and Description |
---|---|
protected static String |
DEFAULT_TEST_HARNESS_SPRING_BEANS |
protected static String |
failedSuiteTestName |
protected static org.apache.log4j.Logger |
LOG |
protected List<Lifecycle> |
perTestLifeCycles |
protected static boolean |
SUITE_LIFE_CYCLES_FAILED |
protected static boolean |
SUITE_LIFE_CYCLES_RAN |
protected List<Lifecycle> |
suiteLifeCycles |
log, method
Constructor and Description |
---|
RiceTestCase() |
Modifier and Type | Method and Description |
---|---|
protected void |
configureLogging()
configures logging using custom properties file if specified, or the default one.
|
protected String |
dumpMemory() |
protected List<String> |
getConfigLocations()
Subclasses may override this method to customize the location(s) of the Rice configuration.
|
protected String |
getFullTestName() |
protected Lifecycle |
getLoadApplicationLifecycle()
This should return a Lifecycle that can be used to load the application
being tested.
|
protected abstract String |
getModuleName()
same as the module directory in the project.
|
protected String |
getModuleTestConfigLocation() |
protected List<Lifecycle> |
getPerTestLifecycles() |
protected String |
getRiceMasterDefaultConfigFile() |
protected List<Lifecycle> |
getSuiteLifecycles()
Returns the List of Lifecycles to start when the unit test suite is started
|
protected Config |
getTestHarnessConfig() |
protected List<String> |
getTestHarnessSpringBeansLocation()
Returns the location of the test harness spring beans context file.
|
SpringResourceLoader |
getTestHarnessSpringResourceLoader() |
protected String |
getUserDir()
the absolute path on the file system to the root folder of the maven module containing a child of this class
e.g.
|
protected void |
loadPerTestData()
A method that can be overridden to load test data on a test-by-test basis
|
protected void |
loadSuiteTestData()
A method that can be overridden to load test data for the unit test Suite.
|
protected void |
logAfterRun() |
protected void |
logBeforeRun() |
protected void |
report(String report) |
protected void |
setBaseDirSystemProperty(String moduleBaseDir)
maven will set this property and find resources from the config based on it.
|
protected void |
setClearTables(boolean clearTables) |
protected void |
setModuleName(String moduleName) |
void |
setUp() |
protected void |
setUpInternal()
Internal setUp() implementation which is invoked by the main setUp() and wrapped with exception handling
|
protected void |
startLifecycles(List<Lifecycle> lifecycles)
Executes the start() method of each of the lifecycles in the given list.
|
protected void |
startSuiteDataLoaderLifecycles()
This block is walking up the class hierarchy of the current unit test looking for PerSuiteUnitTestData annotations.
|
protected void |
stopLifecycles(List<Lifecycle> lifecycles)
Executes the stop() method of each of the lifecyles in the given list.
|
void |
tearDown() |
getName, getPerTestDataLoaderLifecycle, getTestMethod, resetLogLevels, setLogLevel, setName, setTestMethod
protected static final org.apache.log4j.Logger LOG
protected static final String DEFAULT_TEST_HARNESS_SPRING_BEANS
protected static boolean SUITE_LIFE_CYCLES_RAN
protected static boolean SUITE_LIFE_CYCLES_FAILED
protected static String failedSuiteTestName
protected List<Lifecycle> perTestLifeCycles
protected List<Lifecycle> suiteLifeCycles
public RiceTestCase()
public void setUp() throws Exception
setUp
in class BaseRiceTestCase
Exception
protected void setUpInternal() throws Exception
Subclasses should override this method if they want to add set up steps that should occur in the standard set up process, wrapped by exception handling.
Exception
protected void startSuiteDataLoaderLifecycles() throws Exception
Exception
- if a PerSuiteDataLoaderLifecycle is unable to be startedprotected void setBaseDirSystemProperty(String moduleBaseDir)
protected String getUserDir()
the user.dir property can be set on the CLI or IDE run configuration e.g. -Duser.dir=/some/dir
protected void setModuleName(String moduleName)
public void tearDown() throws Exception
tearDown
in class BaseRiceTestCase
Exception
protected void logBeforeRun()
protected void logAfterRun()
protected String getFullTestName()
protected void configureLogging() throws IOException
To configure a custom logging file, set a JVM system property on using -D. For example -Dalt.log4j.config.location=file:/home/me/kuali/test/dev/log4j.properties
The above option can also be set in the run configuration for the unit test in the IDE. To avoid log4j using files called log4j.properties that are defined in the classpath, add the following system property: -Dlog4j.defaultInitOverride=true
IOException
protected void startLifecycles(List<Lifecycle> lifecycles) throws Exception
Exception
protected void stopLifecycles(List<Lifecycle> lifecycles) throws Exception
Exception
protected List<Lifecycle> getSuiteLifecycles()
protected Lifecycle getLoadApplicationLifecycle()
protected List<Lifecycle> getPerTestLifecycles()
protected void loadSuiteTestData() throws Exception
Exception
protected void loadPerTestData() throws Exception
Exception
protected String dumpMemory()
public SpringResourceLoader getTestHarnessSpringResourceLoader()
protected List<String> getTestHarnessSpringBeansLocation()
protected Config getTestHarnessConfig() throws Exception
Exception
protected List<String> getConfigLocations()
protected String getModuleTestConfigLocation()
protected String getRiceMasterDefaultConfigFile()
protected abstract String getModuleName()
protected void setClearTables(boolean clearTables)
Copyright © 2005–2016 The Kuali Foundation. All rights reserved.