Search in sources :

Example 1 with TestSuiteChromosomeFactory

use of org.evosuite.testsuite.factories.TestSuiteChromosomeFactory in project evosuite by EvoSuite.

the class PropertiesSuiteGAFactory method getChromosomeFactory.

protected ChromosomeFactory<TestSuiteChromosome> getChromosomeFactory() {
    switch(Properties.STRATEGY) {
        case EVOSUITE:
            switch(Properties.TEST_FACTORY) {
                case ALLMETHODS:
                    logger.info("Using all methods chromosome factory");
                    return new TestSuiteChromosomeFactory(new AllMethodsTestChromosomeFactory());
                case RANDOM:
                    logger.info("Using random chromosome factory");
                    return new TestSuiteChromosomeFactory(new RandomLengthTestFactory());
                case ARCHIVE:
                    logger.info("Using archive chromosome factory");
                    return new TestSuiteChromosomeFactory(new ArchiveTestChromosomeFactory());
                case JUNIT:
                    logger.info("Using seeding chromosome factory");
                    JUnitTestCarvedChromosomeFactory factory = new JUnitTestCarvedChromosomeFactory(new RandomLengthTestFactory());
                    return new TestSuiteChromosomeFactory(factory);
                case SERIALIZATION:
                    logger.info("Using serialization seeding chromosome factory");
                    return new SerializationSuiteChromosomeFactory(new RandomLengthTestFactory());
                default:
                    throw new RuntimeException("Unsupported test factory: " + Properties.TEST_FACTORY);
            }
        case REGRESSION:
            return new RegressionTestSuiteChromosomeFactory();
        case MOSUITE:
            return new TestSuiteChromosomeFactory(new RandomLengthTestFactory());
        default:
            throw new RuntimeException("Unsupported test factory: " + Properties.TEST_FACTORY);
    }
}
Also used : JUnitTestCarvedChromosomeFactory(org.evosuite.testcase.factories.JUnitTestCarvedChromosomeFactory) TestSuiteChromosomeFactory(org.evosuite.testsuite.factories.TestSuiteChromosomeFactory) RegressionTestSuiteChromosomeFactory(org.evosuite.regression.RegressionTestSuiteChromosomeFactory) RandomLengthTestFactory(org.evosuite.testcase.factories.RandomLengthTestFactory) AllMethodsTestChromosomeFactory(org.evosuite.testcase.factories.AllMethodsTestChromosomeFactory) SerializationSuiteChromosomeFactory(org.evosuite.testsuite.factories.SerializationSuiteChromosomeFactory) RegressionTestSuiteChromosomeFactory(org.evosuite.regression.RegressionTestSuiteChromosomeFactory) ArchiveTestChromosomeFactory(org.evosuite.ga.archive.ArchiveTestChromosomeFactory)

Aggregations

ArchiveTestChromosomeFactory (org.evosuite.ga.archive.ArchiveTestChromosomeFactory)1 RegressionTestSuiteChromosomeFactory (org.evosuite.regression.RegressionTestSuiteChromosomeFactory)1 AllMethodsTestChromosomeFactory (org.evosuite.testcase.factories.AllMethodsTestChromosomeFactory)1 JUnitTestCarvedChromosomeFactory (org.evosuite.testcase.factories.JUnitTestCarvedChromosomeFactory)1 RandomLengthTestFactory (org.evosuite.testcase.factories.RandomLengthTestFactory)1 SerializationSuiteChromosomeFactory (org.evosuite.testsuite.factories.SerializationSuiteChromosomeFactory)1 TestSuiteChromosomeFactory (org.evosuite.testsuite.factories.TestSuiteChromosomeFactory)1