You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tuscany.apache.org by an...@apache.org on 2009/06/16 10:22:07 UTC
svn commit: r785109 - in /tuscany/branches/sca-java-2.0-M3/itest/nodes:
one-node-test/ one-node-test/src/test/java/itest/OneNodeTestCase.java
two-nodes-test/ two-nodes-test/src/test/java/itest/TwoNodesTestCase.java
Author: antelder
Date: Tue Jun 16 08:22:06 2009
New Revision: 785109
URL: http://svn.apache.org/viewvc?rev=785109&view=rev
Log:
Merge 785108 from 2.x to 2.0 m3 branch to remove the explicit jar version dependency in the nodes itests
Modified:
tuscany/branches/sca-java-2.0-M3/itest/nodes/one-node-test/ (props changed)
tuscany/branches/sca-java-2.0-M3/itest/nodes/one-node-test/src/test/java/itest/OneNodeTestCase.java
tuscany/branches/sca-java-2.0-M3/itest/nodes/two-nodes-test/ (props changed)
tuscany/branches/sca-java-2.0-M3/itest/nodes/two-nodes-test/src/test/java/itest/TwoNodesTestCase.java
Propchange: tuscany/branches/sca-java-2.0-M3/itest/nodes/one-node-test/
------------------------------------------------------------------------------
--- svn:mergeinfo (added)
+++ svn:mergeinfo Tue Jun 16 08:22:06 2009
@@ -0,0 +1,3 @@
+/tuscany/branches/sca-equinox/itest/nodes/one-node-test:694816-709480
+/tuscany/branches/sca-java-1.3/itest/nodes/one-node-test:671193,680620-680628
+/tuscany/java/sca/itest/nodes/one-node-test:785108
Modified: tuscany/branches/sca-java-2.0-M3/itest/nodes/one-node-test/src/test/java/itest/OneNodeTestCase.java
URL: http://svn.apache.org/viewvc/tuscany/branches/sca-java-2.0-M3/itest/nodes/one-node-test/src/test/java/itest/OneNodeTestCase.java?rev=785109&r1=785108&r2=785109&view=diff
==============================================================================
--- tuscany/branches/sca-java-2.0-M3/itest/nodes/one-node-test/src/test/java/itest/OneNodeTestCase.java (original)
+++ tuscany/branches/sca-java-2.0-M3/itest/nodes/one-node-test/src/test/java/itest/OneNodeTestCase.java Tue Jun 16 08:22:06 2009
@@ -21,6 +21,9 @@
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 @@
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 {
Propchange: tuscany/branches/sca-java-2.0-M3/itest/nodes/two-nodes-test/
------------------------------------------------------------------------------
--- svn:mergeinfo (added)
+++ svn:mergeinfo Tue Jun 16 08:22:06 2009
@@ -0,0 +1,3 @@
+/tuscany/branches/sca-equinox/itest/nodes/two-nodes-test:694816-709480
+/tuscany/branches/sca-java-1.3/itest/nodes/two-nodes-test:671193,680620-680628
+/tuscany/java/sca/itest/nodes/two-nodes-test:785108
Modified: tuscany/branches/sca-java-2.0-M3/itest/nodes/two-nodes-test/src/test/java/itest/TwoNodesTestCase.java
URL: http://svn.apache.org/viewvc/tuscany/branches/sca-java-2.0-M3/itest/nodes/two-nodes-test/src/test/java/itest/TwoNodesTestCase.java?rev=785109&r1=785108&r2=785109&view=diff
==============================================================================
--- tuscany/branches/sca-java-2.0-M3/itest/nodes/two-nodes-test/src/test/java/itest/TwoNodesTestCase.java (original)
+++ tuscany/branches/sca-java-2.0-M3/itest/nodes/two-nodes-test/src/test/java/itest/TwoNodesTestCase.java Tue Jun 16 08:22:06 2009
@@ -46,12 +46,26 @@
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");