B
- The concrete type of this builder (the 'self-type'). All the
Builder methods of this class (such as named(java.lang.String)
) return this type, so
that Builder methods of more derived classes can be chained onto them without
casting.G
- The type of the generator to be passed to testers in the
generated test suite. An instance of G should somehow provide an
instance of the class under test, plus any other information required
to parameterize the test.@GwtIncompatible public abstract class FeatureSpecificTestSuiteBuilder<B extends FeatureSpecificTestSuiteBuilder<B,G>,G> extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private java.util.Set<Feature<?>> |
features |
private static java.util.logging.Logger |
logger |
private java.lang.String |
name |
private java.lang.Runnable |
setUp |
private G |
subjectGenerator |
private java.util.Set<java.lang.reflect.Method> |
suppressedTests |
private java.lang.Runnable |
tearDown |
Constructor and Description |
---|
FeatureSpecificTestSuiteBuilder() |
Modifier and Type | Method and Description |
---|---|
protected void |
checkCanCreate()
Throw
IllegalStateException if createTestSuite() can't
be called yet. |
junit.framework.TestSuite |
createTestSuite()
Creates a runnable JUnit test suite based on the criteria already given.
|
private static java.lang.reflect.Method |
extractMethod(junit.framework.Test test) |
private junit.framework.TestSuite |
filterSuite(junit.framework.TestSuite suite) |
protected static java.lang.String |
formatFeatureSet(java.util.Set<? extends Feature<?>> features) |
java.util.Set<Feature<?>> |
getFeatures() |
java.lang.String |
getName() |
protected java.lang.Runnable |
getSetUp() |
G |
getSubjectGenerator() |
java.util.Set<java.lang.reflect.Method> |
getSuppressedTests() |
protected java.lang.Runnable |
getTearDown() |
protected abstract java.util.List<java.lang.Class<? extends AbstractTester>> |
getTesters() |
private static boolean |
intersect(java.util.Set<?> a,
java.util.Set<?> b) |
protected junit.framework.TestSuite |
makeSuiteForTesterClass(java.lang.Class<? extends AbstractTester<?>> testerClass) |
private boolean |
matches(junit.framework.Test test) |
B |
named(java.lang.String name)
Configures this builder produce a TestSuite with the given name.
|
protected B |
self() |
B |
suppressing(java.util.Collection<java.lang.reflect.Method> methods) |
B |
suppressing(java.lang.reflect.Method... methods)
Prevents the given methods from being run as part of the test suite.
|
protected B |
usingGenerator(G subjectGenerator) |
B |
withFeatures(Feature<?>... features)
Configures this builder to produce tests appropriate for the given
features.
|
B |
withFeatures(java.lang.Iterable<? extends Feature<?>> features) |
B |
withSetUp(java.lang.Runnable setUp) |
B |
withTearDown(java.lang.Runnable tearDown) |
private G subjectGenerator
private java.lang.Runnable setUp
private java.lang.Runnable tearDown
private java.util.Set<Feature<?>> features
private java.lang.String name
private java.util.Set<java.lang.reflect.Method> suppressedTests
private static final java.util.logging.Logger logger
protected B self()
public G getSubjectGenerator()
public B withSetUp(java.lang.Runnable setUp)
protected java.lang.Runnable getSetUp()
public B withTearDown(java.lang.Runnable tearDown)
protected java.lang.Runnable getTearDown()
public B withFeatures(Feature<?>... features)
public java.util.Set<Feature<?>> getFeatures()
public B named(java.lang.String name)
public java.lang.String getName()
public B suppressing(java.lang.reflect.Method... methods)
public B suppressing(java.util.Collection<java.lang.reflect.Method> methods)
public java.util.Set<java.lang.reflect.Method> getSuppressedTests()
public junit.framework.TestSuite createTestSuite()
protected void checkCanCreate()
IllegalStateException
if createTestSuite()
can't
be called yet.protected abstract java.util.List<java.lang.Class<? extends AbstractTester>> getTesters()
private boolean matches(junit.framework.Test test)
private static boolean intersect(java.util.Set<?> a, java.util.Set<?> b)
private static java.lang.reflect.Method extractMethod(junit.framework.Test test)
protected junit.framework.TestSuite makeSuiteForTesterClass(java.lang.Class<? extends AbstractTester<?>> testerClass)
private junit.framework.TestSuite filterSuite(junit.framework.TestSuite suite)
protected static java.lang.String formatFeatureSet(java.util.Set<? extends Feature<?>> features)