Weld SVN: r7129 - in cdi-tck/trunk/impl/src/main: java/org/jboss/jsr299/tck/tests/implementation/simple/newSimpleBean and 1 other directories.
by weld-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2010-12-10 13:18:44 -0500 (Fri, 10 Dec 2010)
New Revision: 7129
Added:
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/newSimpleBean/Consumer.java
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/newSimpleBean/FoxRun.java
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/newSimpleBean/LionCage.java
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/newSimpleBean/Shop.java
Modified:
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/qualifier/QualifierDefinitionTest.java
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/newSimpleBean/ExplicitContructorSimpleBean.java
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/newSimpleBean/Fox.java
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/newSimpleBean/InitializerSimpleBean.java
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/newSimpleBean/Lion.java
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/newSimpleBean/NewSimpleBeanTest.java
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/newSimpleBean/Order.java
cdi-tck/trunk/impl/src/main/resources/tck-audit-cdi.xml
Log:
CDITCK-194
Modified: cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/qualifier/QualifierDefinitionTest.java
===================================================================
--- cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/qualifier/QualifierDefinitionTest.java 2010-12-10 18:04:45 UTC (rev 7128)
+++ cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/qualifier/QualifierDefinitionTest.java 2010-12-10 18:18:44 UTC (rev 7129)
@@ -62,24 +62,6 @@
InjectionPoint injectionPoint = order.getInjectionPoints().iterator().next();
assert injectionPoint.getQualifiers().contains(new DefaultLiteral());
}
-
- @Test
- @SpecAssertion(section = "2.3.1", id = "a0")
- public void testNewQualifierAndAnyBindingMutualExclusive()
- {
- New newOrderProcessor = new NewLiteral()
- {
-
- public Class<?> value()
- {
- return OrderProcessor.class;
- }
- };
- assert getBeans(OrderProcessor.class, newOrderProcessor).size() == 1;
- Bean<OrderProcessor> order = getBeans(OrderProcessor.class, newOrderProcessor).iterator().next();
- assert order.getQualifiers().size() == 1;
- assert order.getQualifiers().iterator().next().equals(newOrderProcessor);
- }
@Test(groups = { "annotationDefinition", "rewrite" })
@SpecAssertion(section = "2.3.2", id = "ba")
Added: cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/newSimpleBean/Consumer.java
===================================================================
--- cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/newSimpleBean/Consumer.java (rev 0)
+++ cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/newSimpleBean/Consumer.java 2010-12-10 18:18:44 UTC (rev 7129)
@@ -0,0 +1,42 @@
+package org.jboss.jsr299.tck.tests.implementation.simple.newSimpleBean;
+
+import javax.enterprise.inject.New;
+import javax.inject.Inject;
+
+
+public class Consumer
+{
+
+ @Inject
+ private ExplicitContructorSimpleBean explicitConstructorBean;
+
+ @Inject @New
+ private ExplicitContructorSimpleBean newExplicitConstructorBean;
+
+ @Inject
+ private InitializerSimpleBean initializerSimpleBean;
+
+ @Inject @New
+ private InitializerSimpleBean newInitializerSimpleBean;
+
+ public ExplicitContructorSimpleBean getExplicitConstructorBean()
+ {
+ return explicitConstructorBean;
+ }
+
+ public ExplicitContructorSimpleBean getNewExplicitConstructorBean()
+ {
+ return newExplicitConstructorBean;
+ }
+
+ public InitializerSimpleBean getInitializerSimpleBean()
+ {
+ return initializerSimpleBean;
+ }
+
+ public InitializerSimpleBean getNewInitializerSimpleBean()
+ {
+ return newInitializerSimpleBean;
+ }
+
+}
Property changes on: cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/newSimpleBean/Consumer.java
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/newSimpleBean/ExplicitContructorSimpleBean.java
===================================================================
--- cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/newSimpleBean/ExplicitContructorSimpleBean.java 2010-12-10 18:04:45 UTC (rev 7128)
+++ cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/newSimpleBean/ExplicitContructorSimpleBean.java 2010-12-10 18:18:44 UTC (rev 7129)
@@ -20,11 +20,9 @@
import javax.enterprise.context.SessionScoped;
import javax.enterprise.inject.Default;
-import javax.enterprise.inject.New;
+import javax.inject.Inject;
import javax.inject.Named;
-import org.jboss.jsr299.tck.literals.NewLiteral;
-
@SessionScoped
@Named("Fred") @Default
class ExplicitContructorSimpleBean implements Serializable
@@ -32,18 +30,20 @@
private static final long serialVersionUID = 1L;
private static int constructorCalls = 0;
- public static final New NEW = new NewLiteral()
- {
+ public ExplicitContructorSimpleBean() {
- public Class<?> value()
- {
- return ExplicitContructorSimpleBean.class;
- }
- };
+ }
- public ExplicitContructorSimpleBean() {
+ @Inject
+ public ExplicitContructorSimpleBean(Shop shop)
+ {
constructorCalls++;
}
+
+ public void ping()
+ {
+
+ }
public static int getConstructorCalls()
{
Modified: cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/newSimpleBean/Fox.java
===================================================================
--- cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/newSimpleBean/Fox.java 2010-12-10 18:04:45 UTC (rev 7128)
+++ cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/newSimpleBean/Fox.java 2010-12-10 18:18:44 UTC (rev 7129)
@@ -18,25 +18,12 @@
import javax.enterprise.event.Observes;
import javax.enterprise.inject.Disposes;
-import javax.enterprise.inject.New;
import javax.enterprise.inject.Produces;
-import org.jboss.jsr299.tck.literals.NewLiteral;
-
@AnimalStereotype
class Fox
{
- public static final New NEW = new NewLiteral()
- {
-
- public Class<?> value()
- {
- return Fox.class;
- }
-
- };
-
@Produces
private Den den = new Den("FoxDen");
Added: cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/newSimpleBean/FoxRun.java
===================================================================
--- cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/newSimpleBean/FoxRun.java (rev 0)
+++ cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/newSimpleBean/FoxRun.java 2010-12-10 18:18:44 UTC (rev 7129)
@@ -0,0 +1,33 @@
+package org.jboss.jsr299.tck.tests.implementation.simple.newSimpleBean;
+
+import javax.enterprise.inject.New;
+import javax.inject.Inject;
+
+public class FoxRun
+{
+
+ @Inject @New
+ private Fox newFox;
+
+ public Fox getNewFox()
+ {
+ return newFox;
+ }
+
+ @Inject
+ private Fox newFox2;
+
+ public Fox getNewFox2()
+ {
+ return newFox2;
+ }
+
+ @Inject
+ private Fox fox;
+
+ public Fox getFox()
+ {
+ return fox;
+ }
+
+}
Property changes on: cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/newSimpleBean/FoxRun.java
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/newSimpleBean/InitializerSimpleBean.java
===================================================================
--- cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/newSimpleBean/InitializerSimpleBean.java 2010-12-10 18:04:45 UTC (rev 7128)
+++ cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/newSimpleBean/InitializerSimpleBean.java 2010-12-10 18:18:44 UTC (rev 7129)
@@ -20,32 +20,19 @@
import javax.enterprise.context.SessionScoped;
import javax.enterprise.inject.Default;
-import javax.enterprise.inject.New;
import javax.inject.Inject;
import javax.inject.Named;
-import org.jboss.jsr299.tck.literals.NewLiteral;
-
@SessionScoped
@Named("Charlie") @Default
class InitializerSimpleBean implements Serializable
{
- public static final New NEW = new NewLiteral()
- {
-
- public Class<?> value()
- {
- return InitializerSimpleBean.class;
- }
-
- };
-
private static final long serialVersionUID = 1L;
- private static int initializerCalls = 0;
+ private static int initializerCalls = 0;
@Inject
- protected Order order;
+ protected Order order;
@Inject
public void initializer()
@@ -57,6 +44,11 @@
{
}
+
+ public Order getOrder()
+ {
+ return order;
+ }
public static int getInitializerCalls()
{
Modified: cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/newSimpleBean/Lion.java
===================================================================
--- cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/newSimpleBean/Lion.java 2010-12-10 18:04:45 UTC (rev 7128)
+++ cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/newSimpleBean/Lion.java 2010-12-10 18:18:44 UTC (rev 7129)
@@ -16,21 +16,10 @@
*/
package org.jboss.jsr299.tck.tests.implementation.simple.newSimpleBean;
-import javax.enterprise.inject.New;
-import org.jboss.jsr299.tck.literals.NewLiteral;
-
@Tame
class Lion
{
+
- public static final New NEW = new NewLiteral()
- {
-
- public Class<?> value()
- {
- return Lion.class;
- }
- };
-
}
Added: cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/newSimpleBean/LionCage.java
===================================================================
--- cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/newSimpleBean/LionCage.java (rev 0)
+++ cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/newSimpleBean/LionCage.java 2010-12-10 18:18:44 UTC (rev 7129)
@@ -0,0 +1,17 @@
+package org.jboss.jsr299.tck.tests.implementation.simple.newSimpleBean;
+
+import javax.enterprise.inject.New;
+import javax.inject.Inject;
+
+public class LionCage
+{
+
+ @Inject @New
+ private Lion newLion;
+
+ public Lion getNewLion()
+ {
+ return newLion;
+ }
+
+}
Property changes on: cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/newSimpleBean/LionCage.java
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/newSimpleBean/NewSimpleBeanTest.java
===================================================================
--- cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/newSimpleBean/NewSimpleBeanTest.java 2010-12-10 18:04:45 UTC (rev 7128)
+++ cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/newSimpleBean/NewSimpleBeanTest.java 2010-12-10 18:18:44 UTC (rev 7129)
@@ -16,20 +16,16 @@
*/
package org.jboss.jsr299.tck.tests.implementation.simple.newSimpleBean;
-import java.io.Serializable;
import java.lang.annotation.Annotation;
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;
import java.util.HashSet;
import java.util.LinkedHashSet;
-import java.util.Set;
import java.util.TreeSet;
-import javax.enterprise.context.Dependent;
import javax.enterprise.context.RequestScoped;
import javax.enterprise.context.spi.CreationalContext;
-import javax.enterprise.inject.New;
import javax.enterprise.inject.spi.Bean;
import javax.enterprise.util.AnnotationLiteral;
import javax.enterprise.util.TypeLiteral;
@@ -115,47 +111,26 @@
@Test(groups = { "new" })
@SpecAssertions({
- @SpecAssertion(section = "3.12", id = "p")
+
})
public void testNewBeanIsDependentScoped()
{
- Set<Bean<ExplicitContructorSimpleBean>> beans = getBeans(ExplicitContructorSimpleBean.class, ExplicitContructorSimpleBean.NEW);
- assert beans.size() == 1;
- Bean<ExplicitContructorSimpleBean> newSimpleBean = beans.iterator().next();
- assert Dependent.class.equals(newSimpleBean.getScope());
+ FoxRun foxRun = getInstanceByType(FoxRun.class);
+ foxRun.getNewFox().setDen(new Den("TheLarches"));
+ assert !foxRun.getNewFox().getDen().getName().equals(foxRun.getNewFox2().getDen().getName());
}
@Test(groups = { "new" })
- @SpecAssertion(section = "3.12", id = "r")
- public void testNewBeanHasOnlyNewBinding()
- {
- Set<Bean<ExplicitContructorSimpleBean>> beans = getBeans(ExplicitContructorSimpleBean.class, ExplicitContructorSimpleBean.NEW);
- assert beans.size() == 1;
- Bean<ExplicitContructorSimpleBean> newSimpleBean = beans.iterator().next();
- assert newSimpleBean.getQualifiers().size() == 1;
- assert newSimpleBean.getQualifiers().iterator().next().annotationType().equals(New.class);
- }
-
- @Test(groups = { "new" })
- @SpecAssertion(section = "3.12", id = "s")
- public void testNewBeanHasNoBeanELName()
- {
- Set<Bean<ExplicitContructorSimpleBean>> beans = getBeans(ExplicitContructorSimpleBean.class, ExplicitContructorSimpleBean.NEW);
- assert beans.size() == 1;
- Bean<ExplicitContructorSimpleBean> newSimpleBean = beans.iterator().next();
- assert newSimpleBean.getName() == null;
- }
-
- @Test(groups = { "new" })
@SpecAssertion(section = "3.12", id = "t")
public void testNewBeanHasNoStereotypes()
{
Bean<Fox> foxBean = getBeans(Fox.class).iterator().next();
assert foxBean.getScope().equals(RequestScoped.class);
assert foxBean.getName().equals("fox");
- Bean<Fox> newFoxBean = getBeans(Fox.class, Fox.NEW).iterator().next();
- assert newFoxBean.getScope().equals(Dependent.class);
- assert newFoxBean.getName() == null;
+ Fox newFox1 = getInstanceByType(FoxRun.class).getNewFox();
+ Fox newFox2 = getInstanceByType(FoxRun.class).getNewFox();
+ newFox1.setDen(new Den("TheElms"));
+ assert newFox2.getDen().getName() != "TheElms";
}
@Test(groups = { "new" })
@@ -170,37 +145,34 @@
@SpecAssertion(section = "3.12", id = "w")
public void testNewBeanHasNoProducerFields() throws Exception
{
- Fox fox = getInstanceByType(Fox.class);
- Fox newFox = getInstanceByType(Fox.class, Fox.NEW);
- newFox.setDen(new Den("NewFoxDen"));
+ FoxRun foxRun = getInstanceByType(FoxRun.class);
+ foxRun.getNewFox().setDen(new Den("NewFoxDen"));
Den theOnlyDen = getInstanceByType(Den.class);
- assert theOnlyDen.getName().equals(fox.getDen().getName());
+ assert theOnlyDen.getName().equals(foxRun.getFox().getDen().getName());
}
@Test(groups = { "new" })
@SpecAssertion(section = "3.12", id = "v")
public void testNewBeanHasNoProducerMethods() throws Exception
{
- Fox fox = getInstanceByType(Fox.class);
- Fox newFox = getInstanceByType(Fox.class, Fox.NEW);
- fox.setNextLitterSize(3);
- newFox.setNextLitterSize(5);
+ FoxRun foxRun = getInstanceByType(FoxRun.class);
+ foxRun.getFox().setNextLitterSize(3);
+ foxRun.getNewFox().setNextLitterSize(5);
Litter theOnlyLitter = getInstanceByType(Litter.class);
- assert theOnlyLitter.getQuantity() == fox.getNextLitterSize();
+ assert theOnlyLitter.getQuantity() == foxRun.getFox().getNextLitterSize();
}
@Test(groups = { "new" })
@SpecAssertion(section = "3.12", id = "x")
public void testNewBeanHasNoDisposerMethods() throws Exception
{
- Fox fox = getInstanceByType(Fox.class);
- Fox newFox = getInstanceByType(Fox.class, Fox.NEW);
+ FoxRun foxRun = getInstanceByType(FoxRun.class);
Bean<Litter> litterBean = getBeans(Litter.class).iterator().next();
CreationalContext<Litter> creationalContext = getCurrentManager().createCreationalContext(litterBean);
Litter litter = getInstanceByType(Litter.class);
litterBean.destroy(litter, creationalContext);
- assert fox.isLitterDisposed();
- assert !newFox.isLitterDisposed();
+ assert foxRun.getFox().isLitterDisposed();
+ assert !foxRun.getNewFox().isLitterDisposed();
}
@Test
@@ -210,52 +182,27 @@
assert getBeans(Order.class).size() == 1;
assert getUniqueBean(Order.class).getQualifiers().size() == 2;
assert getUniqueBean(Order.class).getQualifiers().contains(new DefaultLiteral());
-
- assert getBeans(Order.class, Order.NEW).size() == 1;
- assert getUniqueBean(Order.class, Order.NEW).getQualifiers().size() == 1;
- assert getUniqueBean(Order.class, Order.NEW).getQualifiers().iterator().next().annotationType().equals(New.class);
-
- assert getBeans(Lion.class, TAME_LITERAL).size() == 1;
- assert getUniqueBean(Lion.class, TAME_LITERAL).getQualifiers().size() == 2;
- assert getUniqueBean(Lion.class, TAME_LITERAL).getQualifiers().contains(TAME_LITERAL);
- assert getUniqueBean(Lion.class, TAME_LITERAL).getQualifiers().contains(new AnyLiteral());
-
- assert getBeans(Lion.class, Lion.NEW).size() == 1;
- assert getUniqueBean(Lion.class, Lion.NEW).getQualifiers().size() == 1;
- assert annotationSetMatches(getUniqueBean(Lion.class, Lion.NEW).getQualifiers(), New.class);
- }
-
- @Test(groups = { "new" })
- @SpecAssertion(section = "3.12", id = "d")
- public void testNewBeanHasSameBeanClass()
- {
- assert getUniqueBean(Order.class).getBeanClass().equals(Order.class);
- assert getUniqueBean(Order.class, Order.NEW).getBeanClass().equals(Order.class);
+ assert getInstanceByType(Shop.class).getNewOrder() != null;
+
+ assert getCurrentManager().getBeans(Lion.class, TAME_LITERAL).size() == 1;
+ assert getCurrentManager().getBeans(Lion.class, TAME_LITERAL).iterator().next().getQualifiers().size() == 2;
+ assert getCurrentManager().getBeans(Lion.class, TAME_LITERAL).iterator().next().getQualifiers().contains(TAME_LITERAL);
+ assert getCurrentManager().getBeans(Lion.class, TAME_LITERAL).iterator().next().getQualifiers().contains(new AnyLiteral());
- assert getUniqueBean(Lion.class, TAME_LITERAL).getBeanClass().equals(Lion.class);
- assert getUniqueBean(Lion.class, Lion.NEW).getBeanClass().equals(Lion.class);
+ assert getInstanceByType(LionCage.class).getNewLion() != null;
}
@Test(groups = { "new" })
- @SpecAssertion(section = "3.12", id = "e")
- public void testNewBeanHasSameBeanTypes()
- {
- assert typeSetMatches(getUniqueBean(Order.class).getTypes(), Order.class, Serializable.class, Object.class);
- assert typeSetMatches(getUniqueBean(Order.class, Order.NEW).getTypes(), Order.class, Serializable.class, Object.class);
-
- assert typeSetMatches(getUniqueBean(Lion.class, TAME_LITERAL).getTypes(), Lion.class, Object.class);
- assert typeSetMatches(getUniqueBean(Lion.class, Lion.NEW).getTypes(), Lion.class, Object.class);
- }
-
- @Test(groups = { "new" })
@SpecAssertion(section = "3.12", id = "f")
public void testNewBeanHasSameConstructor()
{
ExplicitContructorSimpleBean.setConstructorCalls(0);
- ExplicitContructorSimpleBean bean = getInstanceByType(ExplicitContructorSimpleBean.class);
- ExplicitContructorSimpleBean newBean = getInstanceByType(ExplicitContructorSimpleBean.class, ExplicitContructorSimpleBean.NEW);
- assert bean != newBean;
- assert ExplicitContructorSimpleBean.getConstructorCalls() == 2;
+ Consumer consumer = getInstanceByType(Consumer.class);
+ // Make sure all deps are initialized, even if deps are lazily init'd
+ consumer.getExplicitConstructorBean().ping();
+ consumer.getNewExplicitConstructorBean().ping();
+ int calls = ExplicitContructorSimpleBean.getConstructorCalls();
+ assert calls == 2;
}
@Test(groups = { "new" })
@@ -263,32 +210,22 @@
public void testNewBeanHasSameInitializers()
{
InitializerSimpleBean.setInitializerCalls(0);
- InitializerSimpleBean bean = getInstanceByType(InitializerSimpleBean.class);
- bean.businessMethod(); // Cause proxy to initialize the bean
- InitializerSimpleBean newBean = getInstanceByType(InitializerSimpleBean.class, InitializerSimpleBean.NEW);
- assert bean != newBean;
- assert InitializerSimpleBean.getInitializerCalls() == 2;
+ Consumer consumer = getInstanceByType(Consumer.class);
+ consumer.getInitializerSimpleBean().businessMethod(); // Cause proxy to initialize the bean
+ consumer.getNewInitializerSimpleBean().businessMethod();
+ int calls = InitializerSimpleBean.getInitializerCalls();
+ assert calls == 2;
}
@Test(groups = { "new" })
@SpecAssertion(section = "3.12", id = "h")
public void testNewBeanHasSameInjectedFields()
{
- Bean<InitializerSimpleBean> simpleBean = getBeans(InitializerSimpleBean.class).iterator().next();
- Bean<InitializerSimpleBean> newSimpleBean = getBeans(InitializerSimpleBean.class, InitializerSimpleBean.NEW).iterator().next();
- assert !newSimpleBean.getInjectionPoints().isEmpty();
- assert simpleBean.getInjectionPoints().equals(newSimpleBean.getInjectionPoints());
+ Consumer consumer = getInstanceByType(Consumer.class);
+ assert consumer.getNewInitializerSimpleBean().getOrder() != null;
}
@Test(groups = { "new" })
- @SpecAssertion(section = "3.12", id = "i")
- public void testNewBeanHasSameInterceptorBindings()
- {
- assert getInstanceByType(Order.class).foo();
- assert getInstanceByType(Order.class, Order.NEW).foo();
- }
-
- @Test(groups = { "new" })
@SpecAssertion(section = "3.12", id = "xb")
public void testNewBeanIsNotAlternative()
{
Modified: cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/newSimpleBean/Order.java
===================================================================
--- cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/newSimpleBean/Order.java 2010-12-10 18:04:45 UTC (rev 7128)
+++ cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/newSimpleBean/Order.java 2010-12-10 18:18:44 UTC (rev 7129)
@@ -18,24 +18,10 @@
import java.io.Serializable;
-import javax.enterprise.inject.New;
-
-import org.jboss.jsr299.tck.literals.NewLiteral;
-
@Secure
@Transactional
class Order implements Serializable
{
-
- public static final New NEW = new NewLiteral()
- {
-
- public Class<?> value()
- {
- return Order.class;
- }
-
- };
private static final long serialVersionUID = 1L;
public static boolean constructed = true;
Added: cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/newSimpleBean/Shop.java
===================================================================
--- cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/newSimpleBean/Shop.java (rev 0)
+++ cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/newSimpleBean/Shop.java 2010-12-10 18:18:44 UTC (rev 7129)
@@ -0,0 +1,19 @@
+package org.jboss.jsr299.tck.tests.implementation.simple.newSimpleBean;
+
+import java.io.Serializable;
+
+import javax.enterprise.inject.New;
+import javax.inject.Inject;
+
+public class Shop implements Serializable
+{
+
+ @Inject @New
+ private Order newOrder;
+
+ public Order getNewOrder()
+ {
+ return newOrder;
+ }
+
+}
Property changes on: cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/newSimpleBean/Shop.java
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: cdi-tck/trunk/impl/src/main/resources/tck-audit-cdi.xml
===================================================================
--- cdi-tck/trunk/impl/src/main/resources/tck-audit-cdi.xml 2010-12-10 18:04:45 UTC (rev 7128)
+++ cdi-tck/trunk/impl/src/main/resources/tck-audit-cdi.xml 2010-12-10 18:18:44 UTC (rev 7129)
@@ -157,8 +157,9 @@
<section id="2.3.1" title="Built-in qualifier types">
- <assertion id="a0">
+ <assertion id="a0" testable="false">
<text>Every bean has the built-in qualifier |@Any|, even if it does not explicitly declare this qualifier, except for the special |@New| qualified beans defined in Section 3.12, "@New qualified beans".</text>
+ <note>Cannot be checked as @New beans aren't required to be available via programmatic lookup</note>
</assertion>
<assertion id="aa">
@@ -1587,12 +1588,14 @@
<text>This second bean has scope |@Dependent|.</text>
</assertion>
- <assertion id="r">
+ <assertion id="r" testable="false">
<text>This second bean has exactly one qualifier: |(a)javax.enterprise.inject.New(X.class)| where |x| is the bean class.</text>
+ <note>Cannot look up Bean programmatically</note>
</assertion>
- <assertion id="s">
+ <assertion id="s" testable="false">
<text>This second bean has no bean EL name.</text>
+ <note>Cannot lookup Bean programmatically</note>
</assertion>
<assertion id="t">