summaryrefslogtreecommitdiffstats
path: root/sca-java-2.x/trunk
diff options
context:
space:
mode:
authorslaws <slaws@13f79535-47bb-0310-9956-ffa450edef68>2010-05-26 12:36:35 +0000
committerslaws <slaws@13f79535-47bb-0310-9956-ffa450edef68>2010-05-26 12:36:35 +0000
commit64af928d87c8e57c817c9c80c9c34c3601ebe245 (patch)
tree178d57557a44bb37659321d3b620e33b06cfc613 /sca-java-2.x/trunk
parent7752fd6ecdab2516a83fa36ca62be45283a759c6 (diff)
A little bit of tidying in the launchers. I've disabled the binding.ws target in the osgi launcher as under ant it's not working properly.
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@948413 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'sca-java-2.x/trunk')
-rw-r--r--sca-java-2.x/trunk/samples/launcher-embedded-jse/build.xml6
-rw-r--r--sca-java-2.x/trunk/samples/launcher-embedded-osgi/build.xml25
-rw-r--r--sca-java-2.x/trunk/samples/launcher-embedded-osgi/src/main/java/launcher/SampleJSELauncher.java19
3 files changed, 31 insertions, 19 deletions
diff --git a/sca-java-2.x/trunk/samples/launcher-embedded-jse/build.xml b/sca-java-2.x/trunk/samples/launcher-embedded-jse/build.xml
index 1ac9c6f23e..89987056d2 100644
--- a/sca-java-2.x/trunk/samples/launcher-embedded-jse/build.xml
+++ b/sca-java-2.x/trunk/samples/launcher-embedded-jse/build.xml
@@ -52,7 +52,11 @@
</target>
<target name="run" depends="compile">
- <echo>Please use 'ant run-name-of-sample-contribution-to-run' </echo>
+ <echo>Please use 'ant run-name-of-sample-contribution-to-run' for example, try one of</echo>
+ <echo> 'ant run-contribution-binding-sca-calculator' </echo>
+ <echo> 'ant run-contribution-binding-ws-calculator' </echo>
+ <echo> 'ant run-contribution-binding-rmi-calculator' </echo>
+ <echo> 'ant run-contribution-implementation-java-calculator' </echo>
</target>
<target name="run-contribution-binding-sca-calculator" depends="compile">
diff --git a/sca-java-2.x/trunk/samples/launcher-embedded-osgi/build.xml b/sca-java-2.x/trunk/samples/launcher-embedded-osgi/build.xml
index ebb2567a74..f08d19e472 100644
--- a/sca-java-2.x/trunk/samples/launcher-embedded-osgi/build.xml
+++ b/sca-java-2.x/trunk/samples/launcher-embedded-osgi/build.xml
@@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
-->
-<project name="binding-ws-calculator" default="run">
+<project name="launcher-embedded-osgi" default="run">
<property name="tuscany.home" value="../.."/>
<property name="jar.name" value="sample-launcher-embedded-osgi.jar" />
<property name="main.class" value="launcher.SampleJSELauncher" />
@@ -51,7 +51,8 @@
</target>
<target name="run" depends="compile">
- <echo>Please use 'ant run-name-of-sample-contribution-to-run' </echo>
+ <echo>Please use 'ant run-name-of-sample-contribution-to-run' for example, try one of</echo>
+ <echo> 'ant run-contribution-binding-sca-calculator' </echo>
</target>
<target name="run-contribution-binding-sca-calculator" depends="compile">
@@ -60,26 +61,34 @@
failonerror="true">
<classpath>
<pathelement location="target/${jar.name}"/>
- <fileset dir="${tuscany.home}/features">
- <include name="tuscany-sca-manifest.jar" />
- </fileset>
+ <fileset dir="${tuscany.home}/modules">
+ <include name="tuscany-node-api-*.jar" />
+ <include name="tuscany-sca-api-*.jar" />
+ <include name="tuscany-node-launcher-equinox-*.jar" />
+ </fileset>
</classpath>
<arg value="contribution-binding-sca-calculator"/>
</java>
+ <echo> and ant run </echo>
</target>
+ <!-- TODO - this runs from mvn but not from ant so there is some issue with the
+ way the environment gets set up
<target name="run-contribution-binding-ws-calculator" depends="compile">
<java classname="${main.class}"
fork="true"
failonerror="true">
<classpath>
<pathelement location="target/${jar.name}"/>
- <fileset dir="${tuscany.home}/features">
- <include name="tuscany-sca-manifest.jar" />
- </fileset>
+ <fileset dir="${tuscany.home}/modules">
+ <include name="tuscany-node-api-*.jar" />
+ <include name="tuscany-sca-api-*.jar" />
+ <include name="tuscany-node-launcher-equinox-*.jar" />
+ </fileset>
</classpath>
<arg value="contribution-binding-ws-calculator"/>
</java>
</target>
+ -->
</project>
diff --git a/sca-java-2.x/trunk/samples/launcher-embedded-osgi/src/main/java/launcher/SampleJSELauncher.java b/sca-java-2.x/trunk/samples/launcher-embedded-osgi/src/main/java/launcher/SampleJSELauncher.java
index 68059099db..e506f982de 100644
--- a/sca-java-2.x/trunk/samples/launcher-embedded-osgi/src/main/java/launcher/SampleJSELauncher.java
+++ b/sca-java-2.x/trunk/samples/launcher-embedded-osgi/src/main/java/launcher/SampleJSELauncher.java
@@ -19,8 +19,13 @@
package launcher;
+import java.net.URI;
+
import org.apache.tuscany.sca.node.Contribution;
import org.apache.tuscany.sca.node.Node;
+import org.oasisopen.sca.NoSuchDomainException;
+import org.oasisopen.sca.NoSuchServiceException;
+import org.oasisopen.sca.client.SCAClientFactory;
import calculator.CalculatorService;
@@ -51,6 +56,7 @@ public class SampleJSELauncher extends RuntimeIntegration {
} else {
System.out.println("Sample contribution " + contribution + "not found");
}
+
}
/**
@@ -60,24 +66,17 @@ public class SampleJSELauncher extends RuntimeIntegration {
public void launchBindingSCACalculator(){
Node node = startNode(new Contribution("c1", "../binding-sca/contribution-calculator/target/sample-contribution-binding-sca-calculator.jar"));
- //CalculatorService calculator = node.getService(CalculatorService.class, "CalculatorServiceComponent");
- // TODO - could use JUnit assertions but don't want to have to handle JUnit dependency from Ant script
- //double result = calculator.add(3, 2);
- //System.out.println("3 + 2 = " + result);
- //if (result != 5.0){
- // throw new SampleLauncherException();
- //}
stopNode(node);
}
/*
* Using a Tuscany specific mechanism for getting at local service proxies
*/
- public void launchBindingWSCalculator(){
- Node node = startNode(new Contribution("c1", "../contribution-binding-ws-calculator/target/classes"));
+ public void launchBindingWSCalculator() throws NoSuchDomainException, NoSuchServiceException{
+ Node node = startNode(new Contribution("c1", "../contribution-binding-ws-calculator/target/sample-contribution-binding-ws-calculator.jar"));
CalculatorService calculator = node.getService(CalculatorService.class, "CalculatorServiceComponent");
- // TODO - could use JUnit assertions but don't want to have to handle JUnit dependency from Ant script
+
double result = calculator.add(3, 2);
System.out.println("3 + 2 = " + result);
if (result != 5.0){