Class FeatureSpecificTestSuiteBuilder<B extends FeatureSpecificTestSuiteBuilder<B,​G>,​G>

  • Type Parameters:
    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.
    Direct Known Subclasses:
    DerivedIteratorTestSuiteBuilder, IteratorTestSuiteBuilder, PerCollectionSizeTestSuiteBuilder

    @GwtIncompatible
    public abstract class FeatureSpecificTestSuiteBuilder<B extends FeatureSpecificTestSuiteBuilder<B,​G>,​G>
    extends java.lang.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.
    • Constructor Detail

      • FeatureSpecificTestSuiteBuilder

        public FeatureSpecificTestSuiteBuilder()
    • Method Detail

      • self

        protected B self()
      • usingGenerator

        protected B usingGenerator​(G subjectGenerator)
      • getSubjectGenerator

        public G getSubjectGenerator()
      • withSetUp

        public B withSetUp​(java.lang.Runnable setUp)
      • getSetUp

        protected java.lang.Runnable getSetUp()
      • withTearDown

        public B withTearDown​(java.lang.Runnable tearDown)
      • getTearDown

        protected java.lang.Runnable getTearDown()
      • withFeatures

        public B withFeatures​(Feature<?>... features)
        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

        public B withFeatures​(java.lang.Iterable<? extends Feature<?>> features)
      • getFeatures

        public java.util.Set<Feature<?>> getFeatures()
      • named

        public B named​(java.lang.String name)
        Configures this builder produce a TestSuite with the given name.
      • getName

        public java.lang.String getName()
      • suppressing

        public B suppressing​(java.lang.reflect.Method... methods)
        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

        public B suppressing​(java.util.Collection<java.lang.reflect.Method> methods)
      • getSuppressedTests

        public java.util.Set<java.lang.reflect.Method> getSuppressedTests()
      • createTestSuite

        public junit.framework.TestSuite createTestSuite()
        Creates a runnable JUnit test suite based on the criteria already given.
      • checkCanCreate

        protected void checkCanCreate()
        Throw IllegalStateException if createTestSuite() can't be called yet.
      • getTesters

        protected abstract java.util.List<java.lang.Class<? extends AbstractTester>> getTesters()
      • makeSuiteForTesterClass

        protected junit.framework.TestSuite makeSuiteForTesterClass​(java.lang.Class<? extends AbstractTester<?>> testerClass)
      • formatFeatureSet

        protected static java.lang.String formatFeatureSet​(java.util.Set<? extends Feature<?>> features)