Package Test

Source Code of Test.JohnTestLoniToTaverna

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");
   
   
 
  }
}

TOP

Related Classes of Test.JohnTestLoniToTaverna

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.