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.router;
17:
18: import org.griphyn.vdl.classes.*;
19: import org.griphyn.vdl.router.*;
20: import org.griphyn.vdl.dbschema.*;
21: import org.griphyn.vdl.dax.*;
22: import org.griphyn.vdl.util.Logging;
23: import java.io.*;
24: import java.sql.SQLException;
25: import java.lang.reflect.*;
26:
27: public class FullDiamondTest {
28: public static void main(String[] args)
29: throws IllegalArgumentException, IOException,
30: ClassNotFoundException, NoSuchMethodException,
31: InstantiationException, SQLException,
32: IllegalAccessException, InvocationTargetException {
33: // create debug output
34: Logging.instance().register("dag", System.err);
35: Logging.instance().register("state", System.err);
36: Logging.instance().register("route", System.err);
37:
38: // create new route object, in memory classes
39: Definitions diamond = org.griphyn.vdl.router.CreateFullDiamond
40: .create();
41: Route r = new Route(new InMemorySchema(diamond));
42:
43: // request known production
44: BookKeeper bk = r.requestLfn("f.d");
45: ADAG dax = bk.getDAX("testing");
46:
47: // show us the result(s)
48: BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(
49: System.out));
50: if (args.length > 0 && args[0] != null
51: && args[0].startsWith("t")) {
52: dax.toString(bw);
53: } else {
54: dax.toXML(bw, "");
55: }
56: bw.flush();
57:
58: System.exit(0);
59: }
60: }
|