junit.framework
Class SystemTestCase

java.lang.Object
  extended byjunit.framework.Assert
      extended byjunit.framework.TestCase
          extended byjunit.framework.SystemTestCase
All Implemented Interfaces:
Test

public abstract class SystemTestCase
extends TestCase

SystemTestCase is the best starting point to learn the services avilable in JSystem. Every test that uses the JSystem framework should extend SystemTestCase. SystemTestCase extends JUnit TestCase, and can be executed from any JUnit runner. The following services available be using this class: Fixture management - enable you to define a tree of fixtures, bind tests to the fixtures and automaticly execute and navigate the fixture tree. Reporting - enable extendable detail reporting service. This service enable to log positive events from your tests and interfaces. A hierarchal HTML view of the result is available. You can use it to track complex functional/system tests. You can extend it by writing you own reporting layer. SUT (System Under Test) independent - a layer that enable a test to run on deferent setups. System object - Enable you to manage the interfaces to your system in one easy to use object.


Field Summary
static Reporter report
          Use it to log positive events from your test.
static Sut sut
          Use it to get information about the setup/system you are testing.
 SystemObjectManager system
          Use it to access the interfaces of your tested system.
 
Constructor Summary
SystemTestCase()
          No-arg constructor to enable serialization.
SystemTestCase(String name)
          Constructs a test case with the given name.
 
Method Summary
 Class getFixture()
          Get the fixture this test is bind to.
 Class getTearDownFixture()
          Get the fixture to fall to if the test fail.
 boolean isPass()
           
 void run(TestResult result)
          Runs the test case and collects the results in TestResult.
 void runBare()
          Runs the bare test sequence.
 void setFixture(Class fixture)
          Set the fixture to be used when executing this test.
 void setTearDownFixture(Class tearDownFixture)
          Set the fixture to fall to in case of test fail.
 void sleep(long time)
          Go to sleep
 
Methods inherited from class junit.framework.TestCase
countTestCases, createResult, getName, 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
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

report

public static Reporter report
Use it to log positive events from your test.


sut

public static Sut sut
Use it to get information about the setup/system you are testing.


system

public SystemObjectManager system
Use it to access the interfaces of your tested system.

Constructor Detail

SystemTestCase

public SystemTestCase()
No-arg constructor to enable serialization. This method is not intended to be used by mere mortals without calling setName().


SystemTestCase

public SystemTestCase(String name)
Constructs a test case with the given name.

Method Detail

run

public void run(TestResult result)
Runs the test case and collects the results in TestResult.


runBare

public void runBare()
             throws Throwable
Runs the bare test sequence.

Throws:
Throwable - if any exception is thrown

getFixture

public Class getFixture()
Get the fixture this test is bind to.

Returns:
The bond fixture class.

setFixture

public void setFixture(Class fixture)
Set the fixture to be used when executing this test. It's the framework responsebility to navigate to the requested fixture. The test can and should asume it's running under this fixture configurations.

Parameters:
fixture - The fixture to bind to.

getTearDownFixture

public Class getTearDownFixture()
Get the fixture to fall to if the test fail.

Returns:
The fixture to fall to class.

setTearDownFixture

public void setTearDownFixture(Class tearDownFixture)
Set the fixture to fall to in case of test fail. If exist the failTearDown method will be executed (if not the tearDown will be used).

Parameters:
tearDownFixture - The fail to fixture.

isPass

public boolean isPass()
Returns:
Returns the isPass.

sleep

public void sleep(long time)
Go to sleep

Parameters:
time - sleep time