openwebbeans-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From strub...@apache.org
Subject svn commit: r1535770 - in /openwebbeans/trunk: webbeans-impl/src/main/java/org/apache/webbeans/proxy/ webbeans-impl/src/test/java/org/apache/webbeans/newtests/decorators/tests/ webbeans-impl/src/test/java/org/apache/webbeans/newtests/interceptors/facto...
Date Fri, 25 Oct 2013 16:13:56 GMT
Author: struberg
Date: Fri Oct 25 16:13:55 2013
New Revision: 1535770

URL: http://svn.apache.org/r1535770
Log:
OWB-908 properly handle internal Exception classname

Added:
    openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/proxy/beans/DummyBean.java
Modified:
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/proxy/InterceptorDecoratorProxyFactory.java
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/proxy/NormalScopeProxyFactory.java
    openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/decorators/tests/AbstractDecoratorTest.java
    openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/interceptors/factory/beans/ClassInterceptedClass.java
    openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/interceptors/resolution/InterceptorResolutionServiceTest.java
    openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/proxy/beans/ApplicationBean.java
    openwebbeans/trunk/webbeans-web/pom.xml

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/proxy/InterceptorDecoratorProxyFactory.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/proxy/InterceptorDecoratorProxyFactory.java?rev=1535770&r1=1535769&r2=1535770&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/proxy/InterceptorDecoratorProxyFactory.java
(original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/proxy/InterceptorDecoratorProxyFactory.java
Fri Oct 25 16:13:55 2013
@@ -519,7 +519,7 @@ public class InterceptorDecoratorProxyFa
                 mv.visitVarInsn(Opcodes.ALOAD, length);
                 mv.visitMethodInsn(Opcodes.INVOKEVIRTUAL, "java/lang/reflect/InvocationTargetException",
"getCause",
                         "()Ljava/lang/Throwable;");
-                mv.visitTypeInsn(Opcodes.CHECKCAST, exceptionType.getCanonicalName().replace('.',
'/'));
+                mv.visitTypeInsn(Opcodes.CHECKCAST, getCastType(exceptionType));
                 mv.visitInsn(Opcodes.ATHROW);
                 mv.visitLabel(l6);
 

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/proxy/NormalScopeProxyFactory.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/proxy/NormalScopeProxyFactory.java?rev=1535770&r1=1535769&r2=1535770&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/proxy/NormalScopeProxyFactory.java
(original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/proxy/NormalScopeProxyFactory.java
Fri Oct 25 16:13:55 2013
@@ -503,7 +503,7 @@ public class NormalScopeProxyFactory ext
      * if targetMethod is protected. Please see Java LangSpec 6.6.2 about the complex
      * rules for calling 'protected' methods.
      *
-     * @see #generateDelegationMethod(org.apache.xbean.asm.ClassWriter, java.lang.reflect.Method,
int, Class, String)
+     * @see #generateDelegationMethod(org.apache.xbean.asm4.ClassWriter, java.lang.reflect.Method,
int, Class, String)
      */
     @SuppressWarnings("unused")
     public static Object delegateProtectedMethod(Method method, Object instance, Object[]
params)

Modified: openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/decorators/tests/AbstractDecoratorTest.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/decorators/tests/AbstractDecoratorTest.java?rev=1535770&r1=1535769&r2=1535770&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/decorators/tests/AbstractDecoratorTest.java
(original)
+++ openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/decorators/tests/AbstractDecoratorTest.java
Fri Oct 25 16:13:55 2013
@@ -21,10 +21,6 @@ package org.apache.webbeans.newtests.dec
 import java.util.ArrayList;
 import java.util.Collection;
 
-import javax.enterprise.inject.Default;
-import javax.enterprise.inject.spi.Bean;
-import javax.enterprise.util.AnnotationLiteral;
-
 import junit.framework.Assert;
 
 import org.apache.webbeans.newtests.AbstractUnitTest;
@@ -63,17 +59,10 @@ public class AbstractDecoratorTest exten
 
         startContainer(classes, xmls);
 
-        Bean<?> bean = getBeanManager().getBeans(OutputProvider.class, new AnnotationLiteral<Default>()
-        {
-        }).iterator().next();
-        Object instance = getBeanManager().getReference(bean, OutputProvider.class, getBeanManager().createCreationalContext(bean));
-
-        OutputProvider outputProvider = (OutputProvider) instance;
-
+        OutputProvider outputProvider = getInstance(OutputProvider.class);
         Assert.assertTrue(outputProvider != null);
 
         String result = outputProvider.getOutput();
-        System.out.println(result);
         // Verify that the Decorators were called in order, and in a stack, including the
Abstract Decorator 3
         Assert.assertTrue(result.equalsIgnoreCase("Decorator1\nDecorator2\nDecorator3\nOutputProvider\n"));
         
@@ -81,4 +70,20 @@ public class AbstractDecoratorTest exten
         // Verify that the a method change in Decorator2 from trace->otherMethod results
in the right stack
         Assert.assertEquals("Decorator1/trace,Decorator2/trace,delegate/otherMethod", hijackedStack);
  
     }
+
+    @Test
+    public void testPureAbstractDecorator() throws Exception
+    {
+        addDecorator(Decorator3.class);
+        startContainer(Decorator3.class, IOutputProvider.class, OutputProvider.class, RequestStringBuilder.class);
+
+        OutputProvider outputProvider = getInstance(OutputProvider.class);
+        Assert.assertTrue(outputProvider != null);
+
+        String result = outputProvider.getOutput();
+        Assert.assertEquals("Decorator3\nOutputProvider\n", result);
+
+        String trace = outputProvider.trace();
+        Assert.assertEquals("delegate/trace", trace);
+    }
 }

Modified: openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/interceptors/factory/beans/ClassInterceptedClass.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/interceptors/factory/beans/ClassInterceptedClass.java?rev=1535770&r1=1535769&r2=1535770&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/interceptors/factory/beans/ClassInterceptedClass.java
(original)
+++ openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/interceptors/factory/beans/ClassInterceptedClass.java
Fri Oct 25 16:13:55 2013
@@ -22,6 +22,7 @@ import javax.annotation.PostConstruct;
 import javax.annotation.PreDestroy;
 import javax.enterprise.context.RequestScoped;
 
+import org.apache.webbeans.newtests.proxy.beans.DummyBean;
 import org.apache.webbeans.test.component.intercept.webbeans.bindings.Transactional;
 
 /**
@@ -103,4 +104,10 @@ public class ClassInterceptedClass exten
         return 84;
     }
 
+
+    public DummyBean.SomeInnerClass getValueHolder() throws DummyBean.SomeInnerException
+    {
+        return new DummyBean.SomeInnerClass("hello");
+    }
+
 }

Modified: openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/interceptors/resolution/InterceptorResolutionServiceTest.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/interceptors/resolution/InterceptorResolutionServiceTest.java?rev=1535770&r1=1535769&r2=1535770&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/interceptors/resolution/InterceptorResolutionServiceTest.java
(original)
+++ openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/interceptors/resolution/InterceptorResolutionServiceTest.java
Fri Oct 25 16:13:55 2013
@@ -91,7 +91,7 @@ public class InterceptorResolutionServic
 
         Map<Method, BusinessMethodInterceptorInfo> methodInterceptorInfos = interceptorInfo.getBusinessMethodsInfo();
         Assert.assertNotNull(methodInterceptorInfos);
-        Assert.assertEquals(11, methodInterceptorInfos.size());
+        Assert.assertEquals(12, methodInterceptorInfos.size());
 
         for (BusinessMethodInterceptorInfo mi : methodInterceptorInfos.values())
         {

Modified: openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/proxy/beans/ApplicationBean.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/proxy/beans/ApplicationBean.java?rev=1535770&r1=1535769&r2=1535770&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/proxy/beans/ApplicationBean.java
(original)
+++ openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/proxy/beans/ApplicationBean.java
Fri Oct 25 16:13:55 2013
@@ -27,4 +27,8 @@ import javax.enterprise.context.Applicat
 @ApplicationScoped
 public class ApplicationBean
 {
+    public DummyBean.SomeInnerClass getValueHolder() throws DummyBean.SomeInnerException
+    {
+        return new DummyBean.SomeInnerClass("hola");
+    }
 }

Added: openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/proxy/beans/DummyBean.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/proxy/beans/DummyBean.java?rev=1535770&view=auto
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/proxy/beans/DummyBean.java
(added)
+++ openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/proxy/beans/DummyBean.java
Fri Oct 25 16:13:55 2013
@@ -0,0 +1,57 @@
+/*
+ * 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.webbeans.newtests.proxy.beans;
+
+/**
+ * This class just exists as container for some inner classes.
+ */
+public class DummyBean {
+    public static class SomeInnerClass
+    {
+        private String val;
+
+        public SomeInnerClass(String val) {
+            this.val = val;
+        }
+
+        public String getVal()
+        {
+            return val;
+        }
+    }
+
+    public static class SomeInnerException extends Exception
+    {
+        public SomeInnerException() {
+            super();
+        }
+
+        public SomeInnerException(String message) {
+            super(message);
+        }
+
+        public SomeInnerException(String message, Throwable cause) {
+            super(message, cause);
+        }
+
+        public SomeInnerException(Throwable cause) {
+            super(cause);
+        }
+    }
+}

Modified: openwebbeans/trunk/webbeans-web/pom.xml
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-web/pom.xml?rev=1535770&r1=1535769&r2=1535770&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-web/pom.xml (original)
+++ openwebbeans/trunk/webbeans-web/pom.xml Fri Oct 25 16:13:55 2013
@@ -28,13 +28,6 @@
     <description>Apache OpenWebBeans Java EE Web and Serlvet plugin</description>
 
     <dependencies>
-
-        <dependency>
-            <groupId>org.apache.myfaces.core</groupId>
-            <artifactId>myfaces-api</artifactId>
-            <optional>true</optional>
-        </dependency>
-
         <dependency>
             <groupId>org.apache.geronimo.specs</groupId>
             <artifactId>geronimo-el_2.2_spec</artifactId>



Mime
View raw message