use of fr.inria.diversify.utils.sosiefier.InputConfiguration in project dspot by STAMP-project.
the class AutomaticBuilderFactoryTest method getAutomaticBuilder_whenUnknown.
@Test
public void getAutomaticBuilder_whenUnknown() throws Exception {
this.configuration = JSAPOptions.parse(getArgsWithUnknownBuilder());
InputConfiguration inputConfiguration = new InputConfiguration(configuration.pathToConfigurationFile);
inputConfiguration.getProperties().setProperty("automaticBuilderName", configuration.automaticBuilderName);
InputProgram program = InputConfiguration.initInputProgram(inputConfiguration);
inputConfiguration.setInputProgram(program);
assertFalse(inputConfiguration.getProperty("automaticBuilderName") == null);
assertFalse(inputConfiguration.getProperty("automaticBuilderName").toUpperCase().contains("MAVEN"));
assertFalse(inputConfiguration.getProperty("automaticBuilderName").toUpperCase().contains("GRADLE"));
AutomaticBuilder builder = AutomaticBuilderFactory.getAutomaticBuilder(inputConfiguration);
assertNotNull(builder);
assertTrue(builder.getClass().equals(MavenAutomaticBuilder.class));
}
use of fr.inria.diversify.utils.sosiefier.InputConfiguration in project dspot by STAMP-project.
the class AutomaticBuilderFactoryTest method getAutomaticBuilder_whenGradle.
@Test
public void getAutomaticBuilder_whenGradle() throws Exception {
this.configuration = JSAPOptions.parse(getArgsWithGradleBuilder());
InputConfiguration inputConfiguration = new InputConfiguration(configuration.pathToConfigurationFile);
inputConfiguration.getProperties().setProperty("automaticBuilderName", configuration.automaticBuilderName);
assertTrue(inputConfiguration.getProperty("automaticBuilderName").toUpperCase().contains("GRADLE"));
AutomaticBuilder builder = AutomaticBuilderFactory.getAutomaticBuilder(inputConfiguration);
assertNotNull(builder);
assertTrue(builder.getClass().equals(GradleAutomaticBuilder.class));
}
use of fr.inria.diversify.utils.sosiefier.InputConfiguration in project dspot by STAMP-project.
the class PitScoreMutantSelectorDescartesTest method testPitDescartesMode.
@Test
public void testPitDescartesMode() throws Exception {
/*
weak contract: this test should not throw any exception and end properly
the increase of the mutation score and the selection is delegated to dedicated test
here we test that the descartes mode runs
*/
assertFalse(PitMutantScoreSelector.descartesMode);
PitMutantScoreSelector.descartesMode = true;
PitMutantScoreSelector.pitVersion = "1.2.0";
InputConfiguration configuration = new InputConfiguration("src/test/resources/test-projects/test-projects.properties");
DSpot dspot = new DSpot(configuration, 1, Arrays.asList(new StringLiteralAmplifier(), new NumberLiteralAmplifier()), new PitMutantScoreSelector());
dspot.amplifyTest("example.TestSuiteExample", Collections.singletonList("test2"));
FileUtils.cleanDirectory(new File(configuration.getOutputDirectory()));
assertTrue(PitMutantScoreSelector.descartesMode);
}
use of fr.inria.diversify.utils.sosiefier.InputConfiguration in project dspot by STAMP-project.
the class DSpotMultiplePomTest method testCopyMultipleModuleProject.
@Test
public void testCopyMultipleModuleProject() throws Exception {
/*
Contract: DSpot is able to amplify a multi-module project
*/
Main.verbose = true;
EntryPoint.verbose = true;
final InputConfiguration configuration = new InputConfiguration("src/test/resources/multiple-pom/deep-pom-modules.properties");
final DSpot dspot = new DSpot(configuration, new JacocoCoverageSelector());
final List<CtType> ctTypes = dspot.amplifyAllTests();
assertFalse(ctTypes.isEmpty());
EntryPoint.verbose = false;
Main.verbose = false;
}
use of fr.inria.diversify.utils.sosiefier.InputConfiguration in project dspot by STAMP-project.
the class DSpotTest method testInheritanceMethod.
@Test
public void testInheritanceMethod() throws Exception {
/*
Test that DSpot can be run on an abstract test, using its implementation.
*/
final InputConfiguration configuration = new InputConfiguration("src/test/resources/sample/sample.properties");
DSpot dspot = new DSpot(configuration, 3, Collections.singletonList(new TestDataMutator()), new JacocoCoverageSelector());
CtType<?> ctType = dspot.amplifyTest("fr.inria.inheritance.Inherited").get(0);
assertEquals(1, ctType.getMethods().size());
}
Aggregations