You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tuscany.apache.org by js...@apache.org on 2007/06/14 00:18:17 UTC

svn commit: r547047 - in /incubator/tuscany/java/sca/samples/binding-echo: ./ src/main/java/echo/ src/main/java/echo/appl/ src/main/java/echo/client/ src/main/resources/ src/test/java/echo/ src/test/java/echo/appl/

Author: jsdelfino
Date: Wed Jun 13 15:18:12 2007
New Revision: 547047

URL: http://svn.apache.org/viewvc?view=rev&rev=547047
Log:
Finished renaming some of the artifacts in the echo binding sample.

Added:
    incubator/tuscany/java/sca/samples/binding-echo/src/main/java/echo/Echo.java
      - copied, changed from r546733, incubator/tuscany/java/sca/samples/binding-echo/src/main/java/echo/appl/Echo.java
    incubator/tuscany/java/sca/samples/binding-echo/src/main/java/echo/EchoBindingClient.java
      - copied, changed from r546733, incubator/tuscany/java/sca/samples/binding-echo/src/main/java/echo/client/EchoBindingClient.java
    incubator/tuscany/java/sca/samples/binding-echo/src/main/java/echo/EchoComponentImpl.java
      - copied, changed from r546733, incubator/tuscany/java/sca/samples/binding-echo/src/main/java/echo/appl/EchoComponentImpl.java
    incubator/tuscany/java/sca/samples/binding-echo/src/test/java/echo/EchoBindingTestCase.java   (with props)
Removed:
    incubator/tuscany/java/sca/samples/binding-echo/src/main/java/echo/appl/
    incubator/tuscany/java/sca/samples/binding-echo/src/main/java/echo/client/
    incubator/tuscany/java/sca/samples/binding-echo/src/test/java/echo/appl/
Modified:
    incubator/tuscany/java/sca/samples/binding-echo/README
    incubator/tuscany/java/sca/samples/binding-echo/build.xml
    incubator/tuscany/java/sca/samples/binding-echo/src/main/resources/EchoBinding.composite

Modified: incubator/tuscany/java/sca/samples/binding-echo/README
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/samples/binding-echo/README?view=diff&rev=547047&r1=547046&r2=547047
==============================================================================
--- incubator/tuscany/java/sca/samples/binding-echo/README (original)
+++ incubator/tuscany/java/sca/samples/binding-echo/README Wed Jun 13 15:18:12 2007
@@ -14,11 +14,11 @@
 
 OR if you don't have ant, on Windows do
 
-java -cp ..\..\lib\tuscany-sca-manifest.jar;..\binding-echo-extension\target\sample-binding-echo-extension.jar;target\sample-binding-echo.jar echo.client.EchoBindingClient
+java -cp ..\..\lib\tuscany-sca-manifest.jar;..\binding-echo-extension\target\sample-binding-echo-extension.jar;target\sample-binding-echo.jar echo.EchoBindingClient
 
 and on *nix do
 
-java -cp ../../lib/tuscany-sca-manifest.jar:../binding-echo-extension/target/sample-binding-echo-extension.jar:target/sample-binding-echo.jar echo.client.EchoBindingClient
+java -cp ../../lib/tuscany-sca-manifest.jar:../binding-echo-extension/target/sample-binding-echo-extension.jar:target/sample-binding-echo.jar echo.EchoBindingClient
 
 This looks like a long command. The three things we add to the classpath are
 
@@ -38,25 +38,22 @@
     main/
       java/
         echo/
-          appl/
-            Echo.java              - interface definition for the sample  
-                                     reference and service
-            EchoComponentImpl.java - sample component implementation with 
-                                     echo binding reference
-          client/
-            EchoBindingClient.java - sample client
+          Echo.java              - interface definition for the sample  
+                                   reference and service
+          EchoComponentImpl.java - sample component implementation with 
+                                   echo binding reference
+          EchoBindingClient.java - sample client
       resources/
-        EchoBinding.composite      - the SCA assembly for this sample
+        EchoBinding.composite    - the SCA assembly for this sample
     test/
       java/ 
         echo
-          appl/
-            EchoApplTestCase.java  - sample JUnit test case for the sample 
-                                     client
-  binding-echo.png                 - pictorial representation of the sample 
-                                     .composite file
-  build.xml                        - the Ant build file
-  pom.xml                          - the Maven build file
+          EchoTestCase.java      - sample JUnit test case for the sample 
+                                   client
+  binding-echo.png               - pictorial representation of the sample 
+                                   .composite file
+  build.xml                      - the Ant build file
+  pom.xml                        - the Maven build file
   
 
 Building And Running The Sample Using Ant

Modified: incubator/tuscany/java/sca/samples/binding-echo/build.xml
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/samples/binding-echo/build.xml?view=diff&rev=547047&r1=547046&r2=547047
==============================================================================
--- incubator/tuscany/java/sca/samples/binding-echo/build.xml (original)
+++ incubator/tuscany/java/sca/samples/binding-echo/build.xml Wed Jun 13 15:18:12 2007
@@ -17,7 +17,7 @@
  * under the License.    
 -->
 <project name="binding-echo" default="compile">
-    <property name="test.class" value="echo.client.EchoBindingClient" />
+    <property name="test.class" value="echo.EchoBindingClient" />
 	<property name="test.jar"   value="sample-binding-echo.jar" />
 	
     <target name="init">

Copied: incubator/tuscany/java/sca/samples/binding-echo/src/main/java/echo/Echo.java (from r546733, incubator/tuscany/java/sca/samples/binding-echo/src/main/java/echo/appl/Echo.java)
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/samples/binding-echo/src/main/java/echo/Echo.java?view=diff&rev=547047&p1=incubator/tuscany/java/sca/samples/binding-echo/src/main/java/echo/appl/Echo.java&r1=546733&p2=incubator/tuscany/java/sca/samples/binding-echo/src/main/java/echo/Echo.java&r2=547047
==============================================================================
--- incubator/tuscany/java/sca/samples/binding-echo/src/main/java/echo/appl/Echo.java (original)
+++ incubator/tuscany/java/sca/samples/binding-echo/src/main/java/echo/Echo.java Wed Jun 13 15:18:12 2007
@@ -16,7 +16,7 @@
  * specific language governing permissions and limitations
  * under the License.    
  */
-package echo.appl;
+package echo;
 
 /**
  * Interface of our sample Echo service.

Copied: incubator/tuscany/java/sca/samples/binding-echo/src/main/java/echo/EchoBindingClient.java (from r546733, incubator/tuscany/java/sca/samples/binding-echo/src/main/java/echo/client/EchoBindingClient.java)
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/samples/binding-echo/src/main/java/echo/EchoBindingClient.java?view=diff&rev=547047&p1=incubator/tuscany/java/sca/samples/binding-echo/src/main/java/echo/client/EchoBindingClient.java&r1=546733&p2=incubator/tuscany/java/sca/samples/binding-echo/src/main/java/echo/EchoBindingClient.java&r2=547047
==============================================================================
--- incubator/tuscany/java/sca/samples/binding-echo/src/main/java/echo/client/EchoBindingClient.java (original)
+++ incubator/tuscany/java/sca/samples/binding-echo/src/main/java/echo/EchoBindingClient.java Wed Jun 13 15:18:12 2007
@@ -16,11 +16,10 @@
  * specific language governing permissions and limitations
  * under the License.    
  */
-package echo.client;
+package echo;
 
 import org.apache.tuscany.sca.host.embedded.SCADomain;
 
-import echo.appl.Echo;
 import echo.server.EchoServer;
 
 /**

Copied: incubator/tuscany/java/sca/samples/binding-echo/src/main/java/echo/EchoComponentImpl.java (from r546733, incubator/tuscany/java/sca/samples/binding-echo/src/main/java/echo/appl/EchoComponentImpl.java)
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/samples/binding-echo/src/main/java/echo/EchoComponentImpl.java?view=diff&rev=547047&p1=incubator/tuscany/java/sca/samples/binding-echo/src/main/java/echo/appl/EchoComponentImpl.java&r1=546733&p2=incubator/tuscany/java/sca/samples/binding-echo/src/main/java/echo/EchoComponentImpl.java&r2=547047
==============================================================================
--- incubator/tuscany/java/sca/samples/binding-echo/src/main/java/echo/appl/EchoComponentImpl.java (original)
+++ incubator/tuscany/java/sca/samples/binding-echo/src/main/java/echo/EchoComponentImpl.java Wed Jun 13 15:18:12 2007
@@ -16,7 +16,7 @@
  * specific language governing permissions and limitations
  * under the License.    
  */
-package echo.appl;
+package echo;
 
 import org.osoa.sca.annotations.Constructor;
 import org.osoa.sca.annotations.Reference;

Modified: incubator/tuscany/java/sca/samples/binding-echo/src/main/resources/EchoBinding.composite
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/samples/binding-echo/src/main/resources/EchoBinding.composite?view=diff&rev=547047&r1=547046&r2=547047
==============================================================================
--- incubator/tuscany/java/sca/samples/binding-echo/src/main/resources/EchoBinding.composite (original)
+++ incubator/tuscany/java/sca/samples/binding-echo/src/main/resources/EchoBinding.composite Wed Jun 13 15:18:12 2007
@@ -23,16 +23,16 @@
 	name="EchoBinding">
 
     <service name="EchoService" promote="EchoComponent">
-        <interface.java interface="echo.appl.Echo"/>
+        <interface.java interface="echo.Echo"/>
         <binding.echo uri="http://tempuri.org" />
     </service>
 
     <component name="EchoComponent">
-        <implementation.java class="echo.appl.EchoComponentImpl"/>
+        <implementation.java class="echo.EchoComponentImpl"/>
     </component>
     
     <reference name="EchoReference" promote="EchoComponent/echoReference">
-        <interface.java interface="echo.appl.Echo"/>
+        <interface.java interface="echo.Echo"/>
         <binding.echo uri="http://tempuri.org" />
     </reference>
     

Added: incubator/tuscany/java/sca/samples/binding-echo/src/test/java/echo/EchoBindingTestCase.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/samples/binding-echo/src/test/java/echo/EchoBindingTestCase.java?view=auto&rev=547047
==============================================================================
--- incubator/tuscany/java/sca/samples/binding-echo/src/test/java/echo/EchoBindingTestCase.java (added)
+++ incubator/tuscany/java/sca/samples/binding-echo/src/test/java/echo/EchoBindingTestCase.java Wed Jun 13 15:18:12 2007
@@ -0,0 +1,57 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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 echo;
+
+import junit.framework.TestCase;
+
+import org.apache.tuscany.sca.host.embedded.SCADomain;
+
+import echo.Echo;
+import echo.server.EchoServer;
+
+public class EchoBindingTestCase extends TestCase {
+    
+    private SCADomain scaDomain;
+    
+    @Override
+    protected void setUp() throws Exception {
+        scaDomain  = SCADomain.newInstance("EchoBinding.composite");
+    }
+    
+    @Override
+    protected void tearDown() throws Exception {
+        scaDomain.close();
+    }
+
+    public void testReference() throws Exception {
+        // Call the echo service component which will, in turn, call a reference
+        // with an echo binding. The echo binding will echo the given string.
+        Echo service = scaDomain.getService(Echo.class, "EchoComponent");
+        String echoString = service.echo("foo");
+        assertEquals(echoString, "foo");
+    }
+    
+    public void testService() throws Exception {
+        // Call the echo server. This will dispatch the call to a service with an 
+        // echo binding. The echo binding will pass the call to the echo component.
+        String echoString = EchoServer.getServer().sendReceive("EchoComponent/EchoService", "bar");
+        assertEquals(echoString, "bar");
+    }
+}

Propchange: incubator/tuscany/java/sca/samples/binding-echo/src/test/java/echo/EchoBindingTestCase.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/tuscany/java/sca/samples/binding-echo/src/test/java/echo/EchoBindingTestCase.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date



---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-commits-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-commits-help@ws.apache.org