use of org.evosuite.EvoSuite in project evosuite by EvoSuite.
the class TrivialForDynamicSeedingSystemTest method testEndsWithWithoutSeeding.
@Test
public void testEndsWithWithoutSeeding() {
EvoSuite evosuite = new EvoSuite();
String targetClass = TrivialForDynamicSeedingEndsWith.class.getCanonicalName();
Properties.TARGET_CLASS = targetClass;
Properties.DYNAMIC_POOL = 0.0;
ConstantPoolManager.getInstance().reset();
// , "-Ddynamic_pool=0.0"
String[] command = new String[] { "-generateSuite", "-class", targetClass };
Object result = evosuite.parseCommandLine(command);
GeneticAlgorithm<?> ga = getGAFromResult(result);
TestSuiteChromosome best = (TestSuiteChromosome) ga.getBestIndividual();
System.out.println("EvolvedTestSuite:\n" + best);
Assert.assertEquals("Unexpected coverage: ", 2d / 3d, best.getCoverage(), 0.001);
}
use of org.evosuite.EvoSuite in project evosuite by EvoSuite.
the class TrivialForDynamicSeedingSystemTest method testStartsWith.
@Test
public void testStartsWith() {
EvoSuite evosuite = new EvoSuite();
String targetClass = TrivialForDynamicSeedingStartsWith.class.getCanonicalName();
Properties.TARGET_CLASS = targetClass;
// Properties.DYNAMIC_POOL = 1d / 3d;
ConstantPoolManager.getInstance().reset();
String[] command = new String[] { "-generateSuite", "-class", targetClass };
Object result = evosuite.parseCommandLine(command);
GeneticAlgorithm<?> ga = getGAFromResult(result);
TestSuiteChromosome best = (TestSuiteChromosome) ga.getBestIndividual();
System.out.println("EvolvedTestSuite:\n" + best);
Assert.assertEquals("Non-optimal coverage: ", 1d, best.getCoverage(), 0.001);
}
use of org.evosuite.EvoSuite in project evosuite by EvoSuite.
the class TrivialForDynamicSeedingSystemTest method testRegionMatches.
@Test
public void testRegionMatches() {
EvoSuite evosuite = new EvoSuite();
String targetClass = TrivialForDynamicSeedingRegionMatches.class.getCanonicalName();
Properties.TARGET_CLASS = targetClass;
// Properties.DYNAMIC_POOL = 1d / 3d;
ConstantPoolManager.getInstance().reset();
String[] command = new String[] { "-generateSuite", "-class", targetClass };
Object result = evosuite.parseCommandLine(command);
GeneticAlgorithm<?> ga = getGAFromResult(result);
TestSuiteChromosome best = (TestSuiteChromosome) ga.getBestIndividual();
System.out.println("EvolvedTestSuite:\n" + best);
Assert.assertEquals("Non-optimal coverage: ", 1d, best.getCoverage(), 0.001);
}
use of org.evosuite.EvoSuite in project evosuite by EvoSuite.
the class TrivialForDynamicSeedingSystemTest method testRegionMatchesWithoutSeeding.
@Test
public void testRegionMatchesWithoutSeeding() {
EvoSuite evosuite = new EvoSuite();
String targetClass = TrivialForDynamicSeedingRegionMatches.class.getCanonicalName();
Properties.TARGET_CLASS = targetClass;
Properties.DYNAMIC_POOL = 0.0;
ConstantPoolManager.getInstance().reset();
// , "-Ddynamic_pool=0.0"
String[] command = new String[] { "-generateSuite", "-class", targetClass };
Object result = evosuite.parseCommandLine(command);
GeneticAlgorithm<?> ga = getGAFromResult(result);
TestSuiteChromosome best = (TestSuiteChromosome) ga.getBestIndividual();
System.out.println("EvolvedTestSuite:\n" + best);
Assert.assertEquals("Unexpected coverage: ", 2d / 3d, best.getCoverage(), 0.001);
}
use of org.evosuite.EvoSuite in project evosuite by EvoSuite.
the class TrivialForDynamicSeedingSystemTest method testRegionMatchesIgnoreCase.
@Test
public void testRegionMatchesIgnoreCase() {
EvoSuite evosuite = new EvoSuite();
String targetClass = TrivialForDynamicSeedingRegionMatchesCase.class.getCanonicalName();
Properties.TARGET_CLASS = targetClass;
// Properties.DYNAMIC_POOL = 1d / 3d;
ConstantPoolManager.getInstance().reset();
// , "-Ddynamic_pool=0.333"
String[] command = new String[] { "-generateSuite", "-class", targetClass };
Object result = evosuite.parseCommandLine(command);
GeneticAlgorithm<?> ga = getGAFromResult(result);
TestSuiteChromosome best = (TestSuiteChromosome) ga.getBestIndividual();
System.out.println("EvolvedTestSuite:\n" + best);
Assert.assertEquals("Non-optimal coverage: ", 1d, best.getCoverage(), 0.001);
}
Aggregations