tomee-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jgallim...@apache.org
Subject svn commit: r764897 - in /openejb/trunk/openejb3/examples/simple-webservice/src: main/java/org/superbiz/calculator/CalculatorImpl.java main/java/org/superbiz/calculator/CalculatorLocal.java test/java/org/superbiz/calculator/CalculatorTest.java
Date Tue, 14 Apr 2009 17:42:39 GMT
Author: jgallimore
Date: Tue Apr 14 17:42:38 2009
New Revision: 764897

URL: http://svn.apache.org/viewvc?rev=764897&view=rev
Log:
OPENEJB-1017 added test to lookup bean via local EJB interface

Added:
    openejb/trunk/openejb3/examples/simple-webservice/src/main/java/org/superbiz/calculator/CalculatorLocal.java
  (contents, props changed)
      - copied, changed from r764522, openejb/trunk/openejb3/examples/simple-webservice/src/main/java/org/superbiz/calculator/CalculatorWs.java
Modified:
    openejb/trunk/openejb3/examples/simple-webservice/src/main/java/org/superbiz/calculator/CalculatorImpl.java
    openejb/trunk/openejb3/examples/simple-webservice/src/test/java/org/superbiz/calculator/CalculatorTest.java

Modified: openejb/trunk/openejb3/examples/simple-webservice/src/main/java/org/superbiz/calculator/CalculatorImpl.java
URL: http://svn.apache.org/viewvc/openejb/trunk/openejb3/examples/simple-webservice/src/main/java/org/superbiz/calculator/CalculatorImpl.java?rev=764897&r1=764896&r2=764897&view=diff
==============================================================================
--- openejb/trunk/openejb3/examples/simple-webservice/src/main/java/org/superbiz/calculator/CalculatorImpl.java
(original)
+++ openejb/trunk/openejb3/examples/simple-webservice/src/main/java/org/superbiz/calculator/CalculatorImpl.java
Tue Apr 14 17:42:38 2009
@@ -32,7 +32,7 @@
         serviceName = "CalculatorWsService",
         targetNamespace = "http://superbiz.org/wsdl",
         endpointInterface = "org.superbiz.calculator.CalculatorWs")
-public class CalculatorImpl implements CalculatorWs {
+public class CalculatorImpl implements CalculatorWs, CalculatorLocal {
 
     public int sum(int add1, int add2) {
         return add1 + add2;

Copied: openejb/trunk/openejb3/examples/simple-webservice/src/main/java/org/superbiz/calculator/CalculatorLocal.java
(from r764522, openejb/trunk/openejb3/examples/simple-webservice/src/main/java/org/superbiz/calculator/CalculatorWs.java)
URL: http://svn.apache.org/viewvc/openejb/trunk/openejb3/examples/simple-webservice/src/main/java/org/superbiz/calculator/CalculatorLocal.java?p2=openejb/trunk/openejb3/examples/simple-webservice/src/main/java/org/superbiz/calculator/CalculatorLocal.java&p1=openejb/trunk/openejb3/examples/simple-webservice/src/main/java/org/superbiz/calculator/CalculatorWs.java&r1=764522&r2=764897&rev=764897&view=diff
==============================================================================
--- openejb/trunk/openejb3/examples/simple-webservice/src/main/java/org/superbiz/calculator/CalculatorWs.java
(original)
+++ openejb/trunk/openejb3/examples/simple-webservice/src/main/java/org/superbiz/calculator/CalculatorLocal.java
Tue Apr 14 17:42:38 2009
@@ -17,20 +17,16 @@
 package org.superbiz.calculator;
 
 import javax.jws.WebService;
+import javax.ejb.Remote;
+
+//END SNIPPET: code
 
 //END SNIPPET: code
 
-/**
- * This is an EJB 3 webservice interface
- * A webservice interface must be annotated with the @Local
- * annotation.
- */
 //START SNIPPET: code
-@WebService(targetNamespace="http://superbiz.org/wsdl" )
-public interface CalculatorWs {
+public interface CalculatorLocal {
 
 	public int sum(int add1, int add2);
 
 	public int multiply(int mul1, int mul2);
-}
-//END SNIPPET: code
\ No newline at end of file
+}
\ No newline at end of file

Propchange: openejb/trunk/openejb3/examples/simple-webservice/src/main/java/org/superbiz/calculator/CalculatorLocal.java
------------------------------------------------------------------------------
    svn:keywords = Date Rev Author Id Revision HeadURL

Propchange: openejb/trunk/openejb3/examples/simple-webservice/src/main/java/org/superbiz/calculator/CalculatorLocal.java
------------------------------------------------------------------------------
    svn:mergeinfo = 

Modified: openejb/trunk/openejb3/examples/simple-webservice/src/test/java/org/superbiz/calculator/CalculatorTest.java
URL: http://svn.apache.org/viewvc/openejb/trunk/openejb3/examples/simple-webservice/src/test/java/org/superbiz/calculator/CalculatorTest.java?rev=764897&r1=764896&r2=764897&view=diff
==============================================================================
--- openejb/trunk/openejb3/examples/simple-webservice/src/test/java/org/superbiz/calculator/CalculatorTest.java
(original)
+++ openejb/trunk/openejb3/examples/simple-webservice/src/test/java/org/superbiz/calculator/CalculatorTest.java
Tue Apr 14 17:42:38 2009
@@ -50,7 +50,13 @@
 
         CalculatorWs calc = calcService.getPort(CalculatorWs.class);
         assertEquals(10, calc.sum(4,6));
-	assertEquals(12, calc.multiply(3,4));
+	    assertEquals(12, calc.multiply(3,4));
+    }
+
+     public void testCalculatorViaRemoteInterface() throws Exception {
+        CalculatorLocal calc = (CalculatorLocal) initialContext.lookup("CalculatorImplLocal");
+        assertEquals(10, calc.sum(4, 6));
+        assertEquals(12, calc.multiply(3, 4));
     }
     //END SNIPPET: webservice
 



Mime
View raw message