Search in sources :

Example 11 with UserInput

use of eu.stamp_project.dspot.common.configuration.UserInput in project dspot by STAMP-project.

the class GradleInjectorTest method testOnGradleFromActiveonWithoutBuildscript.

@Test
public void testOnGradleFromActiveonWithoutBuildscript() {
    /*
            test the injection of what we need in the build.gradle when we removed the
                buildscript {
                    ...
                }
         */
    UserInput configuration = new UserInput();
    configuration.setExcludedClasses("fr.inria.filter.failing.*");
    configuration.setJVMArgs("-Xmx2048m,-Xms1024m");
    configuration.setFilter("fr.inria.sample.*");
    final GradleInjector gradleInjector = new GradleInjector("src/test/resources/no_buildscript_build.gradle", !configuration.isGregorMode(), configuration.getFilter(), configuration.getPitVersion(), configuration.getTimeOutInMs(), configuration.getJVMArgs(), configuration.getExcludedClasses(), configuration.getAdditionalClasspathElements());
    final String pitTask = gradleInjector.getPitTask();
    assertTrue(pitTask, pitTask.endsWith(expectedEnd));
}
Also used : UserInput(eu.stamp_project.dspot.common.configuration.UserInput) Test(org.junit.Test)

Example 12 with UserInput

use of eu.stamp_project.dspot.common.configuration.UserInput in project dspot by STAMP-project.

the class GradleInjectorTest method testOnGradleFromActiveon.

@Test
public void testOnGradleFromActiveon() {
    /*
            test the injection of what we need in the build.gradle
         */
    UserInput configuration = new UserInput();
    configuration.setAbsolutePathToProjectRoot("src/test/resources/");
    configuration.setExcludedClasses("fr.inria.filter.failing.*");
    configuration.setJVMArgs("-Xmx2048m,-Xms1024m");
    configuration.setFilter("fr.inria.sample.*");
    final GradleInjector gradleInjector = new GradleInjector("src/test/resources/build.gradle", !configuration.isGregorMode(), configuration.getFilter(), configuration.getPitVersion(), configuration.getTimeOutInMs(), configuration.getJVMArgs(), configuration.getExcludedClasses(), configuration.getAdditionalClasspathElements());
    final String pitTask = gradleInjector.getPitTask();
    assertTrue(pitTask, pitTask.startsWith(expectedStarts));
    assertTrue(pitTask, pitTask.endsWith(expectedEnd));
}
Also used : UserInput(eu.stamp_project.dspot.common.configuration.UserInput) Test(org.junit.Test)

Example 13 with UserInput

use of eu.stamp_project.dspot.common.configuration.UserInput in project dspot by STAMP-project.

the class GradleInjectorTest method testOnGradleFromActiveonWithoutRepositories.

@Test
public void testOnGradleFromActiveonWithoutRepositories() {
    /*
            test the injection of what we need in the build.gradle when we removed the
                buildscript {
                    ...
                }
         */
    UserInput configuration = new UserInput();
    configuration.setExcludedClasses("fr.inria.filter.failing.*");
    configuration.setJVMArgs("-Xmx2048m,-Xms1024m");
    configuration.setFilter("fr.inria.sample.*");
    final GradleInjector gradleInjector = new GradleInjector("src/test/resources/no_repositories_build.gradle", !configuration.isGregorMode(), configuration.getFilter(), configuration.getPitVersion(), configuration.getTimeOutInMs(), configuration.getJVMArgs(), configuration.getExcludedClasses(), configuration.getAdditionalClasspathElements());
    final String pitTask = gradleInjector.getPitTask();
    assertTrue(pitTask, pitTask.startsWith(expectedStarts));
    assertTrue(pitTask, pitTask.endsWith(expectedEnd));
}
Also used : UserInput(eu.stamp_project.dspot.common.configuration.UserInput) Test(org.junit.Test)

Example 14 with UserInput

use of eu.stamp_project.dspot.common.configuration.UserInput in project dspot by STAMP-project.

the class TestFrameworkTest method setUp.

@Before
@Override
public void setUp() {
    super.setUp();
    UserInput configuration = new UserInput();
    configuration.setAbsolutePathToProjectRoot(new File("src/test/resources/sample/").getAbsolutePath());
    DSpotUtils.init(CommentEnum.Amplifier, "target/dspot/", configuration.getFullClassPathWithExtraDependencies(), "src/test/resources/sample/");
}
Also used : UserInput(eu.stamp_project.dspot.common.configuration.UserInput) File(java.io.File) Before(org.junit.Before)

Example 15 with UserInput

use of eu.stamp_project.dspot.common.configuration.UserInput in project dspot by STAMP-project.

the class AbstractSelectorTest method setUp.

@Before
public void setUp() throws Exception {
    DSpotState.verbose = true;
    this.configuration = new UserInput();
    this.configuration.setAbsolutePathToProjectRoot(getPathToAbsoluteProjectRoot());
    this.configuration.setOutputDirectory(outputDirectory);
    this.configuration.setGregorMode(true);
    this.builder = AutomaticBuilderEnum.Maven.getAutomaticBuilder(configuration);
    this.initializeDSpot = new InitializeDSpot();
    String dependencies = initializeDSpot.completeDependencies(configuration, this.builder);
    DSpotUtils.init(CommentEnum.None, outputDirectory, this.configuration.getFullClassPathWithExtraDependencies(), this.getPathToAbsoluteProjectRoot());
    this.compiler = DSpotCompiler.createDSpotCompiler(configuration, dependencies);
    DSpotCache.init(10000);
    Launcher launcher = new Launcher();
    launcher.getEnvironment().setNoClasspath(true);
    launcher.addInputResource(this.getPathToAbsoluteProjectRoot());
    launcher.buildModel();
    this.factory = launcher.getFactory();
    TestFramework.init(this.factory);
    this.testRunner = new TestRunner(this.getPathToAbsoluteProjectRoot(), "", false);
    this.testCompiler = new TestCompiler(0, false, this.getPathToAbsoluteProjectRoot(), this.configuration.getClasspathClassesProject(), 10000, "", false);
    AssertionGeneratorUtils.init(false);
    DSpotPOMCreator.createNewPom(configuration);
    RandomHelper.setSeedRandom(72L);
    ValueCreator.count = 0;
    this.testSelectorUnderTest = this.getTestSelector();
}
Also used : TestCompiler(eu.stamp_project.dspot.common.compilation.TestCompiler) TestRunner(eu.stamp_project.dspot.common.execution.TestRunner) UserInput(eu.stamp_project.dspot.common.configuration.UserInput) Launcher(spoon.Launcher) InitializeDSpot(eu.stamp_project.dspot.common.configuration.InitializeDSpot) Before(org.junit.Before)

Aggregations

UserInput (eu.stamp_project.dspot.common.configuration.UserInput)26 Before (org.junit.Before)11 Test (org.junit.Test)10 InitializeDSpot (eu.stamp_project.dspot.common.configuration.InitializeDSpot)8 Launcher (spoon.Launcher)8 File (java.io.File)7 AutomaticBuilder (eu.stamp_project.dspot.common.automaticbuilder.AutomaticBuilder)5 TestCompiler (eu.stamp_project.dspot.common.compilation.TestCompiler)4 PitXMLResultParser (eu.stamp_project.dspot.selector.pitmutantscoreselector.PitXMLResultParser)3 BufferedReader (java.io.BufferedReader)3 FileReader (java.io.FileReader)3 TestRunner (eu.stamp_project.dspot.common.execution.TestRunner)2 ArrayList (java.util.ArrayList)2 CtMethod (spoon.reflect.declaration.CtMethod)2 DSpot (eu.stamp_project.dspot.DSpot)1 DSpotState (eu.stamp_project.dspot.common.configuration.DSpotState)1 InputErrorException (eu.stamp_project.dspot.common.configuration.check.InputErrorException)1 DSpotUtils (eu.stamp_project.dspot.common.miscellaneous.DSpotUtils)1 JacocoCoverageSelector (eu.stamp_project.dspot.selector.JacocoCoverageSelector)1 IOException (java.io.IOException)1