use of org.evosuite.instrumentation.InstrumentingClassLoader in project evosuite by EvoSuite.
the class MockJOptionPaneShowMessageDialogTest method testShowMessageDialog1.
@Test
public void testShowMessageDialog1() throws Exception {
TestSuiteChromosome suite = new TestSuiteChromosome();
InstrumentingClassLoader cl = new InstrumentingClassLoader();
TestCase t0 = buildTestCase1TrueBranch(cl);
TestCase t1 = buildTestCase1FalseBranch(cl);
suite.addTest(t0);
suite.addTest(t1);
BranchCoverageSuiteFitness ff = new BranchCoverageSuiteFitness(cl);
ff.getFitness(suite);
Set<TestFitnessFunction> coveredGoals = suite.getCoveredGoals();
Assert.assertEquals(3, coveredGoals.size());
}
use of org.evosuite.instrumentation.InstrumentingClassLoader in project evosuite by EvoSuite.
the class MockJOptionPaneShowOptionDialogTest method testShowInputDialogs.
@Test
public void testShowInputDialogs() throws Exception {
TestSuiteChromosome suite = new TestSuiteChromosome();
InstrumentingClassLoader cl = new InstrumentingClassLoader();
TestCase t1 = buildTestCase0(cl);
suite.addTest(t1);
BranchCoverageSuiteFitness ff = new BranchCoverageSuiteFitness(cl);
ff.getFitness(suite);
Set<TestFitnessFunction> coveredGoals = suite.getCoveredGoals();
Assert.assertEquals(2, coveredGoals.size());
}
use of org.evosuite.instrumentation.InstrumentingClassLoader in project evosuite by EvoSuite.
the class MockJOptionPaneTest method testCoveredGoals.
@Test
public void testCoveredGoals() throws Exception {
Properties.TIMEOUT = Integer.MAX_VALUE;
InstrumentingClassLoader cl = new InstrumentingClassLoader();
TestCase t0 = buildTestCase0(cl);
TestCase t1 = buildTestCase1(cl);
TestSuiteChromosome suite = new TestSuiteChromosome();
suite.addTest(t0);
suite.addTest(t1);
BranchCoverageSuiteFitness ff = new BranchCoverageSuiteFitness(cl);
ff.getFitness(suite);
Set<TestFitnessFunction> coveredGoals = suite.getCoveredGoals();
Assert.assertEquals(3, coveredGoals.size());
}
use of org.evosuite.instrumentation.InstrumentingClassLoader in project evosuite by EvoSuite.
the class TestGenericClass method reloadNonArrayClass.
@Test
public void reloadNonArrayClass() {
GenericClass arrayClass = new GenericClass(Integer.class);
ClassLoader loader = new InstrumentingClassLoader();
arrayClass.changeClassLoader(loader);
Class<?> rawClass = arrayClass.getRawClass();
Assert.assertFalse(rawClass.isArray());
}
use of org.evosuite.instrumentation.InstrumentingClassLoader in project evosuite by EvoSuite.
the class TestGenericClass method reloadArrayClass.
@Test
public void reloadArrayClass() {
GenericClass arrayClass = new GenericClass(Object[].class);
ClassLoader loader = new InstrumentingClassLoader();
arrayClass.changeClassLoader(loader);
Class<?> rawClass = arrayClass.getRawClass();
Assert.assertTrue(rawClass.isArray());
}
Aggregations