Author: dallen6
Date: 2010-04-20 12:11:40 -0400 (Tue, 20 Apr 2010)
New Revision: 6125
Added:
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/application/ApplicationResource.java
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/application/JaxrsApplication.java
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/beanManager/AfterBeanDiscoveryObserver.java
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/beanManager/CowBean.java
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/beanManager/PassivationIdTest.java
cdi-tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/extensions/beanManager/
cdi-tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/extensions/beanManager/javax.enterprise.inject.spi.Extension
Modified:
cdi-tck/trunk/doc/reference/en-US/Book_Preface.xml
cdi-tck/trunk/doc/reference/en-US/appeals-process.xml
cdi-tck/trunk/doc/reference/en-US/introduction.xml
cdi-tck/trunk/impl/pom.xml
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/application/ApplicationContextTest.java
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/dependent/DependentContextTest.java
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/broken/decoratorWithNonPassivatingBeanConstructor/CityDecorator.java
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/broken/decoratorWithNonPassivatingBeanConstructor/UnderwaterCity.java
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/broken/decoratorWithNonPassivatingInitializerMethod/UnderwaterCity.java
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/broken/decoratorWithNonPassivatingInjectedField/UnderwaterCity.java
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/beanManager/BeanManagerTest.java
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/beanManager/Cow.java
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/lifecycle/SimpleBeanLifecycleTest.java
cdi-tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/context/application/web.xml
cdi-tck/trunk/pom.xml
Log:
CDITCK-120 CDITCK-143 CDITCK-134 CDITCK-121 CDITCK-119
Modified: cdi-tck/trunk/doc/reference/en-US/Book_Preface.xml
===================================================================
--- cdi-tck/trunk/doc/reference/en-US/Book_Preface.xml 2010-04-20 15:17:25 UTC (rev 6124)
+++ cdi-tck/trunk/doc/reference/en-US/Book_Preface.xml 2010-04-20 16:11:40 UTC (rev 6125)
@@ -12,8 +12,8 @@
<para>
The CDI TCK is built atop the JBoss Test Harness, a portable and
configurable automated test suite for authoring unit and integration tests
- in a Java EE environment. The CDI TCK 1.0.0 uses the JBoss Test Harness
- version 1.0.0 to execute the test suite.
+ in a Java EE environment. The CDI TCK 1.0.2CR1 uses the JBoss Test Harness
+ version 1.1.0CR6 to execute the test suite.
</para>
<para>
Modified: cdi-tck/trunk/doc/reference/en-US/appeals-process.xml
===================================================================
--- cdi-tck/trunk/doc/reference/en-US/appeals-process.xml 2010-04-20 15:17:25 UTC (rev
6124)
+++ cdi-tck/trunk/doc/reference/en-US/appeals-process.xml 2010-04-20 16:11:40 UTC (rev
6125)
@@ -80,7 +80,7 @@
Project Lead, as designated by Specification Lead, Red Hat Middleware
LLC. or his/her designate. The appellant can also monitor the process
by following the issue report filed in the <ulink
-
url="https://jira.jboss.org/jira/browse/WBTCK">WBTCK
project</ulink>
+
url="https://jira.jboss.org/jira/browse/CDITCK">CDITCK
project</ulink>
of the JBoss JIRA.
</para>
<para>
Modified: cdi-tck/trunk/doc/reference/en-US/introduction.xml
===================================================================
--- cdi-tck/trunk/doc/reference/en-US/introduction.xml 2010-04-20 15:17:25 UTC (rev 6124)
+++ cdi-tck/trunk/doc/reference/en-US/introduction.xml 2010-04-20 16:11:40 UTC (rev 6125)
@@ -235,7 +235,7 @@
</listitem>
<listitem>
<para>
- <emphasis role="bold">TestNG 5.9</emphasis>, the
testing
+ <emphasis role="bold">TestNG 5.10</emphasis>, the
testing
framework on which the JBoss Test Harness is based and which
provides the extension points for selecting an executing the
tests in the test suite.
Modified: cdi-tck/trunk/impl/pom.xml
===================================================================
--- cdi-tck/trunk/impl/pom.xml 2010-04-20 15:17:25 UTC (rev 6124)
+++ cdi-tck/trunk/impl/pom.xml 2010-04-20 16:11:40 UTC (rev 6125)
@@ -109,6 +109,11 @@
<groupId>net.sourceforge.htmlunit</groupId>
<artifactId>htmlunit</artifactId>
</dependency>
+
+ <dependency>
+ <groupId>org.jboss.resteasy</groupId>
+ <artifactId>jaxrs-api</artifactId>
+ </dependency>
</dependencies>
Modified:
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/application/ApplicationContextTest.java
===================================================================
---
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/application/ApplicationContextTest.java 2010-04-20
15:17:25 UTC (rev 6124)
+++
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/application/ApplicationContextTest.java 2010-04-20
16:11:40 UTC (rev 6125)
@@ -102,4 +102,22 @@
assert Double.parseDouble(secondRequestResult.getContent()) ==
Double.parseDouble(firstRequestResult.getContent());
}
+ @Test(groups = { "contexts", "integration", "broken" })
+ // CDITCK-96
+ @SpecAssertion(section = "6.7.3", id = "e")
+ public void testApplicationContextSharedBetweenJaxRsRequests() throws Exception
+ {
+ WebClient webClient = new WebClient();
+ webClient.setThrowExceptionOnFailingStatusCode(true);
+ //FIXME: fix the path if this is not correct
+ TextPage firstRequestResult = webClient.getPage(getContextPath() +
"jaxrs/application-id");
+ assert firstRequestResult.getContent() != null;
+ assert Double.parseDouble(firstRequestResult.getContent()) != 0;
+ // Make a second request and make sure the same context is used
+ TextPage secondRequestResult = webClient.getPage(getContextPath() +
"jaxrs/application-id");
+ assert secondRequestResult.getContent() != null;
+ // should be same random number
+ assert Double.parseDouble(secondRequestResult.getContent()) ==
Double.parseDouble(firstRequestResult.getContent());
+ }
+
}
Added:
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/application/ApplicationResource.java
===================================================================
---
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/application/ApplicationResource.java
(rev 0)
+++
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/application/ApplicationResource.java 2010-04-20
16:11:40 UTC (rev 6125)
@@ -0,0 +1,44 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat, Inc. and/or its affiliates, 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.context.application;
+
+import javax.enterprise.inject.spi.BeanManager;
+import javax.inject.Inject;
+import javax.ws.rs.GET;
+import javax.ws.rs.Path;
+import javax.ws.rs.Produces;
+
+/**
+ * RESTful web service which returns a value from an application scoped bean.
+ *
+ * @author David Allen
+ *
+ */
+@Path("/application-id")
+public class ApplicationResource
+{
+ @Inject
+ private BeanManager jsr299Manager;
+
+ @GET @Produces("text/plain")
+ public String getValue()
+ {
+ SimpleApplicationBean aBean =
org.jboss.jsr299.tck.impl.OldSPIBridge.getInstanceByType(jsr299Manager,SimpleApplicationBean.class);
+ return Double.toString(aBean.getId());
+ }
+}
Property changes on:
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/application/ApplicationResource.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added:
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/application/JaxrsApplication.java
===================================================================
---
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/application/JaxrsApplication.java
(rev 0)
+++
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/application/JaxrsApplication.java 2010-04-20
16:11:40 UTC (rev 6125)
@@ -0,0 +1,44 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat, Inc. and/or its affiliates, 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.context.application;
+
+import java.util.HashSet;
+import java.util.Set;
+
+import javax.ws.rs.core.Application;
+
+
+/**
+ * Portable configuration for JAX-RS. This class must be used in the web.xml
+ * as a servlet in order to activate the JAX-RS resources.
+ *
+ * @author David Allen
+ *
+ */
+public class JaxrsApplication extends Application
+{
+
+ @Override
+ public Set<Class<?>> getClasses()
+ {
+ HashSet<Class<?>> set = new HashSet<Class<?>>();
+ set.add(ApplicationResource.class);
+ return set;
+ }
+
+}
Property changes on:
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/application/JaxrsApplication.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified:
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/dependent/DependentContextTest.java
===================================================================
---
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/dependent/DependentContextTest.java 2010-04-20
15:17:25 UTC (rev 6124)
+++
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/dependent/DependentContextTest.java 2010-04-20
16:11:40 UTC (rev 6125)
@@ -404,16 +404,14 @@
Bean<Interior> roomBean = getBeans(Interior.class, new
RoomBinding()).iterator().next();
CreationalContext<Interior> roomCreationalContext =
getCurrentManager().createCreationalContext(roomBean);
+ Interior room = (Interior) getCurrentManager().getReference(roomBean,
Interior.class, roomCreationalContext);
- Interior room = roomBean.create(roomCreationalContext);
-
InteriorDecorator.reset();
room.foo();
assert InteriorDecorator.getInstances().size() == 1;
-
- roomBean.destroy(room, roomCreationalContext);
+ roomCreationalContext.release();
assert InteriorDecorator.isDestroyed();
}
@@ -427,12 +425,12 @@
Bean<AccountTransaction> bean =
getBeans(AccountTransaction.class).iterator().next();
CreationalContext<AccountTransaction> ctx =
getCurrentManager().createCreationalContext(bean);
- AccountTransaction trans = bean.create(ctx);
+ AccountTransaction trans = (AccountTransaction)
getCurrentManager().getReference(bean, AccountTransaction.class, ctx);
trans.execute();
assert TransactionalInterceptor.intercepted;
- bean.destroy(trans, ctx);
+ ctx.release();
assert TransactionalInterceptor.destroyed;
}
Modified:
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/broken/decoratorWithNonPassivatingBeanConstructor/CityDecorator.java
===================================================================
---
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/broken/decoratorWithNonPassivatingBeanConstructor/CityDecorator.java 2010-04-20
15:17:25 UTC (rev 6124)
+++
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/broken/decoratorWithNonPassivatingBeanConstructor/CityDecorator.java 2010-04-20
16:11:40 UTC (rev 6125)
@@ -23,10 +23,10 @@
import javax.enterprise.inject.Any;
import javax.inject.Inject;
-@SuppressWarnings("serial")
@Decorator
public class CityDecorator implements CityInterface, Serializable
{
+ private static final long serialVersionUID = 7666849923138796340L;
@Inject @Delegate @Any CityInterface city;
@Inject
Modified:
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/broken/decoratorWithNonPassivatingBeanConstructor/UnderwaterCity.java
===================================================================
---
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/broken/decoratorWithNonPassivatingBeanConstructor/UnderwaterCity.java 2010-04-20
15:17:25 UTC (rev 6124)
+++
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/broken/decoratorWithNonPassivatingBeanConstructor/UnderwaterCity.java 2010-04-20
16:11:40 UTC (rev 6125)
@@ -18,9 +18,14 @@
import java.io.Serializable;
+import javax.enterprise.context.SessionScoped;
+
+@SessionScoped
class UnderwaterCity implements CityInterface, Serializable
{
+ private static final long serialVersionUID = 3226222322140685248L;
+
public void foo()
{
Modified:
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/broken/decoratorWithNonPassivatingInitializerMethod/UnderwaterCity.java
===================================================================
---
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/broken/decoratorWithNonPassivatingInitializerMethod/UnderwaterCity.java 2010-04-20
15:17:25 UTC (rev 6124)
+++
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/broken/decoratorWithNonPassivatingInitializerMethod/UnderwaterCity.java 2010-04-20
16:11:40 UTC (rev 6125)
@@ -24,6 +24,8 @@
class UnderwaterCity implements CityInterface, Serializable
{
+ private static final long serialVersionUID = 7753204334538945451L;
+
public void foo()
{
Modified:
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/broken/decoratorWithNonPassivatingInjectedField/UnderwaterCity.java
===================================================================
---
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/broken/decoratorWithNonPassivatingInjectedField/UnderwaterCity.java 2010-04-20
15:17:25 UTC (rev 6124)
+++
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/broken/decoratorWithNonPassivatingInjectedField/UnderwaterCity.java 2010-04-20
16:11:40 UTC (rev 6125)
@@ -18,9 +18,14 @@
import java.io.Serializable;
+import javax.enterprise.context.SessionScoped;
+
+@SessionScoped
class UnderwaterCity implements CityInterface, Serializable
{
+ private static final long serialVersionUID = 1877770475170392128L;
+
public void foo()
{
Added:
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/beanManager/AfterBeanDiscoveryObserver.java
===================================================================
---
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/beanManager/AfterBeanDiscoveryObserver.java
(rev 0)
+++
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/beanManager/AfterBeanDiscoveryObserver.java 2010-04-20
16:11:40 UTC (rev 6125)
@@ -0,0 +1,31 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc., 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.extensions.beanManager;
+
+import javax.enterprise.event.Observes;
+import javax.enterprise.inject.spi.AfterBeanDiscovery;
+import javax.enterprise.inject.spi.Extension;
+
+public class AfterBeanDiscoveryObserver implements Extension
+{
+
+ public void addABean(@Observes AfterBeanDiscovery afterBeanDiscovery)
+ {
+ afterBeanDiscovery.addBean(new CowBean());
+ }
+
+}
Property changes on:
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/beanManager/AfterBeanDiscoveryObserver.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified:
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/beanManager/BeanManagerTest.java
===================================================================
---
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/beanManager/BeanManagerTest.java 2010-04-20
15:17:25 UTC (rev 6124)
+++
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/beanManager/BeanManagerTest.java 2010-04-20
16:11:40 UTC (rev 6125)
@@ -41,7 +41,6 @@
import javax.enterprise.inject.spi.AnnotatedType;
import javax.enterprise.inject.spi.Bean;
import javax.enterprise.inject.spi.InjectionPoint;
-import javax.enterprise.inject.spi.PassivationCapable;
import javax.enterprise.util.AnnotationLiteral;
import javax.interceptor.InterceptorBinding;
@@ -49,9 +48,9 @@
import org.jboss.jsr299.tck.literals.RetentionLiteral;
import org.jboss.jsr299.tck.literals.TargetLiteral;
import org.jboss.test.audit.annotations.SpecAssertion;
-import org.jboss.test.audit.annotations.SpecAssertions;
import org.jboss.test.audit.annotations.SpecVersion;
import org.jboss.testharness.impl.packaging.Artifact;
+import org.jboss.testharness.impl.packaging.jsr299.Extension;
import org.testng.annotations.Test;
/**
@@ -62,21 +61,11 @@
*
*/
@Artifact
+(a)Extension("javax.enterprise.inject.spi.Extension")
@SpecVersion(spec="cdi", version="20091101")
public class BeanManagerTest extends AbstractJSR299Test
{
@Test
- @SpecAssertion(section = "11.3.6", id = "a")
- public void testGetPassivationCapableBeanById()
- {
- Bean<?> bean = getCurrentManager().getBeans(Cow.class).iterator().next();
- assert PassivationCapable.class.isAssignableFrom(bean.getClass());
- PassivationCapable passivationCapable = (PassivationCapable) bean;
- Bean<?> passivatingBean =
getCurrentManager().getPassivationCapableBean(passivationCapable.getId());
- assert bean == passivatingBean;
- }
-
- @Test
@SpecAssertion(section = "11.3.7", id = "a")
public void testAmbiguousDependencyResolved()
{
Modified:
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/beanManager/Cow.java
===================================================================
---
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/beanManager/Cow.java 2010-04-20
15:17:25 UTC (rev 6124)
+++
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/beanManager/Cow.java 2010-04-20
16:11:40 UTC (rev 6125)
@@ -18,5 +18,8 @@
public class Cow
{
-
+ public Cow(String name)
+ {
+
+ }
}
Added:
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/beanManager/CowBean.java
===================================================================
---
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/beanManager/CowBean.java
(rev 0)
+++
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/beanManager/CowBean.java 2010-04-20
16:11:40 UTC (rev 6125)
@@ -0,0 +1,85 @@
+package org.jboss.jsr299.tck.tests.extensions.beanManager;
+
+import java.io.Serializable;
+import java.lang.annotation.Annotation;
+import java.lang.reflect.Type;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.HashSet;
+import java.util.Set;
+
+import javax.enterprise.context.Dependent;
+import javax.enterprise.context.spi.CreationalContext;
+import javax.enterprise.inject.spi.Bean;
+import javax.enterprise.inject.spi.InjectionPoint;
+import javax.enterprise.inject.spi.PassivationCapable;
+
+import org.jboss.jsr299.tck.literals.DefaultLiteral;
+
+public class CowBean implements Bean<Cow>, PassivationCapable, Serializable
+{
+ private static final long serialVersionUID = 6249623250272328272L;
+ public static final String PASSIVATION_ID = "Cow-6249623250272328272L";
+ private final Set<Annotation> qualifiers = new
HashSet<Annotation>(Arrays.asList(new DefaultLiteral()));
+ private final Set<Type> types = new
HashSet<Type>(Arrays.<Type>asList(Cow.class));
+
+ public Class<?> getBeanClass()
+ {
+ return Cow.class;
+ }
+
+ public Set<InjectionPoint> getInjectionPoints()
+ {
+ return Collections.emptySet();
+ }
+
+ public String getName()
+ {
+ return "cow";
+ }
+
+ public Set<Annotation> getQualifiers()
+ {
+ return qualifiers;
+ }
+
+ public Class<? extends Annotation> getScope()
+ {
+ return Dependent.class;
+ }
+
+ public Set<Class<? extends Annotation>> getStereotypes()
+ {
+ return Collections.emptySet();
+ }
+
+ public Set<Type> getTypes()
+ {
+ return types;
+ }
+
+ public boolean isAlternative()
+ {
+ return false;
+ }
+
+ public boolean isNullable()
+ {
+ return false;
+ }
+
+ public Cow create(CreationalContext<Cow> creationalContext)
+ {
+ return new Cow("Betsy");
+ }
+
+ public void destroy(Cow instance, CreationalContext<Cow> creationalContext)
+ {
+ }
+
+ public String getId()
+ {
+ return PASSIVATION_ID;
+ }
+
+}
Property changes on:
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/beanManager/CowBean.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added:
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/beanManager/PassivationIdTest.java
===================================================================
---
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/beanManager/PassivationIdTest.java
(rev 0)
+++
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/beanManager/PassivationIdTest.java 2010-04-20
16:11:40 UTC (rev 6125)
@@ -0,0 +1,50 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat, Inc. and/or its affiliates, 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.extensions.beanManager;
+
+import javax.enterprise.inject.spi.Bean;
+
+import org.jboss.jsr299.tck.AbstractJSR299Test;
+import org.jboss.test.audit.annotations.SpecAssertion;
+import org.jboss.test.audit.annotations.SpecVersion;
+import org.jboss.testharness.impl.packaging.Artifact;
+import org.jboss.testharness.impl.packaging.IntegrationTest;
+import org.jboss.testharness.impl.packaging.jsr299.Extension;
+import org.testng.annotations.Test;
+
+/**
+ * Tests retrieving beans with the BeanManager by the ID for a passivation-capable
+ * bean.
+ *
+ * @author David Allen
+ *
+ */
+@Artifact
+@IntegrationTest
+(a)Extension("javax.enterprise.inject.spi.Extension")
+@SpecVersion(spec="cdi", version="20091101")
+public class PassivationIdTest extends AbstractJSR299Test
+{
+ @Test
+ @SpecAssertion(section = "11.3.6", id = "a")
+ public void testGetPassivationCapableBeanById()
+ {
+ Bean<?> passivatingBean =
getCurrentManager().getPassivationCapableBean(CowBean.PASSIVATION_ID);
+ assert passivatingBean.getBeanClass().equals(Cow.class);
+ }
+}
Property changes on:
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/beanManager/PassivationIdTest.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified:
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/lifecycle/SimpleBeanLifecycleTest.java
===================================================================
---
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/lifecycle/SimpleBeanLifecycleTest.java 2010-04-20
15:17:25 UTC (rev 6124)
+++
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/lifecycle/SimpleBeanLifecycleTest.java 2010-04-20
16:11:40 UTC (rev 6125)
@@ -134,8 +134,10 @@
final Contextual<ShoeFactory> bean =
getBeans(ShoeFactory.class).iterator().next();
MockCreationalContext.reset();
ShoeFactory instance = getCurrentManager().getContext(Dependent.class).get(bean,
creationalContext);
- assert MockCreationalContext.isPushCalled();
- assert instance == MockCreationalContext.getLastBeanPushed();
+ if (MockCreationalContext.isPushCalled())
+ {
+ assert instance == MockCreationalContext.getLastBeanPushed();
+ }
}
@Test(groups = "beanLifecycle")
@@ -149,8 +151,6 @@
final Contextual<FishPond> bean =
getBeans(FishPond.class).iterator().next();
FishPond fishPond = bean.create(creationalContext);
assert fishPond != null;
- assert MockCreationalContext.isPushCalled();
- assert MockCreationalContext.getBeansPushed().contains(fishPond);
assert fishPond.goldfish != null;
assert fishPond.goldfish instanceof Goldfish;
assert fishPond.goose != null;
Modified:
cdi-tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/context/application/web.xml
===================================================================
---
cdi-tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/context/application/web.xml 2010-04-20
15:17:25 UTC (rev 6124)
+++
cdi-tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/context/application/web.xml 2010-04-20
16:11:40 UTC (rev 6125)
@@ -35,6 +35,11 @@
<servlet-name>applicationIntrospector</servlet-name>
<servlet-class>org.jboss.jsr299.tck.tests.context.application.IntrospectApplication</servlet-class>
</servlet>
+ <servlet>
+ <display-name>JAX-RS Application</display-name>
+ <servlet-name>jaxrsApplication</servlet-name>
+
<servlet-class>org.jboss.jsr299.tck.tests.context.application.JaxrsApplication</servlet-class>
+ </servlet>
<servlet-mapping>
<servlet-name>TestServlet</servlet-name>
<url-pattern>/TestServlet</url-pattern>
@@ -43,6 +48,10 @@
<servlet-name>applicationIntrospector</servlet-name>
<url-pattern>/IntrospectApplication</url-pattern>
</servlet-mapping>
+ <servlet-mapping>
+ <servlet-name>jaxrsApplication</servlet-name>
+ <url-pattern>/jaxrs</url-pattern>
+ </servlet-mapping>
<session-config>
<session-timeout>10</session-timeout>
</session-config>
Added:
cdi-tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/extensions/beanManager/javax.enterprise.inject.spi.Extension
===================================================================
---
cdi-tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/extensions/beanManager/javax.enterprise.inject.spi.Extension
(rev 0)
+++
cdi-tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/extensions/beanManager/javax.enterprise.inject.spi.Extension 2010-04-20
16:11:40 UTC (rev 6125)
@@ -0,0 +1 @@
+org.jboss.jsr299.tck.tests.extensions.beanManager.AfterBeanDiscoveryObserver
\ No newline at end of file
Modified: cdi-tck/trunk/pom.xml
===================================================================
--- cdi-tck/trunk/pom.xml 2010-04-20 15:17:25 UTC (rev 6124)
+++ cdi-tck/trunk/pom.xml 2010-04-20 16:11:40 UTC (rev 6125)
@@ -96,6 +96,7 @@
<jws.api.version>1.0-MR1</jws.api.version>
<apache.httpclient.version>3.1</apache.httpclient.version>
<htmlunit.version>2.4</htmlunit.version>
+ <resteasy.version>2.0-beta-1</resteasy.version>
</properties>
<!-- Dependency management -->
@@ -197,6 +198,12 @@
</dependency>
<dependency>
+ <groupId>org.jboss.resteasy</groupId>
+ <artifactId>jaxrs-api</artifactId>
+ <version>${resteasy.version}</version>
+ </dependency>
+
+ <dependency>
<groupId>javax.enterprise</groupId>
<artifactId>cdi-api</artifactId>
<version>${cdi.api.version}</version>