diff options
author | antelder <antelder@13f79535-47bb-0310-9956-ffa450edef68> | 2009-06-16 08:22:06 +0000 |
---|---|---|
committer | antelder <antelder@13f79535-47bb-0310-9956-ffa450edef68> | 2009-06-16 08:22:06 +0000 |
commit | 57485094833282300ce30d05db9222b49a72eee0 (patch) | |
tree | 2f0ecaf46d0abe4f3b8fa092fe8155635537a2fa /branches/sca-java-2.0-M3/itest/nodes | |
parent | ea2e710442179cdb42ef593c34ff691b5acb4145 (diff) |
Merge 785108 from 2.x to 2.0 m3 branch to remove the explicit jar version dependency in the nodes itests
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@785109 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'branches/sca-java-2.0-M3/itest/nodes')
2 files changed, 35 insertions, 4 deletions
diff --git a/branches/sca-java-2.0-M3/itest/nodes/one-node-test/src/test/java/itest/OneNodeTestCase.java b/branches/sca-java-2.0-M3/itest/nodes/one-node-test/src/test/java/itest/OneNodeTestCase.java index f05851a117..63ddc789db 100644 --- a/branches/sca-java-2.0-M3/itest/nodes/one-node-test/src/test/java/itest/OneNodeTestCase.java +++ b/branches/sca-java-2.0-M3/itest/nodes/one-node-test/src/test/java/itest/OneNodeTestCase.java @@ -21,6 +21,9 @@ package itest; import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
+
+import java.io.File;
+
import itest.nodes.Helloworld;
import org.apache.tuscany.sca.node.Contribution;
@@ -42,11 +45,25 @@ public class OneNodeTestCase{ System.setProperty("org.apache.tuscany.sca.contribution.processor.ValidationSchemaExtensionPoint.enabled", "false");
NodeFactory factory = NodeFactory.newInstance();
node = factory.createNode(
- new Contribution("service", "../helloworld-service/target/itest-nodes-helloworld-service-2.0-SNAPSHOT.jar"),
- new Contribution("client", "../helloworld-client/target/itest-nodes-helloworld-client-2.0-SNAPSHOT.jar"));
+ new Contribution("service", getJar("../helloworld-service/target")),
+ new Contribution("client", getJar("../helloworld-client/target")));
node.start();
}
+ /**
+ * Get the jar in the target folder without being dependent on the version name to
+ * make tuscany releases easier
+ */
+ private static String getJar(String targetDirectory) {
+ File f = new File(targetDirectory);
+ for (File file : f.listFiles()) {
+ if (file.getName().endsWith(".jar")) {
+ return file.toURI().toString();
+ }
+ }
+ throw new IllegalStateException("Can't find jar in: " + targetDirectory);
+ }
+
@Test
public void testCalculator() throws Exception {
diff --git a/branches/sca-java-2.0-M3/itest/nodes/two-nodes-test/src/test/java/itest/TwoNodesTestCase.java b/branches/sca-java-2.0-M3/itest/nodes/two-nodes-test/src/test/java/itest/TwoNodesTestCase.java index 4659b717fb..8352f70e17 100644 --- a/branches/sca-java-2.0-M3/itest/nodes/two-nodes-test/src/test/java/itest/TwoNodesTestCase.java +++ b/branches/sca-java-2.0-M3/itest/nodes/two-nodes-test/src/test/java/itest/TwoNodesTestCase.java @@ -46,12 +46,26 @@ public class TwoNodesTestCase{ public static void setUpBeforeClass() throws Exception {
System.setProperty("org.apache.tuscany.sca.contribution.processor.ValidationSchemaExtensionPoint.enabled", "false");
NodeFactory factory = NodeFactory.newInstance();
- serviceNode = factory.createNode(new Contribution("service", new File("../helloworld-service/target/itest-nodes-helloworld-service-2.0-SNAPSHOT.jar").toURI().toString()));
+ serviceNode = factory.createNode(new Contribution("service", getJar("../helloworld-service/target")));
serviceNode.start();
- clientNode = factory.createNode(new Contribution("client", new File("../helloworld-client/target/itest-nodes-helloworld-client-2.0-SNAPSHOT.jar").toURI().toString()));
+ clientNode = factory.createNode(new Contribution("client", getJar("../helloworld-client/target")));
clientNode.start();
}
+ /**
+ * Get the jar in the target folder without being dependent on the version name to
+ * make tuscany releases easier
+ */
+ private static String getJar(String targetDirectory) {
+ File f = new File(targetDirectory);
+ for (File file : f.listFiles()) {
+ if (file.getName().endsWith(".jar")) {
+ return file.toURI().toString();
+ }
+ }
+ throw new IllegalStateException("Can't find jar in: " + targetDirectory);
+ }
+
@Test
public void testCalculator() throws Exception {
Helloworld service = serviceNode.getService(Helloworld.class, "HelloworldService");
|