Search in sources :

Example 1 with TestRunner

use of eu.stamp_project.dspot.common.execution.TestRunner in project dspot by STAMP-project.

the class AbstractTestOnSample method setUp.

@Before
public void setUp() {
    launcher = new Launcher();
    launcher.addInputResource(getPathToProjectRoot() + "src/");
    launcher.getEnvironment().setNoClasspath(true);
    launcher.buildModel();
    AssertionGeneratorUtils.init(false);
    CloneHelper.init(false);
    TestFramework.init(launcher.getFactory());
    DSpotCache.init(10000);
    RandomHelper.setSeedRandom(72L);
    DSpotUtils.init(CommentEnum.None, null, null, null);
    this.testRunner = new TestRunner(getPathToProjectRoot(), "", false);
}
Also used : TestRunner(eu.stamp_project.dspot.common.execution.TestRunner) Launcher(spoon.Launcher) Before(org.junit.Before)

Example 2 with TestRunner

use of eu.stamp_project.dspot.common.execution.TestRunner 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)

Example 3 with TestRunner

use of eu.stamp_project.dspot.common.execution.TestRunner in project dspot by STAMP-project.

the class OneTestClassPitScoreMutantSelectorTest method setUp.

@Before
public void setUp() {
    DSpotState.verbose = true;
    this.configuration = new UserInput();
    this.configuration.setAbsolutePathToProjectRoot("src/test/resources/test-projects/");
    this.builder = AutomaticBuilderEnum.Maven.getAutomaticBuilder(configuration);
    this.initializeDSpot = new InitializeDSpot();
    DSpotCompiler.createDSpotCompiler(configuration, initializeDSpot.completeDependencies(configuration, this.builder));
    Launcher launcher = new Launcher();
    launcher.getEnvironment().setNoClasspath(true);
    launcher.addInputResource("src/test/resources/test-projects/");
    launcher.buildModel();
    Factory factory = launcher.getFactory();
    this.configuration.setFactory(factory);
    this.configuration.setTestClasses(Collections.singletonList(FULL_QUALIFIED_NAME_TEST_CLASS));
    this.configuration.setTargetOneTestClass(true);
    this.testRunner = new TestRunner(this.configuration.getAbsolutePathToProjectRoot(), "", false);
}
Also used : TestRunner(eu.stamp_project.dspot.common.execution.TestRunner) UserInput(eu.stamp_project.dspot.common.configuration.UserInput) Launcher(spoon.Launcher) Factory(spoon.reflect.factory.Factory) InitializeDSpot(eu.stamp_project.dspot.common.configuration.InitializeDSpot) Before(org.junit.Before)

Aggregations

TestRunner (eu.stamp_project.dspot.common.execution.TestRunner)3 Before (org.junit.Before)3 Launcher (spoon.Launcher)3 InitializeDSpot (eu.stamp_project.dspot.common.configuration.InitializeDSpot)2 UserInput (eu.stamp_project.dspot.common.configuration.UserInput)2 TestCompiler (eu.stamp_project.dspot.common.compilation.TestCompiler)1 Factory (spoon.reflect.factory.Factory)1