deltaspike-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tandrasc...@apache.org
Subject deltaspike git commit: DELTASPIKE-1069 evaluate interceptors for producer-methods
Date Tue, 22 Mar 2016 16:35:26 GMT
Repository: deltaspike
Updated Branches:
  refs/heads/master b13e68983 -> f58e3259c


DELTASPIKE-1069 evaluate interceptors for producer-methods

Project: http://git-wip-us.apache.org/repos/asf/deltaspike/repo
Commit: http://git-wip-us.apache.org/repos/asf/deltaspike/commit/f58e3259
Tree: http://git-wip-us.apache.org/repos/asf/deltaspike/tree/f58e3259
Diff: http://git-wip-us.apache.org/repos/asf/deltaspike/diff/f58e3259

Branch: refs/heads/master
Commit: f58e3259cfe2beab9dbf5abed3a41ad92cc0e10d
Parents: b13e689
Author: tandraschko <tandraschko@apache.org>
Authored: Tue Mar 22 17:31:33 2016 +0100
Committer: tandraschko <tandraschko@apache.org>
Committed: Tue Mar 22 17:31:33 2016 +0100

----------------------------------------------------------------------
 deltaspike/modules/proxy/impl-asm5/pom.xml      | 36 +++++------
 .../EnableInterceptorsTest.java                 | 14 ++++-
 ...bleInterceptors_WithoutInterceptor_Test.java | 66 --------------------
 .../proxy/impl/enableinterceptors/MyBean.java   |  8 ++-
 .../test/proxy/impl/util/ArchiveUtils.java      |  7 ++-
 5 files changed, 42 insertions(+), 89 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/deltaspike/blob/f58e3259/deltaspike/modules/proxy/impl-asm5/pom.xml
----------------------------------------------------------------------
diff --git a/deltaspike/modules/proxy/impl-asm5/pom.xml b/deltaspike/modules/proxy/impl-asm5/pom.xml
index 0c79ad1..efa9665 100644
--- a/deltaspike/modules/proxy/impl-asm5/pom.xml
+++ b/deltaspike/modules/proxy/impl-asm5/pom.xml
@@ -18,19 +18,19 @@
   ~ under the License.
   -->
 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
-	<modelVersion>4.0.0</modelVersion>
+    <modelVersion>4.0.0</modelVersion>
 
-	<parent>
-		<groupId>org.apache.deltaspike.modules</groupId>
-		<artifactId>proxy-module-project</artifactId>
-		<version>1.5.5-SNAPSHOT</version>
-	</parent>
+    <parent>
+        <groupId>org.apache.deltaspike.modules</groupId>
+        <artifactId>proxy-module-project</artifactId>
+        <version>1.5.5-SNAPSHOT</version>
+    </parent>
 
-	<artifactId>deltaspike-proxy-module-impl-asm5</artifactId>
-	<packaging>bundle</packaging>
+    <artifactId>deltaspike-proxy-module-impl-asm5</artifactId>
+    <packaging>bundle</packaging>
+
+    <name>Apache DeltaSpike Proxy-Module Impl ASM5</name>
 
-	<name>Apache DeltaSpike Proxy-Module Impl ASM5</name>
-    
     <properties>
         <deltaspike.osgi.export.pkg>
             org.apache.deltaspike.proxy.impl.*
@@ -40,8 +40,6 @@
         </deltaspike.osgi.import>
     </properties>
 
-
-
     <build>
         <plugins>
             <plugin>
@@ -87,11 +85,11 @@
         </plugins>
     </build>
 
-	<dependencies>
-		<dependency>
-			<groupId>org.apache.deltaspike.core</groupId>
-			<artifactId>deltaspike-core-api</artifactId>
-		</dependency>
+    <dependencies>
+        <dependency>
+            <groupId>org.apache.deltaspike.core</groupId>
+            <artifactId>deltaspike-core-api</artifactId>
+        </dependency>
 
         <dependency>
             <groupId>org.apache.deltaspike.modules</groupId>
@@ -116,12 +114,12 @@
             <version>5.0.3</version>
             <optional>true</optional>
         </dependency>
-        
+
         <dependency>
             <groupId>org.apache.deltaspike.core</groupId>
             <artifactId>deltaspike-core-impl</artifactId>
             <scope>test</scope>
         </dependency>
-	</dependencies>
+    </dependencies>
 
 </project>

http://git-wip-us.apache.org/repos/asf/deltaspike/blob/f58e3259/deltaspike/modules/proxy/impl-asm5/src/test/java/org/apache/deltaspike/proxy/impl/enableinterceptors/EnableInterceptorsTest.java
----------------------------------------------------------------------
diff --git a/deltaspike/modules/proxy/impl-asm5/src/test/java/org/apache/deltaspike/proxy/impl/enableinterceptors/EnableInterceptorsTest.java
b/deltaspike/modules/proxy/impl-asm5/src/test/java/org/apache/deltaspike/proxy/impl/enableinterceptors/EnableInterceptorsTest.java
index db3c258..fe4ac33 100644
--- a/deltaspike/modules/proxy/impl-asm5/src/test/java/org/apache/deltaspike/proxy/impl/enableinterceptors/EnableInterceptorsTest.java
+++ b/deltaspike/modules/proxy/impl-asm5/src/test/java/org/apache/deltaspike/proxy/impl/enableinterceptors/EnableInterceptorsTest.java
@@ -60,7 +60,7 @@ public class EnableInterceptorsTest
     private MyBean myBean;
     
     @Test
-    public void testPartialBeanWithApplicationScope() throws Exception
+    public void testInterception() throws Exception
     {
         Assert.assertFalse(myBean.isIntercepted());
         Assert.assertFalse(myBean.isMethodCalled());
@@ -70,4 +70,16 @@ public class EnableInterceptorsTest
         Assert.assertTrue(myBean.isIntercepted());
         Assert.assertTrue(myBean.isMethodCalled());
     }
+    
+    @Test
+    public void testNonInterception() throws Exception
+    {
+        Assert.assertFalse(myBean.isIntercepted());
+        Assert.assertFalse(myBean.isMethodCalled());
+        
+        myBean.somethingNotIntercepted();
+        
+        Assert.assertFalse(myBean.isIntercepted());
+        Assert.assertTrue(myBean.isMethodCalled());
+    }
 }

http://git-wip-us.apache.org/repos/asf/deltaspike/blob/f58e3259/deltaspike/modules/proxy/impl-asm5/src/test/java/org/apache/deltaspike/proxy/impl/enableinterceptors/EnableInterceptors_WithoutInterceptor_Test.java
----------------------------------------------------------------------
diff --git a/deltaspike/modules/proxy/impl-asm5/src/test/java/org/apache/deltaspike/proxy/impl/enableinterceptors/EnableInterceptors_WithoutInterceptor_Test.java
b/deltaspike/modules/proxy/impl-asm5/src/test/java/org/apache/deltaspike/proxy/impl/enableinterceptors/EnableInterceptors_WithoutInterceptor_Test.java
deleted file mode 100644
index de26499..0000000
--- a/deltaspike/modules/proxy/impl-asm5/src/test/java/org/apache/deltaspike/proxy/impl/enableinterceptors/EnableInterceptors_WithoutInterceptor_Test.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/*
- * 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 org.apache.deltaspike.proxy.impl.enableinterceptors;
-
-import javax.inject.Inject;
-import org.apache.deltaspike.test.proxy.impl.util.ArchiveUtils;
-import org.jboss.arquillian.container.test.api.Deployment;
-import org.jboss.arquillian.junit.Arquillian;
-import org.jboss.shrinkwrap.api.ShrinkWrap;
-import org.jboss.shrinkwrap.api.asset.EmptyAsset;
-import org.jboss.shrinkwrap.api.spec.JavaArchive;
-import org.jboss.shrinkwrap.api.spec.WebArchive;
-import org.junit.Assert;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-
-@RunWith(Arquillian.class)
-public class EnableInterceptors_WithoutInterceptor_Test
-{    
-    @Deployment
-    public static WebArchive war()
-    {
-        String simpleName = EnableInterceptors_WithoutInterceptor_Test.class.getSimpleName();
-        String archiveName = simpleName.substring(0, 1).toLowerCase() + simpleName.substring(1);
-
-        JavaArchive testJar = ShrinkWrap.create(JavaArchive.class, archiveName + ".jar")
-                .addPackage(EnableInterceptors_WithoutInterceptor_Test.class.getPackage())
-                .addAsManifestResource(EmptyAsset.INSTANCE, "beans.xml");
-
-        return ShrinkWrap.create(WebArchive.class, archiveName + ".war")
-                .addAsLibraries(ArchiveUtils.getDeltaSpikeCoreAndProxyArchive())
-                .addAsLibraries(testJar)
-                .addAsWebInfResource(EmptyAsset.INSTANCE, "beans.xml");
-    }
-
-    @Inject
-    private MyBean myBean;
-    
-    @Test
-    public void testPartialBeanWithApplicationScope() throws Exception
-    {
-        Assert.assertFalse(myBean.isIntercepted());
-        Assert.assertFalse(myBean.isMethodCalled());
-        
-        myBean.somethingIntercepted();
-        
-        Assert.assertFalse(myBean.isIntercepted());
-        Assert.assertTrue(myBean.isMethodCalled());
-    }
-}

http://git-wip-us.apache.org/repos/asf/deltaspike/blob/f58e3259/deltaspike/modules/proxy/impl-asm5/src/test/java/org/apache/deltaspike/proxy/impl/enableinterceptors/MyBean.java
----------------------------------------------------------------------
diff --git a/deltaspike/modules/proxy/impl-asm5/src/test/java/org/apache/deltaspike/proxy/impl/enableinterceptors/MyBean.java
b/deltaspike/modules/proxy/impl-asm5/src/test/java/org/apache/deltaspike/proxy/impl/enableinterceptors/MyBean.java
index 4c2373e..e1406e8 100644
--- a/deltaspike/modules/proxy/impl-asm5/src/test/java/org/apache/deltaspike/proxy/impl/enableinterceptors/MyBean.java
+++ b/deltaspike/modules/proxy/impl-asm5/src/test/java/org/apache/deltaspike/proxy/impl/enableinterceptors/MyBean.java
@@ -45,11 +45,15 @@ public class MyBean
     {
         this.methodCalled = methodCalled;
     }
-    
-    
+
     @MyBeanInterceptorBinding
     public void somethingIntercepted()
     {
         methodCalled = true;
     }
+
+    public void somethingNotIntercepted()
+    {
+        methodCalled = true;
+    }
 }

http://git-wip-us.apache.org/repos/asf/deltaspike/blob/f58e3259/deltaspike/modules/proxy/impl-asm5/src/test/java/org/apache/deltaspike/test/proxy/impl/util/ArchiveUtils.java
----------------------------------------------------------------------
diff --git a/deltaspike/modules/proxy/impl-asm5/src/test/java/org/apache/deltaspike/test/proxy/impl/util/ArchiveUtils.java
b/deltaspike/modules/proxy/impl-asm5/src/test/java/org/apache/deltaspike/test/proxy/impl/util/ArchiveUtils.java
index bba08f5..e772b6a 100644
--- a/deltaspike/modules/proxy/impl-asm5/src/test/java/org/apache/deltaspike/test/proxy/impl/util/ArchiveUtils.java
+++ b/deltaspike/modules/proxy/impl-asm5/src/test/java/org/apache/deltaspike/test/proxy/impl/util/ArchiveUtils.java
@@ -21,6 +21,7 @@ package org.apache.deltaspike.test.proxy.impl.util;
 import java.util.ArrayList;
 import java.util.Arrays;
 import org.apache.deltaspike.test.utils.ShrinkWrapArchiveUtil;
+import org.jboss.shrinkwrap.api.ShrinkWrap;
 import org.jboss.shrinkwrap.api.spec.JavaArchive;
 
 public abstract class ArchiveUtils
@@ -39,11 +40,15 @@ public abstract class ArchiveUtils
                 "META-INF/beans.xml",
                 new String[] { "org.apache.deltaspike.core",
                         "org.apache.deltaspike.proxy",
-                        "org.apache.deltaspike.test.category" },
+                        "org.apache.deltaspike.test.category"},
                 new String[] { "META-INF.apache-deltaspike.properties" },
                 "ds-core_and_proxy");
         result.addAll(Arrays.asList(temp));
 
+        // add asm - it isn't shaded yet in the test phase
+        result.add(ShrinkWrap.create(JavaArchive.class, "ds-asm.jar")
+                    .addPackages(true, "org.objectweb.asm"));
+
         return result.toArray(new JavaArchive[result.size()]);
     }
 }


Mime
View raw message