01: /*
02: * This file or a portion of this file is licensed under the terms of
03: * the Globus Toolkit Public License, found in file GTPL, or at
04: * http://www.globus.org/toolkit/download/license.html. This notice must
05: * appear in redistributions of this file, with or without modification.
06: *
07: * Redistributions of this Software, with or without modification, must
08: * reproduce the GTPL in: (1) the Software, or (2) the Documentation or
09: * some other similar material which is provided with the Software (if
10: * any).
11: *
12: * Copyright 1999-2004 University of Chicago and The University of
13: * Southern California. All rights reserved.
14: */
15:
16: package org.griphyn.vdl.parser;
17:
18: import org.griphyn.vdl.invocation.*;
19: import org.griphyn.vdl.util.*;
20: import java.io.*;
21:
22: /**
23: * This class is used to test the <code>InvocationParser</code> class.
24: * It parses an invocation record, creates the corresponding java
25: * objects, and generates an XML document from these objects.
26: *
27: * @author Jens-S. Vöckler
28: * @author Yong Zhao
29: * @version $Revision: 50 $
30: *
31: * @see InvocationParser
32: * @see org.griphyn.vdl.invocation.Invocation
33: */
34:
35: public class IVPTest {
36: static public void main(String[] args) throws IOException {
37: if (args.length == 0) {
38: System.err
39: .println("Usage: java IVPTest [invocationfile] ...");
40: return;
41: }
42:
43: // connect debug stream
44: Logging.instance().register("parser", System.err);
45: Logging.instance().register("app", System.err);
46: // Logging.instance().register( "app", System.err );
47:
48: InvocationParser ip = new InvocationParser(
49: InvocationRecord.SCHEMA_LOCATION);
50: Writer stdout = new BufferedWriter(new OutputStreamWriter(
51: System.out));
52: for (int i = 0; i < args.length; i++) {
53: InvocationRecord invocation = ip.parse(new FileInputStream(
54: args[i]));
55: System.err.println("\nNow convert back to XML\n");
56: invocation.toXML(stdout, "", null);
57: Logging.instance().log("app", 0, "done writing XML");
58: }
59: }
60: }
|