Author: antelder
Date: Tue Mar 14 08:12:36 2006
New Revision: 385823
URL: http://svn.apache.org/viewcvs?rev=385823&view=rev
Log:
Add JSON-RPC binding sample
Added:
incubator/tuscany/java/samples/helloworld/helloworldjsonrpc/
incubator/tuscany/java/samples/helloworld/helloworldjsonrpc/pom.xml
incubator/tuscany/java/samples/helloworld/helloworldjsonrpc/readme.htm
incubator/tuscany/java/samples/helloworld/helloworldjsonrpc/src/
incubator/tuscany/java/samples/helloworld/helloworldjsonrpc/src/main/
incubator/tuscany/java/samples/helloworld/helloworldjsonrpc/src/main/java/
incubator/tuscany/java/samples/helloworld/helloworldjsonrpc/src/main/java/org/
incubator/tuscany/java/samples/helloworld/helloworldjsonrpc/src/main/java/org/apache/
incubator/tuscany/java/samples/helloworld/helloworldjsonrpc/src/main/java/org/apache/tuscany/
incubator/tuscany/java/samples/helloworld/helloworldjsonrpc/src/main/java/org/apache/tuscany/samples/
incubator/tuscany/java/samples/helloworld/helloworldjsonrpc/src/main/java/org/apache/tuscany/samples/helloworldjsonrpc/
incubator/tuscany/java/samples/helloworld/helloworldjsonrpc/src/main/java/org/apache/tuscany/samples/helloworldjsonrpc/HelloWorldService.java
incubator/tuscany/java/samples/helloworld/helloworldjsonrpc/src/main/java/org/apache/tuscany/samples/helloworldjsonrpc/HelloWorldServiceComponentImpl.java
incubator/tuscany/java/samples/helloworld/helloworldjsonrpc/src/main/resources/
incubator/tuscany/java/samples/helloworld/helloworldjsonrpc/src/main/resources/sca.module
incubator/tuscany/java/samples/helloworld/helloworldjsonrpc/src/main/webapp/
incubator/tuscany/java/samples/helloworld/helloworldjsonrpc/src/main/webapp/HelloWorldJSONRPC.html
incubator/tuscany/java/samples/helloworld/helloworldjsonrpc/src/main/webapp/WEB-INF/
incubator/tuscany/java/samples/helloworld/helloworldjsonrpc/src/main/webapp/WEB-INF/web.xml
incubator/tuscany/java/samples/helloworld/helloworldjsonrpc/src/main/webapp/helloworld.js
incubator/tuscany/java/samples/helloworld/helloworldjsonrpc/src/test/
incubator/tuscany/java/samples/helloworld/helloworldjsonrpc/src/test/java/
incubator/tuscany/java/samples/helloworld/helloworldjsonrpc/src/test/java/org/
incubator/tuscany/java/samples/helloworld/helloworldjsonrpc/src/test/java/org/apache/
incubator/tuscany/java/samples/helloworld/helloworldjsonrpc/src/test/java/org/apache/tuscany/
incubator/tuscany/java/samples/helloworld/helloworldjsonrpc/src/test/java/org/apache/tuscany/samples/
incubator/tuscany/java/samples/helloworld/helloworldjsonrpc/src/test/java/org/apache/tuscany/samples/helloworldjsonrpc/
incubator/tuscany/java/samples/helloworld/helloworldjsonrpc/src/test/java/org/apache/tuscany/samples/helloworldjsonrpc/HelloWorldServiceTestCase.java
Modified:
incubator/tuscany/java/samples/helloworld/pom.xml
Added: incubator/tuscany/java/samples/helloworld/helloworldjsonrpc/pom.xml
URL:
http://svn.apache.org/viewcvs/incubator/tuscany/java/samples/helloworld/helloworldjsonrpc/pom.xml?rev=385823&view=auto
==============================================================================
--- incubator/tuscany/java/samples/helloworld/helloworldjsonrpc/pom.xml (added)
+++ incubator/tuscany/java/samples/helloworld/helloworldjsonrpc/pom.xml Tue Mar
14 08:12:36 2006
@@ -0,0 +1,57 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Copyright (c) 2005-2006 The Apache Software Foundation or its licensors,
as applicable.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ -->
+<project>
+ <parent>
+ <groupId>org.apache.tuscany.samples.helloworld</groupId>
+ <artifactId>helloworld-samples</artifactId>
+ <version>SNAPSHOT</version>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+ <artifactId>helloworldjsonrpc</artifactId>
+ <packaging>war</packaging>
+ <name>Tuscany sample HelloWorld JSON-RPC</name>
+ <description>Sample classic helloworld using JSON-RPC</description>
+ <version>SNAPSHOT</version>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.tuscany</groupId>
+ <artifactId>tuscany-core</artifactId>
+ <version>${pom.version}</version>
+ <scope>provided</scope> <!-- use provided so tuscany infrastructue
is not inc. in the war-->
+ </dependency>
+ <dependency>
+ <groupId>org.apache.tuscany</groupId>
+ <artifactId>tuscany-container-java</artifactId>
+ <version>${pom.version}</version>
+ <scope>provided</scope> <!-- use provided so tuscany infrastructue
is not inc. in the war-->
+ </dependency>
+ <dependency>
+ <groupId>org.apache.tuscany</groupId>
+ <artifactId>tuscany-binding-jsonrpc</artifactId>
+ <version>${pom.version}</version>
+ <scope>provided</scope> <!-- use provided so tuscany infrastructue
is not inc. in the war-->
+ </dependency>
+
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>3.8.1</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+</project>
Added: incubator/tuscany/java/samples/helloworld/helloworldjsonrpc/readme.htm
URL:
http://svn.apache.org/viewcvs/incubator/tuscany/java/samples/helloworld/helloworldjsonrpc/readme.htm?rev=385823&view=auto
==============================================================================
--- incubator/tuscany/java/samples/helloworld/helloworldjsonrpc/readme.htm
(added)
+++ incubator/tuscany/java/samples/helloworld/helloworldjsonrpc/readme.htm Tue
Mar 14 08:12:36 2006
@@ -0,0 +1,139 @@
+<!--
+ Copyright (c) 2005 The Apache Software Foundation or its licensors, as
applicable.
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+ -->
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html><head>
+
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+
+ <meta http-equiv="Content-Style-Type" content="text/css">
+ <title>Tuscany Hello World JSON-RPC Sample</title><!-- LINK
rel="stylesheet" href="ait.css" type="text/css" --></head>
+
+<body>
+
+<h2>Tuscany Hello World JSON-RPC Sample</h2>
+
+<h3>Overview</h3>
+
+<p>The Tuscany hello world JSON-RPC sample shows using the Tuscany SCA
+ runtime in a Tomcat environment being accessed from a JavaScript program
running in the client browser that
+ implements the classic introductory hello world example. </p>
+
+
+<h3>Setup</h3>Set up your server as described in the <a
href="http://wiki.apache.org/ws/Tuscany/TomcatIntegration"
target="_blank">Tomcat
+ Setup</a>. If you are not configuring with the acceptance test the
server, you will need to add <span
+ style="font-weight: bold;">helloworldjsonrpc-SNAPSHOT.war</span> to
your tomcat's webapp directory.<br>
+
+<h3>Running</h3>
+
+Once you've started your web server, use your browse to view the
+following URL: <a href="http://localhost:8080/helloworldjsonrpc-SNAPSHOT/"
target="_blank">http://localhost:8080/helloworldjsonrpc-SNAPSHOT/</a>
+<br>
+
+You should see a form you can supply your name and a button.
+ Once you click the button the JavaScript program locates the SCA
component to execute
+the greeting service.
+<br>
+Note, unlike the J2SE or JSP clients the Tuscany runtime is automatically
+initialized and running.
+<h3>Results</h3>
+
+<p>The page should be updated with the greeting displayed below
+ the form.<br>
+
+</p>
+
+<h3>Code Overview</h3>
+
+The source files are physically organized as shown below:<br>
+<table style="text-align: left; width: 100%;" border="1" cellpadding="2"
cellspacing="2">
+ <tbody>
+ <tr>
+ <td>
+ <pre>+---main<br>¦ +---java<br>¦
¦ sca.module
+ +---org<br>¦ +---apache<br>¦
+---tuscany<br>¦ +---samples<br>¦
+---helloworldjsonrpc
+ ¦ HelloWorldService.java
+ ¦
HelloWorldServiceComponentImpl.java<br>+---webapp
+ ¦ helloworld.js
+ ¦ HelloWorldJSONRPC.html
+ +---WEB-INF<br> ¦ web.xml<br></pre>
+ </td>
+ </tr>
+ </tbody>
+</table>
+<br>
+<br>
+
+<p> </p>
+
+<table style="text-align: left; width: 100%; height: 154px;" border="0"
cellpadding="2" cellspacing="2">
+
+ <tbody>
+
+ <tr>
+
+ <td style="vertical-align: top;">sca.module</td>
+
+ <td>Defines the SCA module, entryPoint and component. Defines an
entryPoint with an JSON-RPC binding, and the
+ HelloWorldService component and the Java class that
+ implements that component</td>
+
+ </tr>
+
+ <tr>
+
+ <td style="vertical-align: top;">HelloWorldService.java</td>
+
+ <td>Defines the Java interface implemented by the component.</td>
+
+ </tr>
+
+ <tr>
+
+ <td style="vertical-align:
top;">HelloWorldServiceComponentImpl.java</td>
+
+ <td>Implements the SCA component. Uses the SCA service
+ annotation tag on the class to show what SCA interface is being
+ implemented.</td>
+
+ </tr>
+
+ <tr>
+ <td>helloworld.js</td>
+ <td>Handles invoking the HelloWorld SCA service. Gets the value
entered in the text field on the web page, invokes the SCA component and puts
the result in the output field on the web page.
+ <br>The interesting part of the script is
SCA.HelloWorldService.getGreetings(who) .
+ In the SCA JSON-RPC environment all entryPoints with an
JSON-RPC binding are bound to the automatically defined script variable
SCA. .
+ </td>
+ </tr>
+
+ <tr>
+ <td>HelloWorldJSONRPC.html</td>
+ <td>Handles Web form input.. Obtains the module context which was
defined by the
+ sca.module file. From the module context locates the
+ HelloWorldServiceComponent and then calls the
getGreetings
+ method to invoke the component. and formats
returned results.</td>
+ </tr>
+
+ <tr>
+ <td>web.xml</td>
+ <td>Standard J2EE web application's web.xml</td>
+ </tr>
+
+ </tbody>
+</table>
+
+<br>
+
+</body></html>
Added:
incubator/tuscany/java/samples/helloworld/helloworldjsonrpc/src/main/java/org/apache/tuscany/samples/helloworldjsonrpc/HelloWorldService.java
URL:
http://svn.apache.org/viewcvs/incubator/tuscany/java/samples/helloworld/helloworldjsonrpc/src/main/java/org/apache/tuscany/samples/helloworldjsonrpc/HelloWorldService.java?rev=385823&view=auto
==============================================================================
---
incubator/tuscany/java/samples/helloworld/helloworldjsonrpc/src/main/java/org/apache/tuscany/samples/helloworldjsonrpc/HelloWorldService.java
(added)
+++
incubator/tuscany/java/samples/helloworld/helloworldjsonrpc/src/main/java/org/apache/tuscany/samples/helloworldjsonrpc/HelloWorldService.java
Tue Mar 14 08:12:36 2006
@@ -0,0 +1,26 @@
+/**
+ *
+ * Copyright 2005 The Apache Software Foundation or its licensors, as
applicable.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.tuscany.samples.helloworldjsonrpc;
+
+/**
+ * This is the business interface of the HelloWorld service component.
+ */
+public interface HelloWorldService {
+
+ public String getGreetings(String name);
+
+}
Added:
incubator/tuscany/java/samples/helloworld/helloworldjsonrpc/src/main/java/org/apache/tuscany/samples/helloworldjsonrpc/HelloWorldServiceComponentImpl.java
URL:
http://svn.apache.org/viewcvs/incubator/tuscany/java/samples/helloworld/helloworldjsonrpc/src/main/java/org/apache/tuscany/samples/helloworldjsonrpc/HelloWorldServiceComponentImpl.java?rev=385823&view=auto
==============================================================================
---
incubator/tuscany/java/samples/helloworld/helloworldjsonrpc/src/main/java/org/apache/tuscany/samples/helloworldjsonrpc/HelloWorldServiceComponentImpl.java
(added)
+++
incubator/tuscany/java/samples/helloworld/helloworldjsonrpc/src/main/java/org/apache/tuscany/samples/helloworldjsonrpc/HelloWorldServiceComponentImpl.java
Tue Mar 14 08:12:36 2006
@@ -0,0 +1,34 @@
+/**
+ *
+ * Copyright 2005 The Apache Software Foundation or its licensors, as
applicable.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.tuscany.samples.helloworldjsonrpc;
+
+import org.osoa.sca.annotations.Service;
+
+/**
+ * This class implements the HelloWorld service component.
+ */
[EMAIL PROTECTED](HelloWorldService.class)
+public class HelloWorldServiceComponentImpl implements HelloWorldService {
+
+ /*
+ * @see
org.apache.tuscany.samples.helloworld.HelloWorldServiceComponent#getGreetings()
+ */
+ public String getGreetings(String name) {
+ return "jsonrpcHello " + name;
+ }
+
+}
Added:
incubator/tuscany/java/samples/helloworld/helloworldjsonrpc/src/main/resources/sca.module
URL:
http://svn.apache.org/viewcvs/incubator/tuscany/java/samples/helloworld/helloworldjsonrpc/src/main/resources/sca.module?rev=385823&view=auto
==============================================================================
---
incubator/tuscany/java/samples/helloworld/helloworldjsonrpc/src/main/resources/sca.module
(added)
+++
incubator/tuscany/java/samples/helloworld/helloworldjsonrpc/src/main/resources/sca.module
Tue Mar 14 08:12:36 2006
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright (c) 2005 BEA Sytems Inc.
+ Copyright (c) 2005 International Business Machines
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+ -->
+<module xmlns="http://www.osoa.org/xmlns/sca/0.9"
xmlns:v="http://www.osoa.org/xmlns/sca/values/0.9"
+ xmlns:jsonrpc="http://org.apache.tuscany/xmlns/jsonrpc/0.9"
+
+ name="sampleHelloworldJSONRPC">
+
+ <entryPoint name="HelloWorldService">
+ <interface.java
interface="org.apache.tuscany.samples.helloworldjsonrpc.HelloWorldService"/>
+ <jsonrpc:binding.jsonrpc/>
+ <reference>HelloWorldServiceComponent/HelloWorldService</reference>
+ </entryPoint>
+
+ <component name="HelloWorldServiceComponent">
+ <implementation.java
class="org.apache.tuscany.samples.helloworldjsonrpc.HelloWorldServiceComponentImpl"/>
+ </component>
+
+</module>
Added:
incubator/tuscany/java/samples/helloworld/helloworldjsonrpc/src/main/webapp/HelloWorldJSONRPC.html
URL:
http://svn.apache.org/viewcvs/incubator/tuscany/java/samples/helloworld/helloworldjsonrpc/src/main/webapp/HelloWorldJSONRPC.html?rev=385823&view=auto
==============================================================================
---
incubator/tuscany/java/samples/helloworld/helloworldjsonrpc/src/main/webapp/HelloWorldJSONRPC.html
(added)
+++
incubator/tuscany/java/samples/helloworld/helloworldjsonrpc/src/main/webapp/HelloWorldJSONRPC.html
Tue Mar 14 08:12:36 2006
@@ -0,0 +1,27 @@
+<html>
+ <head>
+ <script type="text/javascript" src="SCA/scripts/sca.js"></script>
+ <script type="text/javascript" src="helloworld.js"></script>
+ <TITLE>Tuscany HelloWorld JSON-RPC Example</TITLE>
+ </head>
+ <body>
+
+ <h2>Tuscany HelloWorld JSON-RPC Example</h2>
+
+ <P> </P>
+
+ <p>
+ Name please:
+ <input type="text" id="name" size="30" value="World" />
+ <br><BR>
+ <input type="button" value="Submit" onclick="getGreeting()" />
+ </p>
+
+ <br>
+ <hr>
+
+ Response:
+ <input type="text" id="greeting" size="40" readonly/>
+
+ </body>
+</html>
Added:
incubator/tuscany/java/samples/helloworld/helloworldjsonrpc/src/main/webapp/WEB-INF/web.xml
URL:
http://svn.apache.org/viewcvs/incubator/tuscany/java/samples/helloworld/helloworldjsonrpc/src/main/webapp/WEB-INF/web.xml?rev=385823&view=auto
==============================================================================
---
incubator/tuscany/java/samples/helloworld/helloworldjsonrpc/src/main/webapp/WEB-INF/web.xml
(added)
+++
incubator/tuscany/java/samples/helloworld/helloworldjsonrpc/src/main/webapp/WEB-INF/web.xml
Tue Mar 14 08:12:36 2006
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+ Copyright (c) 2005 The Apache Software Foundation or its licensors, as
applicable.
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+ -->
+<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web
+Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd">
+
+<web-app>
+ <display-name>Tuscany sample HelloWorld JSON-RPC</display-name>
+
+ <welcome-file-list id="WelcomeFileList">
+ <welcome-file>HelloWorldJSONRPC.html</welcome-file>
+ </welcome-file-list>
+
+</web-app>
Added:
incubator/tuscany/java/samples/helloworld/helloworldjsonrpc/src/main/webapp/helloworld.js
URL:
http://svn.apache.org/viewcvs/incubator/tuscany/java/samples/helloworld/helloworldjsonrpc/src/main/webapp/helloworld.js?rev=385823&view=auto
==============================================================================
---
incubator/tuscany/java/samples/helloworld/helloworldjsonrpc/src/main/webapp/helloworld.js
(added)
+++
incubator/tuscany/java/samples/helloworld/helloworldjsonrpc/src/main/webapp/helloworld.js
Tue Mar 14 08:12:36 2006
@@ -0,0 +1,6 @@
+
+function getGreeting() {
+ var name = document.getElementById("name").value;
+ var result = SCA.HelloWorldService.getGreetings(name);
+ document.getElementById("greeting").value = result;
+}
Added:
incubator/tuscany/java/samples/helloworld/helloworldjsonrpc/src/test/java/org/apache/tuscany/samples/helloworldjsonrpc/HelloWorldServiceTestCase.java
URL:
http://svn.apache.org/viewcvs/incubator/tuscany/java/samples/helloworld/helloworldjsonrpc/src/test/java/org/apache/tuscany/samples/helloworldjsonrpc/HelloWorldServiceTestCase.java?rev=385823&view=auto
==============================================================================
---
incubator/tuscany/java/samples/helloworld/helloworldjsonrpc/src/test/java/org/apache/tuscany/samples/helloworldjsonrpc/HelloWorldServiceTestCase.java
(added)
+++
incubator/tuscany/java/samples/helloworld/helloworldjsonrpc/src/test/java/org/apache/tuscany/samples/helloworldjsonrpc/HelloWorldServiceTestCase.java
Tue Mar 14 08:12:36 2006
@@ -0,0 +1,83 @@
+/**
+ *
+ * Copyright 2005 The Apache Software Foundation or its licensors, as
applicable.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.tuscany.samples.helloworldjsonrpc;
+
+import junit.framework.TestCase;
+
+import org.apache.tuscany.core.client.TuscanyRuntime;
+import org.apache.tuscany.samples.helloworldjsonrpc.HelloWorldService;
+import
org.apache.tuscany.samples.helloworldjsonrpc.HelloWorldServiceComponentImpl;
+import org.osoa.sca.CurrentModuleContext;
+import org.osoa.sca.ModuleContext;
+
+/**
+ *
+ */
+public class HelloWorldServiceTestCase extends TestCase {
+ public boolean verbose = false;
+
+ public void testGeetings() throws Exception {
+
+ final boolean viaSCA = true;
+ TuscanyRuntime tuscany;
+ ModuleContext moduleContext = null;
+ if (verbose)
+ System.out.println("starting test..");
+ System.out.flush();
+ HelloWorldService helloworldService = null;
+
+ if (viaSCA) {
+ tuscany = new TuscanyRuntime("test", null);
+ tuscany.start();
+ moduleContext = CurrentModuleContext.getContext();
+
+ assertNotNull(moduleContext);
+
+ helloworldService = (HelloWorldService) moduleContext
+ .locateService("HelloWorldServiceComponent");
+
+ assertNotNull(helloworldService);
+ } else
+ helloworldService = new HelloWorldServiceComponentImpl();
+
+ String value = helloworldService
+ .getGreetings("World");
+
+ if (verbose)
+ System.out.println("Value = '" + value + "'");
+ assertEquals("jsonrpcHello World", value);
+ if (viaSCA)
+ tuscany.stop();
+
+ }
+
+ public final static void main(String[] args) throws Exception {
+ HelloWorldServiceTestCase hwc = new HelloWorldServiceTestCase();
+ hwc.setVerbose(true);
+ hwc.testGeetings();
+
+ }
+
+ public boolean isVerbose() {
+ return verbose;
+ }
+
+ public void setVerbose(boolean verbose) {
+ this.verbose = verbose;
+ }
+
+}
Modified: incubator/tuscany/java/samples/helloworld/pom.xml
URL:
http://svn.apache.org/viewcvs/incubator/tuscany/java/samples/helloworld/pom.xml?rev=385823&r1=385822&r2=385823&view=diff
==============================================================================
--- incubator/tuscany/java/samples/helloworld/pom.xml (original)
+++ incubator/tuscany/java/samples/helloworld/pom.xml Tue Mar 14 08:12:36 2006
@@ -37,6 +37,7 @@
<module>helloworldaxissvc</module>
-->
<module>helloworldaxis2</module>
+ <module>helloworldjsonrpc</module>
<module>helloworldws</module>
<module>helloworldwsclient</module>
</modules>