use of de.dagere.peass.execution.processutils.ProcessSuccessTester in project peass by DaGeRe.
the class GradleTestExecutor method isVersionRunning.
@Override
public boolean isVersionRunning(final String version) {
boolean isRunning = false;
if (doesBuildfileExist()) {
boolean isAndroid = false;
for (final File module : getModules().getModules()) {
final File buildfile = GradleParseHelper.findGradleFile(module);
final FindDependencyVisitor visitor = GradleParseUtil.setAndroidTools(buildfile);
if (visitor.isAndroid()) {
isAndroid = true;
if (!visitor.hasVersion()) {
return false;
}
}
}
this.isAndroid = isAndroid;
ProjectModules modules = getModules();
replaceAllBuildfiles(modules);
final String[] vars = new String[] { env.fetchGradleCall(), "--no-daemon", "assemble" };
ProcessSuccessTester processSuccessTester = new ProcessSuccessTester(folders, testTransformer.getConfig(), env);
isRunning = processSuccessTester.testRunningSuccess(version, vars);
}
return isRunning;
}
use of de.dagere.peass.execution.processutils.ProcessSuccessTester in project peass by DaGeRe.
the class MavenRunningTester method isVersionRunning.
public boolean isVersionRunning(final String version) {
File potentialPom = new File(folders.getProjectFolder(), "pom.xml");
final File testFolder = new File(folders.getProjectFolder(), "src/test");
boolean isRunning = false;
if (potentialPom.exists()) {
try {
final boolean multimodule = MavenPomUtil.isMultiModuleProject(potentialPom);
if (multimodule || testFolder.exists()) {
new MavenUpdater(folders, modules, measurementConfig).updateJava();
String goal = getGoal();
MavenPomUtil.cleanType(potentialPom);
String[] basicParameters = new String[] { env.fetchMavenCall(), "--batch-mode", "clean", goal, "-DskipTests", "-Dmaven.test.skip.exec" };
String[] withMavendefaults = CommandConcatenator.concatenateCommandArrays(basicParameters, CommandConcatenator.mavenCheckDeactivation);
if (measurementConfig.getExecutionConfig().getPl() != null) {
String[] projectListArray = new String[] { "-pl", measurementConfig.getExecutionConfig().getPl(), "-am" };
String[] withPl = CommandConcatenator.concatenateCommandArrays(withMavendefaults, projectListArray);
isRunning = new ProcessSuccessTester(folders, measurementConfig, env).testRunningSuccess(version, withPl);
} else {
isRunning = new ProcessSuccessTester(folders, measurementConfig, env).testRunningSuccess(version, withMavendefaults);
}
} else {
LOG.error("Expected src/test to exist");
return false;
}
} catch (IOException | XmlPullParserException e) {
e.printStackTrace();
}
} else {
LOG.error("No pom.xml in {}", version);
}
return isRunning;
}
Aggregations