diff options
author | nash <nash@13f79535-47bb-0310-9956-ffa450edef68> | 2009-05-04 20:21:55 +0000 |
---|---|---|
committer | nash <nash@13f79535-47bb-0310-9956-ffa450edef68> | 2009-05-04 20:21:55 +0000 |
commit | 818cab64a0e869011acb140271664c10707ef803 (patch) | |
tree | bdea6a3e2089df7a551622c3c18694376acfcc48 /sandbox/travelsample/chapter-02/node/src/main/java/scatours/LaunchNode.java | |
parent | 9e513bb2c1a132e85bb684939b6162aa084a36c5 (diff) |
Fix ant script problems and add a test case
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@771426 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'sandbox/travelsample/chapter-02/node/src/main/java/scatours/LaunchNode.java')
-rw-r--r-- | sandbox/travelsample/chapter-02/node/src/main/java/scatours/LaunchNode.java | 42 |
1 files changed, 14 insertions, 28 deletions
diff --git a/sandbox/travelsample/chapter-02/node/src/main/java/scatours/LaunchNode.java b/sandbox/travelsample/chapter-02/node/src/main/java/scatours/LaunchNode.java index 777963c13e..b7888c8749 100644 --- a/sandbox/travelsample/chapter-02/node/src/main/java/scatours/LaunchNode.java +++ b/sandbox/travelsample/chapter-02/node/src/main/java/scatours/LaunchNode.java @@ -19,48 +19,34 @@ package scatours; -import java.io.IOException; - +import org.apache.tuscany.sca.node.SCAClient; import org.apache.tuscany.sca.node.SCAContribution; import org.apache.tuscany.sca.node.SCANode; import org.apache.tuscany.sca.node.SCANodeFactory; -import org.apache.tuscany.sca.node.launcher.NodeLauncher; public class LaunchNode { + public static void main(String[] args) throws Exception { LaunchNode.launchFromFileSystemDir(); } // OK for development but you must launch the node from this module public static void launchFromFileSystemDir(){ - SCANode node = null; - try { - node = SCANodeFactory.newInstance().createSCANode("scatours.composite", - new SCAContribution("common", "../../shared-contributions/common-contribution/target/classes"), - new SCAContribution("currency", "../../shared-contributions/currency-contribution/target/classes"), - new SCAContribution("hotel", "../../shared-contributions/hotel-contribution/target/classes"), - new SCAContribution("flight", "../../shared-contributions/flight-contribution/target/classes"), - new SCAContribution("car", "../../shared-contributions/car-contribution/target/classes"), - new SCAContribution("trip", "../../shared-contributions/trip-contribution/target/classes"), - new SCAContribution("tripbooking", "../../shared-contributions/tripbooking-contribution/target/classes"), - new SCAContribution("travelcatalog", "../../shared-contributions/travelcatalog-contribution/target/classes"), - new SCAContribution("payment", "../../shared-contributions/payment-contribution/target/classes"), - new SCAContribution("emailgateway", "../../shared-contributions/emailgateway-contribution/target/classes"), - new SCAContribution("shoppingcart", "../../shared-contributions/shoppingcart-contribution/target/classes"), - new SCAContribution("scatours", "../../shared-contributions/scatours-contribution/target/classes"), - new SCAContribution("ui", "../ui-contribution/target/classes")); + SCANode node = SCANodeFactory.newInstance().createSCANode("scatours.composite", + new SCAContribution("goodvaluetrips", "../goodvaluetrips-contribution/target/classes"), + new SCAContribution("tuscanyscatours", "../tuscanyscatours-contribution/target/classes"), + new SCAContribution("client", "../client-contribution/target/classes"), + new SCAContribution("node", "./target/classes")); node.start(); - - System.out.println("Node started - Press enter to shutdown."); - try { - System.in.read(); - } catch (IOException e) {} - + + Runnable runner = ((SCAClient)node).getService(Runnable.class, "TestClient/Runnable"); + runner.run(); + node.stop(); - } catch (Exception ex) { - System.out.println(ex.toString()); + } catch (Throwable th) { + th.printStackTrace(); } - } + } } |