[webbeans-commits] Webbeans SVN: r3831 - tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/literals and 1 other directories.

webbeans-commits at lists.jboss.org webbeans-commits at lists.jboss.org
Fri Oct 2 05:20:30 EDT 2009


Author: pete.muir at jboss.org
Date: 2009-10-02 05:20:29 -0400 (Fri, 02 Oct 2009)
New Revision: 3831

Added:
   tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/literals/NamedLiteral.java
   tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/binding/NamedOrder.java
Modified:
   ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/AbstractBean.java
   tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/binding/BindingDefinitionTest.java
Log:
WBRI-404

Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/AbstractBean.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/AbstractBean.java	2009-10-01 20:24:31 UTC (rev 3830)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/AbstractBean.java	2009-10-02 09:20:29 UTC (rev 3831)
@@ -193,6 +193,14 @@
          log.trace("Adding default @Current binding type");
          this.bindings.add(CURRENT_LITERAL);
       }
+      if (bindings.size() == 1)
+      {
+         if (bindings.iterator().next().annotationType().equals(Named.class))
+         {
+            log.trace("Adding default @Current binding type");
+            this.bindings.add(CURRENT_LITERAL);
+         }
+      }
       this.bindings.add(ANY_LITERAL);
    }
 

Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/literals/NamedLiteral.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/literals/NamedLiteral.java	                        (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/literals/NamedLiteral.java	2009-10-02 09:20:29 UTC (rev 3831)
@@ -0,0 +1,14 @@
+package org.jboss.jsr299.tck.literals;
+
+import javax.enterprise.inject.AnnotationLiteral;
+import javax.inject.Named;
+
+public class NamedLiteral extends AnnotationLiteral<Named> implements Named
+{
+   
+   public String value()
+   {
+      return "";
+   }
+   
+}


Property changes on: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/literals/NamedLiteral.java
___________________________________________________________________
Name: svn:mime-type
   + text/plain

Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/binding/BindingDefinitionTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/binding/BindingDefinitionTest.java	2009-10-01 20:24:31 UTC (rev 3830)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/binding/BindingDefinitionTest.java	2009-10-02 09:20:29 UTC (rev 3831)
@@ -10,6 +10,7 @@
 import org.jboss.jsr299.tck.AbstractJSR299Test;
 import org.jboss.jsr299.tck.literals.AnyLiteral;
 import org.jboss.jsr299.tck.literals.DefaultLiteral;
+import org.jboss.jsr299.tck.literals.NamedLiteral;
 import org.jboss.jsr299.tck.literals.NewLiteral;
 import org.jboss.test.audit.annotations.SpecAssertion;
 import org.jboss.test.audit.annotations.SpecAssertions;
@@ -32,6 +33,12 @@
       assert order.getQualifiers().size() == 2;
       assert order.getQualifiers().contains(new DefaultLiteral());
       assert order.getQualifiers().contains(new AnyLiteral());
+      
+      Bean<NamedOrder> namedOrder = getBeans(NamedOrder.class).iterator().next();
+      assert namedOrder.getQualifiers().size() == 3;
+      assert namedOrder.getQualifiers().contains(new DefaultLiteral());
+      assert namedOrder.getQualifiers().contains(new AnyLiteral());
+      assert namedOrder.getQualifiers().contains(new NamedLiteral());
    }
    
    @Test

Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/binding/NamedOrder.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/binding/NamedOrder.java	                        (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/binding/NamedOrder.java	2009-10-02 09:20:29 UTC (rev 3831)
@@ -0,0 +1,9 @@
+package org.jboss.jsr299.tck.tests.definition.binding;
+
+import javax.inject.Named;
+
+ at Named
+public class NamedOrder
+{
+
+}


Property changes on: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/binding/NamedOrder.java
___________________________________________________________________
Name: svn:mime-type
   + text/plain




More information about the weld-commits mailing list