Class FeatureSpecificTestSuiteBuilder<B extends FeatureSpecificTestSuiteBuilder<B,G>,G>
java.lang.Object
com.google.common.collect.testing.FeatureSpecificTestSuiteBuilder<B,G>
- Type Parameters:
B
- The concrete type of this builder (the 'self-type'). All the Builder methods of this class (such asnamed(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.
- Direct Known Subclasses:
PerCollectionSizeTestSuiteBuilder
,PerCollectionSizeTestSuiteBuilder.OneSizeTestSuiteBuilder
public abstract class FeatureSpecificTestSuiteBuilder<B extends FeatureSpecificTestSuiteBuilder<B,G>,G>
extends Object
Creates, based on your criteria, a JUnit test suite that exhaustively tests the object generated
by a G, selecting appropriate tests by matching them against specified features.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected void
ThrowIllegalStateException
ifcreateTestSuite()
can't be called yet.junit.framework.TestSuite
Creates a runnable JUnit test suite based on the criteria already given.private static Method
extractMethod
(junit.framework.Test test) private junit.framework.TestSuite
filterSuite
(junit.framework.TestSuite suite) protected static String
formatFeatureSet
(Set<? extends Feature<?>> features) getName()
getSetUp()
protected abstract List
<Class<? extends AbstractTester>> private static boolean
protected junit.framework.TestSuite
makeSuiteForTesterClass
(Class<? extends AbstractTester<?>> testerClass) private boolean
matches
(junit.framework.Test test) Configures this builder produce a TestSuite with the given name.protected B
self()
suppressing
(Method... methods) Prevents the given methods from being run as part of the test suite.suppressing
(Collection<Method> methods) protected B
usingGenerator
(G subjectGenerator) withFeatures
(Feature<?>... features) Configures this builder to produce tests appropriate for the given features.withFeatures
(Iterable<? extends Feature<?>> features) withTearDown
(Runnable tearDown)
-
Field Details
-
subjectGenerator
-
setUp
-
tearDown
-
features
-
name
-
suppressedTests
-
logger
-
-
Constructor Details
-
FeatureSpecificTestSuiteBuilder
public FeatureSpecificTestSuiteBuilder()
-
-
Method Details
-
self
-
usingGenerator
-
getSubjectGenerator
-
withSetUp
-
getSetUp
-
withTearDown
-
getTearDown
-
withFeatures
Configures this builder to produce tests appropriate for the given features. This method may be called more than once to add features in multiple groups. -
withFeatures
-
getFeatures
-
named
Configures this builder produce a TestSuite with the given name. -
getName
-
suppressing
Prevents the given methods from being run as part of the test suite.Note: in principle this should never need to be used, but it might be useful if the semantics of an implementation disagree in unforeseen ways with the semantics expected by a test, or to keep dependent builds clean in spite of an erroneous test.
-
suppressing
-
getSuppressedTests
-
createTestSuite
public junit.framework.TestSuite createTestSuite()Creates a runnable JUnit test suite based on the criteria already given. -
checkCanCreate
protected void checkCanCreate()ThrowIllegalStateException
ifcreateTestSuite()
can't be called yet. -
getTesters
-
matches
private boolean matches(junit.framework.Test test) -
intersect
-
extractMethod
-
makeSuiteForTesterClass
protected junit.framework.TestSuite makeSuiteForTesterClass(Class<? extends AbstractTester<?>> testerClass) -
filterSuite
private junit.framework.TestSuite filterSuite(junit.framework.TestSuite suite) -
formatFeatureSet
-