package Test;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException;
import CLInterface.ConverterConfig;
import LONI.tree.workflow.Pipeline;
import LONI.visitor.LoniToGalaxyConverter;
import LONI.visitor.LoniToTavernaConverter;
import Specification.GalaxySpecification;
import Specification.LoniSpecification;
import Specification.TavernaSpecification;
import Taverna.Tree.Workflow;
public class JohnTestLoniToTaverna {
public static void TestLoniXML (String path, String output) {
System.out.println("==="+path + ">" + output+"===");
Pipeline p;
try {
p = LoniSpecification.getXMLParser().parse(new File(path));
try {
LoniSpecification.getXMLGenerator().generate(p, output);
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
} catch (FileNotFoundException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
public static void TestLoniToTav (String path, String output) {
System.out.println("==="+path + ">" + output+"===");
Pipeline p;
try {
p = LoniSpecification.getXMLParser().parse(new File(path));
LoniToTavernaConverter l2t = new LoniToTavernaConverter();
Workflow workflow= (Workflow) l2t.visit(p);
try {
TavernaSpecification.getXMLGenerator().generate(workflow, output);
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
} catch (FileNotFoundException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
public static void main(String[] args){
//testJSON("data/test2.ga");
TestLoniToTav("data/Loni/input/jloni1.pipe", "data/Loni/output/jloni1.t2flow");
}
}