Author: jharting
Date: 2009-10-23 12:52:04 -0400 (Fri, 23 Oct 2009)
New Revision: 4238
Added:
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/inheritance/specialization/simple/broken/inconsistent/
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/inheritance/specialization/simple/broken/inconsistent/Employee.java
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/inheritance/specialization/simple/broken/inconsistent/InconsistentSpecializationTest.java
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/inheritance/specialization/simple/broken/inconsistent/Maid.java
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/inheritance/specialization/simple/broken/inconsistent/Manager.java
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injectionpoint/broken/not/bean/
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injectionpoint/broken/not/bean/InjectionPointTest.java
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injectionpoint/broken/not/bean/TestServlet_Broken.java
cdi-tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/lookup/injectionpoint/broken/
cdi-tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/lookup/injectionpoint/broken/not/
cdi-tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/lookup/injectionpoint/broken/not/bean/
cdi-tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/lookup/injectionpoint/broken/not/bean/web.xml
Modified:
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injection/enterprise/SessionBeanInjectionTest.java
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injectionpoint/InjectionPointTest.java
Log:
Tests for Chapter 5
Added:
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/inheritance/specialization/simple/broken/inconsistent/Employee.java
===================================================================
---
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/inheritance/specialization/simple/broken/inconsistent/Employee.java
(rev 0)
+++
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/inheritance/specialization/simple/broken/inconsistent/Employee.java 2009-10-23
16:52:04 UTC (rev 4238)
@@ -0,0 +1,6 @@
+package
org.jboss.jsr299.tck.tests.inheritance.specialization.simple.broken.inconsistent;
+
+class Employee
+{
+
+}
Added:
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/inheritance/specialization/simple/broken/inconsistent/InconsistentSpecializationTest.java
===================================================================
---
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/inheritance/specialization/simple/broken/inconsistent/InconsistentSpecializationTest.java
(rev 0)
+++
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/inheritance/specialization/simple/broken/inconsistent/InconsistentSpecializationTest.java 2009-10-23
16:52:04 UTC (rev 4238)
@@ -0,0 +1,37 @@
+/*
+ * 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.inheritance.specialization.simple.broken.inconsistent;
+
+import org.jboss.jsr299.tck.AbstractJSR299Test;
+import org.jboss.jsr299.tck.DeploymentError;
+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.ExpectedDeploymentException;
+import org.testng.annotations.Test;
+
+@Artifact
+(a)ExpectedDeploymentException(DeploymentError.class)
+@SpecVersion(spec="cdi", version="20091018")
+public class InconsistentSpecializationTest extends AbstractJSR299Test
+{
+ @Test
+ @SpecAssertion(section = "5.2.3", id = "a")
+ public void testInconsistentSpecialization() {
+ assert false;
+ }
+}
Added:
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/inheritance/specialization/simple/broken/inconsistent/Maid.java
===================================================================
---
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/inheritance/specialization/simple/broken/inconsistent/Maid.java
(rev 0)
+++
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/inheritance/specialization/simple/broken/inconsistent/Maid.java 2009-10-23
16:52:04 UTC (rev 4238)
@@ -0,0 +1,9 @@
+package
org.jboss.jsr299.tck.tests.inheritance.specialization.simple.broken.inconsistent;
+
+import javax.enterprise.inject.Specializes;
+
+@Specializes
+class Maid extends Employee
+{
+
+}
Added:
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/inheritance/specialization/simple/broken/inconsistent/Manager.java
===================================================================
---
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/inheritance/specialization/simple/broken/inconsistent/Manager.java
(rev 0)
+++
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/inheritance/specialization/simple/broken/inconsistent/Manager.java 2009-10-23
16:52:04 UTC (rev 4238)
@@ -0,0 +1,9 @@
+package
org.jboss.jsr299.tck.tests.inheritance.specialization.simple.broken.inconsistent;
+
+import javax.enterprise.inject.Specializes;
+
+@Specializes
+class Manager extends Employee
+{
+
+}
Modified:
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injection/enterprise/SessionBeanInjectionTest.java
===================================================================
---
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injection/enterprise/SessionBeanInjectionTest.java 2009-10-23
15:33:22 UTC (rev 4237)
+++
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injection/enterprise/SessionBeanInjectionTest.java 2009-10-23
16:52:04 UTC (rev 4238)
@@ -58,7 +58,10 @@
}
@Test(groups = "jboss-as-broken")
- @SpecAssertion(section = "5.6", id = "ed")
+ @SpecAssertions({
+ @SpecAssertion(section = "5.6", id = "ed"),
+ @SpecAssertion(section = "5.6.4", id = "ao")
+ })
//JBAS-7046
public void testInjectionOnEJBInterceptor()
{
Modified:
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injectionpoint/InjectionPointTest.java
===================================================================
---
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injectionpoint/InjectionPointTest.java 2009-10-23
15:33:22 UTC (rev 4237)
+++
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injectionpoint/InjectionPointTest.java 2009-10-23
16:52:04 UTC (rev 4238)
@@ -166,7 +166,25 @@
assert getBeans(InjectionPoint.class).size() == 1;
assert
getBeans(InjectionPoint.class).iterator().next().getScope().equals(Dependent.class);
}
-
+
+ @Test(groups = { "injectionPoint", "ri-broken" })
+ @SpecAssertion(section = "5.6.9", id = "eb")
+ //WELD-227
+ public void testPassivationCapability() throws Exception
+ {
+ InjectionPoint ip1 =
getInstanceByType(FieldInjectionPointBean.class).getInjectedBean().getInjectedMetadata();
+ InjectionPoint ip2 =
getInstanceByType(MethodInjectionPointBean.class).getInjectedBean().getInjectedMetadata();
+ InjectionPoint ip3 =
getInstanceByType(ConstructorInjectionPointBean.class).getInjectedBean().getInjectedMetadata();
+
+ ip1 = (InjectionPoint) deserialize(serialize(ip1));
+ ip2 = (InjectionPoint) deserialize(serialize(ip2));
+ ip3 = (InjectionPoint) deserialize(serialize(ip3));
+
+ assert ip1.getType().equals(BeanWithInjectionPointMetadata.class);
+ assert ip2.getType().equals(BeanWithInjectionPointMetadata.class);
+ assert ip3.getType().equals(BeanWithInjectionPointMetadata.class);
+ }
+
@Test(groups = { "injectionPoint" })
@SpecAssertions({
@SpecAssertion(section = "5.6.9", id = "ea")
Added:
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injectionpoint/broken/not/bean/InjectionPointTest.java
===================================================================
---
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injectionpoint/broken/not/bean/InjectionPointTest.java
(rev 0)
+++
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injectionpoint/broken/not/bean/InjectionPointTest.java 2009-10-23
16:52:04 UTC (rev 4238)
@@ -0,0 +1,43 @@
+/*
+ * 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.injectionpoint.broken.not.bean;
+
+import org.jboss.jsr299.tck.AbstractJSR299Test;
+import org.jboss.jsr299.tck.DefinitionError;
+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.ExpectedDeploymentException;
+import org.jboss.testharness.impl.packaging.IntegrationTest;
+import org.jboss.testharness.impl.packaging.Resource;
+import org.jboss.testharness.impl.packaging.war.WarArtifactDescriptor;
+import org.testng.annotations.Test;
+
+@Artifact
+@SpecVersion(spec="cdi", version="20091018")
+(a)ExpectedDeploymentException(DefinitionError.class)
+@IntegrationTest
+@Resource(destination = WarArtifactDescriptor.WEB_XML_DESTINATION, source =
"web.xml")
+public class InjectionPointTest extends AbstractJSR299Test
+{
+ @Test(groups = "ri-broken")
+ @SpecAssertion(section = "5.6.9", id = "ga")
+ //WELD-228
+ public void testDefinitionErrorDetected() {
+ assert false;
+ }
+}
Added:
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injectionpoint/broken/not/bean/TestServlet_Broken.java
===================================================================
---
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injectionpoint/broken/not/bean/TestServlet_Broken.java
(rev 0)
+++
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injectionpoint/broken/not/bean/TestServlet_Broken.java 2009-10-23
16:52:04 UTC (rev 4238)
@@ -0,0 +1,14 @@
+package org.jboss.jsr299.tck.tests.lookup.injectionpoint.broken.not.bean;
+
+import javax.enterprise.inject.spi.InjectionPoint;
+import javax.inject.Inject;
+import javax.servlet.http.HttpServlet;
+
+@SuppressWarnings("serial")
+public class TestServlet_Broken extends HttpServlet
+{
+ @SuppressWarnings("unused")
+ @Inject
+ private InjectionPoint ip;
+
+}
Added:
cdi-tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/lookup/injectionpoint/broken/not/bean/web.xml
===================================================================
---
cdi-tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/lookup/injectionpoint/broken/not/bean/web.xml
(rev 0)
+++
cdi-tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/lookup/injectionpoint/broken/not/bean/web.xml 2009-10-23
16:52:04 UTC (rev 4238)
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<web-app version="2.5"
xmlns="http://java.sun.com/xml/ns/javaee"
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
+ <display-name>Dependency Injection Test</display-name>
+ <servlet>
+ <servlet-name>TestServlet</servlet-name>
+ <servlet-class>org.jboss.jsr299.tck.tests.lookup.injectionpoint.broken.not.bean.TestServlet_Broken</servlet-class>
+ <load-on-startup>1</load-on-startup>
+ </servlet>
+ <servlet>
+ <servlet-name>JBoss Test Harness Test Runner</servlet-name>
+ <servlet-class>org.jboss.testharness.impl.runner.servlet.ServletTestRunner</servlet-class>
+ </servlet>
+ <servlet-mapping>
+ <servlet-name>TestServlet</servlet-name>
+ <url-pattern>/Test/*</url-pattern>
+ </servlet-mapping>
+ <servlet-mapping>
+ <servlet-name>JBoss Test Harness Test Runner</servlet-name>
+ <url-pattern>/</url-pattern>
+ </servlet-mapping>
+ <session-config>
+ <session-timeout>10</session-timeout>
+ </session-config>
+</web-app>