[weld-commits] Weld SVN: r5643 - core/trunk/tests/src/test/java/org/jboss/weld/tests/extensions/annotatedType.

weld-commits at lists.jboss.org weld-commits at lists.jboss.org
Wed Jan 27 13:22:07 EST 2010


Author: pete.muir at jboss.org
Date: 2010-01-27 13:22:07 -0500 (Wed, 27 Jan 2010)
New Revision: 5643

Modified:
   core/trunk/tests/src/test/java/org/jboss/weld/tests/extensions/annotatedType/AnnotatedTypeExtension.java
   core/trunk/tests/src/test/java/org/jboss/weld/tests/extensions/annotatedType/AnnotatedTypeExtensionTest.java
   core/trunk/tests/src/test/java/org/jboss/weld/tests/extensions/annotatedType/EcoFriendlyWashingMachine.java
Log:
WELD-371

Modified: core/trunk/tests/src/test/java/org/jboss/weld/tests/extensions/annotatedType/AnnotatedTypeExtension.java
===================================================================
--- core/trunk/tests/src/test/java/org/jboss/weld/tests/extensions/annotatedType/AnnotatedTypeExtension.java	2010-01-27 18:17:24 UTC (rev 5642)
+++ core/trunk/tests/src/test/java/org/jboss/weld/tests/extensions/annotatedType/AnnotatedTypeExtension.java	2010-01-27 18:22:07 UTC (rev 5643)
@@ -29,18 +29,12 @@
 import javax.enterprise.inject.spi.AnnotatedType;
 import javax.enterprise.inject.spi.BeforeBeanDiscovery;
 import javax.enterprise.inject.spi.Extension;
-import javax.enterprise.util.AnnotationLiteral;
 
+import org.jboss.weld.tests.extensions.annotatedType.EcoFriendlyWashingMachine.EcoFriendlyWashingMachineLiteral;
+
 public class AnnotatedTypeExtension implements Extension
 {
    
-   public static class EcoFriendlyWashingMachineLiteral extends AnnotationLiteral<EcoFriendlyWashingMachine> implements EcoFriendlyWashingMachine
-   {
-      
-      public static final EcoFriendlyWashingMachine INSTANCE = new EcoFriendlyWashingMachineLiteral();
-      
-   }
-   
    /**
     * Adds an eco friendly wasing machine
     * @param beforeBeanDiscovery

Modified: core/trunk/tests/src/test/java/org/jboss/weld/tests/extensions/annotatedType/AnnotatedTypeExtensionTest.java
===================================================================
--- core/trunk/tests/src/test/java/org/jboss/weld/tests/extensions/annotatedType/AnnotatedTypeExtensionTest.java	2010-01-27 18:17:24 UTC (rev 5642)
+++ core/trunk/tests/src/test/java/org/jboss/weld/tests/extensions/annotatedType/AnnotatedTypeExtensionTest.java	2010-01-27 18:22:07 UTC (rev 5643)
@@ -16,12 +16,17 @@
  */
 package org.jboss.weld.tests.extensions.annotatedType;
 
+import javax.enterprise.inject.Any;
+import javax.enterprise.inject.spi.Bean;
+
 import org.jboss.testharness.impl.packaging.Artifact;
 import org.jboss.testharness.impl.packaging.IntegrationTest;
 import org.jboss.testharness.impl.packaging.Packaging;
 import org.jboss.testharness.impl.packaging.PackagingType;
 import org.jboss.testharness.impl.packaging.jsr299.Extension;
 import org.jboss.weld.test.AbstractWeldTest;
+import org.jboss.weld.test.Utils;
+import org.jboss.weld.tests.extensions.annotatedType.EcoFriendlyWashingMachine.EcoFriendlyWashingMachineLiteral;
 import org.testng.annotations.Test;
 
 @Artifact
@@ -39,5 +44,12 @@
       assert laundry.fastWashingMachine != null;
    }
    
+   @Test(description = "WELD-371")
+   public void testAnnotationsAreOverridden()
+   {
+      Bean<WashingMachine> bean = getBean(WashingMachine.class, EcoFriendlyWashingMachineLiteral.INSTANCE);
+      assert Utils.annotationSetMatches(bean.getQualifiers(), Any.class, EcoFriendlyWashingMachine.class);
+   }
+   
 
 }

Modified: core/trunk/tests/src/test/java/org/jboss/weld/tests/extensions/annotatedType/EcoFriendlyWashingMachine.java
===================================================================
--- core/trunk/tests/src/test/java/org/jboss/weld/tests/extensions/annotatedType/EcoFriendlyWashingMachine.java	2010-01-27 18:17:24 UTC (rev 5642)
+++ core/trunk/tests/src/test/java/org/jboss/weld/tests/extensions/annotatedType/EcoFriendlyWashingMachine.java	2010-01-27 18:22:07 UTC (rev 5643)
@@ -26,6 +26,7 @@
 import java.lang.annotation.Retention;
 import java.lang.annotation.Target;
 
+import javax.enterprise.util.AnnotationLiteral;
 import javax.inject.Qualifier;
 
 @Target( { TYPE, METHOD, PARAMETER, FIELD })
@@ -34,5 +35,15 @@
 @Qualifier
 public @interface EcoFriendlyWashingMachine
 {
+   
+   @SuppressWarnings("serial")
+   public static class EcoFriendlyWashingMachineLiteral extends AnnotationLiteral<EcoFriendlyWashingMachine> implements EcoFriendlyWashingMachine 
+   {
+      
+      public static final EcoFriendlyWashingMachine INSTANCE = new EcoFriendlyWashingMachineLiteral();
+      
+      private EcoFriendlyWashingMachineLiteral() {}
+      
+   }
 
 }



More information about the weld-commits mailing list