public class BaseTest extends TextComparison
expect(Parameter...). each junit test method should call this method for each test case. Use expect(Parameter...) to define your validation checks. If your test case has
calculated its values, you should check
them through BaseTest.Parameter.validate(Comparable). Please call checkCoverage(List) at the end to throw an exception if not all parameters were checked.
Example:
public class PruefeAufVertragTest extends BaseTest {| Modifier and Type | Class and Description |
|---|---|
static class |
BaseTest.Condition
condition for exptected value and calculated result.
|
class |
BaseTest.Parameter<T extends Comparable<T>> |
REGEX_DATE_DE, REGEX_DATE_US, REGEX_TIME_DE, XXX| Constructor and Description |
|---|
BaseTest() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
check(List<BaseTest.Parameter<?>> pars,
String name,
Object result) |
protected static void |
checkCoverage(List<BaseTest.Parameter<?>> pars)
convenience to create a set of parameter
|
static Date |
d(int tag,
int monat,
int jahr) |
protected static List<BaseTest.Parameter<?>> |
expect(BaseTest.Parameter<?>... pars)
convenience to create a set of parameter
|
<V extends Comparable<V>> |
p(String name,
V exptected) |
<V extends Comparable<V>> |
p(String name,
V exptected,
BaseTest.Condition cond)
convenience for DSL calls
|
assertEquals, getDiffs, prepareForComparisonprotected static final List<BaseTest.Parameter<?>> expect(BaseTest.Parameter<?>... pars)
pars - parameterprotected final void check(List<BaseTest.Parameter<?>> pars, String name, Object result)
protected static final void checkCoverage(List<BaseTest.Parameter<?>> pars)
pars - parameterpublic final <V extends Comparable<V>> BaseTest.Parameter<V> p(String name, V exptected)
public final <V extends Comparable<V>> BaseTest.Parameter<V> p(String name, V exptected, BaseTest.Condition cond)
name - parameter nameexptected - expected result valuecond - BaseTest.ConditionBaseTest.Parameterpublic static final Date d(int tag, int monat, int jahr)
Copyright © 2012–2018. All rights reserved.