Commit ebfa0a60 authored by Jaime Arias's avatar Jaime Arias
Browse files

wip: read output from minimal

parent 39d2d967
package org.cosyverif.service.adt2amas; package org.cosyverif.service.adt2amas;
import java.io.BufferedWriter;
import java.io.File; import java.io.File;
import java.io.FileWriter;
import java.io.IOException; import java.io.IOException;
import java.nio.file.Paths; import java.nio.file.Paths;
import org.apache.commons.exec.CommandLine; import org.apache.commons.exec.CommandLine;
import org.cosyverif.alligator.service.AnnotatedService.Task; import org.cosyverif.alligator.service.AnnotatedService.Task;
import org.cosyverif.Configuration;
import org.cosyverif.alligator.service.BinaryService; import org.cosyverif.alligator.service.BinaryService;
import org.cosyverif.alligator.service.Parameter.Direction; import org.cosyverif.alligator.service.Parameter.Direction;
import org.cosyverif.alligator.service.annotation.Example; import org.cosyverif.alligator.service.annotation.Example;
...@@ -60,16 +63,37 @@ public class MinimalScheduling extends BinaryService { ...@@ -60,16 +63,37 @@ public class MinimalScheduling extends BinaryService {
@Override @Override
public void fallback(String line){ public void fallback(String line){
try{ try{
outputParameter = formatResult(line); outputParameter = formatResult();
} catch (IOException e) { } catch (IOException e) {
e.printStackTrace(); e.printStackTrace();
} }
} }
@Override
public void fallback(String key, String value) {
}
}); });
} }
private String formatResult(String output) throws IOException { private String formatResult() throws IOException {
return output; BufferedWriter bw = null;
FileWriter fw = null;
String result = "";
try {
File fileOutput = new File(baseDirectory().getAbsolutePath() + "/minimal_scheduling.log");
fw = new FileWriter(fileOutput);
bw = new BufferedWriter(fw);
} catch (Exception e) {
e.printStackTrace();
} finally {
if (bw != null)
bw.close();
if (fw != null)
fw.close();
}
return result;
} }
@Example(name = "Example of the minimal scheduling algorithm", @Example(name = "Example of the minimal scheduling algorithm",
......
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