openwebbeans-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a...@apache.org
Subject svn commit: r1479658 - in /openwebbeans/trunk/webbeans-impl/src: main/java/org/apache/webbeans/annotation/ main/java/org/apache/webbeans/component/ main/java/org/apache/webbeans/container/ main/java/org/apache/webbeans/util/ test/java/org/apache/webbea...
Date Mon, 06 May 2013 17:56:51 GMT
Author: arne
Date: Mon May  6 17:56:51 2013
New Revision: 1479658

URL: http://svn.apache.org/r1479658
Log:
OWB-828: added test

Added:
    openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/util/CustomBaseType.java
    openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/util/CustomType.java
    openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/util/ExtendedCustomType.java
    openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/util/ExtendedSpecificClass.java
Modified:
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/annotation/AnnotationManager.java
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/AbstractProducerBean.java
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/InjectionTargetBean.java
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/container/AbstractBeanManager.java
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/util/WebBeansUtil.java
    openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/interceptors/factory/InterceptorDecoratorProxyFactoryTest.java
    openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/util/GenericInterface.java
    openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/util/SpecificClass.java

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/annotation/AnnotationManager.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/annotation/AnnotationManager.java?rev=1479658&r1=1479657&r2=1479658&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/annotation/AnnotationManager.java
(original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/annotation/AnnotationManager.java
Mon May  6 17:56:51 2013
@@ -26,7 +26,6 @@ import org.apache.webbeans.exception.inj
 import org.apache.webbeans.util.AnnotationUtil;
 import org.apache.webbeans.util.ArrayUtil;
 import org.apache.webbeans.util.Asserts;
-import org.apache.webbeans.util.WebBeansUtil;
 
 import javax.enterprise.context.NormalScope;
 import javax.enterprise.inject.Default;
@@ -752,7 +751,7 @@ public final class AnnotationManager
      * @param method specialized producer method
      * @param superMethod overriden super producer method
      */
-    public boolean configuredProducerSpecializedName(AbstractOwbBean<?> component,
+    public boolean isSuperMethodNamed(AbstractOwbBean<?> component,
                                                             Method method,
                                                             Method superMethod)
     {
@@ -760,20 +759,10 @@ public final class AnnotationManager
         Asserts.assertNotNull(method,"method parameter can not be null");
         Asserts.assertNotNull(superMethod,"superMethod parameter can not be null");
 
-        String name = null;
         boolean hasName = false;
         if(AnnotationUtil.hasMethodAnnotation(superMethod, Named.class))
         {
-            Named named =  superMethod.getAnnotation(Named.class);
             hasName = true;
-            if(!named.value().equals(""))
-            {
-                name = named.value();
-            }
-            else
-            {
-                name = WebBeansUtil.getProducerDefaultName(superMethod.getName());
-            }
         }
         else
         {
@@ -783,7 +772,6 @@ public final class AnnotationManager
                 if(ann.annotationType().isAnnotationPresent(Stereotype.class))
                 {
                     hasName = true;
-                    name = WebBeansUtil.getProducerDefaultName(superMethod.getName());
                     break;
                 }
             }
@@ -796,16 +784,9 @@ public final class AnnotationManager
                 throw new DefinitionException("Specialized method : " + method.getName()
+ " in class : "
                         + component.getReturnType().getName() + " may not define @Named annotation");
             }
-
-//            component.setName(name);
         }
 
         return hasName;
-//        else
-//        {
-//            component.setName(name);
-//        }
-
     }
 
     @SuppressWarnings("unchecked")

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/AbstractProducerBean.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/AbstractProducerBean.java?rev=1479658&r1=1479657&r2=1479658&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/AbstractProducerBean.java
(original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/AbstractProducerBean.java
Mon May  6 17:56:51 2013
@@ -36,7 +36,7 @@ import org.apache.webbeans.config.WebBea
  * @version $Rev$ $Date$
  * @param <T> bean type info
  */
-public abstract class AbstractProducerBean<T> extends AbstractOwbBean<T> implements
PassivationCapable
+public class AbstractProducerBean<T> extends AbstractOwbBean<T> implements PassivationCapable
 {
     private Class<T> returnType;
     private Producer<T> producer;
@@ -47,12 +47,12 @@ public abstract class AbstractProducerBe
      * @param returnType bean type info
      * @param ownerComponent owner bean
      */
-    protected AbstractProducerBean(Class<?> ownerBeanClass,
-                                   WebBeansContext webBeansContext,
-                                   WebBeansType webBeansType,
-                                   BeanAttributes<T> beanAttributes,
-                                   Class<T> returnType,
-                                   ProducerFactory<?> producerFactory)
+    public AbstractProducerBean(Class<?> ownerBeanClass,
+            WebBeansContext webBeansContext,
+            WebBeansType webBeansType,
+            BeanAttributes<T> beanAttributes,
+            Class<T> returnType,
+            ProducerFactory<?> producerFactory)
     {
         super(webBeansContext, webBeansType, beanAttributes, ownerBeanClass, !returnType.isPrimitive());
         this.returnType = returnType;

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/InjectionTargetBean.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/InjectionTargetBean.java?rev=1479658&r1=1479657&r2=1479658&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/InjectionTargetBean.java
(original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/InjectionTargetBean.java
Mon May  6 17:56:51 2013
@@ -29,6 +29,7 @@ import java.util.Map;
 import javax.enterprise.inject.spi.AnnotatedType;
 
 import org.apache.webbeans.component.spi.BeanAttributes;
+import org.apache.webbeans.component.spi.InjectionTargetFactory;
 import org.apache.webbeans.config.WebBeansContext;
 import org.apache.webbeans.container.InjectionTargetFactoryImpl;
 
@@ -49,13 +50,14 @@ import org.apache.webbeans.util.Asserts;
  * @version $Rev$ $Date$
  * @param <T> bean class
  */
-public abstract class InjectionTargetBean<T> extends AbstractOwbBean<T>
+public class InjectionTargetBean<T> extends AbstractOwbBean<T>
 {    
     /**Annotated type for bean*/
     private AnnotatedType<T> annotatedType;
     private InjectionTarget<T> injectionTarget;
 
-    protected InjectionTargetBean(WebBeansContext webBeansContext,
+    public InjectionTargetBean(
+            WebBeansContext webBeansContext,
             WebBeansType webBeansType,
             AnnotatedType<T> annotatedType,
             BeanAttributes<T> beanAttributes,
@@ -67,12 +69,12 @@ public abstract class InjectionTargetBea
     /**
      * Initializes the InjectionTarget Bean part.
      */
-    protected InjectionTargetBean(WebBeansContext webBeansContext,
-                                  WebBeansType webBeansType,
-                                  AnnotatedType<T> annotatedType,
-                                  BeanAttributes<T> beanAttributes,
-                                  Class<T> beanClass,
-                                  InjectionTargetFactoryImpl<T> factory)
+    public InjectionTargetBean(WebBeansContext webBeansContext,
+            WebBeansType webBeansType,
+            AnnotatedType<T> annotatedType,
+            BeanAttributes<T> beanAttributes,
+            Class<T> beanClass,
+            InjectionTargetFactory<T> factory)
     {
         super(webBeansContext, webBeansType, beanAttributes, beanClass, false);
         Asserts.assertNotNull(annotatedType, "AnnotatedType may not be null");

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/container/AbstractBeanManager.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/container/AbstractBeanManager.java?rev=1479658&r1=1479657&r2=1479658&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/container/AbstractBeanManager.java
(original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/container/AbstractBeanManager.java
Mon May  6 17:56:51 2013
@@ -30,6 +30,8 @@ import javax.enterprise.inject.spi.BeanM
 import javax.enterprise.inject.spi.Extension;
 import javax.enterprise.inject.spi.InjectionPoint;
 
+import org.apache.webbeans.component.InjectionTargetBean;
+import org.apache.webbeans.component.WebBeansType;
 import org.apache.webbeans.component.creation.BeanAttributesBuilder;
 import org.apache.webbeans.component.creation.FieldProducerFactory;
 import org.apache.webbeans.component.creation.MethodProducerFactory;
@@ -118,12 +120,19 @@ public abstract class AbstractBeanManage
 
     public <T> Bean<T> createBean(BeanAttributes<T> attributes, Class<T>
type, InjectionTargetFactory<T> factory)
     {
-        throw new UnsupportedOperationException("Not yet implemented");
+        return new InjectionTargetBean<T>(
+                getWebBeansContext(),
+                WebBeansType.THIRDPARTY,
+                getWebBeansContext().getAnnotatedElementFactory().newAnnotatedType(type),
+                attributes,
+                type,
+                factory);
     }
 
     public <T, X> Bean<T> createBean(BeanAttributes<T> attributes, Class<X>
type, ProducerFactory<X> factory)
     {
-        throw new UnsupportedOperationException("Not yet implemented");
+        return null;
+        //return new AbstractProducerBean<T>(type, getWebBeansContext(), WebBeansType.THIRDPARTY,
attributes, returnType, factory);
     }
 
     public <T extends Extension> T getExtension(Class<T> type)

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/util/WebBeansUtil.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/util/WebBeansUtil.java?rev=1479658&r1=1479657&r2=1479658&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/util/WebBeansUtil.java
(original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/util/WebBeansUtil.java
Mon May  6 17:56:51 2013
@@ -810,7 +810,7 @@ public final class WebBeansUtil
             ProducerMethodBean superBean = sortedProducerBeans.get(i - 1);
 
             // inherit name is super class has name
-            boolean isSuperHasName = configuredProducerSpecializedName(bean, bean.getCreatorMethod(),
superMethod);
+            boolean isSuperHasName = isSuperMethodNamed(bean, bean.getCreatorMethod(), superMethod);
 
             // disable super bean if needed
             if (bean.getCreatorMethod().getAnnotation(Alternative.class) == null)
@@ -1025,9 +1025,9 @@ public final class WebBeansUtil
      * @param method specialized producer method
      * @param superMethod overriden super producer method
      */
-    public boolean configuredProducerSpecializedName(AbstractOwbBean<?> component,
Method method, Method superMethod)
+    public boolean isSuperMethodNamed(AbstractOwbBean<?> component, Method method,
Method superMethod)
     {
-        return webBeansContext.getAnnotationManager().configuredProducerSpecializedName(component,
method, superMethod);
+        return webBeansContext.getAnnotationManager().isSuperMethodNamed(component, method,
superMethod);
     }
 
     /**

Modified: openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/interceptors/factory/InterceptorDecoratorProxyFactoryTest.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/interceptors/factory/InterceptorDecoratorProxyFactoryTest.java?rev=1479658&r1=1479657&r2=1479658&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/interceptors/factory/InterceptorDecoratorProxyFactoryTest.java
(original)
+++ openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/interceptors/factory/InterceptorDecoratorProxyFactoryTest.java
Mon May  6 17:56:51 2013
@@ -28,6 +28,7 @@ import java.lang.reflect.Type;
 import java.net.URL;
 import java.net.URLClassLoader;
 import java.util.ArrayList;
+import java.util.Iterator;
 import java.util.List;
 import java.util.Set;
 
@@ -40,7 +41,13 @@ import org.apache.webbeans.proxy.Interce
 import org.apache.webbeans.proxy.InterceptorHandler;
 import org.apache.webbeans.proxy.OwbInterceptorProxy;
 import org.apache.webbeans.util.ClassUtil;
+import org.apache.webbeans.util.CustomBaseType;
+import org.apache.webbeans.util.CustomType;
+import org.apache.webbeans.util.ExtendedSpecificClass;
+import org.apache.webbeans.util.GenericInterface;
+import org.apache.webbeans.util.SpecificClass;
 import org.junit.Assert;
+import org.junit.Ignore;
 import org.junit.Test;
 
 
@@ -51,7 +58,7 @@ public class InterceptorDecoratorProxyFa
 {
 
     @Test
-    public void textSimpleProxyCreation() throws Exception
+    public void testSimpleProxyCreation() throws Exception
     {
         InterceptorDecoratorProxyFactory pf = new InterceptorDecoratorProxyFactory(new WebBeansContext());
 
@@ -63,94 +70,137 @@ public class InterceptorDecoratorProxyFa
         Method[] interceptedMethods = methods.toArray(new Method[methods.size()]);
         Method[] nonInterceptedMethods = null;
 
-        Bean dummyBean = new Bean() {
-            @Override
-            public Object create(CreationalContext context)
-            {
-                return null;
-            }
+        Bean dummyBean = new DummyBean();
 
-            @Override
-            public Set<Type> getTypes()
-            {
-                return null;
-            }
+        Class<ClassInterceptedClass> proxyClass = pf.createProxyClass(dummyBean, classLoader,
ClassInterceptedClass.class, interceptedMethods, nonInterceptedMethods);
+        Assert.assertNotNull(proxyClass);
 
-            @Override
-            public Set<Annotation> getQualifiers()
-            {
-                return null;
-            }
+        ClassInterceptedClass internalInstance = new ClassInterceptedClass();
+        internalInstance.init();
 
-            @Override
-            public Class<? extends Annotation> getScope()
-            {
-                return null;
-            }
+        TestInterceptorHandler testInvocationHandler = new TestInterceptorHandler(internalInstance);
 
-            @Override
-            public String getName()
-            {
-                return null;
-            }
+        ClassInterceptedClass proxy = pf.createProxyInstance(proxyClass, internalInstance,
testInvocationHandler);
+        Assert.assertNotNull(proxy);
 
-            @Override
-            public boolean isNullable()
-            {
-                return false;
-            }
+        Assert.assertTrue(proxy instanceof OwbInterceptorProxy);
 
-            @Override
-            public Set<InjectionPoint> getInjectionPoints()
-            {
-                return null;
-            }
+        proxy.setMeaningOfLife(42);
 
-            @Override
-            public Class<?> getBeanClass()
-            {
-                return null;
-            }
+        Assert.assertEquals(42, proxy.getMeaningOfLife());
+        Assert.assertEquals(internalInstance.getFloat(), proxy.getFloat(), 0f);
+        Assert.assertEquals('c', proxy.getChar());
+        Assert.assertEquals(internalInstance, proxy.getSelf());
 
-            @Override
-            public Set<Class<? extends Annotation>> getStereotypes()
-            {
-                return null;
-            }
+        Assert.assertEquals(5, testInvocationHandler.invokedMethodNames.size());
+    }
 
-            @Override
-            public boolean isAlternative()
-            {
-                return false;
-            }
+    @Test
+    public void testGenericProxyGeneration()
+    {
+        InterceptorDecoratorProxyFactory pf = new InterceptorDecoratorProxyFactory(new WebBeansContext());
 
-            @Override
-            public void destroy(Object instance, CreationalContext context)
+        // we take a fresh URLClassLoader to not blur the test classpath with synthetic classes.
+        ClassLoader classLoader = new URLClassLoader(new URL[0]);
+
+        List<Method> methods = ClassUtil.getNonPrivateMethods(ExtendedSpecificClass.class,
true);
+        for (Iterator<Method> i = methods.iterator(); i.hasNext();)
+        {
+            if (i.next().isBridge())
             {
+                i.remove();
             }
-        };
+        }
 
-        Class<ClassInterceptedClass> proxyClass = pf.createProxyClass(dummyBean, classLoader,
ClassInterceptedClass.class, interceptedMethods, nonInterceptedMethods);
+        Method[] interceptedMethods = methods.toArray(new Method[methods.size()]);
+        Method[] nonInterceptedMethods = null;
+
+        Bean dummyBean = new DummyBean();
+
+        Class<ExtendedSpecificClass> proxyClass = pf.createProxyClass(dummyBean, classLoader,
ExtendedSpecificClass.class, interceptedMethods, nonInterceptedMethods);
         Assert.assertNotNull(proxyClass);
 
-        ClassInterceptedClass internalInstance = new ClassInterceptedClass();
+        ExtendedSpecificClass internalInstance = new ExtendedSpecificClass();
         internalInstance.init();
 
         TestInterceptorHandler testInvocationHandler = new TestInterceptorHandler(internalInstance);
 
-        ClassInterceptedClass proxy = pf.createProxyInstance(proxyClass, internalInstance,
testInvocationHandler);
-        Assert.assertNotNull(proxy);
+        ExtendedSpecificClass extendedSpecificProxyInstance = pf.createProxyInstance(proxyClass,
internalInstance, testInvocationHandler);
+        SpecificClass<CustomType> specificProxyInstance = extendedSpecificProxyInstance;
+        GenericInterface<CustomBaseType> interfaceProxyInstance = extendedSpecificProxyInstance;
+        Assert.assertNotNull(extendedSpecificProxyInstance.newInstance());
+        Assert.assertNotNull(specificProxyInstance.newInstance());
+        Assert.assertNotNull(interfaceProxyInstance.newInstance());
 
-        Assert.assertTrue(proxy instanceof OwbInterceptorProxy);
+        Assert.assertTrue(extendedSpecificProxyInstance instanceof OwbInterceptorProxy);
+        Assert.assertNotNull(internalInstance.newInstance()); 
+    }
 
-        proxy.setMeaningOfLife(42);
+    public static class DummyBean implements Bean {
+        @Override
+        public Object create(CreationalContext context)
+        {
+            return null;
+        }
 
-        Assert.assertEquals(42, proxy.getMeaningOfLife());
-        Assert.assertEquals(internalInstance.getFloat(), proxy.getFloat(), 0f);
-        Assert.assertEquals('c', proxy.getChar());
-        Assert.assertEquals(internalInstance, proxy.getSelf());
+        @Override
+        public Set<Type> getTypes()
+        {
+            return null;
+        }
 
-        Assert.assertEquals(5, testInvocationHandler.invokedMethodNames.size());
+        @Override
+        public Set<Annotation> getQualifiers()
+        {
+            return null;
+        }
+
+        @Override
+        public Class<? extends Annotation> getScope()
+        {
+            return null;
+        }
+
+        @Override
+        public String getName()
+        {
+            return null;
+        }
+
+        @Override
+        public boolean isNullable()
+        {
+            return false;
+        }
+
+        @Override
+        public Set<InjectionPoint> getInjectionPoints()
+        {
+            return null;
+        }
+
+        @Override
+        public Class<?> getBeanClass()
+        {
+            return null;
+        }
+
+        @Override
+        public Set<Class<? extends Annotation>> getStereotypes()
+        {
+            return null;
+        }
+
+        @Override
+        public boolean isAlternative()
+        {
+            return false;
+        }
+
+        @Override
+        public void destroy(Object instance, CreationalContext context)
+        {
+        }
     }
 
     public static class TestInterceptorHandler implements InterceptorHandler
@@ -167,6 +217,7 @@ public class InterceptorDecoratorProxyFa
         @Override
         public Object invoke(Method method, Object[] args)
         {
+            Assert.assertFalse(method.isBridge());
             if (!method.getName().equals("toString"))
             {
                 invokedMethodNames.add(method.getName());

Added: openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/util/CustomBaseType.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/util/CustomBaseType.java?rev=1479658&view=auto
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/util/CustomBaseType.java
(added)
+++ openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/util/CustomBaseType.java
Mon May  6 17:56:51 2013
@@ -0,0 +1,23 @@
+/*
+ * 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.util;
+
+public abstract class CustomBaseType
+{
+}

Added: openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/util/CustomType.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/util/CustomType.java?rev=1479658&view=auto
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/util/CustomType.java
(added)
+++ openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/util/CustomType.java
Mon May  6 17:56:51 2013
@@ -0,0 +1,23 @@
+/*
+ * 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.util;
+
+public class CustomType extends CustomBaseType
+{
+}

Added: openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/util/ExtendedCustomType.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/util/ExtendedCustomType.java?rev=1479658&view=auto
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/util/ExtendedCustomType.java
(added)
+++ openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/util/ExtendedCustomType.java
Mon May  6 17:56:51 2013
@@ -0,0 +1,23 @@
+/*
+ * 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.util;
+
+public class ExtendedCustomType extends CustomType
+{
+}

Added: openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/util/ExtendedSpecificClass.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/util/ExtendedSpecificClass.java?rev=1479658&view=auto
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/util/ExtendedSpecificClass.java
(added)
+++ openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/util/ExtendedSpecificClass.java
Mon May  6 17:56:51 2013
@@ -0,0 +1,35 @@
+/*
+ * 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.util;
+
+public class ExtendedSpecificClass extends SpecificClass {
+
+    private ExtendedCustomType customType;
+
+    public void init()
+    {
+        customType = new ExtendedCustomType();
+    }
+
+    @Override
+    public ExtendedCustomType newInstance()
+    {
+        return customType;
+    }
+}

Modified: openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/util/GenericInterface.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/util/GenericInterface.java?rev=1479658&r1=1479657&r2=1479658&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/util/GenericInterface.java
(original)
+++ openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/util/GenericInterface.java
Mon May  6 17:56:51 2013
@@ -18,7 +18,7 @@
  */
 package org.apache.webbeans.util;
 
-public interface GenericInterface<T> {
+public interface GenericInterface<T extends CustomBaseType> {
 
     T newInstance();
 }

Modified: openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/util/SpecificClass.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/util/SpecificClass.java?rev=1479658&r1=1479657&r2=1479658&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/util/SpecificClass.java
(original)
+++ openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/util/SpecificClass.java
Mon May  6 17:56:51 2013
@@ -18,10 +18,10 @@
  */
 package org.apache.webbeans.util;
 
-public class SpecificClass implements GenericInterface<String> {
+public class SpecificClass<T extends CustomType> implements GenericInterface<T>
{
 
     @Override
-    public String newInstance() {
-        return "";
+    public T newInstance() {
+        return null;
     }
 }



Mime
View raw message