[webbeans-commits] Webbeans SVN: r787 - in ri/trunk/webbeans-ri/src: main/java/org/jboss/webbeans/bean and 2 other directories.

webbeans-commits at lists.jboss.org webbeans-commits at lists.jboss.org
Tue Jan 6 10:41:42 EST 2009


Author: dallen6
Date: 2009-01-06 10:41:41 -0500 (Tue, 06 Jan 2009)
New Revision: 787

Added:
   ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/injection/
   ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/injection/InjectionPointImpl.java
Removed:
   ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/InjectionPointBean.java
Modified:
   ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/InjectionPointTest.java
Log:
Renamed the injection point metadata web bean implementation and some fixes for the tests.

Deleted: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/InjectionPointBean.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/InjectionPointBean.java	2009-01-06 14:52:59 UTC (rev 786)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/InjectionPointBean.java	2009-01-06 15:41:41 UTC (rev 787)
@@ -1,98 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * Licensed 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.jboss.webbeans.bean;
-
-import java.lang.annotation.Annotation;
-import java.lang.reflect.Member;
-import java.lang.reflect.Type;
-import java.util.Set;
-
-import javax.webbeans.Dependent;
-import javax.webbeans.InjectionPoint;
-import javax.webbeans.Standard;
-import javax.webbeans.manager.Bean;
-
-import org.jboss.webbeans.introspector.jlr.AbstractAnnotatedMember;
-
-/**
- * The container provided implementation for InjectionPoint beans
- * 
- * @author David Allen
- */
- at Standard
- at Dependent
-public class InjectionPointBean implements InjectionPoint
-{
-   private final AbstractAnnotatedMember<?, ? extends Member> memberInjectionPoint;
-   private final Bean<?> bean;
-   private final Object beanInstance;
-
-   /**
-    * Creates a new metadata bean for the given injection point information.
-    * 
-    * @param injectedMember The member of the bean being injected
-    * @param bean The bean being injected
-    * @param beanInstance The instance of the bean being injected
-    */
-   public InjectionPointBean(AbstractAnnotatedMember<?, ? extends Member> injectedMember, Bean<?> bean, Object beanInstance)
-   {
-      this.memberInjectionPoint = injectedMember;
-      this.bean = bean;
-      this.beanInstance = beanInstance;
-   }
-
-   public <T extends Annotation> T getAnnotation(Class<T> annotationType)
-   {
-      return this.memberInjectionPoint.getAnnotation(annotationType);
-   }
-
-   public Annotation[] getAnnotations()
-   {
-      return this.memberInjectionPoint.getAnnotations().toArray(new Annotation[0]);
-   }
-
-   public Bean<?> getBean()
-   {
-      return this.bean;
-   }
-
-   public Set<Annotation> getBindingTypes()
-   {
-      return this.memberInjectionPoint.getBindingTypes();
-   }
-
-   public Object getInstance()
-   {
-      return this.beanInstance;
-   }
-
-   public Member getMember()
-   {
-      return this.memberInjectionPoint.getDelegate();
-   }
-
-   public Type getType()
-   {
-      return this.memberInjectionPoint.getType();
-   }
-
-   public boolean isAnnotationPresent(Class<? extends Annotation> annotationType)
-   {
-      return this.memberInjectionPoint.isAnnotationPresent(annotationType);
-   }
-}

Copied: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/injection/InjectionPointImpl.java (from rev 785, ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/InjectionPointBean.java)
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/injection/InjectionPointImpl.java	                        (rev 0)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/injection/InjectionPointImpl.java	2009-01-06 15:41:41 UTC (rev 787)
@@ -0,0 +1,98 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * Licensed 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.jboss.webbeans.injection;
+
+import java.lang.annotation.Annotation;
+import java.lang.reflect.Member;
+import java.lang.reflect.Type;
+import java.util.Set;
+
+import javax.webbeans.Dependent;
+import javax.webbeans.InjectionPoint;
+import javax.webbeans.Standard;
+import javax.webbeans.manager.Bean;
+
+import org.jboss.webbeans.introspector.jlr.AbstractAnnotatedMember;
+
+/**
+ * The container provided implementation for InjectionPoint beans
+ * 
+ * @author David Allen
+ */
+ at Standard
+ at Dependent
+public class InjectionPointImpl implements InjectionPoint
+{
+   private final AbstractAnnotatedMember<?, ? extends Member> memberInjectionPoint;
+   private final Bean<?> bean;
+   private final Object beanInstance;
+
+   /**
+    * Creates a new metadata bean for the given injection point information.
+    * 
+    * @param injectedMember The member of the bean being injected
+    * @param bean The bean being injected
+    * @param beanInstance The instance of the bean being injected
+    */
+   public InjectionPointImpl(AbstractAnnotatedMember<?, ? extends Member> injectedMember, Bean<?> bean, Object beanInstance)
+   {
+      this.memberInjectionPoint = injectedMember;
+      this.bean = bean;
+      this.beanInstance = beanInstance;
+   }
+
+   public <T extends Annotation> T getAnnotation(Class<T> annotationType)
+   {
+      return this.memberInjectionPoint.getAnnotation(annotationType);
+   }
+
+   public Annotation[] getAnnotations()
+   {
+      return this.memberInjectionPoint.getAnnotations().toArray(new Annotation[0]);
+   }
+
+   public Bean<?> getBean()
+   {
+      return this.bean;
+   }
+
+   public Set<Annotation> getBindingTypes()
+   {
+      return this.memberInjectionPoint.getBindingTypes();
+   }
+
+   public Object getInstance()
+   {
+      return this.beanInstance;
+   }
+
+   public Member getMember()
+   {
+      return this.memberInjectionPoint.getDelegate();
+   }
+
+   public Type getType()
+   {
+      return this.memberInjectionPoint.getType();
+   }
+
+   public boolean isAnnotationPresent(Class<? extends Annotation> annotationType)
+   {
+      return this.memberInjectionPoint.isAnnotationPresent(annotationType);
+   }
+}


Property changes on: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/injection/InjectionPointImpl.java
___________________________________________________________________
Name: svn:mime-type
   + text/plain

Modified: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/InjectionPointTest.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/InjectionPointTest.java	2009-01-06 14:52:59 UTC (rev 786)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/InjectionPointTest.java	2009-01-06 15:41:41 UTC (rev 787)
@@ -131,7 +131,7 @@
          assert beanWithInjectionPoint.getInjectedMetadata() != null;
          Set<Annotation> bindingTypes = beanWithInjectionPoint.getInjectedMetadata().getBindingTypes();
          assert bindingTypes.size() == 1;
-         assert bindingTypes.iterator().next().equals(Current.class);
+         assert Current.class.isAssignableFrom(bindingTypes.iterator().next().annotationType());
       }
       finally
       {
@@ -251,7 +251,7 @@
          FieldInjectionPointBean beanWithInjectedBean = manager.getInstanceByType(FieldInjectionPointBean.class, new CurrentBinding());
          BeanWithInjectionPointMetadata beanWithInjectionPoint = beanWithInjectedBean.getInjectedBean();
          assert beanWithInjectionPoint.getInjectedMetadata() != null;
-         assert beanWithInjectionPoint.getInjectedMetadata().getBean().getDeploymentType().equals(Standard.class);
+         assert beanWithInjectionPoint.getInjectedMetadata().getClass().isAnnotationPresent(Standard.class);
       }
       finally
       {
@@ -273,7 +273,7 @@
          FieldInjectionPointBean beanWithInjectedBean = manager.getInstanceByType(FieldInjectionPointBean.class, new CurrentBinding());
          BeanWithInjectionPointMetadata beanWithInjectionPoint = beanWithInjectedBean.getInjectedBean();
          assert beanWithInjectionPoint.getInjectedMetadata() != null;
-         assert beanWithInjectionPoint.getInjectedMetadata().getBean().getScopeType().equals(Dependent.class);
+         assert beanWithInjectionPoint.getInjectedMetadata().getClass().isAnnotationPresent(Dependent.class);
       }
       finally
       {
@@ -317,7 +317,7 @@
          FieldInjectionPointBean beanWithInjectedBean = manager.getInstanceByType(FieldInjectionPointBean.class, new CurrentBinding());
          BeanWithInjectionPointMetadata beanWithInjectionPoint = beanWithInjectedBean.getInjectedBean();
          assert beanWithInjectionPoint.getInjectedMetadata() != null;
-         assert beanWithInjectionPoint.getInjectedMetadata().getBean().getBindingTypes().contains(Current.class);
+         assert beanWithInjectionPoint.getInjectedMetadata().getBindingTypes().contains(new CurrentBinding());
       }
       finally
       {




More information about the weld-commits mailing list