openwebbeans-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gerdo...@apache.org
Subject svn commit: r891893 - in /incubator/openwebbeans/trunk/webbeans-impl/src: main/java/org/apache/webbeans/config/ test/java/org/apache/webbeans/newtests/concepts/ test/java/org/apache/webbeans/newtests/concepts/apiTypes/ test/java/org/apache/webbeans/new...
Date Thu, 17 Dec 2009 20:56:25 GMT
Author: gerdogdu
Date: Thu Dec 17 20:56:24 2009
New Revision: 891893

URL: http://svn.apache.org/viewvc?rev=891893&view=rev
Log:
[OWB-192] Bean Api Types Does not contain Object.class

Added:
    incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/concepts/
    incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/concepts/apiTypes/
    incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/concepts/apiTypes/common/
    incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/concepts/apiTypes/common/ApiTypeBean.java
  (with props)
    incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/concepts/apiTypes/tests/
    incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/concepts/apiTypes/tests/ApiTypeTest.java
  (with props)
Modified:
    incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/config/DefinitionUtil.java
    incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/definition/BeanTypesTest.java

Modified: incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/config/DefinitionUtil.java
URL: http://svn.apache.org/viewvc/incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/config/DefinitionUtil.java?rev=891893&r1=891892&r2=891893&view=diff
==============================================================================
--- incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/config/DefinitionUtil.java
(original)
+++ incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/config/DefinitionUtil.java
Thu Dec 17 20:56:24 2009
@@ -94,10 +94,11 @@
         if(AnnotationUtil.hasAnnotation(annots, Typed.class))
         {
             Typed beanTypes = (Typed) AnnotationUtil.getAnnotation(annots, Typed.class);
-            defineUserDefinedBeanTypes(bean, beanTypes);
+            defineUserDefinedBeanTypes(bean, beanTypes);            
         }
         else
         {
+            bean.getTypes().add(Object.class);
             ClassUtil.setTypeHierarchy(bean.getTypes(), clazz);   
         }        
     }
@@ -119,6 +120,7 @@
             apiTypes.add(type);
         }
         
+        apiTypes.add(Object.class);
     }
     
     

Added: incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/concepts/apiTypes/common/ApiTypeBean.java
URL: http://svn.apache.org/viewvc/incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/concepts/apiTypes/common/ApiTypeBean.java?rev=891893&view=auto
==============================================================================
--- incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/concepts/apiTypes/common/ApiTypeBean.java
(added)
+++ incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/concepts/apiTypes/common/ApiTypeBean.java
Thu Dec 17 20:56:24 2009
@@ -0,0 +1,36 @@
+/*
+ * 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.concepts.apiTypes.common;
+
+import java.io.Serializable;
+import java.util.AbstractMap;
+import java.util.Set;
+
+public class ApiTypeBean extends AbstractMap<String, String> implements Serializable
+{
+    private static final long serialVersionUID = 1L;
+
+    @Override
+    public Set<java.util.Map.Entry<String, String>> entrySet()
+    {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+}

Propchange: incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/concepts/apiTypes/common/ApiTypeBean.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/concepts/apiTypes/tests/ApiTypeTest.java
URL: http://svn.apache.org/viewvc/incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/concepts/apiTypes/tests/ApiTypeTest.java?rev=891893&view=auto
==============================================================================
--- incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/concepts/apiTypes/tests/ApiTypeTest.java
(added)
+++ incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/concepts/apiTypes/tests/ApiTypeTest.java
Thu Dec 17 20:56:24 2009
@@ -0,0 +1,49 @@
+/*
+ * 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.concepts.apiTypes.tests;
+
+import java.lang.reflect.Type;
+import java.util.Set;
+
+import junit.framework.Assert;
+
+import org.apache.webbeans.component.ManagedBean;
+import org.apache.webbeans.config.DefinitionUtil;
+import org.apache.webbeans.newtests.AbstractUnitTest;
+import org.apache.webbeans.newtests.concepts.apiTypes.common.ApiTypeBean;
+import org.junit.Test;
+
+public class ApiTypeTest extends AbstractUnitTest
+{
+    public ApiTypeTest()
+    {
+        
+    }
+    
+    @Test
+    public void testApiType()
+    {
+        ManagedBean<ApiTypeBean> bean = new ManagedBean<ApiTypeBean>(ApiTypeBean.class);
+        DefinitionUtil.defineApiTypes(bean, ApiTypeBean.class);
+        
+        Set<Type> type = bean.getTypes();
+        Assert.assertEquals(5, type.size());
+    }
+
+}

Propchange: incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/concepts/apiTypes/tests/ApiTypeTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/definition/BeanTypesTest.java
URL: http://svn.apache.org/viewvc/incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/definition/BeanTypesTest.java?rev=891893&r1=891892&r2=891893&view=diff
==============================================================================
--- incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/definition/BeanTypesTest.java
(original)
+++ incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/definition/BeanTypesTest.java
Thu Dec 17 20:56:24 2009
@@ -47,8 +47,8 @@
         Bean<BeanTypesDefinedBean> bean = defineManagedBean(BeanTypesDefinedBean.class);
         Set<Type> apiTypes = bean.getTypes();
         
-        Assert.assertEquals(1, apiTypes.size());        
-        Assert.assertTrue(apiTypes.iterator().next().equals(BeanTypesDefinedBean.class));
+        Assert.assertEquals(2, apiTypes.size());        
+        Assert.assertTrue(apiTypes.contains(BeanTypesDefinedBean.class));
         
         Set<Bean<?>> beans = getManager().getBeans("paymentField");
         Assert.assertEquals(1, beans.size());
@@ -56,8 +56,8 @@
         Bean<?> pbean = beans.iterator().next();
         apiTypes = pbean.getTypes();
         
-        Assert.assertEquals(1, apiTypes.size());        
-        Assert.assertTrue(apiTypes.iterator().next().equals(CheckWithCheckPayment.class));
+        Assert.assertEquals(2, apiTypes.size());        
+        Assert.assertTrue(apiTypes.contains(CheckWithCheckPayment.class));
         
         beans = getManager().getBeans("paymentMethod");
         Assert.assertEquals(1, beans.size());
@@ -65,8 +65,8 @@
         pbean = beans.iterator().next();
         apiTypes = pbean.getTypes();
         
-        Assert.assertEquals(1, apiTypes.size());        
-        Assert.assertTrue(apiTypes.iterator().next().equals(CheckWithCheckPayment.class));
+        Assert.assertEquals(2, apiTypes.size());        
+        Assert.assertTrue(apiTypes.contains(CheckWithCheckPayment.class));
         
         
         



Mime
View raw message