|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjunit.framework.Assert
junit.framework.TestCase
org.sysunit.SystemTestCase
public class SystemTestCase
Base for all system tests.
A test with multiple threads of execution (possibly distributed
across multiple machines) should descend from SystemTestCase
.
TBean
,
TBeanManager
,
TBeanManagerFactory
,
TBeanSynchronizer
Constructor Summary | |
---|---|
SystemTestCase()
Construct. |
|
SystemTestCase(String testName)
Construct. |
Method Summary | |
---|---|
void |
addTBeanFactory(String name,
TBeanFactory tbeanFactory)
Add a TBeanFactory to this test. |
void |
assertValid()
Perform default post-validation assertion. |
TBeanFactory[] |
getTBeanFactories()
Retrieve all TBeanFactory s. |
TBeanFactory |
getTBeanFactory(String name)
Retrieve a TBeanFactory by name. |
String[] |
getTBeanFactoryNames()
Retrieve an array of TBeanFactory names. |
protected TBeanManager |
getTBeanManager()
Retrieve the TBeanManager . |
void |
runBare()
|
protected void |
setTBeanManager(TBeanManager tbeanManager)
|
protected void |
setUpTBeans()
Set up the TBean s. |
protected void |
sync(String syncPoint)
Synchronize a synthesized ThreadMethodTBean at
a sync-point. |
protected void |
tearDownTBeans()
Tear down the TBean s. |
void |
testSystem()
Default test. |
protected Throwable[] |
validateTBeans()
|
Methods inherited from class junit.framework.TestCase |
---|
countTestCases, createResult, getName, run, run, runTest, setName, setUp, tearDown, toString |
Methods inherited from class junit.framework.Assert |
---|
assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, fail, fail, failNotEquals, failNotSame, failSame |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public SystemTestCase()
public SystemTestCase(String testName)
testName
- The name of the test to run.Method Detail |
---|
public void addTBeanFactory(String name, TBeanFactory tbeanFactory)
TBeanFactory
to this test.
name
- The unique name of the factory.tbeanFactory
- The TBean factory.public TBeanFactory[] getTBeanFactories()
TBeanFactory
s.
public TBeanFactory getTBeanFactory(String name)
TBeanFactory
by name.
name
- The unique TBeanFactory name.
null
.public String[] getTBeanFactoryNames()
TBeanFactory
names.
public void runBare() throws Throwable
runBare
in class junit.framework.TestCase
Throwable
TestCase
protected void setUpTBeans() throws Exception
TBean
s.
Exception
- If an error occurs.protected Throwable[] validateTBeans() throws Exception
Exception
protected void tearDownTBeans() throws Exception
TBean
s.
Exception
- If an error occurs.protected TBeanManager getTBeanManager() throws Exception
TBeanManager
.
This method may create a new TBeanManager
using the TBeanManagerFactory
the first
time it is called.
Exception
- If an error occurs while attempting
to instantiate the TBeanManager.TBeanManagerFactory
protected void setTBeanManager(TBeanManager tbeanManager)
protected void sync(String syncPoint) throws SynchronizationException, InterruptedException
ThreadMethodTBean
at
a sync-point.
This method is usable only by reflected/synthesized
ThreadMethodTBean
instances. It replaces the
sync(...)
method in AbstractSynchronizableTBean
.
This method relies upon ThreadLocal
data-structures
that are configured by the test-runner.
syncPoint
- The sync-point.
SynchronizationException
- If an error occurs while attempting
to perform synchronization.
InterruptedException
- If the synchronization is interrupted.AbstractSynchronizableTBean
public void testSystem() throws Exception
This test, by default, performs nothing and only
calls assertValid()
, which itself is defaultly
a no-op. This structure allows the simplest tests to
be completely contained within the TBeans or threads.
Exception
- If an error occurs.assertValid()
public void assertValid() throws Exception
Exception
- If an error occurs.testSystem()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |