[webbeans-commits] Webbeans SVN: r3138 - in tck/trunk/impl/src/main: java/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution and 1 other directories.
by webbeans-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2009-07-22 12:23:19 -0400 (Wed, 22 Jul 2009)
New Revision: 3138
Modified:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injectionpoint/InjectionPointTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/ResolutionByTypeTest.java
tck/trunk/impl/src/main/resources/tck-audit.xml
Log:
make resolution assertions more granular
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injectionpoint/InjectionPointTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injectionpoint/InjectionPointTest.java 2009-07-22 16:09:39 UTC (rev 3137)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injectionpoint/InjectionPointTest.java 2009-07-22 16:23:19 UTC (rev 3138)
@@ -316,7 +316,7 @@
}
@Test(groups = { "ri-broken", "resolution" })
- @SpecAssertion(section = "5.3", id = "h")
+ @SpecAssertion(section = "5.3", id = "hb")
public void testDecoratorNotResolved() {
Cat cat = getInstanceByType(Cat.class);
assert cat != null;
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/ResolutionByTypeTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/ResolutionByTypeTest.java 2009-07-22 16:09:39 UTC (rev 3137)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/ResolutionByTypeTest.java 2009-07-22 16:23:19 UTC (rev 3138)
@@ -43,7 +43,7 @@
{
@Test(groups = "resolution")
- @SpecAssertion(section = "5.3", id = "l")
+ @SpecAssertion(section = "5.3", id = "lb")
public void testDefaultBindingTypeAssumed() throws Exception
{
Set<Bean<Tuna>> possibleTargets = getBeans(Tuna.class);
@@ -52,7 +52,7 @@
}
@Test(groups = "resolution")
- @SpecAssertion(section = "unknown", id = "unknown")
+ @SpecAssertion(section = "5.3", id = "hc")
public void testResolveByType() throws Exception
{
@@ -88,7 +88,7 @@
@Test(groups = "injection")
@SpecAssertions( {
@SpecAssertion(section = "2.3.4", id = "b"),
- @SpecAssertion(section = "5.3", id = "l"),
+ @SpecAssertion(section = "5.3", id = "lc"),
@SpecAssertion(section = "2.3.3", id = "d"),
@SpecAssertion(section = "5.3.6", id = "a"),
@SpecAssertion(section = "5.3.6", id = "d") })
@@ -124,9 +124,8 @@
@Test(groups = { "resolution" })
@SpecAssertions( {
- @SpecAssertion(section = "5.3", id = "k"),
- @SpecAssertion(section = "2.2", id = "review"),
- @SpecAssertion(section = "2.2", id = "review") })
+ @SpecAssertion(section = "5.3", id = "ka")
+ })
public void testResolveByTypeWithTypeParameter() throws Exception
{
assert getBeans(new TypeLiteral<Farmer<ScottishFish>>(){}).size() == 1;
@@ -163,7 +162,7 @@
}
@Test(groups = "resolution")
@SpecAssertions( {
- @SpecAssertion(section = "5.3", id = "l"),
+ @SpecAssertion(section = "5.3", id = "le"),
@SpecAssertion(section = "5.3.5", id = "b")
})
public void testResolveByTypeWithNonBindingMembers() throws Exception
Modified: tck/trunk/impl/src/main/resources/tck-audit.xml
===================================================================
--- tck/trunk/impl/src/main/resources/tck-audit.xml 2009-07-22 16:09:39 UTC (rev 3137)
+++ tck/trunk/impl/src/main/resources/tck-audit.xml 2009-07-22 16:23:19 UTC (rev 3138)
@@ -1709,33 +1709,65 @@
</section>
<section id="5.3" title="Typesafe resolution">
- <assertion id="h">
- <text>When resolving beans that are eligible for injection to an injection point, the container identifies the set of matching beans which are not interceptors or decorators and which have a bean type that matches the required type.</text>
+ <assertion id="hq">
+ <text>When resolving beans that are eligible for injection to an injection point, the container identifies the set of matching beans which are not _interceptors_ or decorators and which have a bean type that matches the required type.</text>
</assertion>
+ <assertion id="hb">
+ <text>When resolving beans that are eligible for injection to an injection point, the container identifies the set of matching beans which are not interceptors or _decorators_ and which have a bean type that matches the required type.</text>
+ </assertion>
+
+ <assertion id="hc">
+ <text>When resolving beans that are eligible for injection to an injection point, the container identifies the set of matching beans which are not interceptors or decorators and which have a _bean type that matches the required type_.</text>
+ </assertion>
+
<assertion id="i">
- <text>When resolving beans that are eligible for injection to an injection point, the container identifies the set of matching beans which are not interceptors or decorators and which have a bean type that matches the required type. For this purpose, primitive types are considered to match their corresponding wrapper types in |java.lang| ~and array types are considered to match only if their element types are identical. Parameterized and raw types are considered to match if they are identical or if the bean type is assignable to the required type, as defined in Section 5.3.3, "Assignability of raw and parameterized types".~</text>
+ <text>When resolving beans that are eligible for injection to an injection point, the container identifies the set of matching beans which are not interceptors or decorators and which have a bean type that matches the required type. For this purpose, _primitive types are considered to match their corresponding wrapper types in |java.lang|_ ~and array types are considered to match only if their element types are identical. Parameterized and raw types are considered to match if they are identical or if the bean type is assignable to the required type, as defined in Section 5.3.3, "Assignability of raw and parameterized types".~</text>
</assertion>
<assertion id="j">
- <text>When resolving beans that are eligible for injection to an injection point, the container identifies the set of matching beans which are not interceptors or decorators and which have a bean type that matches the required type. For this purpose, ~primitive types are considered to match their corresponding wrapper types in |java.lang| and~ array types are considered to match only if their element types are identical. ~Parameterized and raw types are considered to match if they are identical or if the bean type is assignable to the required type, as defined in Section 5.3.3, "Assignability of raw and parameterized types".~</text>
+ <text>When resolving beans that are eligible for injection to an injection point, the container identifies the set of matching beans which are not interceptors or decorators and which have a bean type that matches the required type. For this purpose, ~primitive types are considered to match their corresponding wrapper types in |java.lang| and~ _array types are considered to match only if their element types are identical_. ~Parameterized and raw types are considered to match if they are identical or if the bean type is assignable to the required type, as defined in Section 5.3.3, "Assignability of raw and parameterized types".~</text>
</assertion>
- <assertion id="k">
- <text>When resolving beans that are eligible for injection to an injection point, the container identifies the set of matching beans which are not interceptors or decorators and which have a bean type that matches the required type. For this purpose, ~primitive types are considered to match their corresponding wrapper types in |java.lang| and array types are considered to match only if their element types are identical.~ Parameterized and raw types are considered to match if they are identical or if the bean type is assignable to the required type, as defined in Section 5.3.3, "Assignability of raw and parameterized types".</text>
+ <assertion id="ka">
+ <text>When resolving beans that are eligible for injection to an injection point, the container identifies the set of matching beans which are not interceptors or decorators and which have a bean type that matches the required type. For this purpose, ~primitive types are considered to match their corresponding wrapper types in |java.lang| and array types are considered to match only if their element types are identical.~ _Parameterized_ and raw types are considered to match if they are identical or if the bean type is assignable to the required type, as defined in Section 5.3.3, "Assignability of raw and parameterized types".</text>
</assertion>
+
+ <assertion id="kb">
+ <text>When resolving beans that are eligible for injection to an injection point, the container identifies the set of matching beans which are not interceptors or decorators and which have a bean type that matches the required type. For this purpose, ~primitive types are considered to match their corresponding wrapper types in |java.lang| and array types are considered to match only if their element types are identical.~ Parameterized and _raw types_ are considered to match if they are identical or if the bean type is assignable to the required type, as defined in Section 5.3.3, "Assignability of raw and parameterized types".</text>
+ </assertion>
- <assertion id="l">
- <text>When resolving beans that are eligible for injection to an injection point, the container identifies the set of matching beans which are not interceptors or decorators and which have the required bindings. If no required bindings were explicitly specified, the container assumes the required binding |@Current|. The container narrows the set of matching beans to just those where for each required binding, the bean declares a matching binding with (a) the same type and (b) the same annotation member value for each member which is not annotated |(a)javax.enterprise.inject.NonBinding| (see Section 5.3.5, "Binding annotations with members").</text>
+ <assertion id="la">
+ <text>When resolving beans that are eligible for injection to an injection point, the container identifies the set of matching beans which are not interceptors or decorators and _which have the required bindings_. If no required bindings were explicitly specified, the container assumes the required binding |@Current|. The container narrows the set of matching beans to just those where for each required binding, the bean declares a matching binding with (a) the same type and (b) the same annotation member value for each member which is not annotated |(a)javax.enterprise.inject.NonBinding| (see Section 5.3.5, "Binding annotations with members").</text>
</assertion>
+
+ <assertion id="lb">
+ <text>When resolving beans that are eligible for injection to an injection point, the container identifies the set of matching beans which are not interceptors or decorators and which have the required bindings. _If no required bindings were explicitly specified, the container assumes the required binding |@Current|_. The container narrows the set of matching beans to just those where for each required binding, the bean declares a matching binding with (a) the same type and (b) the same annotation member value for each member which is not annotated |(a)javax.enterprise.inject.NonBinding| (see Section 5.3.5, "Binding annotations with members").</text>
+ </assertion>
+
+ <assertion id="lc">
+ <text>When resolving beans that are eligible for injection to an injection point, the container identifies the set of matching beans which are not interceptors or decorators and which have the required bindings. If no required bindings were explicitly specified, the container assumes the required binding |@Current|. The container narrows the set of matching beans to just those where for each required binding, the bean declares a matching binding with (a) _the same type_ and (b) the same annotation member value for each member which is not annotated |(a)javax.enterprise.inject.NonBinding| (see Section 5.3.5, "Binding annotations with members").</text>
+ </assertion>
+
+ <assertion id="ld">
+ <text>When resolving beans that are eligible for injection to an injection point, the container identifies the set of matching beans which are not interceptors or decorators and which have the required bindings. If no required bindings were explicitly specified, the container assumes the required binding |@Current|. The container narrows the set of matching beans to just those where for each required binding, the bean declares a matching binding with (a) the same type and (b) _the same annotation member value_ for each member which is not annotated |(a)javax.enterprise.inject.NonBinding| (see Section 5.3.5, "Binding annotations with members").</text>
+ </assertion>
+
+ <assertion id="le">
+ <text>When resolving beans that are eligible for injection to an injection point, the container identifies the set of matching beans which are not interceptors or decorators and which have the required bindings. If no required bindings were explicitly specified, the container assumes the required binding |@Current|. The container narrows the set of matching beans to just those where for each required binding, the bean declares a matching binding with (a) the same type and (b) the same annotation member value for each member _which is not annotated |(a)javax.enterprise.inject.NonBinding|_ (see Section 5.3.5, "Binding annotations with members").</text>
+ </assertion>
<assertion id="m">
<text>When resolving beans that are eligible for injection to an injection point, the container identifies the set of matching beans which are not interceptors or decorators. In a Java EE or servlet container, the bean class is required to be accessible to the class that declares the injection point, according to the class loading requirements of the Java EE platform and Java Servlet specifications.</text>
</assertion>
- <assertion id="n">
- <text>When resolving beans that are eligible for injection to an injection point, the container identifies the set of matching beans which are not interceptors or decorators and which are not a policy, or is an enabled policy of the bean deployment archive of the class that declares the injection point. For a custom implementation of the |Bean| interface defined in Section 11.1, "The Bean interface", the container calls |getTypes()| and |getBindings()| to determine the bean types and bindings.</text>
+ <assertion id="na">
+ <text>When resolving beans that are eligible for injection to an injection point, the container identifies the set of matching beans which are not interceptors or decorators and which are not a policy, or is an enabled policy of the bean deployment archive of the class that declares the injection point. For a custom implementation of the |Bean| interface defined in Section 11.1, "The Bean interface", the container calls _|getTypes()|_ and |getBindings()| to determine the bean types and bindings.</text>
</assertion>
+
+ <assertion id="nb">
+ <text>When resolving beans that are eligible for injection to an injection point, the container identifies the set of matching beans which are not interceptors or decorators and which are not a policy, or is an enabled policy of the bean deployment archive of the class that declares the injection point. For a custom implementation of the |Bean| interface defined in Section 11.1, "The Bean interface", the container calls |getTypes()| and _|getBindings()|_ to determine the bean types and bindings.</text>
+ </assertion>
</section>
<section id="5.3.1" title="Unsatisfied and ambiguous dependencies">
15 years, 4 months
[webbeans-commits] Webbeans SVN: r3137 - in tck/trunk/impl/src/main: resources and 1 other directory.
by webbeans-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2009-07-22 12:09:39 -0400 (Wed, 22 Jul 2009)
New Revision: 3137
Modified:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/dependent/ejb/DependentContextEjbTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/dependent/ejb/House.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/dependent/ejb/Room.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/dependent/ejb/Table.java
tck/trunk/impl/src/main/resources/tck-audit.xml
Log:
Remove redundent test, improve tests, add assertion
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/dependent/ejb/DependentContextEjbTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/dependent/ejb/DependentContextEjbTest.java 2009-07-22 16:02:00 UTC (rev 3136)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/dependent/ejb/DependentContextEjbTest.java 2009-07-22 16:09:39 UTC (rev 3137)
@@ -29,35 +29,16 @@
import org.testng.annotations.Test;
/**
- * Spec version: 20090519
+ * Spec version: 20090625
*/
@IntegrationTest
@Packaging(PackagingType.EAR)
@Artifact
public class DependentContextEjbTest extends AbstractJSR299Test
{
- @Test(groups = { "contexts", "injection", "ejb3", "integration" })
- //@SpecAssertion(section = "8.3", id = "k")
- @SpecAssertion(section = "unknown", id = "unknown")
- public void testContextIsActiveDuringEJBDependencyInjection()
- {
- Bean<FoxRunLocal> foxRunBean = getBeans(FoxRunLocal.class).iterator().next();
- CreationalContext<FoxRunLocal> creationalContext = getCurrentManager().createCreationalContext(foxRunBean);
- FoxRunLocal foxRun = foxRunBean.create(creationalContext);
- assert foxRun.getFox() != null;
- }
- @Test(groups = { "contexts", "postconstruct", "ejb3", "integration" })
- @SpecAssertion(section = "6.4.1", id = "ka")
- public void testContextIsActiveDuringEJBPostConstruct()
- {
- Fox.setDependentContextActiveDuringPostConstruct(false);
- getInstanceByType(FoxLocal.class).getName();
- assert Fox.isDependentContextActiveDuringPostConstruct();
- }
-
@Test(groups = { "contexts", "ejb3", "integration", "ri-broken"})
- @SpecAssertion(section = "6.4.3", id = "baa")
+ @SpecAssertion(section = "6.4.2", id = "aaaa")
public void testDestroyingEjbDestroysDependents() throws Exception
{
new RunInDependentContext()
@@ -81,7 +62,7 @@
}
@Test(groups = { "contexts", "ejb3", "integration","ri-broken", "broken" })
- @SpecAssertion(section = "6.4.3", id = "baa")
+ @SpecAssertion(section = "6.4.2", id = "aaaa")
public void testDestroyingEjbDestroysDependentSimples() throws Exception
{
new RunInDependentContext()
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/dependent/ejb/House.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/dependent/ejb/House.java 2009-07-22 16:02:00 UTC (rev 3136)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/dependent/ejb/House.java 2009-07-22 16:09:39 UTC (rev 3137)
@@ -5,7 +5,7 @@
import javax.enterprise.inject.Current;
@RequestScoped @Stateful
-class House implements HouseLocal
+public class House implements HouseLocal
{
@Current RoomLocal room;
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/dependent/ejb/Room.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/dependent/ejb/Room.java 2009-07-22 16:02:00 UTC (rev 3136)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/dependent/ejb/Room.java 2009-07-22 16:09:39 UTC (rev 3137)
@@ -5,7 +5,7 @@
import javax.enterprise.inject.Current;
@Stateful
-class Room implements RoomLocal
+public class Room implements RoomLocal
{
@Current TableLocal table;
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/dependent/ejb/Table.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/dependent/ejb/Table.java 2009-07-22 16:02:00 UTC (rev 3136)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/dependent/ejb/Table.java 2009-07-22 16:09:39 UTC (rev 3137)
@@ -4,7 +4,7 @@
import javax.ejb.Stateful;
@Stateful
-class Table implements TableLocal
+public class Table implements TableLocal
{
public static boolean destroyed;
Modified: tck/trunk/impl/src/main/resources/tck-audit.xml
===================================================================
--- tck/trunk/impl/src/main/resources/tck-audit.xml 2009-07-22 16:02:00 UTC (rev 3136)
+++ tck/trunk/impl/src/main/resources/tck-audit.xml 2009-07-22 16:09:39 UTC (rev 3137)
@@ -2419,9 +2419,14 @@
</section>
<section id="6.4.2" title="Dependent object destruction">
- <assertion id="aaa">
+
+ <assertion id="aaaa">
<text>The container must ensure that all dependent objects of a non-contextual instance of a bean or other Java EE component class are destroyed when the instance is destroyed by the container.</text>
</assertion>
+
+ <assertion id="aaab">
+ <text>The container must ensure that all dependent objects of a non-contextual instance of a bean or other Java EE component class are destroyed when the instance is destroyed by the container.</text>
+ </assertion>
<assertion id="bbb">
<text>The container must ensure that all |@Dependent| scoped contextual instances injected into method parameters of an observer method of any container lifecycle event, as defined in Section 11.5, "Container lifecycle events", is destroyed after all observers of the |BeforeShutdown| event complete.</text>
15 years, 4 months
[webbeans-commits] Webbeans SVN: r3136 - tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/manager/jndi and 1 other directory.
by webbeans-commits@lists.jboss.org
Author: dallen6
Date: 2009-07-22 12:02:00 -0400 (Wed, 22 Jul 2009)
New Revision: 3136
Modified:
ri/trunk/impl/src/main/java/org/jboss/webbeans/bootstrap/AbstractBeanDeployer.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/manager/jndi/ManagerTest.java
Log:
Minor cleanup...fixed test assertion and removed code not needed in deployer.
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/bootstrap/AbstractBeanDeployer.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/bootstrap/AbstractBeanDeployer.java 2009-07-22 14:31:32 UTC (rev 3135)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/bootstrap/AbstractBeanDeployer.java 2009-07-22 16:02:00 UTC (rev 3136)
@@ -167,15 +167,8 @@
{
ObserverMethodImpl<?, ?> observer = ObserverFactory.create(method, declaringBean, manager);
environment.getObservers().add(observer);
- //TODO Not sure how to create the templated event without any type information here
- //fireProcessObserverMethod(observer, method);
}
- private <X, T> void fireProcessObserverMethod(final ObserverMethodImpl<X, T> observerMethod, final AnnotatedMethod<X> method)
- {
- manager.fireEvent(new ProcessObserverMethodImpl<X, T>(method, observerMethod, definitionErrors));
- }
-
protected <T> void createSimpleBean(WBClass<T> annotatedClass)
{
SimpleBean<T> bean = SimpleBean.of(annotatedClass, manager);
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/manager/jndi/ManagerTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/manager/jndi/ManagerTest.java 2009-07-22 14:31:32 UTC (rev 3135)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/manager/jndi/ManagerTest.java 2009-07-22 16:02:00 UTC (rev 3136)
@@ -11,19 +11,20 @@
/**
*
- * Spec version: 20090519
+ * Spec version: 20090625
*
*/
@Artifact
@IntegrationTest
public class ManagerTest extends AbstractJSR299Test
{
- @Test(groups = { "manager", "ejb3", "integration" })
- @SpecAssertion(section = "11.2", id = "d")
+ @Test(groups = { "manager", "ejb3", "integration", "rewrite" })
+ //TODO This test needs to use an EJB component that looks up the JNDI manager (java:comp)
+ @SpecAssertion(section = "11.3", id = "da")
public void testManagerLookupInJndi() throws Exception
{
InitialContext ctx = new InitialContext();
- BeanManager beanManager = (BeanManager) ctx.lookup("java:app/BeanManager");
+ BeanManager beanManager = (BeanManager) ctx.lookup("java:comp/BeanManager");
assert beanManager != null;
}
}
15 years, 4 months
[webbeans-commits] Webbeans SVN: r3135 - tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event and 1 other directories.
by webbeans-commits@lists.jboss.org
Author: dallen6
Date: 2009-07-22 10:31:32 -0400 (Wed, 22 Jul 2009)
New Revision: 3135
Added:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/DisobedientDog.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/LargeDog.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/ShowDog.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/SmallDog.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/TransactionalObservers.java
Modified:
ri/trunk/impl/src/main/java/org/jboss/webbeans/event/ObserverMethodImpl.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/EventTest.java
tck/trunk/impl/src/main/resources/tck-audit.xml
Log:
Added new tests for ObserverMethod and fixed related bugs.
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/event/ObserverMethodImpl.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/event/ObserverMethodImpl.java 2009-07-22 14:01:07 UTC (rev 3134)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/event/ObserverMethodImpl.java 2009-07-22 14:31:32 UTC (rev 3135)
@@ -43,6 +43,7 @@
import org.jboss.webbeans.injection.MethodInjectionPoint;
import org.jboss.webbeans.introspector.WBMethod;
import org.jboss.webbeans.introspector.WBParameter;
+import org.jboss.webbeans.literal.AnyLiteral;
import org.jboss.webbeans.util.Names;
/**
@@ -83,6 +84,7 @@
this.eventType = observerMethod.getAnnotatedParameters(Observes.class).get(0).getBaseType();
this.bindings = new HashSet<Annotation>(Arrays.asList(observerMethod.getAnnotatedParameters(Observes.class).get(0).getBindingsAsArray()));
+ this.bindings.add(new AnyLiteral()); // Always add the Any annotation in case it is not there yet
Observes observesAnnotation = observerMethod.getAnnotatedParameters(Observes.class).get(0).getAnnotation(Observes.class);
this.notifyType = observesAnnotation.notifyObserver();
transactionPhase = TransactionPhase.IN_PROGRESS;
@@ -172,7 +174,7 @@
public TransactionPhase getTransactionPhase()
{
- return TransactionPhase.IN_PROGRESS;
+ return transactionPhase;
}
/**
Copied: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/DisobedientDog.java (from rev 3123, tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/transactionalObservers/DisobedientDog.java)
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/DisobedientDog.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/DisobedientDog.java 2009-07-22 14:31:32 UTC (rev 3135)
@@ -0,0 +1,6 @@
+package org.jboss.jsr299.tck.tests.event;
+
+class DisobedientDog
+{
+
+}
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/EventTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/EventTest.java 2009-07-22 14:01:07 UTC (rev 3134)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/EventTest.java 2009-07-22 14:31:32 UTC (rev 3135)
@@ -4,6 +4,8 @@
import java.util.ArrayList;
import java.util.Set;
+import javax.enterprise.event.Notify;
+import javax.enterprise.event.TransactionPhase;
import javax.enterprise.inject.AnnotationLiteral;
import javax.enterprise.inject.spi.BeanManager;
import javax.enterprise.inject.spi.ObserverMethod;
@@ -11,6 +13,8 @@
import org.hibernate.tck.annotations.SpecAssertion;
import org.hibernate.tck.annotations.SpecAssertions;
import org.jboss.jsr299.tck.AbstractJSR299Test;
+import org.jboss.jsr299.tck.literals.AnyLiteral;
+import org.jboss.jsr299.tck.literals.CurrentLiteral;
import org.jboss.testharness.impl.packaging.Artifact;
import org.jboss.testharness.impl.packaging.jsr299.BeansXml;
import org.testng.annotations.Test;
@@ -233,7 +237,7 @@
@SpecAssertion(section = "10.4.4", id = "a"),
@SpecAssertion(section = "5.6.8", id = "b")
} )
- public void testConditionalObserver() throws Exception
+ public void testConditionalObserver()
{
RecluseSpider.reset();
getCurrentManager().fireEvent(new ConditionalEvent());
@@ -241,21 +245,13 @@
assert !RecluseSpider.isNotified();
// Now instantiate the bean and fire another event
- new RunInDependentContext()
- {
- @Override
- protected void execute() throws Exception
- {
- RecluseSpider bean = getInstanceByType(RecluseSpider.class);
- assert bean != null;
- // Must invoke a method to really create the instance
- assert !bean.isInstanceNotified();
- getCurrentManager().fireEvent(new ConditionalEvent());
- assert RecluseSpider.isNotified() && bean.isInstanceNotified();
- }
+ RecluseSpider bean = getInstanceByType(RecluseSpider.class);
+ assert bean != null;
+ // Must invoke a method to really create the instance
+ assert !bean.isInstanceNotified();
+ getCurrentManager().fireEvent(new ConditionalEvent());
+ assert RecluseSpider.isNotified() && bean.isInstanceNotified();
- }.run();
-
RecluseSpider.reset();
}
@@ -272,19 +268,11 @@
@SpecAssertion(section = "10.5", id = "review"), // was b
@SpecAssertion(section = "10.5", id = "review") // was h
})
- public void testObserverMethodCalledImmediately() throws Exception
+ public void testObserverMethodCalledImmediately()
{
StaticObserver.reset();
- new RunInDependentContext()
- {
- @Override
- protected void execute() throws Exception
- {
- getCurrentManager().fireEvent(new Delivery());
- assert StaticObserver.isDeliveryReceived() && StaticObserver.getThreadObservingEvent().equals(Thread.currentThread());
- }
-
- }.run();
+ getCurrentManager().fireEvent(new Delivery());
+ assert StaticObserver.isDeliveryReceived() && StaticObserver.getThreadObservingEvent().equals(Thread.currentThread());
StaticObserver.reset();
}
@@ -297,7 +285,7 @@
@SpecAssertion(section = "10.4", id = "c"),
@SpecAssertion(section = "5.6.8", id = "a")
})
- public void testStaticObserverMethodInvoked() throws Exception
+ public void testStaticObserverMethodInvoked()
{
try
{
@@ -339,20 +327,11 @@
@Test(groups = { "events", "stub" })
@SpecAssertion(section = "10.5", id = "ca")
- public void testAsynchronousObserverThrowsExceptionIsLogged() throws Exception
+ public void testAsynchronousObserverThrowsExceptionIsLogged() throws InterruptedException
{
- new RunInDependentContext()
- {
-
- @Override
- protected void execute() throws Exception
- {
- getCurrentManager().fireEvent('a');
- Thread.sleep(200);
- //TODO How can we assert that the exception was logged?
- }
-
- }.run();
+ getCurrentManager().fireEvent('a');
+ Thread.sleep(200);
+ //TODO How can we assert that the exception was logged?
}
@Test(groups = { "events", "stub" })
@@ -364,18 +343,10 @@
@Test(groups = { "events" }, expectedExceptions = { IllegalArgumentException.class })
@SpecAssertion(section = "11.3.10", id = "d")
- public void testDuplicateBindingsToFireFails() throws Exception
+ public void testDuplicateBindingsToFireFails()
{
- new RunInDependentContext()
- {
- @Override
- protected void execute() throws Exception
- {
- SweeWaxbill bean = getInstanceByType(SweeWaxbill.class);
- bean.methodThatFiresEvent();
- }
-
- }.run();
+ SweeWaxbill bean = getInstanceByType(SweeWaxbill.class);
+ bean.methodThatFiresEvent();
}
@Test(groups = { "events" })
@@ -506,49 +477,102 @@
*/
@Test(groups = { "events", "inheritance" })
@SpecAssertion(section = "4.2", id = "dc")
- public void testNonStaticObserverMethodNotInherited() throws Exception
+ public void testNonStaticObserverMethodNotInherited()
{
- new RunInDependentContext()
- {
- @Override
- protected void execute() throws Exception
- {
- Egg egg = new Egg();
- Set<ObserverMethod<?, Egg>> observers = getCurrentManager().resolveObserverMethods(egg);
- assert observers.size() == 1;
+ Egg egg = new Egg();
+ Set<ObserverMethod<?, Egg>> observers = getCurrentManager().resolveObserverMethods(egg);
+ assert observers.size() == 1;
- // Notify the observer so we can confirm that it
- // is a method only on Farmer, and not LazyFarmer
- observers.iterator().next().notify(egg);
- assert egg.getClassesVisited().size() == 1;
- assert egg.getClassesVisited().iterator().next().equals(Farmer.class);
- }
-
- }.run();
+ // Notify the observer so we can confirm that it
+ // is a method only on Farmer, and not LazyFarmer
+ observers.iterator().next().notify(egg);
+ assert egg.getClassesVisited().size() == 1;
+ assert egg.getClassesVisited().iterator().next().equals(Farmer.class);
}
@Test(groups = { "events", "inheritance" })
- @SpecAssertion(section = "4.2", id = "di")
- public void testNonStaticObserverMethodNotIndirectlyInherited() throws Exception
+ @SpecAssertions({
+ @SpecAssertion(section = "4.2", id = "di"),
+ @SpecAssertion(section = "11.1.3", id = "f")
+ })
+ public void testNonStaticObserverMethodNotIndirectlyInherited()
{
- new RunInDependentContext()
- {
- @Override
- protected void execute() throws Exception
- {
- StockPrice price = new StockPrice();
- Set<ObserverMethod<?, StockPrice>> observers = getCurrentManager().resolveObserverMethods(price);
- assert observers.size() == 1;
+ StockPrice price = new StockPrice();
+ Set<ObserverMethod<?, StockPrice>> observers = getCurrentManager().resolveObserverMethods(price);
+ assert observers.size() == 1;
- // Notify the observer so we can confirm that it
- // is a method only on StockWatcher, and not IntermediateStockWatcher
- // or IndirectStockWatcher
- observers.iterator().next().notify(price);
- assert price.getClassesVisited().size() == 1;
- assert price.getClassesVisited().iterator().next().equals(StockWatcher.class);
- }
+ // Notify the observer so we can confirm that it
+ // is a method only on StockWatcher, and not IntermediateStockWatcher
+ // or IndirectStockWatcher
+ observers.iterator().next().notify(price);
+ assert price.getClassesVisited().size() == 1;
+ assert price.getClassesVisited().iterator().next().equals(StockWatcher.class);
+ }
- }.run();
+ @Test(groups = { "events" })
+ @SpecAssertion(section = "11.1.3", id = "b")
+ public void testGetBeanOnObserverMethod()
+ {
+ Set<ObserverMethod<?, StockPrice>> observers = getCurrentManager().resolveObserverMethods(new StockPrice());
+ assert observers.size() == 1;
+ ObserverMethod<?, StockPrice> observerMethod = observers.iterator().next();
+ assert observerMethod.getBean().getBeanClass().equals(StockWatcher.class);
}
+ @Test(groups = { "events" })
+ @SpecAssertion(section = "11.1.3", id = "c")
+ public void testGetObservedTypeOnObserverMethod()
+ {
+ Set<ObserverMethod<?, StockPrice>> observers = getCurrentManager().resolveObserverMethods(new StockPrice());
+ assert observers.size() == 1;
+ ObserverMethod<?, ?> observerMethod = observers.iterator().next();
+ assert observerMethod.getObservedType().equals(StockPrice.class);
+ }
+
+ @Test(groups = { "events" })
+ @SpecAssertion(section = "11.1.3", id = "c")
+ public void testGetObservedBindingsOnObserverMethod()
+ {
+ Set<ObserverMethod<?, StockPrice>> observers = getCurrentManager().resolveObserverMethods(new StockPrice());
+ assert observers.size() == 1;
+ ObserverMethod<?, ?> observerMethod = observers.iterator().next();
+ assert observerMethod.getObservedBindings().size() == 2;
+ assert observerMethod.getObservedBindings().contains(new CurrentLiteral());
+ assert observerMethod.getObservedBindings().contains(new AnyLiteral());
+ }
+
+ @Test(groups = { "events" })
+ @SpecAssertion(section = "11.1.3", id = "d")
+ public void testGetNotifyOnObserverMethod()
+ {
+ Set<ObserverMethod<?, StockPrice>> observers = getCurrentManager().resolveObserverMethods(new StockPrice());
+ assert observers.size() == 1;
+ assert observers.iterator().next().getNotify().equals(Notify.ALWAYS);
+
+ Set<ObserverMethod<?, ConditionalEvent>> conditionalObservers = getCurrentManager().resolveObserverMethods(new ConditionalEvent());
+ assert !conditionalObservers.isEmpty();
+ assert conditionalObservers.iterator().next().getNotify().equals(Notify.IF_EXISTS);
+ }
+
+ @Test(groups = { "events" })
+ @SpecAssertion(section = "11.1.3", id = "e")
+ public void testGetTransactionPhaseOnObserverMethod()
+ {
+ assert getCurrentManager().resolveObserverMethods(new StockPrice()).iterator().next().getTransactionPhase().equals(TransactionPhase.IN_PROGRESS);
+ assert getCurrentManager().resolveObserverMethods(new DisobedientDog()).iterator().next().getTransactionPhase().equals(TransactionPhase.BEFORE_COMPLETION);
+ assert getCurrentManager().resolveObserverMethods(new ShowDog()).iterator().next().getTransactionPhase().equals(TransactionPhase.AFTER_COMPLETION);
+ assert getCurrentManager().resolveObserverMethods(new SmallDog()).iterator().next().getTransactionPhase().equals(TransactionPhase.AFTER_FAILURE);
+ assert getCurrentManager().resolveObserverMethods(new LargeDog()).iterator().next().getTransactionPhase().equals(TransactionPhase.AFTER_SUCCESS);
+ }
+
+ @Test(groups = { "events" })
+ @SpecAssertion(section = "11.1.3", id = "g")
+ public void testInstanceOfBeanForEveryEnabledObserverMethod()
+ {
+ assert getCurrentManager().resolveObserverMethods(new StockPrice()).iterator().next().getTransactionPhase().equals(TransactionPhase.IN_PROGRESS);
+ assert getCurrentManager().resolveObserverMethods(new DisobedientDog()).iterator().next().getTransactionPhase().equals(TransactionPhase.BEFORE_COMPLETION);
+ assert getCurrentManager().resolveObserverMethods(new ShowDog()).iterator().next().getTransactionPhase().equals(TransactionPhase.AFTER_COMPLETION);
+ assert getCurrentManager().resolveObserverMethods(new SmallDog()).iterator().next().getTransactionPhase().equals(TransactionPhase.AFTER_FAILURE);
+ assert getCurrentManager().resolveObserverMethods(new LargeDog()).iterator().next().getTransactionPhase().equals(TransactionPhase.AFTER_SUCCESS);
+ }
}
Copied: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/LargeDog.java (from rev 3123, tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/transactionalObservers/LargeDog.java)
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/LargeDog.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/LargeDog.java 2009-07-22 14:31:32 UTC (rev 3135)
@@ -0,0 +1,6 @@
+package org.jboss.jsr299.tck.tests.event;
+
+public class LargeDog
+{
+
+}
Copied: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/ShowDog.java (from rev 3123, tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/transactionalObservers/ShowDog.java)
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/ShowDog.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/ShowDog.java 2009-07-22 14:31:32 UTC (rev 3135)
@@ -0,0 +1,6 @@
+package org.jboss.jsr299.tck.tests.event;
+
+public class ShowDog
+{
+
+}
Copied: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/SmallDog.java (from rev 3123, tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/transactionalObservers/SmallDog.java)
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/SmallDog.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/SmallDog.java 2009-07-22 14:31:32 UTC (rev 3135)
@@ -0,0 +1,6 @@
+package org.jboss.jsr299.tck.tests.event;
+
+public class SmallDog
+{
+
+}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/TransactionalObservers.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/TransactionalObservers.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/TransactionalObservers.java 2009-07-22 14:31:32 UTC (rev 3135)
@@ -0,0 +1,28 @@
+package org.jboss.jsr299.tck.tests.event;
+
+import static javax.enterprise.event.TransactionPhase.BEFORE_COMPLETION;
+import static javax.enterprise.event.TransactionPhase.AFTER_COMPLETION;
+import static javax.enterprise.event.TransactionPhase.AFTER_FAILURE;
+import static javax.enterprise.event.TransactionPhase.AFTER_SUCCESS;
+
+import javax.enterprise.event.Observes;
+
+public class TransactionalObservers
+{
+ public void train(@Observes(during=BEFORE_COMPLETION) DisobedientDog dog)
+ {
+ }
+
+ public void trainNewTricks(@Observes(during=AFTER_COMPLETION) ShowDog dog)
+ {
+ }
+
+ public void trainCompanion(@Observes(during=AFTER_FAILURE) SmallDog dog)
+ {
+ }
+
+ public void trainSightSeeing(@Observes(during=AFTER_SUCCESS) LargeDog dog)
+ {
+ }
+
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/TransactionalObservers.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: tck/trunk/impl/src/main/resources/tck-audit.xml
===================================================================
--- tck/trunk/impl/src/main/resources/tck-audit.xml 2009-07-22 14:01:07 UTC (rev 3134)
+++ tck/trunk/impl/src/main/resources/tck-audit.xml 2009-07-22 14:31:32 UTC (rev 3135)
@@ -3897,7 +3897,7 @@
</section>
<section id="11.1.3" title="The ObserverMethod interface">
- <assertion id="a">
+ <assertion id="a" testable="false">
<text>The interface |javax.enterprise.inject.spi.ObserverMethod| defines everything the container needs to know about an observer method.</text>
</assertion>
15 years, 4 months
[webbeans-commits] Webbeans SVN: r3134 - tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/remove.
by webbeans-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2009-07-22 10:01:07 -0400 (Wed, 22 Jul 2009)
New Revision: 3134
Modified:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/remove/EnterpriseBeanRemoveMethodTest.java
Log:
update class to current spec
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/remove/EnterpriseBeanRemoveMethodTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/remove/EnterpriseBeanRemoveMethodTest.java 2009-07-22 13:55:53 UTC (rev 3133)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/remove/EnterpriseBeanRemoveMethodTest.java 2009-07-22 14:01:07 UTC (rev 3134)
@@ -13,7 +13,7 @@
import org.testng.annotations.Test;
/**
- * Spec version: 20090519
+ * Spec version: 20090625
*
* @author Nicklas Karlsson
*/
@@ -24,7 +24,7 @@
{
@Test(groups = { "enterpriseBeans", "removeMethod", "lifecycle" })
- @SpecAssertion(section = "3.3.1", id = "a")
+ @SpecAssertion(section = "3.2.1", id = "a")
public void applicationMayCallAnyRemoveMethodOnDependentScopedSessionEnterpriseBeans() throws Exception
{
new RunInDependentContext()
@@ -44,7 +44,7 @@
}
@Test(groups = { "enterpriseBeans", "removeMethod", "lifecycle" })
- @SpecAssertion(section = "3.3.1", id = "da")
+ @SpecAssertion(section = "3.2.1", id = "da")
public void applicationMayCallRemoveMethodOnDependentScopedSessionEnterpriseBeansButNoParametersArePassed() throws Exception
{
new RunInDependentContext()
@@ -63,8 +63,8 @@
@Test(groups = { "enterpriseBeans", "removeMethod", "lifecycle" }, expectedExceptions = UnsupportedOperationException.class)
@SpecAssertions({
- @SpecAssertion(section = "3.3.1", id = "b"),
- @SpecAssertion(section = "3.3.1", id = "c")
+ @SpecAssertion(section = "3.2.1", id = "b"),
+ @SpecAssertion(section = "3.2.1", id = "c")
})
public void applicationCannotCallRemoveMethodOnNonDependentScopedSessionEnterpriseBean()
{
15 years, 4 months
[webbeans-commits] Webbeans SVN: r3133 - in tck/trunk/impl/src/main: java/org/jboss/jsr299/tck/tests/event/observer/checkedException and 7 other directories.
by webbeans-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2009-07-22 09:55:53 -0400 (Wed, 22 Jul 2009)
New Revision: 3133
Modified:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/EventTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/checkedException/CheckedExceptionWrappedTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/runtimeException/ObserverExceptionRethrownTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/field/lifecycle/ProducerFieldLifecycleTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/lifecycle/ProducerMethodLifecycleTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/lifecycle/SimpleBeanLifecycleTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/inheritance/specialization/enterprise/EnterpriseBeanSpecializationIntegrationTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/inheritance/specialization/simple/SimpleBeanSpecializationTest.java
tck/trunk/impl/src/main/resources/tck-audit.xml
Log:
MAtch observer exception tests, match specialization tests
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/EventTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/EventTest.java 2009-07-22 13:13:34 UTC (rev 3132)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/EventTest.java 2009-07-22 13:55:53 UTC (rev 3133)
@@ -4,7 +4,6 @@
import java.util.ArrayList;
import java.util.Set;
-import javax.enterprise.event.Observer;
import javax.enterprise.inject.AnnotationLiteral;
import javax.enterprise.inject.spi.BeanManager;
import javax.enterprise.inject.spi.ObserverMethod;
@@ -316,7 +315,8 @@
@Test(groups = { "events" })
@SpecAssertions({
- @SpecAssertion(section = "4.3.2", id = "a"),
+ @SpecAssertion(section = "4.3.2", id = "d"),
+ @SpecAssertion(section="4.3", id="cb"),
@SpecAssertion(section = "5.6.8", id = "ba")
})
public void testObserverCalledOnMostSpecializedInstance()
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/checkedException/CheckedExceptionWrappedTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/checkedException/CheckedExceptionWrappedTest.java 2009-07-22 13:13:34 UTC (rev 3132)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/checkedException/CheckedExceptionWrappedTest.java 2009-07-22 13:55:53 UTC (rev 3133)
@@ -35,7 +35,7 @@
public class CheckedExceptionWrappedTest extends AbstractJSR299Test
{
@Test(groups = { "events" }, expectedExceptions = { ObserverException.class })
- @SpecAssertion(section = "10.6.1", id = "review") // no longer described by spec
+ @SpecAssertion(section = "10.5", id = "cd")
public void testNonTransactionalObserverThrowsCheckedExceptionIsWrappedAndRethrown()
{
getCurrentManager().fireEvent(new Integer(1));
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/runtimeException/ObserverExceptionRethrownTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/runtimeException/ObserverExceptionRethrownTest.java 2009-07-22 13:13:34 UTC (rev 3132)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/runtimeException/ObserverExceptionRethrownTest.java 2009-07-22 13:55:53 UTC (rev 3133)
@@ -34,7 +34,7 @@
public class ObserverExceptionRethrownTest extends AbstractJSR299Test
{
@Test(groups = { "events" }, expectedExceptions = { TeaCupPomeranian.OversizedException.class })
- @SpecAssertion(section = "review", id = "review") // no longer described by spec?
+ @SpecAssertion(section = "10.5", id = "cc")
public void testNonTransactionalObserverThrowsNonCheckedExceptionIsRethrown()
{
getCurrentManager().fireEvent("string event");
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/field/lifecycle/ProducerFieldLifecycleTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/field/lifecycle/ProducerFieldLifecycleTest.java 2009-07-22 13:13:34 UTC (rev 3132)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/field/lifecycle/ProducerFieldLifecycleTest.java 2009-07-22 13:55:53 UTC (rev 3133)
@@ -57,7 +57,6 @@
@Test(groups = { "producerField" })
@SpecAssertions({
- @SpecAssertion(section = "4.3.2", id = "a"),
@SpecAssertion(section = "5.6.7", id = "b"),
@SpecAssertion(section = "7.3.5", id = "ga")
})
@@ -76,7 +75,8 @@
@Test(groups = { "producerField", "specialization" })
@SpecAssertions({
- @SpecAssertion(section = "4.3.2", id = "a")
+ @SpecAssertion(section = "4.3.2", id = "b"),
+ @SpecAssertion(section="4.3", id="cb")
})
public void testSpecializedBeanAlwaysUsed() throws Exception
{
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/lifecycle/ProducerMethodLifecycleTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/lifecycle/ProducerMethodLifecycleTest.java 2009-07-22 13:13:34 UTC (rev 3132)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/lifecycle/ProducerMethodLifecycleTest.java 2009-07-22 13:55:53 UTC (rev 3133)
@@ -73,7 +73,8 @@
@Test(groups = { "producerMethod" })
@SpecAssertions({
@SpecAssertion(section = "4.3.2", id = "a"),
- @SpecAssertion(section = "5.6.6", id = "c")
+ @SpecAssertion(section = "5.6.6", id = "c"),
+ @SpecAssertion(section="4.3", id="cb")
})
public void testProducerMethodFromMostSpecializedBeanUsed()
{
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/lifecycle/SimpleBeanLifecycleTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/lifecycle/SimpleBeanLifecycleTest.java 2009-07-22 13:13:34 UTC (rev 3132)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/lifecycle/SimpleBeanLifecycleTest.java 2009-07-22 13:55:53 UTC (rev 3133)
@@ -121,8 +121,7 @@
@Test(groups = {"beanLifecycle", "broken"})
@SpecAssertions({
@SpecAssertion(section="2", id="g"),
- @SpecAssertion(section="2.2.1", id="b"),
- @SpecAssertion(section = "7", id = "d")
+ @SpecAssertion(section="2.2.1", id="b")
})
public void testCreateReturnsInstanceOfBean()
{
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/inheritance/specialization/enterprise/EnterpriseBeanSpecializationIntegrationTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/inheritance/specialization/enterprise/EnterpriseBeanSpecializationIntegrationTest.java 2009-07-22 13:13:34 UTC (rev 3132)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/inheritance/specialization/enterprise/EnterpriseBeanSpecializationIntegrationTest.java 2009-07-22 13:55:53 UTC (rev 3133)
@@ -30,8 +30,7 @@
@Test
@SpecAssertions({
- @SpecAssertion(section = "3.2.4", id = "review"), // removed from spec?
- @SpecAssertion(section = "3.2.4", id = "review")
+ @SpecAssertion(section = "4.3", id = "ca")
})
public void testSpecializedBeanNotInstantiated() throws Exception
{
@@ -50,7 +49,10 @@
@Test
- @SpecAssertion(section="review", id = "review") // removed from spec?
+ @SpecAssertions({
+ @SpecAssertion(section="4.3.2", id = "a"),
+ @SpecAssertion(section="4.3.1", id ="cb")
+ })
public void testProducerMethodOnSpecializedBeanCalledOnSpecializingBean() throws Exception
{
new RunInDependentContext()
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/inheritance/specialization/simple/SimpleBeanSpecializationTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/inheritance/specialization/simple/SimpleBeanSpecializationTest.java 2009-07-22 13:13:34 UTC (rev 3132)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/inheritance/specialization/simple/SimpleBeanSpecializationTest.java 2009-07-22 13:55:53 UTC (rev 3133)
@@ -55,7 +55,8 @@
@Test
@SpecAssertions( {
- @SpecAssertion(section = "4.3.2", id = "a")
+ @SpecAssertion(section = "4.3.2", id = "a"),
+ @SpecAssertion(section="4.3", id="cb")
})
public void testProducerMethodOnSpecializedBeanCalledOnSpecializingBean()
{
Modified: tck/trunk/impl/src/main/resources/tck-audit.xml
===================================================================
--- tck/trunk/impl/src/main/resources/tck-audit.xml 2009-07-22 13:13:34 UTC (rev 3132)
+++ tck/trunk/impl/src/main/resources/tck-audit.xml 2009-07-22 13:55:53 UTC (rev 3133)
@@ -1582,8 +1582,12 @@
</assertion>
<assertion id="ca">
- <text>The only way one bean can completely override a lower-priority bean at all injection points is if it implements all the bean types and declares all the bindings of the lower-priority bean. However, if the lower-priority bean declares a producer method or observer method, then even this is not enough to ensure that the lower-priority bean is never called.</text>
+ <text>When an enabled bean specializes a second bean, we can be certain that the second bean is never instantiated or called by the container.</text>
</assertion>
+
+ <assertion id="cb">
+ <text>When an enabled bean specializes a second bean, we can be certain ~that the second bean is never instantiated or called by the container.~ Even if the second bean defines a producer or observer method, the method will be called upon an instance of the first bean. </text>
+ </assertion>
</section>
@@ -1615,8 +1619,20 @@
<section id="4.3.2" title="Most specialized enabled bean for a bean">
<assertion id="a">
- <text>Non-static producer methods, producer fields, disposal methods and observer methods of a bean are invoked upon an instance of the most specialized enabled bean that specializes the bean, as defined by Section 5.6.6, "Invocation of producer or disposal methods", Section 5.6.7, "Access to producer field values" and Section 5.6.8, "Invocation of observer methods".</text>
+ <text>Non-static producer methods, ~producer fields, disposal methods and observer methods~ of a bean are invoked upon an instance of the most specialized enabled bean that specializes the bean, as defined by Section 5.6.6, "Invocation of producer or disposal methods", Section 5.6.7, "Access to producer field values" and Section 5.6.8, "Invocation of observer methods".</text><assertion id="b">
+ <text>Non-static ~producer methods,~ producer fields~, disposal methods and observer methods~ of a bean are invoked upon an instance of the most specialized enabled bean that specializes the bean, as defined by Section 5.6.6, "Invocation of producer or disposal methods", Section 5.6.7, "Access to producer field values" and Section 5.6.8, "Invocation of observer methods".</text>
</assertion>
+ </assertion>
+
+
+
+ <assertion id="c">
+ <text>Non-static ~producer methods, producer fields,~ disposal methods~ and observer methods~ of a bean are invoked upon an instance of the most specialized enabled bean that specializes the bean, as defined by Section 5.6.6, "Invocation of producer or disposal methods", Section 5.6.7, "Access to producer field values" and Section 5.6.8, "Invocation of observer methods".</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>Non-static ~producer methods, producer fields, disposal methods and~ observer methods of a bean are invoked upon an instance of the most specialized enabled bean that specializes the bean, as defined by Section 5.6.6, "Invocation of producer or disposal methods", Section 5.6.7, "Access to producer field values" and Section 5.6.8, "Invocation of observer methods".</text>
+ </assertion>
</section>
@@ -3746,12 +3762,20 @@
</assertion>
<assertion id="ca">
- <text>Observers may throw exceptions. If an observer method is a transactional observer method, any exception is caught and logged by the container. ~Otherwise, the exception aborts processing of the event. No other observer methods of that event will be called. The |fireEvent()| method rethrows the exception. If the exception is a checked exception, it is wrapped and rethrown as an (unchecked) |ObserverException|.~</text>
+ <text>Observers may throw exceptions. If an observer method is a transactional observer method, any exception is caught and logged by the container.</text>
</assertion>
<assertion id="cb">
- <text>Observers may throw exceptions. If an observer method is a transactional observer method, ~any exception is caught and logged by the container.~ Otherwise, the exception aborts processing of the event. No other observer methods of that event will be called. The |fireEvent()| method rethrows the exception. If the exception is a checked exception, it is wrapped and rethrown as an (unchecked) |ObserverException|.</text>
+ <text>Observers may throw exceptions. If an observer method is a transactional observer method, ~any exception is caught and logged by the container.~ Otherwise, the exception aborts processing of the event.</text>
</assertion>
+
+ <assertion id="cc">
+ <text>Observers may throw exceptions. ~If an observer method is a transactional observer method, any exception is caught and logged by the container. Otherwise, the exception aborts processing of the event. No other observer methods of that event will be called.~ The |fireEvent()| method rethrows the exception. ~If the exception is a checked exception, it is wrapped and rethrown as an (unchecked) |ObserverException|~.</text>
+ </assertion>
+
+ <assertion id="cd">
+ <text>Observers may throw exceptions. ~If an observer method is a transactional observer method, any exception is caught and logged by the container. Otherwise, the exception aborts processing of the event. No other observer methods of that event will be called. The |fireEvent()| method rethrows the exception.~ If the exception is a checked exception, it is wrapped and rethrown as an (unchecked) |ObserverException|.</text>
+ </assertion>
<assertion id="f">
<text>For a custom implementation of the |ObserverMethod| interface defined in Section 11.1.3, "The ObserverMethod interface", the container must call |getNotify()| and |getTransactionPhase()| to determine is the observer method is a conditional or transactional observer method, and |notify()| to invoke the method.</text>
15 years, 4 months
[webbeans-commits] Webbeans SVN: r3132 - in tck/trunk/impl/src/main: java/org/jboss/jsr299/tck/tests/implementation/enterprise/broken and 5 other directories.
by webbeans-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2009-07-22 09:13:34 -0400 (Wed, 22 Jul 2009)
New Revision: 3132
Removed:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/broken/newAndOtherBinding/
Modified:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/broken10/UnserializableSimpleInjectedIntoPassivatingEnterpriseBeanTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/field/lifecycle/ProducerFieldLifecycleTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/definition/ProducerMethodDefinitionTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/lifecycle/SimpleBeanLifecycleTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/newSimpleBean/NewSimpleBeanTest.java
tck/trunk/impl/src/main/resources/tck-audit.xml
Log:
Removev uneeded tests, assign some
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/broken10/UnserializableSimpleInjectedIntoPassivatingEnterpriseBeanTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/broken10/UnserializableSimpleInjectedIntoPassivatingEnterpriseBeanTest.java 2009-07-22 13:01:46 UTC (rev 3131)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/broken10/UnserializableSimpleInjectedIntoPassivatingEnterpriseBeanTest.java 2009-07-22 13:13:34 UTC (rev 3132)
@@ -16,7 +16,7 @@
{
@Test(groups = { "contexts", "passivation"})
- @SpecAssertion(section = "8.4", id = "k")
+ @SpecAssertion(section = "6.6.4", id = "ba")
public void testSimpleDependentWebBeanWithNonSerializableImplementationInjectedIntoStatefulSessionBeanFails()
{
// WBRI-150
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/field/lifecycle/ProducerFieldLifecycleTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/field/lifecycle/ProducerFieldLifecycleTest.java 2009-07-22 13:01:46 UTC (rev 3131)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/field/lifecycle/ProducerFieldLifecycleTest.java 2009-07-22 13:13:34 UTC (rev 3132)
@@ -21,7 +21,7 @@
@Test(groups = { "producerField" })
@SpecAssertions({
- @SpecAssertion(section = "7.3.5", id = "review") // removed from spec
+ @SpecAssertion(section = "3.4", id = "aa") // removed from spec
})
public void testProducerFieldNotAnotherBean()
{
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/definition/ProducerMethodDefinitionTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/definition/ProducerMethodDefinitionTest.java 2009-07-22 13:01:46 UTC (rev 3131)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/definition/ProducerMethodDefinitionTest.java 2009-07-22 13:13:34 UTC (rev 3132)
@@ -34,7 +34,6 @@
@Test(groups = "producerMethod")
@SpecAssertions( {
@SpecAssertion(section = "3.3", id = "b"),
- @SpecAssertion(section = "7.3.4", id = "a"),
@SpecAssertion(section = "5.6.6", id = "a")
} )
public void testStaticMethod() throws Exception
@@ -170,17 +169,6 @@
@Test(groups = "producerMethod")
@SpecAssertions({
- @SpecAssertion(section = "review", id = "review"), // deployment types removed from spec
- @SpecAssertion(section = "review", id = "review")
- })
- public void testDeploymentType() throws Exception
- {
- assert getBeans(LadybirdSpider.class, TAME_LITERAL).size() == 1;
- Bean<LadybirdSpider> ladybirdSpider = getBeans(LadybirdSpider.class).iterator().next();
- }
-
- @Test(groups = "producerMethod")
- @SpecAssertions({
@SpecAssertion(section = "3.3.2", id = "bb"),
@SpecAssertion(section = "2.5.1", id = "b")
})
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/lifecycle/SimpleBeanLifecycleTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/lifecycle/SimpleBeanLifecycleTest.java 2009-07-22 13:01:46 UTC (rev 3131)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/lifecycle/SimpleBeanLifecycleTest.java 2009-07-22 13:13:34 UTC (rev 3132)
@@ -118,15 +118,15 @@
assert fishPond.postConstructCalled = true; // required by Managed Bean specification
}
- @Test(groups = "beanLifecycle")
+ @Test(groups = {"beanLifecycle", "broken"})
@SpecAssertions({
@SpecAssertion(section="2", id="g"),
@SpecAssertion(section="2.2.1", id="b"),
- @SpecAssertion(section="3.1.6", id="a"),
@SpecAssertion(section = "7", id = "d")
})
public void testCreateReturnsInstanceOfBean()
{
+ // TODO Test needs to use create()!!! PLM
assert getBeans(RedSnapper.class).size() == 1;
assert getInstanceByType(RedSnapper.class) instanceof RedSnapper;
}
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/newSimpleBean/NewSimpleBeanTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/newSimpleBean/NewSimpleBeanTest.java 2009-07-22 13:01:46 UTC (rev 3131)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/newSimpleBean/NewSimpleBeanTest.java 2009-07-22 13:13:34 UTC (rev 3132)
@@ -1,8 +1,6 @@
package org.jboss.jsr299.tck.tests.implementation.simple.newSimpleBean;
import java.lang.annotation.Annotation;
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Target;
import java.util.Set;
import javax.enterprise.context.Dependent;
@@ -163,19 +161,6 @@
}.run();
}
- @Test(groups = { "new" })
- @SpecAssertion(section = "review", id = "review")
- public void testNewAnnotationCannotBeExplicitlyDeclared()
- {
- // All we can really do is make sure the annotation itself
- // prevents the compiler from violating the assertion
- Target target = New.class.getAnnotation(Target.class);
- for (ElementType elementType : target.value())
- {
- assert !elementType.equals(ElementType.TYPE);
- }
- }
-
@Test
@SpecAssertion(section = "3.10", id = "d")
public void testForEachSimpleBeanANewBeanExists()
Modified: tck/trunk/impl/src/main/resources/tck-audit.xml
===================================================================
--- tck/trunk/impl/src/main/resources/tck-audit.xml 2009-07-22 13:01:46 UTC (rev 3131)
+++ tck/trunk/impl/src/main/resources/tck-audit.xml 2009-07-22 13:13:34 UTC (rev 3132)
@@ -998,9 +998,15 @@
</section>
<section id="3.4" title="Producer fields">
- <assertion id="a">
- <text>A producer field must be a field of a managed bean class or session bean class</text>
+ <assertion id="aa">
+ <text>A producer field must be a field of a managed bean class ~or session bean class~</text>
+ <note>Just test that a producer field on these works</note>
</assertion>
+
+ <assertion id="ab">
+ <text>A producer field must be a field of a ~managed bean class or~ session bean class</text>
+ <note>Just test that a producer field on these works</note>
+ </assertion>
<assertion id="b">
<text>A producer field may be static.</text>
15 years, 4 months
[webbeans-commits] Webbeans SVN: r3131 - in tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup: injectionpoint and 5 other directories.
by webbeans-commits@lists.jboss.org
Author: jharting
Date: 2009-07-22 09:01:46 -0400 (Wed, 22 Jul 2009)
New Revision: 3131
Added:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/broken/type/
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/broken/type/variable/
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/broken/type/variable/Animal.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/broken/type/variable/Farm.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/broken/type/variable/Sheep.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/broken/type/variable/TypeVariableInjectionPointTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/parameterized/InjectedBean.java
Modified:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dynamic/builtin/BuiltinInstanceTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injectionpoint/InjectionPointTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/broken/primitive/PrimitiveInjectionPointTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/parameterized/AssignabilityOfRawAndParameterizedTypesTest.java
Log:
Added tests for 5.3.2 b, c plus minor changes
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dynamic/builtin/BuiltinInstanceTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dynamic/builtin/BuiltinInstanceTest.java 2009-07-22 12:58:06 UTC (rev 3130)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dynamic/builtin/BuiltinInstanceTest.java 2009-07-22 13:01:46 UTC (rev 3131)
@@ -22,6 +22,7 @@
import javax.enterprise.inject.spi.Bean;
import org.hibernate.tck.annotations.SpecAssertion;
+import org.hibernate.tck.annotations.SpecAssertions;
import org.jboss.jsr299.tck.AbstractJSR299Test;
import org.jboss.testharness.impl.packaging.Artifact;
import org.testng.annotations.Test;
@@ -50,7 +51,9 @@
}
@Test
- @SpecAssertion(section = "5.7.2", id = "a")
+ @SpecAssertions({
+ @SpecAssertion(section = "5.7.2", id = "a"),
+ @SpecAssertion(section = "5.7.2", id = "f")})
public void testInstanceProvidedForEveryLegalBeanType() {
Farm farm = getInstanceByType(Farm.class);
assert farm.getAnimal() != null;
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injectionpoint/InjectionPointTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injectionpoint/InjectionPointTest.java 2009-07-22 12:58:06 UTC (rev 3130)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injectionpoint/InjectionPointTest.java 2009-07-22 13:01:46 UTC (rev 3131)
@@ -318,6 +318,8 @@
@Test(groups = { "ri-broken", "resolution" })
@SpecAssertion(section = "5.3", id = "h")
public void testDecoratorNotResolved() {
- assert getInstanceByType(Cat.class) != null;
+ Cat cat = getInstanceByType(Cat.class);
+ assert cat != null;
+ assert cat.getClass().equals(Cat.class);
}
}
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/broken/primitive/PrimitiveInjectionPointTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/broken/primitive/PrimitiveInjectionPointTest.java 2009-07-22 12:58:06 UTC (rev 3130)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/broken/primitive/PrimitiveInjectionPointTest.java 2009-07-22 13:01:46 UTC (rev 3131)
@@ -31,7 +31,7 @@
@ExpectedDeploymentException(DeploymentError.class)
public class PrimitiveInjectionPointTest
{
- @Test(groups={"resolution, producerMethod", "ri-broken"})
+ @Test(groups={"resolution", "producerMethod", "ri-broken"})
@SpecAssertion(section="5.3.4", id="aa")
public void testPrimitiveInjectionPointResolvedToNonPrimitiveProducerMethod() {
assert false;
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/broken/type/variable/Animal.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/broken/type/variable/Animal.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/broken/type/variable/Animal.java 2009-07-22 13:01:46 UTC (rev 3131)
@@ -0,0 +1,6 @@
+package org.jboss.jsr299.tck.tests.lookup.typesafe.resolution.broken.type.variable;
+
+interface Animal
+{
+
+}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/broken/type/variable/Farm.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/broken/type/variable/Farm.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/broken/type/variable/Farm.java 2009-07-22 13:01:46 UTC (rev 3131)
@@ -0,0 +1,9 @@
+package org.jboss.jsr299.tck.tests.lookup.typesafe.resolution.broken.type.variable;
+
+import javax.enterprise.inject.Current;
+
+@SuppressWarnings("unused")
+class Farm<T extends Animal>
+{
+ @Current private T animal;
+}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/broken/type/variable/Sheep.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/broken/type/variable/Sheep.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/broken/type/variable/Sheep.java 2009-07-22 13:01:46 UTC (rev 3131)
@@ -0,0 +1,6 @@
+package org.jboss.jsr299.tck.tests.lookup.typesafe.resolution.broken.type.variable;
+
+class Sheep implements Animal
+{
+
+}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/broken/type/variable/TypeVariableInjectionPointTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/broken/type/variable/TypeVariableInjectionPointTest.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/broken/type/variable/TypeVariableInjectionPointTest.java 2009-07-22 13:01:46 UTC (rev 3131)
@@ -0,0 +1,39 @@
+/*
+ * 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.jsr299.tck.tests.lookup.typesafe.resolution.broken.type.variable;
+
+import org.hibernate.tck.annotations.SpecAssertion;
+import org.jboss.jsr299.tck.DefinitionError;
+import org.jboss.testharness.impl.packaging.Artifact;
+import org.jboss.testharness.impl.packaging.ExpectedDeploymentException;
+import org.testng.annotations.Test;
+
+/**
+ *
+ * Spec version: 20090625
+ *
+ */
+@Artifact
+(a)ExpectedDeploymentException(DefinitionError.class)
+public class TypeVariableInjectionPointTest
+{
+ @Test(groups={"resolution", "ri-broken"})
+ @SpecAssertion(section="5.3.2", id="c")
+ public void testTypeVariableInjectionPoint() {
+ assert false;
+ }
+}
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/parameterized/AssignabilityOfRawAndParameterizedTypesTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/parameterized/AssignabilityOfRawAndParameterizedTypesTest.java 2009-07-22 12:58:06 UTC (rev 3130)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/parameterized/AssignabilityOfRawAndParameterizedTypesTest.java 2009-07-22 13:01:46 UTC (rev 3131)
@@ -21,6 +21,7 @@
import javax.enterprise.inject.TypeLiteral;
import org.hibernate.tck.annotations.SpecAssertion;
+import org.hibernate.tck.annotations.SpecAssertions;
import org.jboss.jsr299.tck.AbstractJSR299Test;
import org.jboss.testharness.impl.packaging.Artifact;
import org.testng.annotations.Test;
@@ -39,7 +40,7 @@
assert getBeans(Dao.class).size() == 2; // Dao and ObjectDao
}
- @Test(groups="resolution")
+ @Test(groups= {"resolution", "ri-broken"})
@SpecAssertion(section = "5.3.3", id = "b")
public void testAssignabilityOfParameterizedTypeWithActualTypesToParameterizedTypeWithActualTypes()
{
@@ -49,12 +50,12 @@
}
@Test(groups = { "resolution", "ri-broken" })
- @SpecAssertion(section = "5.3.3", id = "c")
+ @SpecAssertions({
+ @SpecAssertion(section = "5.3.2", id = "b"),
+ @SpecAssertion(section = "5.3.3", id = "c")})
public void testAssignabilityOfParameterizedTypeWithActualTypesToParameterizedTypeWithWildcards()
{
- assert getBeans(new TypeLiteral<HashMap<? extends Number, ? super Integer>>(){}).size() == 1;
- assert getBeans(new TypeLiteral<HashMap<? extends Number, ? super Integer>>(){}
- ).iterator().next().getTypes().contains(IntegerHashMap.class);
+ assert getInstanceByType(InjectedBean.class).getMap() instanceof IntegerHashMap;
}
@Test(groups = { "resolution", "ri-broken" })
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/parameterized/InjectedBean.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/parameterized/InjectedBean.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/parameterized/InjectedBean.java 2009-07-22 13:01:46 UTC (rev 3131)
@@ -0,0 +1,16 @@
+package org.jboss.jsr299.tck.tests.lookup.typesafe.resolution.parameterized;
+
+import java.util.HashMap;
+
+import javax.enterprise.inject.Current;
+
+class InjectedBean
+{
+ @Current
+ private HashMap<? extends Number, ? super Integer> map;
+
+ public HashMap<? extends Number, ? super Integer> getMap()
+ {
+ return map;
+ }
+}
15 years, 4 months
[webbeans-commits] Webbeans SVN: r3130 - in tck/trunk/impl/src/main: java/org/jboss/jsr299/tck/tests/context/passivating/broken2 and 1 other directories.
by webbeans-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2009-07-22 08:58:06 -0400 (Wed, 22 Jul 2009)
New Revision: 3130
Removed:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/integration/
Modified:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/broken2/NonSerializableTest.java
tck/trunk/impl/src/main/resources/tck-audit.xml
Log:
Remove stub, assign test, update audit
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/broken2/NonSerializableTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/broken2/NonSerializableTest.java 2009-07-22 12:50:09 UTC (rev 3129)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/broken2/NonSerializableTest.java 2009-07-22 12:58:06 UTC (rev 3130)
@@ -20,7 +20,7 @@
public class NonSerializableTest extends AbstractJSR299Test
{
@Test(groups = { "contexts", "passivation" })
- @SpecAssertion(section = "8.4", id = "b")
+ @SpecAssertion(section = "6.6.4", id = "aaa")
public void testSimpleWebBeanWithNonSerializableImplementationClassFails()
{
assert false;
Modified: tck/trunk/impl/src/main/resources/tck-audit.xml
===================================================================
--- tck/trunk/impl/src/main/resources/tck-audit.xml 2009-07-22 12:50:09 UTC (rev 3129)
+++ tck/trunk/impl/src/main/resources/tck-audit.xml 2009-07-22 12:58:06 UTC (rev 3130)
@@ -2561,6 +2561,7 @@
<section id="6.6.4" title="Validation of passivation capable beans and dependencies">
<assertion id="aaa">
<text>If a managed bean which declares a passivating scope is not passivation capable, then the container automatically detects the problem and treats it as a deployment problem, as defined in Section 12.4, "Problems detected automatically by the container".</text>
+ <note>Here we check the class, as interceptors and decorators are tested below</note>
</assertion>
<assertion id="aab">
15 years, 4 months
[webbeans-commits] Webbeans SVN: r3129 - examples/trunk/se/numberguess/src/main/java/org/jboss/webbeans/environment/se/example/numberguess and 6 other directories.
by webbeans-commits@lists.jboss.org
Author: peteroyle
Date: 2009-07-22 08:50:09 -0400 (Wed, 22 Jul 2009)
New Revision: 3129
Added:
extensions/trunk/se/src/main/java/org/jboss/webbeans/environment/se/discovery/SEBeanDeploymentArchive.java
extensions/trunk/se/src/main/java/org/jboss/webbeans/environment/se/discovery/SEWebBeansDeployment.java
Modified:
examples/trunk/se/hello-world/src/main/java/org/jboss/webbeans/environment/se/example/simple/HelloWorld.java
examples/trunk/se/numberguess/src/main/java/org/jboss/webbeans/environment/se/example/numberguess/NumberGuessFrame.java
extensions/trunk/se/pom.xml
extensions/trunk/se/src/main/java/org/jboss/webbeans/environment/se/StartMain.java
extensions/trunk/se/src/main/java/org/jboss/webbeans/environment/se/util/WebBeansManagerUtils.java
ri/trunk/spi/src/main/java/org/jboss/webbeans/bootstrap/spi/BeanDeploymentArchive.java
ri/trunk/spi/src/main/java/org/jboss/webbeans/bootstrap/spi/Deployment.java
ri/trunk/version-matrix/pom.xml
Log:
- Introduced Deployment service by wrapping the existing SEWebBeanDiscovery class. - Update getInstanceByType utility method to include the required CreationalContext. - Add the jta runtime dependency (needs addressing) - Set webbeans-se version to 1.0.0-SNAPSHOT in version matrix
Modified: examples/trunk/se/hello-world/src/main/java/org/jboss/webbeans/environment/se/example/simple/HelloWorld.java
===================================================================
--- examples/trunk/se/hello-world/src/main/java/org/jboss/webbeans/environment/se/example/simple/HelloWorld.java 2009-07-22 12:49:54 UTC (rev 3128)
+++ examples/trunk/se/hello-world/src/main/java/org/jboss/webbeans/environment/se/example/simple/HelloWorld.java 2009-07-22 12:50:09 UTC (rev 3129)
@@ -16,9 +16,9 @@
*/
package org.jboss.webbeans.environment.se.example.simple;
+import javax.enterprise.event.Observes;
import javax.enterprise.inject.Current;
import javax.enterprise.inject.spi.AfterDeploymentValidation;
-import javax.event.Observes;
/**
* @author Peter Royle
Modified: examples/trunk/se/numberguess/src/main/java/org/jboss/webbeans/environment/se/example/numberguess/NumberGuessFrame.java
===================================================================
--- examples/trunk/se/numberguess/src/main/java/org/jboss/webbeans/environment/se/example/numberguess/NumberGuessFrame.java 2009-07-22 12:49:54 UTC (rev 3128)
+++ examples/trunk/se/numberguess/src/main/java/org/jboss/webbeans/environment/se/example/numberguess/NumberGuessFrame.java 2009-07-22 12:50:09 UTC (rev 3129)
@@ -18,9 +18,9 @@
import java.awt.CardLayout;
+import javax.enterprise.event.Observes;
import javax.enterprise.inject.Current;
import javax.enterprise.inject.spi.AfterDeploymentValidation;
-import javax.event.Observes;
/**
* Swing-based number guess example, main application frame.
Modified: extensions/trunk/se/pom.xml
===================================================================
--- extensions/trunk/se/pom.xml 2009-07-22 12:49:54 UTC (rev 3128)
+++ extensions/trunk/se/pom.xml 2009-07-22 12:50:09 UTC (rev 3129)
@@ -8,7 +8,6 @@
<modelVersion>4.0.0</modelVersion>
<groupId>org.jboss.webbeans</groupId>
<artifactId>webbeans-se</artifactId>
- <version>1.0.0-SNAPSHOT</version>
<packaging>jar</packaging>
<name>Web Beans SE Module</name>
<url>http://maven.apache.org</url>
@@ -65,15 +64,18 @@
<dependency>
<groupId>org.jboss.webbeans</groupId>
<artifactId>webbeans-core</artifactId>
- <version>1.0.0-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
+ <dependency>
+ <groupId>javax.transaction</groupId>
+ <artifactId>jta</artifactId>
+ </dependency>
</dependencies>
-
+
<scm>
<connection>scm:svn:http://anonsvn.jboss.org/repos/webbeans/extensions</connection>
<developerConnection>scm:svn:https://svn.jboss.org/repos/webbeans/extensions</developerConnection>
<url>http://fisheye.jboss.org/browse/WebBeans/extensions</url>
</scm>
+</project>
-</project>
Modified: extensions/trunk/se/src/main/java/org/jboss/webbeans/environment/se/StartMain.java
===================================================================
--- extensions/trunk/se/src/main/java/org/jboss/webbeans/environment/se/StartMain.java 2009-07-22 12:49:54 UTC (rev 3128)
+++ extensions/trunk/se/src/main/java/org/jboss/webbeans/environment/se/StartMain.java 2009-07-22 12:50:09 UTC (rev 3129)
@@ -20,10 +20,10 @@
import org.jboss.webbeans.bootstrap.api.Bootstrap;
import org.jboss.webbeans.bootstrap.api.Environments;
-import org.jboss.webbeans.bootstrap.spi.WebBeanDiscovery;
+import org.jboss.webbeans.bootstrap.spi.Deployment;
import org.jboss.webbeans.context.api.BeanStore;
import org.jboss.webbeans.context.api.helpers.ConcurrentHashMapBeanStore;
-import org.jboss.webbeans.environment.se.discovery.SEWebBeanDiscovery;
+import org.jboss.webbeans.environment.se.discovery.SEWebBeansDeployment;
import org.jboss.webbeans.environment.se.util.Reflections;
import org.jboss.webbeans.environment.se.util.WebBeansManagerUtils;
import org.jboss.webbeans.manager.api.WebBeansManager;
@@ -60,7 +60,7 @@
public BeanManager go()
{
bootstrap.setEnvironment(Environments.SE);
- bootstrap.getServices().add(WebBeanDiscovery.class, new SEWebBeanDiscovery() {});
+ bootstrap.getServices().add(Deployment.class, new SEWebBeansDeployment() {});
bootstrap.setApplicationContext(applicationBeanStore);
bootstrap.initialize();
this.manager = bootstrap.getManager();
Added: extensions/trunk/se/src/main/java/org/jboss/webbeans/environment/se/discovery/SEBeanDeploymentArchive.java
===================================================================
--- extensions/trunk/se/src/main/java/org/jboss/webbeans/environment/se/discovery/SEBeanDeploymentArchive.java (rev 0)
+++ extensions/trunk/se/src/main/java/org/jboss/webbeans/environment/se/discovery/SEBeanDeploymentArchive.java 2009-07-22 12:50:09 UTC (rev 3129)
@@ -0,0 +1,75 @@
+/*
+ * 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.environment.se.discovery;
+
+import java.net.URL;
+import java.util.Collections;
+import java.util.List;
+import org.jboss.webbeans.bootstrap.spi.BeanDeploymentArchive;
+import org.jboss.webbeans.ejb.spi.EjbDescriptor;
+
+/**
+ * A Java SE implementation of BeanDeploymentArchive. It is essentially an
+ * adaptor from the SEWebBeanDiscovery to the BeanDeploymentArchive interface.
+ * It returns, in a single logical archive, all Bean classes and beans.xml
+ * descriptors. It always returns an empty collection of EJBs.
+ *
+ * @author Peter Royle
+ */
+public class SEBeanDeploymentArchive implements BeanDeploymentArchive
+{
+ private final SEWebBeanDiscovery wbDiscovery;
+
+ public SEBeanDeploymentArchive()
+ {
+ wbDiscovery = new SEWebBeanDiscovery() {};
+ }
+
+ /**
+ * @return a collection of all Bean classes on the classpath.
+ */
+ public Iterable<Class<?>> getBeanClasses()
+ {
+ return wbDiscovery.getWbClasses();
+ }
+
+ /**
+ * @return an empty collection, since this instance is the only logical
+ * archive for the current SE classloader.
+ */
+ public List<BeanDeploymentArchive> getBeanDeploymentArchives()
+ {
+ return Collections.EMPTY_LIST;
+ }
+
+ /**
+ * @return all beans.xml decriptors found on the classpath.
+ */
+ public Iterable<URL> getBeansXml()
+ {
+ return wbDiscovery.discoverWebBeansXml();
+ }
+
+ /**
+ * @return an empty collection since there are no EJBs in Java SE.
+ */
+ public Iterable<EjbDescriptor<?>> getEjbs()
+ {
+ return Collections.EMPTY_SET;
+ }
+
+}
Added: extensions/trunk/se/src/main/java/org/jboss/webbeans/environment/se/discovery/SEWebBeansDeployment.java
===================================================================
--- extensions/trunk/se/src/main/java/org/jboss/webbeans/environment/se/discovery/SEWebBeansDeployment.java (rev 0)
+++ extensions/trunk/se/src/main/java/org/jboss/webbeans/environment/se/discovery/SEWebBeansDeployment.java 2009-07-22 12:50:09 UTC (rev 3129)
@@ -0,0 +1,62 @@
+/**
+ * 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.environment.se.discovery;
+
+import java.util.ArrayList;
+import java.util.List;
+import org.jboss.webbeans.bootstrap.spi.BeanDeploymentArchive;
+import org.jboss.webbeans.bootstrap.spi.Deployment;
+
+/**
+ * WebBeans Deployment for Java SE environment.
+ *
+ * @author Peter Royle
+ */
+public abstract class SEWebBeansDeployment implements Deployment
+{
+ private final BeanDeploymentArchive beanDeploymentArchive;
+ private final List<BeanDeploymentArchive> archInCollection;
+
+ public SEWebBeansDeployment()
+ {
+ this.beanDeploymentArchive = new SEBeanDeploymentArchive();
+ this.archInCollection = new ArrayList<BeanDeploymentArchive>(1);
+ this.archInCollection.add(this.beanDeploymentArchive);
+ }
+
+
+ /**
+ * {@inheritDoc}
+ * @return A collection containing the singular logical BeanDeploymentArchive
+ * consisting of all Bean classes and beans.xml descriptos in the current
+ * classpath.
+ */
+ public List<BeanDeploymentArchive> getBeanDeploymentArchives()
+ {
+ return this.archInCollection;
+ }
+
+ /**
+ * {@inheritDoc}
+ * @return The singular logical BeanDeploymentArchive consisting of all
+ * which contains all Beans classes.
+ */
+ public BeanDeploymentArchive loadBeanDeploymentArchive(Class<?> beanClass)
+ {
+ return this.beanDeploymentArchive;
+ }
+}
Modified: extensions/trunk/se/src/main/java/org/jboss/webbeans/environment/se/util/WebBeansManagerUtils.java
===================================================================
--- extensions/trunk/se/src/main/java/org/jboss/webbeans/environment/se/util/WebBeansManagerUtils.java 2009-07-22 12:49:54 UTC (rev 3128)
+++ extensions/trunk/se/src/main/java/org/jboss/webbeans/environment/se/util/WebBeansManagerUtils.java 2009-07-22 12:50:09 UTC (rev 3129)
@@ -17,6 +17,8 @@
package org.jboss.webbeans.environment.se.util;
import java.lang.annotation.Annotation;
+import javax.enterprise.context.spi.CreationalContext;
+import javax.enterprise.inject.spi.Bean;
import javax.enterprise.inject.spi.BeanManager;
/**
@@ -26,7 +28,13 @@
public class WebBeansManagerUtils {
public static <T> T getInstanceByType(BeanManager manager, Class<T> type, Annotation... bindings) {
+ final Bean<?> bean = manager.getBeans(type).iterator().next();
+ CreationalContext cc = manager.createCreationalContext(bean);
+ return (T)manager.getReference(bean, type, cc);
+ }
+
+ public static <T> T getInstanceByType(BeanManager manager, Class<T> type, CreationalContext cc, Annotation... bindings) {
return (T)manager.getReference(
- manager.getBeans(type).iterator().next(), type, null);
+ manager.getBeans(type).iterator().next(), type, cc);
}
}
Modified: ri/trunk/spi/src/main/java/org/jboss/webbeans/bootstrap/spi/BeanDeploymentArchive.java
===================================================================
--- ri/trunk/spi/src/main/java/org/jboss/webbeans/bootstrap/spi/BeanDeploymentArchive.java 2009-07-22 12:49:54 UTC (rev 3128)
+++ ri/trunk/spi/src/main/java/org/jboss/webbeans/bootstrap/spi/BeanDeploymentArchive.java 2009-07-22 12:50:09 UTC (rev 3129)
@@ -49,7 +49,7 @@
/**
* Get the ordered bean deployment archives which are accessible to this bean
- * deployment archive and adjacent to it i n the deployment archive graph.
+ * deployment archive and adjacent to it in the deployment archive graph.
*
* The bean deployment archives will be processed in the order specified.
*
Modified: ri/trunk/spi/src/main/java/org/jboss/webbeans/bootstrap/spi/Deployment.java
===================================================================
--- ri/trunk/spi/src/main/java/org/jboss/webbeans/bootstrap/spi/Deployment.java 2009-07-22 12:49:54 UTC (rev 3128)
+++ ri/trunk/spi/src/main/java/org/jboss/webbeans/bootstrap/spi/Deployment.java 2009-07-22 12:50:09 UTC (rev 3129)
@@ -42,6 +42,10 @@
* bean deployment archive structure built.
*
* TODO Java SE structure
+ * For an application deployed in the SE environment, all library jars and
+ * classpath directories should be searched, and the bean deployment archive
+ * structure built. A single, logical deployment archive will be built for
+ * all beans and beans.xml files found on the classpath.
*
* @see BeanDeploymentArchive
*
Modified: ri/trunk/version-matrix/pom.xml
===================================================================
--- ri/trunk/version-matrix/pom.xml 2009-07-22 12:49:54 UTC (rev 3128)
+++ ri/trunk/version-matrix/pom.xml 2009-07-22 12:50:09 UTC (rev 3129)
@@ -50,7 +50,7 @@
<jsr299.tck.version>1.0.0-SNAPSHOT</jsr299.tck.version>
<webbeans.version>1.0.0-SNAPSHOT</webbeans.version>
<webbeans.servlet.version>1.0.0.CR1</webbeans.servlet.version>
- <webbeans.se.version>1.0.0.BETA1</webbeans.se.version>
+ <webbeans.se.version>1.0.0-SNAPSHOT</webbeans.se.version>
<jboss.test.harness.version>1.0.0-SNAPSHOT</jboss.test.harness.version>
</properties>
15 years, 4 months