tomee-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jlaskow...@apache.org
Subject svn commit: r896708 - /openejb/trunk/openejb3/container/openejb-core/src/test/java/org/apache/openejb/config/AnnotationDeployerTest.java
Date Wed, 06 Jan 2010 22:57:31 GMT
Author: jlaskowski
Date: Wed Jan  6 22:57:31 2010
New Revision: 896708

URL: http://svn.apache.org/viewvc?rev=896708&view=rev
Log:
Test enhancements for ensuring OpenEJB supports generic business method call interceptors

See OPENEJB-1128 Intercepting generic business method calls fails for more

Modified:
    openejb/trunk/openejb3/container/openejb-core/src/test/java/org/apache/openejb/config/AnnotationDeployerTest.java

Modified: openejb/trunk/openejb3/container/openejb-core/src/test/java/org/apache/openejb/config/AnnotationDeployerTest.java
URL: http://svn.apache.org/viewvc/openejb/trunk/openejb3/container/openejb-core/src/test/java/org/apache/openejb/config/AnnotationDeployerTest.java?rev=896708&r1=896707&r2=896708&view=diff
==============================================================================
--- openejb/trunk/openejb3/container/openejb-core/src/test/java/org/apache/openejb/config/AnnotationDeployerTest.java
(original)
+++ openejb/trunk/openejb3/container/openejb-core/src/test/java/org/apache/openejb/config/AnnotationDeployerTest.java
Wed Jan  6 22:57:31 2010
@@ -19,19 +19,23 @@
 import org.apache.openejb.assembler.classic.AppInfo;
 import org.apache.openejb.assembler.classic.Assembler;
 import org.apache.openejb.assembler.classic.ClientInfo;
+import org.apache.openejb.assembler.classic.EjbJarInfo;
 import org.apache.openejb.jee.AssemblyDescriptor;
 import org.apache.openejb.jee.EjbJar;
 
 import static org.hamcrest.CoreMatchers.*;
 import static org.junit.Assert.assertThat;
 
+import org.apache.openejb.jee.EnterpriseBean;
 import org.junit.Assert;
 import org.junit.Test;
 
 import javax.ejb.ApplicationException;
+import javax.ejb.Local;
+import javax.ejb.Stateless;
 
 /**
- * @version $Rev$ $Date$
+ * @version $Rev$ $Date$
  */
 public class AnnotationDeployerTest {
 
@@ -86,17 +90,44 @@
         Assert.assertEquals(MyMainClass.class.getName(), clientInfo.mainClass);
     }
 
+    /**
+     *  For https://issues.apache.org/jira/browse/OPENEJB-1128
+     */
+    @Test
+    public void interceptingGenericBusinessMethodCalls() throws Exception {
+        EjbJar ejbJar = new EjbJar("test-classes");
+        EjbModule ejbModule = new EjbModule(ejbJar);
+        ejbModule.setJarLocation(null);
+
+        AnnotationDeployer.DiscoverAnnotatedBeans discvrAnnBeans = new AnnotationDeployer.DiscoverAnnotatedBeans();
+        ejbModule = discvrAnnBeans.deploy(ejbModule);
+
+        final EnterpriseBean bean = ejbJar.getEnterpriseBean("InterceptedSLSBean");
+        assert bean != null;        
+    }
+
     @ApplicationException(rollback = true)
     public abstract class BusinessException extends Exception {
     }
 
     public class ValueRequiredException extends BusinessException {
     }
-    
+
     public static final class MyMainClass {
-	public static void main(String[] args) {
-	    
-	}
+        public static void main(String[] args) {
+        }
+    }
+
+    public static interface GenericInterface<T> {
+        T genericMethod(T t);
+    }
+
+    @Stateless
+    @Local(GenericInterface.class)
+    public static class InterceptedSLSBean implements GenericInterface<String> {
+        public String genericMethod(String s) {
+            return s;
+        }
     }
 
 }



Mime
View raw message