Commit 7893aed4 authored by ferpasri's avatar ferpasri
Browse files

update linux cmd for analysis service

parent a4af1880
......@@ -50,7 +50,13 @@ public class AnalysisService implements IAnalysisService{
public Void analysis(String orientDBname, String key, String referer) throws Exception {
List<String> commands = new ArrayList<>();
commands.add("testar.bat");
// Prepare linux or windows testar launchment
String launchCommand = "./testar";
if(System.getProperty("os.name").toLowerCase().contains("windows")) {
launchCommand = "testar.bat";
}
commands.add(launchCommand);
// TESTAR Report Mode is used to start the web service that allows remote State Model Analysis
// testar ShowVisualSettingsDialogOnStartup=false Mode=Analysis DataStoreType=remote DataStoreServer=10.0.0.1 DataStoreDB=testar DataStoreUser=testar DataStorePassword=testar
......@@ -73,7 +79,11 @@ public class AnalysisService implements IAnalysisService{
cmdToExecute.append(string + " ");
}
ProcessBuilder builder = new ProcessBuilder("cmd.exe", "/c", cmdToExecute.toString());
// Prepare process execution for linux or windows
ProcessBuilder builder = new ProcessBuilder("/bin/sh", "-c", cmdToExecute.toString());
if(System.getProperty("os.name").toLowerCase().contains("windows")) {
builder = new ProcessBuilder("cmd.exe", "/c", cmdToExecute.toString());
}
Process p = builder.start();
StringBuilder executionOutput = new StringBuilder("");
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment