diff options
Diffstat (limited to '')
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){
|