Source code: org/embl/ebi/escience/scufl/view/test/XScuflViewTest.java
1 /**
2 * This file is a component of the Taverna project,
3 * and is licensed under the GNU LGPL.
4 * Copyright Tom Oinn, EMBL-EBI
5 */
6 package org.embl.ebi.escience.scufl.view.test;
7
8 import org.embl.ebi.escience.scufl.ScuflModel;
9 import org.embl.ebi.escience.scufl.parser.XScuflParser;
10 import org.embl.ebi.escience.scufl.view.XScuflView;
11
12 // Network Imports
13 import java.net.URL;
14
15 import java.lang.ClassLoader;
16 import java.lang.Exception;
17 import java.lang.String;
18 import java.lang.System;
19 import java.lang.Thread;
20
21
22
23 /**
24 * Attempts to load data into a ScuflModel from the
25 * same source that the XScuflParserTest uses, then
26 * print out the XScufl text from the XScuflView.
27 * In an ideal world these would be the same, subject
28 * to XML parsing (esp. whitespace).
29 * @author Tom Oinn
30 */
31 public class XScuflViewTest {
32
33 public static void main(String args[]) throws Exception {
34
35 ScuflModel model = new ScuflModel();
36 XScuflView view = new XScuflView(model);
37 ClassLoader loader = Thread.currentThread().getContextClassLoader();
38 URL location = loader.getResource("org/embl/ebi/escience/scufl/parser/test/XScufl_example.xml");
39 System.out.println("Loading definition from : "+location.toString());
40 XScuflParser.populate(location.openStream(), model, null);
41 System.out.println(view.getXMLText());
42
43 }
44
45 }