You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tuscany.apache.org by rf...@apache.org on 2009/04/09 19:22:21 UTC

svn commit: r763739 - in /tuscany/branches/sca-java-1.x/modules/binding-ejb-runtime/src/test: java/account/ java/calculator/ java/org/apache/tuscany/sca/binding/ejb/tests/ resources/account/ resources/calculator-ejb/

Author: rfeng
Date: Thu Apr  9 17:22:20 2009
New Revision: 763739

URL: http://svn.apache.org/viewvc?rev=763739&view=rev
Log:
Fix TUSCANY-2957

Added:
    tuscany/branches/sca-java-1.x/modules/binding-ejb-runtime/src/test/java/calculator/AddServiceRemote.java
    tuscany/branches/sca-java-1.x/modules/binding-ejb-runtime/src/test/resources/calculator-ejb/
    tuscany/branches/sca-java-1.x/modules/binding-ejb-runtime/src/test/resources/calculator-ejb/calculator-ejb.jar   (with props)
Removed:
    tuscany/branches/sca-java-1.x/modules/binding-ejb-runtime/src/test/java/calculator/AddService.java
    tuscany/branches/sca-java-1.x/modules/binding-ejb-runtime/src/test/java/calculator/AddServiceHome.java
Modified:
    tuscany/branches/sca-java-1.x/modules/binding-ejb-runtime/src/test/java/account/CustomerImpl.java
    tuscany/branches/sca-java-1.x/modules/binding-ejb-runtime/src/test/java/org/apache/tuscany/sca/binding/ejb/tests/EJBReferenceTestCase.java
    tuscany/branches/sca-java-1.x/modules/binding-ejb-runtime/src/test/java/org/apache/tuscany/sca/binding/ejb/tests/MockServer.java
    tuscany/branches/sca-java-1.x/modules/binding-ejb-runtime/src/test/resources/account/account.composite

Modified: tuscany/branches/sca-java-1.x/modules/binding-ejb-runtime/src/test/java/account/CustomerImpl.java
URL: http://svn.apache.org/viewvc/tuscany/branches/sca-java-1.x/modules/binding-ejb-runtime/src/test/java/account/CustomerImpl.java?rev=763739&r1=763738&r2=763739&view=diff
==============================================================================
--- tuscany/branches/sca-java-1.x/modules/binding-ejb-runtime/src/test/java/account/CustomerImpl.java (original)
+++ tuscany/branches/sca-java-1.x/modules/binding-ejb-runtime/src/test/java/account/CustomerImpl.java Thu Apr  9 17:22:20 2009
@@ -6,15 +6,15 @@
  * 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.    
+ * under the License.
  */
 package account;
 
@@ -22,32 +22,32 @@
 import org.osoa.sca.annotations.Reference;
 import org.osoa.sca.annotations.Service;
 
-import calculator.AddService;
+import calculator.AddServiceRemote;
 
 @Service(Customer.class)
 public class CustomerImpl implements Customer {
 
-    private AddService extEJBService = null;
+    private AddServiceRemote extEJBService = null;
 
-    public AddService getExtEJBService() {
+    public AddServiceRemote getExtEJBService() {
         return extEJBService;
     }
 
     @Reference
-    public void setExtEJBService(AddService extEJBService) {
+    public void setExtEJBService(AddServiceRemote extEJBService) {
         this.extEJBService = extEJBService;
     }
 
     // this method invokes external EJB through EJB reference binding
     public Double depositAmount(java.lang.String accountNo, Double amount) {
-         
+
         Double total = null;
 
         System.out.println("In component implementation. Invoking external EJB through EJB reference binding  ");
 
         try {
-            Double balance = extEJBService.add(amount.doubleValue(), 1000); //invoke external ejb through ejb reference binding 
-            total =  balance + amount; 
+            Double balance = extEJBService.add(amount.doubleValue(), 1000); //invoke external ejb through ejb reference binding
+            total = balance + amount;
         } catch (Exception e) {
             throw new ServiceRuntimeException(e);
         }

Added: tuscany/branches/sca-java-1.x/modules/binding-ejb-runtime/src/test/java/calculator/AddServiceRemote.java
URL: http://svn.apache.org/viewvc/tuscany/branches/sca-java-1.x/modules/binding-ejb-runtime/src/test/java/calculator/AddServiceRemote.java?rev=763739&view=auto
==============================================================================
--- tuscany/branches/sca-java-1.x/modules/binding-ejb-runtime/src/test/java/calculator/AddServiceRemote.java (added)
+++ tuscany/branches/sca-java-1.x/modules/binding-ejb-runtime/src/test/java/calculator/AddServiceRemote.java Thu Apr  9 17:22:20 2009
@@ -0,0 +1,8 @@
+package calculator;
+
+import javax.ejb.Remote;
+
+@Remote
+public interface AddServiceRemote {
+    double add(double n1, double n2);
+}

Modified: tuscany/branches/sca-java-1.x/modules/binding-ejb-runtime/src/test/java/org/apache/tuscany/sca/binding/ejb/tests/EJBReferenceTestCase.java
URL: http://svn.apache.org/viewvc/tuscany/branches/sca-java-1.x/modules/binding-ejb-runtime/src/test/java/org/apache/tuscany/sca/binding/ejb/tests/EJBReferenceTestCase.java?rev=763739&r1=763738&r2=763739&view=diff
==============================================================================
--- tuscany/branches/sca-java-1.x/modules/binding-ejb-runtime/src/test/java/org/apache/tuscany/sca/binding/ejb/tests/EJBReferenceTestCase.java (original)
+++ tuscany/branches/sca-java-1.x/modules/binding-ejb-runtime/src/test/java/org/apache/tuscany/sca/binding/ejb/tests/EJBReferenceTestCase.java Thu Apr  9 17:22:20 2009
@@ -22,7 +22,6 @@
 import org.junit.After;
 import org.junit.Assert;
 import org.junit.Before;
-import org.junit.Ignore;
 import org.junit.Test;
 
 import account.Customer;
@@ -44,11 +43,12 @@
 
         scaDomain = SCADomain.newInstance("account/account.composite");
 
-        // To capture the network traffic for the MockServer, uncomment the next line
-        // new Thread(new SocketTracer(MOCK_PORT, OPENEJB_PORT)).start();
+        // To capture the network traffic for the MockServer, uncomment the next two lines (A) and comment out B
+        // int OPENEJB_PORT = 4201; // A
+        // new Thread(new SocketTracer(MOCK_PORT, OPENEJB_PORT)).start(); // A
 
         // Start the mock server to simulate the remote EJB
-        new Thread(new MockServer(MOCK_PORT)).start();
+        new Thread(new MockServer(MOCK_PORT)).start(); // B
 
         // Wait enough for the server to be started
         Thread.sleep(500);
@@ -59,7 +59,6 @@
         scaDomain.close();
     }
 
-    @Ignore("TUSCANY-2957")
     @Test
     public void testCalculator() throws Exception {
         Customer customer = scaDomain.getService(Customer.class, "CustomerComponent");

Modified: tuscany/branches/sca-java-1.x/modules/binding-ejb-runtime/src/test/java/org/apache/tuscany/sca/binding/ejb/tests/MockServer.java
URL: http://svn.apache.org/viewvc/tuscany/branches/sca-java-1.x/modules/binding-ejb-runtime/src/test/java/org/apache/tuscany/sca/binding/ejb/tests/MockServer.java?rev=763739&r1=763738&r2=763739&view=diff
==============================================================================
--- tuscany/branches/sca-java-1.x/modules/binding-ejb-runtime/src/test/java/org/apache/tuscany/sca/binding/ejb/tests/MockServer.java (original)
+++ tuscany/branches/sca-java-1.x/modules/binding-ejb-runtime/src/test/java/org/apache/tuscany/sca/binding/ejb/tests/MockServer.java Thu Apr  9 17:22:20 2009
@@ -6,15 +6,15 @@
  * 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.    
+ * under the License.
  */
 
 package org.apache.tuscany.sca.binding.ejb.tests;
@@ -30,35 +30,24 @@
     private int listen;
     byte[][] seq =
         {
-         {79, 69, 74, 80, 47, 51, 46, 48, 1, -84, -19, 0, 5, 119, 58, 1, 27, 0, 54, 47, 104, 101, 108, 108, 111, 45,
-          97, 100, 100, 115, 101, 114, 118, 105, 99, 101, 47, 65, 100, 100, 83, 101, 114, 118, 105, 99, 101, 66, 101,
-          97, 110, 47, 99, 97, 108, 99, 117, 108, 97, 116, 111, 114, 46, 65, 100, 100, 83, 101, 114, 118, 105, 99, 101,
-          112},
-
-         {79, 69, 74, 80, 47, 50, 46, 48, -84, -19, 0, 5, 119, 3, 1, 13, 1, 118, 114, 0, 25, 99, 97, 108, 99, 117, 108,
-          97, 116, 111, 114, 46, 65, 100, 100, 83, 101, 114, 118, 105, 99, 101, 72, 111, 109, 101, 0, 0, 0, 0, 0, 0, 0,
-          0, 0, 0, 0, 120, 112, 118, 114, 0, 21, 99, 97, 108, 99, 117, 108, 97, 116, 111, 114, 46, 65, 100, 100, 83,
-          101, 114, 118, 105, 99, 101, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 120, 112, 112, 112, 119, 38, 7, 0, 31, 104,
-          101, 108, 108, 111, 45, 97, 100, 100, 115, 101, 114, 118, 105, 99, 101, 47, 65, 100, 100, 83, 101, 114, 118,
-          105, 99, 101, 66, 101, 97, 110, -1, -1, 0, 0},
-
-         {79, 69, 74, 80, 47, 51, 46, 48, 0, -84, -19, 0, 5, 119, 1, 10, 116, 0, 31, 104, 101, 108, 108, 111, 45, 97,
-          100, 100, 115, 101, 114, 118, 105, 99, 101, 47, 65, 100, 100, 83, 101, 114, 118, 105, 99, 101, 66, 101, 97,
-          110, 119, 2, -1, -1, 112, 119, 1, 1, 112, 118, 114, 0, 25, 99, 97, 108, 99, 117, 108, 97, 116, 111, 114, 46,
-          65, 100, 100, 83, 101, 114, 118, 105, 99, 101, 72, 111, 109, 101, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 120, 112,
-          119, 9, 0, 6, 99, 114, 101, 97, 116, 101, 0},
-         {79, 69, 74, 80, 47, 50, 46, 48, -84, -19, 0, 5, 119, 2, 1, 4, 112},
-
-         {79, 69, 74, 80, 47, 51, 46, 48, 0, -84, -19, 0, 5, 119, 1, 23, 116, 0, 31, 104, 101, 108, 108, 111, 45, 97,
-          100, 100, 115, 101, 114, 118, 105, 99, 101, 47, 65, 100, 100, 83, 101, 114, 118, 105, 99, 101, 66, 101, 97,
-          110, 119, 2, -1, -1, 112, 119, 1, 1, 112, 118, 114, 0, 21, 99, 97, 108, 99, 117, 108, 97, 116, 111, 114, 46,
-          65, 100, 100, 83, 101, 114, 118, 105, 99, 101, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 120, 112, 119, 24, 0, 3, 97,
+         {79, 69, 74, 80, 47, 51, 46, 48, 1, -84, -19, 0, 5, 119, 21, 1, 27, 0, 17, 47, 65, 100, 100, 83, 101, 114,
+          118, 105, 99, 101, 82, 101, 109, 111, 116, 101, 112, 119, 4, -63, -5, 13, 59},
+         {79, 69, 74, 80, 47, 51, 46, 48, -84, -19, 0, 5, 119, 3, 1, 0, 21, 115, 114, 0, 41, 111, 114, 103, 46, 97,
+          112, 97, 99, 104, 101, 46, 111, 112, 101, 110, 101, 106, 98, 46, 99, 108, 105, 101, 110, 116, 46, 69, 74, 66,
+          77, 101, 116, 97, 68, 97, 116, 97, 73, 109, 112, 108, 29, -120, -127, 52, 16, -56, 15, 77, 12, 0, 0, 120,
+          112, 119, 1, 1, 112, 112, 112, 112, 119, 28, 7, 0, 21, 67, 97, 108, 99, 117, 108, 97, 116, 111, 114, 47, 65,
+          100, 100, 83, 101, 114, 118, 105, 99, 101, -1, -1, 0, 1, 118, 114, 0, 27, 99, 97, 108, 99, 117, 108, 97, 116,
+          111, 114, 46, 65, 100, 100, 83, 101, 114, 118, 105, 99, 101, 82, 101, 109, 111, 116, 101, 0, 0, 0, 0, 0, 0,
+          0, 0, 0, 0, 0, 120, 112, 112, 120},
+         {79, 69, 74, 80, 47, 51, 46, 48, 0, -84, -19, 0, 5, 119, 1, 23, 116, 0, 21, 67, 97, 108, 99, 117, 108, 97,
+          116, 111, 114, 47, 65, 100, 100, 83, 101, 114, 118, 105, 99, 101, 119, 2, -1, -1, 112, 119, 5, -63, -5, 13,
+          59, 1, 112, 118, 114, 0, 27, 99, 97, 108, 99, 117, 108, 97, 116, 111, 114, 46, 65, 100, 100, 83, 101, 114,
+          118, 105, 99, 101, 82, 101, 109, 111, 116, 101, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 120, 112, 119, 24, 0, 3, 97,
           100, 100, 2, 4, 64, 89, 0, 0, 0, 0, 0, 0, 4, 64, -113, 64, 0, 0, 0, 0, 0},
-         {79, 69, 74, 80, 47, 50, 46, 48, -84, -19, 0, 5, 119, 2, 1, 4, 115, 114, 0, 16, 106, 97, 118, 97, 46, 108, 97,
-          110, 103, 46, 68, 111, 117, 98, 108, 101, -128, -77, -62, 74, 41, 107, -5, 4, 2, 0, 1, 68, 0, 5, 118, 97,
+         {79, 69, 74, 80, 47, 51, 46, 48, -84, -19, 0, 5, 119, 3, 1, 0, 4, 115, 114, 0, 16, 106, 97, 118, 97, 46, 108,
+          97, 110, 103, 46, 68, 111, 117, 98, 108, 101, -128, -77, -62, 74, 41, 107, -5, 4, 2, 0, 1, 68, 0, 5, 118, 97,
           108, 117, 101, 120, 114, 0, 16, 106, 97, 118, 97, 46, 108, 97, 110, 103, 46, 78, 117, 109, 98, 101, 114,
           -122, -84, -107, 29, 11, -108, -32, -117, 2, 0, 0, 120, 112, 64, -111, 48, 0, 0, 0, 0, 0}
-
         };
 
     public MockServer(int listen) {

Modified: tuscany/branches/sca-java-1.x/modules/binding-ejb-runtime/src/test/resources/account/account.composite
URL: http://svn.apache.org/viewvc/tuscany/branches/sca-java-1.x/modules/binding-ejb-runtime/src/test/resources/account/account.composite?rev=763739&r1=763738&r2=763739&view=diff
==============================================================================
--- tuscany/branches/sca-java-1.x/modules/binding-ejb-runtime/src/test/resources/account/account.composite (original)
+++ tuscany/branches/sca-java-1.x/modules/binding-ejb-runtime/src/test/resources/account/account.composite Thu Apr  9 17:22:20 2009
@@ -7,15 +7,15 @@
     * 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.    
+    * under the License.
 -->
 <composite xmlns="http://www.osoa.org/xmlns/sca/1.0" name="account">
 
@@ -25,10 +25,10 @@
         <implementation.java class="account.CustomerImpl" />
         <reference name="extEJBService">
             <!-- To use the CosNaming, use the following URI -->
-            <!-- 
+            <!--
                 <binding.ejb uri="corbaname:iiop:1.2@localhost:1050#AddServiceBean" />
             -->
-            <binding.ejb uri="hello-addservice/AddServiceBean/calculator.AddService" />
+            <binding.ejb uri="AddServiceRemote" />
         </reference>
     </component>
 

Added: tuscany/branches/sca-java-1.x/modules/binding-ejb-runtime/src/test/resources/calculator-ejb/calculator-ejb.jar
URL: http://svn.apache.org/viewvc/tuscany/branches/sca-java-1.x/modules/binding-ejb-runtime/src/test/resources/calculator-ejb/calculator-ejb.jar?rev=763739&view=auto
==============================================================================
Binary file - no diff available.

Propchange: tuscany/branches/sca-java-1.x/modules/binding-ejb-runtime/src/test/resources/calculator-ejb/calculator-ejb.jar
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream