Search in sources :

Example 16 with InstrumentingClassLoader

use of org.evosuite.instrumentation.InstrumentingClassLoader in project evosuite by EvoSuite.

the class MockJOptionPaneShowInputDialogTest method testShowOptionDialog.

@Test
public void testShowOptionDialog() 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(7, coveredGoals.size());
}
Also used : TestCase(org.evosuite.testcase.TestCase) TestFitnessFunction(org.evosuite.testcase.TestFitnessFunction) BranchCoverageSuiteFitness(org.evosuite.coverage.branch.BranchCoverageSuiteFitness) TestSuiteChromosome(org.evosuite.testsuite.TestSuiteChromosome) InstrumentingClassLoader(org.evosuite.instrumentation.InstrumentingClassLoader) Test(org.junit.Test)

Example 17 with InstrumentingClassLoader

use of org.evosuite.instrumentation.InstrumentingClassLoader in project evosuite by EvoSuite.

the class MockJOptionPaneShowInternalInputDialogTest method testShowInternalInputDialog.

@Test
public void testShowInternalInputDialog() 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(4, coveredGoals.size());
}
Also used : TestCase(org.evosuite.testcase.TestCase) TestFitnessFunction(org.evosuite.testcase.TestFitnessFunction) BranchCoverageSuiteFitness(org.evosuite.coverage.branch.BranchCoverageSuiteFitness) TestSuiteChromosome(org.evosuite.testsuite.TestSuiteChromosome) InstrumentingClassLoader(org.evosuite.instrumentation.InstrumentingClassLoader) Test(org.junit.Test)

Example 18 with InstrumentingClassLoader

use of org.evosuite.instrumentation.InstrumentingClassLoader in project evosuite by EvoSuite.

the class MockJOptionPaneShowConfirmDialogTest method testShowConfirmDialogs.

@Test
public void testShowConfirmDialogs() 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(5, coveredGoals.size());
}
Also used : TestCase(org.evosuite.testcase.TestCase) TestFitnessFunction(org.evosuite.testcase.TestFitnessFunction) BranchCoverageSuiteFitness(org.evosuite.coverage.branch.BranchCoverageSuiteFitness) TestSuiteChromosome(org.evosuite.testsuite.TestSuiteChromosome) InstrumentingClassLoader(org.evosuite.instrumentation.InstrumentingClassLoader) Test(org.junit.Test)

Example 19 with InstrumentingClassLoader

use of org.evosuite.instrumentation.InstrumentingClassLoader in project evosuite by EvoSuite.

the class MockJOptionPaneShowInternalConfirmDialogTest method testShowInternalConfirmDialog.

@Test
public void testShowInternalConfirmDialog() throws Exception {
    TestSuiteChromosome suite = new TestSuiteChromosome();
    InstrumentingClassLoader cl = new InstrumentingClassLoader();
    TestCase t0 = buildTestCase0(cl);
    TestCase t1 = buildTestCase1(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());
}
Also used : TestCase(org.evosuite.testcase.TestCase) TestFitnessFunction(org.evosuite.testcase.TestFitnessFunction) BranchCoverageSuiteFitness(org.evosuite.coverage.branch.BranchCoverageSuiteFitness) TestSuiteChromosome(org.evosuite.testsuite.TestSuiteChromosome) InstrumentingClassLoader(org.evosuite.instrumentation.InstrumentingClassLoader) Test(org.junit.Test)

Example 20 with InstrumentingClassLoader

use of org.evosuite.instrumentation.InstrumentingClassLoader in project evosuite by EvoSuite.

the class MockJOptionPaneShowInternalMessageDialogTest method testShowInternalMessageDialog.

@Test
public void testShowInternalMessageDialog() throws Exception {
    TestSuiteChromosome suite = new TestSuiteChromosome();
    InstrumentingClassLoader cl = new InstrumentingClassLoader();
    TestCase t0 = buildTestCase0(cl);
    TestCase t1 = buildTestCase1(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());
}
Also used : TestCase(org.evosuite.testcase.TestCase) TestFitnessFunction(org.evosuite.testcase.TestFitnessFunction) BranchCoverageSuiteFitness(org.evosuite.coverage.branch.BranchCoverageSuiteFitness) TestSuiteChromosome(org.evosuite.testsuite.TestSuiteChromosome) InstrumentingClassLoader(org.evosuite.instrumentation.InstrumentingClassLoader) Test(org.junit.Test)

Aggregations

InstrumentingClassLoader (org.evosuite.instrumentation.InstrumentingClassLoader)26 Test (org.junit.Test)23 TestCase (org.evosuite.testcase.TestCase)15 TestSuiteChromosome (org.evosuite.testsuite.TestSuiteChromosome)13 BranchCoverageSuiteFitness (org.evosuite.coverage.branch.BranchCoverageSuiteFitness)12 TestFitnessFunction (org.evosuite.testcase.TestFitnessFunction)11 DefaultTestCase (org.evosuite.testcase.DefaultTestCase)5 VariableReference (org.evosuite.testcase.variable.VariableReference)4 GenericClass (org.evosuite.utils.generic.GenericClass)3 ExtendingFile (com.examples.with.different.packagename.mock.java.io.ExtendingFile)2 Method (java.lang.reflect.Method)2 ArrayList (java.util.ArrayList)2 NonInstrumentingClassLoader (org.evosuite.instrumentation.NonInstrumentingClassLoader)2 MockFile (org.evosuite.runtime.mock.java.io.MockFile)2 VariableReferenceImpl (org.evosuite.testcase.variable.VariableReferenceImpl)2 CBranchExample (com.examples.with.different.packagename.cbranch.CBranchExample)1 MemoryCheck (com.examples.with.different.packagename.mock.java.lang.MemoryCheck)1 TypeToken (com.googlecode.gentyref.TypeToken)1 File (java.io.File)1 Assertion (org.evosuite.assertion.Assertion)1