|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjsystem.framework.fixture.Fixture
What is a fixture? A fixture represents a state of the Software/System you are testing. Let’s say you are testing a web application. One fixture (and obviously the basic) can be your machine without anything install on it, you can define it as your root fixture. A second fixture can be the machine install with the application you are testing. Additional fixture can be your application configured with some data. To define a fixture 2 things should be defined: setup - the way to get to the fixture and teardown - the way from the fixture to it parent state. In our model the fixture are arranged in tree. Every fixture can set it parent fixture. Why do you need fixtures? Every test, especially functional/system test, have a fixture. In some of the cases the fixture is very complicated. A not so good solution to the problem will be to enter the fixture setting to the test itself. Fixture management gives better alternative.
Field Summary | |
static Reporter |
report
Use it to log positive events from your test. |
static int |
SETUP_DIRECTION
|
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. |
static int |
TEARDOWN_DIRECTION
|
static int |
TEARDOWN_FAIL_DIRECTION
|
Constructor Summary | |
Fixture()
|
Method Summary | |
void |
failTearDown()
failTearDown will be invoke if a test that failed defined a fixture to fail to. |
String |
getName()
Get the fixture name (the default is the class name).. |
Class |
getParentFixture()
Get the parent fixture class. |
void |
run(int direction)
|
void |
setName(String name)
Set fixture name. |
void |
setParentFixture(Class parentFixture)
Set the parent fixture class. |
abstract void |
setUp()
The fixture setup method, should include all the operations, that will take you from the parent fixture to the current fixture. |
abstract void |
tearDown()
The fixture tearDown method, should include all the operations, that will take you from the current fixture back to the parent fixture. |
String |
toString()
The fixture name without the package (used for presentation). |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final int SETUP_DIRECTION
public static final int TEARDOWN_DIRECTION
public static final int TEARDOWN_FAIL_DIRECTION
public static Reporter report
public static Sut sut
public SystemObjectManager system
Constructor Detail |
public Fixture()
Method Detail |
public abstract void setUp() throws Exception
Exception
public abstract void tearDown() throws Exception
Exception
public void failTearDown() throws Exception
Exception
public void run(int direction) throws Throwable
Throwable
public Class getParentFixture()
public void setParentFixture(Class parentFixture)
parentFixture
- Parent fixture class.public String getName()
public void setName(String name)
name
- Fixture name.public String toString()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |