You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tuscany.apache.org by lr...@apache.org on 2008/01/21 07:33:14 UTC

svn commit: r613772 - in /incubator/tuscany/java/sca/itest/bpel/helloworld-reference/src/test: java/helloworld/ resources/helloworld/

Author: lresende
Date: Sun Jan 20 22:32:59 2008
New Revision: 613772

URL: http://svn.apache.org/viewvc?rev=613772&view=rev
Log:
Strawman of a helloworld bpel with reference to a sca component

Modified:
    incubator/tuscany/java/sca/itest/bpel/helloworld-reference/src/test/java/helloworld/HelloWorldServiceImpl.java
    incubator/tuscany/java/sca/itest/bpel/helloworld-reference/src/test/java/helloworld/HelloWorldTestCase.java
    incubator/tuscany/java/sca/itest/bpel/helloworld-reference/src/test/resources/helloworld/helloworld.componentType
    incubator/tuscany/java/sca/itest/bpel/helloworld-reference/src/test/resources/helloworld/helloworld.composite

Modified: incubator/tuscany/java/sca/itest/bpel/helloworld-reference/src/test/java/helloworld/HelloWorldServiceImpl.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/itest/bpel/helloworld-reference/src/test/java/helloworld/HelloWorldServiceImpl.java?rev=613772&r1=613771&r2=613772&view=diff
==============================================================================
--- incubator/tuscany/java/sca/itest/bpel/helloworld-reference/src/test/java/helloworld/HelloWorldServiceImpl.java (original)
+++ incubator/tuscany/java/sca/itest/bpel/helloworld-reference/src/test/java/helloworld/HelloWorldServiceImpl.java Sun Jan 20 22:32:59 2008
@@ -30,15 +30,18 @@
     GreetingsService greetingsService;
 
     public GreetingsService getGreetingsService() {
+        System.out.println("Got Injected greetingsService");
         return greetingsService;
     }
 
     @Reference
     public void setGreetingsService(GreetingsService greetingsService) {
+        System.out.println("Injected greetingsService");
         this.greetingsService = greetingsService;
     }
     
     public String hello(String name) {
+        System.out.println("Calling greeting services getGreetings");
         return greetingsService.getGreetings(name);
     }
 }

Modified: incubator/tuscany/java/sca/itest/bpel/helloworld-reference/src/test/java/helloworld/HelloWorldTestCase.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/itest/bpel/helloworld-reference/src/test/java/helloworld/HelloWorldTestCase.java?rev=613772&r1=613771&r2=613772&view=diff
==============================================================================
--- incubator/tuscany/java/sca/itest/bpel/helloworld-reference/src/test/java/helloworld/HelloWorldTestCase.java (original)
+++ incubator/tuscany/java/sca/itest/bpel/helloworld-reference/src/test/java/helloworld/HelloWorldTestCase.java Sun Jan 20 22:32:59 2008
@@ -19,15 +19,11 @@
 
 package helloworld;
 
-import greetings.GreetingsService;
-
-import java.io.IOException;
-import java.net.Socket;
-
+import greetings.GreetingsTestServer;
 import junit.framework.TestCase;
 
-import org.apache.tuscany.implementation.bpel.example.helloworld.HelloPortType;
 import org.apache.tuscany.sca.host.embedded.SCADomain;
+import org.apache.tuscany.sca.host.embedded.SCATestCaseRunner;
 
 /**
  * Tests the BPEL Helloworld Service
@@ -37,12 +33,17 @@
 public class HelloWorldTestCase extends TestCase {
     private SCADomain scaDomain;
     
+    private SCATestCaseRunner server;
+    
     /**
      * @throws java.lang.Exception
      */
     @Override
     protected void setUp() throws Exception {
         scaDomain = SCADomain.newInstance("helloworld/helloworld.composite");
+        
+        server =  new SCATestCaseRunner(GreetingsTestServer.class);
+        server.before();
     }
 
     /**
@@ -50,22 +51,13 @@
      */
     @Override
     protected void tearDown() throws Exception {
+        server.after();
         scaDomain.close();
     }
     
-    public void testPing() throws IOException {
-        new Socket("127.0.0.1", 8085);
-    }
-    
-    public void testGreetingsServiceInvocation() {
-        GreetingsService greetingsService = scaDomain.getService(GreetingsService.class, "GreetingsServiceComponent");
-        String response = greetingsService.getGreetings("Luciano");
-        assertEquals("Hello Luciano", response);
-    }
-    
     public void testServiceInvocation() {
-        HelloPortType bpelService = scaDomain.getService(HelloPortType.class, "BPELHelloWorldService");
-        String response = bpelService.hello("Hello");
-        assertEquals("Hello World", response);
+        HelloWorldService bpelService = scaDomain.getService(HelloWorldService.class, "HelloWorldService");
+        String response = bpelService.hello("Luciano");
+        assertEquals("Hello Luciano", response);
     }
 }

Modified: incubator/tuscany/java/sca/itest/bpel/helloworld-reference/src/test/resources/helloworld/helloworld.componentType
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/itest/bpel/helloworld-reference/src/test/resources/helloworld/helloworld.componentType?rev=613772&r1=613771&r2=613772&view=diff
==============================================================================
--- incubator/tuscany/java/sca/itest/bpel/helloworld-reference/src/test/resources/helloworld/helloworld.componentType (original)
+++ incubator/tuscany/java/sca/itest/bpel/helloworld-reference/src/test/resources/helloworld/helloworld.componentType Sun Jan 20 22:32:59 2008
@@ -22,6 +22,7 @@
 	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
 	xmlns:xsd="http://www.w3.org/2001/XMLSchema">
 
+  <!-- 
   <service name="HelloService">
         <interface.wsdl interface="http://tuscany.apache.org/implementation/bpel/example/helloworld.wsdl#wsdl.interface(HelloPortType)" />
   </service>
@@ -29,6 +30,6 @@
   <reference name="greetingsService" target="GreetingsServiceComponent">
         <binding.ws uri="http://localhost:8085/GreetingsService"/>
   </reference>
-
+   -->
 </componentType>              
        

Modified: incubator/tuscany/java/sca/itest/bpel/helloworld-reference/src/test/resources/helloworld/helloworld.composite
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/itest/bpel/helloworld-reference/src/test/resources/helloworld/helloworld.composite?rev=613772&r1=613771&r2=613772&view=diff
==============================================================================
--- incubator/tuscany/java/sca/itest/bpel/helloworld-reference/src/test/resources/helloworld/helloworld.composite (original)
+++ incubator/tuscany/java/sca/itest/bpel/helloworld-reference/src/test/resources/helloworld/helloworld.composite Sun Jan 20 22:32:59 2008
@@ -22,15 +22,14 @@
     xmlns:hns="http://tuscany.apache.org/implementation/bpel/example/helloworld"
     name="helloworld">
     
-    <component name="BPELHelloWorldServiceComponent">
+    <!-- component name="BPELHelloWorldServiceComponent">
         <implementation.bpel process="hns:HelloWorld"/>
-    </component>
+    </component -->
     
-    <component name="GreetingsServiceComponent">
-        <implementation.java class="greetings.GreetingsServiceImpl" />
-	    <service name="GreetingsService">
-	    	<interface.wsdl interface="http://greetings#wsdl.interface(Greetings)" />
-	        <binding.ws uri="http://localhost:8085/GreetingsService"/>
-	    </service>
-    </component> 
+    <component name="HelloWorldService">
+    	<implementation.java class="helloworld.HelloWorldServiceImpl"/>
+    	<reference name="greetingsService">
+    		<binding.ws uri="http://localhost:8085/GreetingsService"/>
+    	</reference>
+    </component>
 </composite>



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