Class CombinatorialTestConsumerManager


  • public class CombinatorialTestConsumerManager
    extends java.lang.Object
    A manager for converting test inputs using a ModelConverter and putting them into a provided consumer. Uses a DelegatingModelBasedArgumentConverter and DelegatingExecutionReporter and ExecutionReporterToGenerationReporterAdapter to convert between different representations and allow multiple converts and reporter even though method in engine only accept one.
    • Constructor Detail

      • CombinatorialTestConsumerManager

        public CombinatorialTestConsumerManager​(CombinatorialTestConsumerManagerConfiguration configuration,
                                                java.util.function.Consumer<Combination> testInputConsumer,
                                                InputParameterModel model)
        Creates a new manager with the given configuration, consumer and testModel.
        Parameters:
        configuration - all needed configuration for a combinatorial test. This is the part which can be reused across different tests. Must not be null
        testInputConsumer - a consumer for all test inputs generated by the CombinatorialTestManager provided by the configuration. Each test input is converted using a ModelConverter generated by the provided ModelConverterFactory. This part is generally not reusable. Must not be null
        model - the testModel which defines all parameters and constraints for a combinatorial test. This part is generally not reusable. Must not be null
    • Method Detail

      • checkConstraintsForConflicts

        public boolean checkConstraintsForConflicts()
        Checks for conflicts among error-constraints, converts them and reports them to System.out.
        Returns:
        true if not conflicts were detected false if conflicts were detected
      • generateInitialTests

        public void generateInitialTests()
        Generates the initial test inputs, converts them and propagates them to the consumer given in the constructor.
      • generateAdditionalTestInputsWithResult

        public void generateAdditionalTestInputsWithResult​(Combination testInput,
                                                           de.rwth.swc.coffee4j.engine.TestResult testResult)
        Generates additional test inputs based on a new test result. All returned test inputs are converted and then propagated to the given consumer.
        Parameters:
        testInput - a test input. Must not be null
        testResult - the result of the test input. Must not be null