use of eu.stamp_project.dspot.common.configuration.UserInput in project dspot by STAMP-project.
the class Main method parse.
public static UserInput parse(String[] args) {
UserInput userInput = new UserInput();
final CommandLine commandLine = new CommandLine(userInput);
commandLine.setUsageHelpWidth(120);
try {
commandLine.parseArgs(args);
} catch (Exception e) {
e.printStackTrace();
commandLine.usage(System.err);
return null;
}
if (commandLine.isUsageHelpRequested()) {
commandLine.usage(System.out);
return null;
}
if (commandLine.isVersionHelpRequested()) {
commandLine.printVersionHelp(System.out);
return null;
}
if (userInput.shouldRunExample()) {
userInput.configureExample();
}
try {
Checker.preChecking(userInput);
} catch (InputErrorException e) {
e.printStackTrace();
commandLine.usage(System.err);
return null;
}
return userInput;
}
use of eu.stamp_project.dspot.common.configuration.UserInput in project dspot by STAMP-project.
the class Main method main.
public static void main(String[] args) {
UserInput userInput = parse(args);
if (userInput == null) {
return;
}
final DSpot dspot = new DSpot(userInput);
dspot.run();
}
use of eu.stamp_project.dspot.common.configuration.UserInput in project dspot by STAMP-project.
the class ProjectJSONTest method setUp.
@Before
public void setUp() {
super.setUp();
this.configuration = new UserInput();
this.configuration.setAbsolutePathToProjectRoot(getPathToProjectRoot());
this.configuration.setOutputDirectory(outputDirectory);
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.getPathToProjectRoot());
this.compiler = DSpotCompiler.createDSpotCompiler(configuration, dependencies);
DSpotCache.init(10000);
Launcher launcher = new Launcher();
launcher.getEnvironment().setNoClasspath(true);
launcher.addInputResource(this.getPathToProjectRoot());
launcher.buildModel();
this.factory = launcher.getFactory();
TestFramework.init(this.factory);
testCompiler = new TestCompiler(0, false, this.getPathToProjectRoot(), this.configuration.getClasspathClassesProject(), 10000, "", false);
AssertionGeneratorUtils.init(false);
DSpotPOMCreator.createNewPom(configuration);
RandomHelper.setSeedRandom(72L);
ValueCreator.count = 0;
this.testSelector = new JacocoCoverageSelector(builder, configuration);
try {
FileUtils.forceDelete(new File(outputDirectory));
} catch (Exception ignored) {
}
}
use of eu.stamp_project.dspot.common.configuration.UserInput in project dspot by STAMP-project.
the class MavenAutomaticBuilderTest method testGetDependenciesOf.
@Test
public void testGetDependenciesOf() throws Exception {
UserInput configuration = new UserInput();
configuration.setAbsolutePathToProjectRoot(new File("src/test/resources/test-projects/").getAbsolutePath());
AutomaticBuilder builder = AutomaticBuilderEnum.Maven.getAutomaticBuilder(configuration);
final String dependenciesOf = builder.buildClasspath();
assertTrue(dependenciesOf.contains("org" + System.getProperty("file.separator") + "hamcrest" + System.getProperty("file.separator") + "hamcrest-core" + System.getProperty("file.separator") + "1.3" + System.getProperty("file.separator") + "hamcrest-core-1.3.jar"));
assertTrue(dependenciesOf.contains("junit" + System.getProperty("file.separator") + "junit" + System.getProperty("file.separator") + "4.11" + System.getProperty("file.separator") + "junit-4.11.jar"));
}
use of eu.stamp_project.dspot.common.configuration.UserInput in project dspot by STAMP-project.
the class DSpotUtilsTest method setUp.
@Override
@Before
public void setUp() {
super.setUp();
super.setUp();
this.configuration = new UserInput();
this.configuration.setAbsolutePathToProjectRoot(getPathToProjectRoot());
this.configuration.setOutputDirectory(outputDirectory.getAbsolutePath());
this.builder = AutomaticBuilderEnum.Maven.getAutomaticBuilder(configuration);
this.initializeDSpot = new InitializeDSpot();
String dependencies = initializeDSpot.completeDependencies(configuration, this.builder);
DSpotUtils.init(CommentEnum.None, outputDirectory.getAbsolutePath(), this.configuration.getFullClassPathWithExtraDependencies(), this.getPathToProjectRoot());
this.compiler = DSpotCompiler.createDSpotCompiler(configuration, dependencies);
}
Aggregations