package Test;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException;
import CLInterface.ConverterConfig;
import Galaxy.Tree.Tool.Tool;
import Galaxy.Tree.Workflow.Workflow;
import Galaxy.Toolbox.GalaxyToolDatabase;
import Galaxy.Visitor.Local.GalaxyToLoniWorkflowConverter;
import LONI.tree.workflow.Pipeline;
import LONI.visitor.LoniToGalaxyConverter;
import Specification.GalaxySpecification;
import Specification.LoniSpecification;
public class ChrisTestSpecifications {
public static void main(String[] args){
//testJSON("data/test2.ga");
ConverterConfig.GALAXY_INPUT_DIR = "/home/chris/galaxy-dist/";
ConverterConfig.GALAXY_OUTPUT_DIR = "/home/chris/foo/";
testPipelineConverter("data/Loni/input/loni_input_output.pipe", "data/Loni/input/gal1.ga");
}
private static void testPipelineConverter(String path, String output) {
// TODO Auto-generated method stub
System.out.println("==="+path+"===");
Pipeline p;
try {
p = LoniSpecification.getXMLParser().parse(new File(path));
LoniToGalaxyConverter lgc = new LoniToGalaxyConverter();
Workflow workflow = (Workflow) lgc.visit(p);
try {
GalaxySpecification.getJSONGenerator().generate(workflow, output);
GalaxySpecification.getDatabase().dumpDatabase();
GalaxySpecification.getDatabase().clear();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
} catch (FileNotFoundException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}