|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjunit.framework.Assert
junit.framework.TestCase
com.agical.rmock.extension.junit.AbstractStrategyTestCase
public abstract class AbstractStrategyTestCase
A base for a strategy tests. A strategy test is different from a traditional JUnit test by allowing more flexibility. Where a traditional JUnit testCase simply offers a
flow, a strategy test supports any setup that can be implemented from a run() method.
Apart from providing strategies, this TestCase also provides a Hub for configuration (this test configures itself by passing this to the hub within a begin/end scope.
Finally, this test also provides an assertThat(actual, expression) method and a Constraint factory reachable via the is attribute.
| Field Summary | |
|---|---|
protected ConstraintFactory |
is
All expressions for the assertThatMethods are reachable from this factory. |
| Constructor Summary | |
|---|---|
AbstractStrategyTestCase(java.lang.String name)
|
|
AbstractStrategyTestCase(java.lang.String name,
Hub hub)
Takes the name of the test as a parameter. |
|
| Method Summary | |
|---|---|
void |
assertThat(boolean result,
Expression constraint)
|
void |
assertThat(byte result,
Expression constraint)
|
void |
assertThat(char result,
Expression constraint)
|
void |
assertThat(double result,
Expression constraint)
|
void |
assertThat(float result,
Expression constraint)
|
void |
assertThat(int result,
Expression constraint)
|
void |
assertThat(long result,
Expression constraint)
|
void |
assertThat(java.lang.Object actual,
Expression expression)
Assert method that asserts that the object passed in the actual parameter passes the constraint passed in the expected parameter. |
void |
assertThat(short result,
Expression constraint)
|
protected abstract TestStep |
createStrategy(java.lang.String test)
Implement this method to return a strategy to run for the given test. |
Hub |
getHub()
|
StrategyRunner |
getStrategyRunner()
|
protected Verifiable |
getVerifiable()
|
void |
runBare()
Gets and runs the strategy. |
void |
setAsserter(Assert asserter)
|
void |
setStrategyRunner(StrategyRunner strategyRunner)
|
void |
setTestCaseListener(TestCaseListener testCaseListener)
|
void |
setVerifiable(Verifiable verifiable)
|
| 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, format |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected ConstraintFactory is
| Constructor Detail |
|---|
public AbstractStrategyTestCase(java.lang.String name)
public AbstractStrategyTestCase(java.lang.String name,
Hub hub)
name - hub - | Method Detail |
|---|
public void setStrategyRunner(StrategyRunner strategyRunner)
public StrategyRunner getStrategyRunner()
protected abstract TestStep createStrategy(java.lang.String test)
test - The test to get the strategy for
public void runBare()
throws java.lang.Throwable
runBare in class junit.framework.TestCasejava.lang.Throwablepublic Hub getHub()
public void assertThat(java.lang.Object actual,
Expression expression)
actual - The actual object that is checked against the expected constraint.expression - The constraint that actual is expected to pass
public void assertThat(boolean result,
Expression constraint)
Assert#assertThat(boolean)
public void assertThat(byte result,
Expression constraint)
Assert#assertThat(byte)
public void assertThat(char result,
Expression constraint)
Assert#assertThat(char)
public void assertThat(short result,
Expression constraint)
Assert#assertThat(short)
public void assertThat(int result,
Expression constraint)
Assert#assertThat(int)
public void assertThat(long result,
Expression constraint)
Assert#assertThat(long)
public void assertThat(float result,
Expression constraint)
Assert#assertThat(float)
public void assertThat(double result,
Expression constraint)
Assert#assertThat(double)public void setAsserter(Assert asserter)
public void setTestCaseListener(TestCaseListener testCaseListener)
public void setVerifiable(Verifiable verifiable)
protected Verifiable getVerifiable()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||