use of org.evosuite.testcase.factories.JUnitTestCarvedChromosomeFactory in project evosuite by EvoSuite.
the class JUnitTestCarvedChromosomeFactorySystemTest method testBeanDateConverterUtils8.
@Test
public void testBeanDateConverterUtils8() {
Properties.SELECTED_JUNIT = com.examples.with.different.packagename.testcarver.DateConverterTest8.class.getCanonicalName();
Properties.TARGET_CLASS = com.examples.with.different.packagename.testcarver.DateConverter.class.getCanonicalName();
Properties.SEED_MUTATIONS = 1;
Properties.SEED_CLONE = 1;
JUnitTestCarvedChromosomeFactory factory = new JUnitTestCarvedChromosomeFactory(null);
Assert.assertEquals(1, factory.getNumCarvedTestCases());
String code = factory.getChromosome().getTestCase().toCode();
System.out.println(code);
}
use of org.evosuite.testcase.factories.JUnitTestCarvedChromosomeFactory in project evosuite by EvoSuite.
the class JUnitTestCarvedChromosomeFactorySystemTest method testClassWithStaticMethod.
@Test
public void testClassWithStaticMethod() {
Properties.SELECTED_JUNIT = com.examples.with.different.packagename.testcarver.ClassWithStaticMethodTestCase.class.getCanonicalName();
Properties.TARGET_CLASS = com.examples.with.different.packagename.testcarver.ClassWithStaticMethod.class.getCanonicalName();
Properties.SEED_MUTATIONS = 0;
Properties.SEED_CLONE = 1;
JUnitTestCarvedChromosomeFactory factory = new JUnitTestCarvedChromosomeFactory(null);
Assert.assertEquals(1, factory.getNumCarvedTestCases());
TestChromosome test = factory.getChromosome();
String code = test.getTestCase().toCode();
System.out.println(code);
Assert.assertFalse(code.contains("XStream"));
Assert.assertTrue(code.contains("classWithStaticMethod0.testMe"));
}
use of org.evosuite.testcase.factories.JUnitTestCarvedChromosomeFactory in project evosuite by EvoSuite.
the class JUnitTestCarvedChromosomeFactorySystemTest method testObjectSetWrapper.
@Test
public void testObjectSetWrapper() {
Properties.SELECTED_JUNIT = com.examples.with.different.packagename.testcarver.ObjectWrapperSetTest.class.getCanonicalName();
Properties.TARGET_CLASS = com.examples.with.different.packagename.testcarver.ObjectWrapper.class.getCanonicalName();
Properties.SEED_MUTATIONS = 1;
Properties.SEED_CLONE = 1;
JUnitTestCarvedChromosomeFactory factory = new JUnitTestCarvedChromosomeFactory(null);
Assert.assertTrue(factory.hasCarvedTestCases());
TestChromosome carved = factory.getChromosome();
Assert.assertNotNull(carved);
Assert.assertEquals("", 13, carved.test.size());
}
use of org.evosuite.testcase.factories.JUnitTestCarvedChromosomeFactory in project evosuite by EvoSuite.
the class JUnitTestCarvedChromosomeFactorySystemTest method testDefaultEmptySetting.
@SuppressWarnings("unused")
@Test
public void testDefaultEmptySetting() {
/*
* by default, no seeded test should be selected
*/
try {
JUnitTestCarvedChromosomeFactory factory = new JUnitTestCarvedChromosomeFactory(null);
Assert.fail("Expected IllegalStateException");
} catch (IllegalStateException e) {
// expected
}
}
use of org.evosuite.testcase.factories.JUnitTestCarvedChromosomeFactory in project evosuite by EvoSuite.
the class JUnitTestCarvedChromosomeFactorySystemTest method testBeanDateConverterUtils10.
@Test
public void testBeanDateConverterUtils10() {
Properties.SELECTED_JUNIT = com.examples.with.different.packagename.testcarver.DateConverterTest10.class.getCanonicalName();
Properties.TARGET_CLASS = com.examples.with.different.packagename.testcarver.DateConverter.class.getCanonicalName();
Properties.SEED_MUTATIONS = 1;
Properties.SEED_CLONE = 1;
JUnitTestCarvedChromosomeFactory factory = new JUnitTestCarvedChromosomeFactory(null);
Assert.assertEquals(1, factory.getNumCarvedTestCases());
String code = factory.getChromosome().getTestCase().toCode();
System.out.println(code);
}
Aggregations