use of fr.inria.diversify.utils.sosiefier.InputConfiguration in project dspot by STAMP-project.
the class GradleAutomaticBuilderTest method setUp.
@Before
public void setUp() throws Exception {
cleanTestEnv();
Utils.init("src/test/resources/test-projects/test-projects.properties");
AutomaticBuilderFactory.reset();
Utils.LOGGER.debug("Test Set-up - Reading input parameters...");
this.configuration = JSAPOptions.parse(getArgsWithGradleBuilder());
InputConfiguration inputConfiguration = Utils.getInputConfiguration();
inputConfiguration.getProperties().setProperty("automaticBuilderName", this.configuration.automaticBuilderName);
Utils.LOGGER.debug("Test Set-up - instantiating Automatic Builder (SUT)...");
sut = AutomaticBuilderFactory.getAutomaticBuilder(inputConfiguration);
Utils.LOGGER.debug("Test Set-up complete.");
}
use of fr.inria.diversify.utils.sosiefier.InputConfiguration in project dspot by STAMP-project.
the class GradleAutomaticBuilderWithDescartesTest method setUp.
@Before
public void setUp() throws Exception {
cleanTestEnv();
Utils.init("src/test/resources/test-projects/test-projects.properties");
AutomaticBuilderFactory.reset();
Utils.LOGGER.debug("Test Set-up - Reading input parameters...");
this.configuration = JSAPOptions.parse(getArgsWithGradleBuilder());
InputConfiguration inputConfiguration = Utils.getInputConfiguration();
inputConfiguration.getProperties().setProperty("automaticBuilderName", this.configuration.automaticBuilderName);
Utils.LOGGER.debug("Test Set-up - instantiating Automatic Builder (SUT)...");
sut = AutomaticBuilderFactory.getAutomaticBuilder(inputConfiguration);
Utils.LOGGER.debug("Test Set-up complete.");
}
use of fr.inria.diversify.utils.sosiefier.InputConfiguration in project dspot by STAMP-project.
the class JacocoCoverageSelectorTest method testDSpotWithJacocoCoverageSelector.
@Test
public void testDSpotWithJacocoCoverageSelector() throws Exception {
try {
FileUtils.deleteDirectory(new File("target/trash"));
} catch (Exception ignored) {
// ignored
}
AmplificationHelper.setSeedRandom(23L);
InputConfiguration configuration = new InputConfiguration("src/test/resources/test-projects/test-projects.properties");
DSpot dspot = new DSpot(configuration, 2, Arrays.asList(new TestDataMutator(), new StatementAdd()), new JacocoCoverageSelector());
dspot.amplifyTest("example.TestSuiteExample", Collections.singletonList("test2"));
try (BufferedReader buffer = new BufferedReader(new FileReader(configuration.getOutputDirectory() + "example.TestSuiteExample_jacoco_instr_coverage_report.txt"))) {
assertEquals(expectedReport, buffer.lines().collect(Collectors.joining(nl)));
}
}
use of fr.inria.diversify.utils.sosiefier.InputConfiguration in project dspot by STAMP-project.
the class DSpotMockedTest method test.
@Test
public void test() throws Exception {
/*
Test the whole dspot procedure.
*/
ValueCreator.count = 0;
AmplificationHelper.setSeedRandom(23L);
InputConfiguration configuration = new InputConfiguration(getPathToPropertiesFile());
InputProgram program = new InputProgram();
configuration.setInputProgram(program);
DSpot dspot = new DSpot(configuration, 1, Arrays.asList(new StatementAdd()));
try {
FileUtils.cleanDirectory(new File(configuration.getOutputDirectory()));
} catch (Exception ignored) {
}
assertEquals(6, dspot.getInputProgram().getFactory().Class().get("info.sanaulla.dal.BookDALTest").getMethods().size());
CtType<?> amplifiedTest = dspot.amplifyTest("info.sanaulla.dal.BookDALTest", Collections.singletonList("testGetBook"));
assertEquals(1, amplifiedTest.getMethods().stream().filter(AmplificationChecker::isTest).count());
System.out.println(amplifiedTest);
assertTrue(!amplifiedTest.getMethodsByName("testGetBook_sd8").isEmpty());
}
use of fr.inria.diversify.utils.sosiefier.InputConfiguration in project dspot by STAMP-project.
the class DSpotSelectionTest method setUpClass.
@BeforeClass
public static void setUpClass() throws Exception {
Utils.reset();
final InputConfiguration inputConfiguration = new InputConfiguration("src/test/resources/test-projects/test-projects.properties");
Main.createOutputDirectories(inputConfiguration, true);
dspotUnderTest = new MockedDSpot(inputConfiguration, 1, new JacocoCoverageSelector());
}
Aggregations