public abstract class UISpecTestCase
extends junit.framework.TestCase
Test cases derived from this class automatically set up the instanciation mechanism. They can
also access the application main window by defining an adapter, i.e. a class implementing
the UISpecAdapter
class.
The adapter can be set from the test setUp()
or any test method using the
setAdapter(UISpecAdapter)
method.
The adapter can also be registered by setting the uispec4j.adapter
property as follows:
uispec4j.adapter=samples.addressbook.test.Adapter
Modifier | Constructor and Description |
---|---|
protected |
UISpecTestCase() |
protected |
UISpecTestCase(String testName) |
Modifier and Type | Method and Description |
---|---|
Assertion |
and(Assertion... assertions)
Returns the intersection of two assertions.
|
void |
assertEquals(boolean expected,
Assertion assertion)
Checks that the given assertion equals the expected parameter.
|
void |
assertEquals(String message,
boolean expected,
Assertion assertion)
Checks that the given assertion equals the expected parameter.
|
void |
assertFalse(Assertion assertion)
Checks that the given assertion fails.
|
void |
assertFalse(String message,
Assertion assertion)
Checks that the given assertion fails.
|
void |
assertThat(Assertion assertion)
Checks the given assertion.
|
void |
assertThat(String message,
Assertion assertion)
Checks the given assertion.
|
void |
assertTrue(Assertion assertion)
Checks the given assertion.
|
void |
assertTrue(String message,
Assertion assertion)
Checks the given assertion.
|
Window |
getMainWindow()
Returns the Window created by the adapter.
|
Assertion |
not(Assertion assertion)
Returns a negation of the given assertion.
|
Assertion |
or(Assertion... assertions)
Returns the union of two assertions.
|
void |
setAdapter(UISpecAdapter adapter) |
protected void |
setUp()
Initializes the resources needed by the test case.
NB: If you provide your own implementation, do not forget to call this one first. |
protected void |
tearDown()
Checks whether an unexpected exception had occurred, and releases the test resources.
|
void |
waitUntil(Assertion assertion,
long waitTimeLimit)
Waits for at most 'waitTimeLimit' ms until the assertion is true.
|
void |
waitUntil(String message,
Assertion assertion,
long waitTimeLimit)
Waits for at most 'waitTimeLimit' ms until the assertion is true.
|
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, countTestCases, createResult, fail, fail, failNotEquals, failNotSame, failSame, format, getName, run, run, runBare, runTest, setName, toString
protected UISpecTestCase()
protected UISpecTestCase(String testName)
public void setAdapter(UISpecAdapter adapter)
protected void setUp() throws Exception
setUp
in class junit.framework.TestCase
Exception
protected void tearDown() throws Exception
tearDown
in class junit.framework.TestCase
Exception
public Window getMainWindow() throws org.uispec4j.UISpecTestCase.AdapterNotFoundException
AdapterNotFoundException
- if the uispec4j.adapter
property does not refer
to a valid adapterorg.uispec4j.UISpecTestCase.AdapterNotFoundException
public void assertTrue(Assertion assertion)
assertThat(Assertion)
.UISpecAssert.assertTrue(Assertion)
public void assertTrue(String message, Assertion assertion)
assertThat(String,Assertion)
.public void assertThat(Assertion assertion)
assertTrue(Assertion)
.UISpecAssert.assertThat(Assertion)
public void assertThat(String message, Assertion assertion)
assertTrue(String,Assertion)
.public void waitUntil(Assertion assertion, long waitTimeLimit)
UISpecAssert.waitUntil(Assertion, long)
public void assertFalse(Assertion assertion)
UISpecAssert.assertFalse(Assertion)
public void waitUntil(String message, Assertion assertion, long waitTimeLimit)
public void assertFalse(String message, Assertion assertion)
public Assertion not(Assertion assertion)
UISpecAssert.not(Assertion)
public Assertion and(Assertion... assertions)
UISpecAssert.and(Assertion[])
public Assertion or(Assertion... assertions)
UISpecAssert.or(Assertion[])
public void assertEquals(boolean expected, Assertion assertion)
Copyright © 2004–2016. All rights reserved.