Search in sources :

Example 1 with AllMethodsTestChromosomeFactory

use of org.evosuite.testcase.factories.AllMethodsTestChromosomeFactory in project evosuite by EvoSuite.

the class PropertiesNoveltySearchFactory method getChromosomeFactory.

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

Example 2 with AllMethodsTestChromosomeFactory

use of org.evosuite.testcase.factories.AllMethodsTestChromosomeFactory 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)2 AllMethodsTestChromosomeFactory (org.evosuite.testcase.factories.AllMethodsTestChromosomeFactory)2 JUnitTestCarvedChromosomeFactory (org.evosuite.testcase.factories.JUnitTestCarvedChromosomeFactory)2 RandomLengthTestFactory (org.evosuite.testcase.factories.RandomLengthTestFactory)2 RegressionTestSuiteChromosomeFactory (org.evosuite.regression.RegressionTestSuiteChromosomeFactory)1 SerializationSuiteChromosomeFactory (org.evosuite.testsuite.factories.SerializationSuiteChromosomeFactory)1 TestSuiteChromosomeFactory (org.evosuite.testsuite.factories.TestSuiteChromosomeFactory)1