[weld-commits] Weld SVN: r5825 - in cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/field/definition: broken and 4 other directories.

weld-commits at lists.jboss.org weld-commits at lists.jboss.org
Tue Feb 9 04:34:43 EST 2010


Author: jharting
Date: 2010-02-09 04:34:43 -0500 (Tue, 09 Feb 2010)
New Revision: 5825

Added:
   cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/field/definition/SpiderListProducer.java
   cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/field/definition/broken/enterprise/
   cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/field/definition/broken/enterprise/nonstatic/
   cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/field/definition/broken/enterprise/nonstatic/FooLocal_Broken.java
   cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/field/definition/broken/enterprise/nonstatic/Foo_Broken.java
   cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/field/definition/broken/enterprise/nonstatic/NonStaticFieldOfSessionBeanTest.java
   cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/field/definition/broken/typeVariable/
   cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/field/definition/broken/typeVariable/Foo.java
   cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/field/definition/broken/typeVariable/ProducerFieldWithTypeVariableTest.java
   cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/field/definition/broken/typeVariable2/
   cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/field/definition/broken/typeVariable2/Foo.java
   cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/field/definition/broken/typeVariable2/RequestScopedProducerFieldWithTypeVariableTest.java
Modified:
   cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/field/definition/ProducerFieldDefinitionTest.java
Log:
More tests for producer fields

Modified: cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/field/definition/ProducerFieldDefinitionTest.java
===================================================================
--- cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/field/definition/ProducerFieldDefinitionTest.java	2010-02-05 18:32:10 UTC (rev 5824)
+++ cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/field/definition/ProducerFieldDefinitionTest.java	2010-02-09 09:34:43 UTC (rev 5825)
@@ -17,11 +17,13 @@
 package org.jboss.jsr299.tck.tests.implementation.producer.field.definition;
 
 import java.lang.annotation.Annotation;
+import java.util.List;
 import java.util.Set;
 
 import javax.enterprise.context.RequestScoped;
 import javax.enterprise.inject.spi.Bean;
 import javax.enterprise.util.AnnotationLiteral;
+import javax.enterprise.util.TypeLiteral;
 
 import org.jboss.jsr299.tck.AbstractJSR299Test;
 import org.jboss.jsr299.tck.literals.DefaultLiteral;
@@ -213,4 +215,13 @@
    {
       assert !(getInstanceByType(Egg.class,FOO_LITERAL).getMother() instanceof LameInfertileChicken);
    }
+   
+   @SuppressWarnings("serial")
+   @Test(groups = "producerField")
+   @SpecAssertion(section = "3.4", id = "fb")
+   //WELD-431
+   public void testProducerFieldWithTypeVariable()
+   {
+      assert (getInstanceByType(new TypeLiteral<List<Spider>>(){})) != null;
+   }
 }
\ No newline at end of file

Added: cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/field/definition/SpiderListProducer.java
===================================================================
--- cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/field/definition/SpiderListProducer.java	                        (rev 0)
+++ cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/field/definition/SpiderListProducer.java	2010-02-09 09:34:43 UTC (rev 5825)
@@ -0,0 +1,28 @@
+/*
+ * 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.implementation.producer.field.definition;
+
+import java.util.List;
+import java.util.ArrayList;
+
+import javax.enterprise.inject.Produces;
+
+public class SpiderListProducer<T extends Spider>
+{
+   @Produces
+   List<T> spiders = new ArrayList<T>();
+}

Added: cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/field/definition/broken/enterprise/nonstatic/FooLocal_Broken.java
===================================================================
--- cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/field/definition/broken/enterprise/nonstatic/FooLocal_Broken.java	                        (rev 0)
+++ cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/field/definition/broken/enterprise/nonstatic/FooLocal_Broken.java	2010-02-09 09:34:43 UTC (rev 5825)
@@ -0,0 +1,25 @@
+/*
+ * 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.implementation.producer.field.definition.broken.enterprise.nonstatic;
+
+import javax.ejb.Local;
+
+ at Local
+public interface FooLocal_Broken
+{
+
+}

Added: cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/field/definition/broken/enterprise/nonstatic/Foo_Broken.java
===================================================================
--- cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/field/definition/broken/enterprise/nonstatic/Foo_Broken.java	                        (rev 0)
+++ cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/field/definition/broken/enterprise/nonstatic/Foo_Broken.java	2010-02-09 09:34:43 UTC (rev 5825)
@@ -0,0 +1,27 @@
+/*
+ * 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.implementation.producer.field.definition.broken.enterprise.nonstatic;
+
+import javax.ejb.Stateless;
+import javax.enterprise.inject.Produces;
+
+ at Stateless
+public class Foo_Broken implements FooLocal_Broken
+{
+   @Produces
+   Integer zero = 0;
+}

Added: cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/field/definition/broken/enterprise/nonstatic/NonStaticFieldOfSessionBeanTest.java
===================================================================
--- cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/field/definition/broken/enterprise/nonstatic/NonStaticFieldOfSessionBeanTest.java	                        (rev 0)
+++ cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/field/definition/broken/enterprise/nonstatic/NonStaticFieldOfSessionBeanTest.java	2010-02-09 09:34:43 UTC (rev 5825)
@@ -0,0 +1,40 @@
+/*
+ * 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.implementation.producer.field.definition.broken.enterprise.nonstatic;
+
+
+import org.jboss.jsr299.tck.AbstractJSR299Test;
+import org.jboss.jsr299.tck.DeploymentFailure;
+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;
+
+ at Artifact
+ at ExpectedDeploymentException(DeploymentFailure.class)
+ at SpecVersion(spec="cdi", version="20091101")
+public class NonStaticFieldOfSessionBeanTest extends AbstractJSR299Test
+{
+   @Test
+   @SpecAssertion(section = "3.4.2", id = "h")
+   //WELD-432
+   public void testNonStaticFieldOfSessionBeanCannotBeProducerField()
+   {
+      assert false;
+   }
+}

Added: cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/field/definition/broken/typeVariable/Foo.java
===================================================================
--- cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/field/definition/broken/typeVariable/Foo.java	                        (rev 0)
+++ cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/field/definition/broken/typeVariable/Foo.java	2010-02-09 09:34:43 UTC (rev 5825)
@@ -0,0 +1,25 @@
+/*
+ * 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.implementation.producer.field.definition.broken.typeVariable;
+
+import javax.enterprise.inject.Produces;
+
+public class Foo<T>
+{
+   @Produces
+   T foo = null;
+}

Added: cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/field/definition/broken/typeVariable/ProducerFieldWithTypeVariableTest.java
===================================================================
--- cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/field/definition/broken/typeVariable/ProducerFieldWithTypeVariableTest.java	                        (rev 0)
+++ cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/field/definition/broken/typeVariable/ProducerFieldWithTypeVariableTest.java	2010-02-09 09:34:43 UTC (rev 5825)
@@ -0,0 +1,39 @@
+/*
+ * 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.implementation.producer.field.definition.broken.typeVariable;
+
+
+import org.jboss.jsr299.tck.AbstractJSR299Test;
+import org.jboss.jsr299.tck.DeploymentFailure;
+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;
+
+ at Artifact
+ at ExpectedDeploymentException(DeploymentFailure.class)
+ at SpecVersion(spec="cdi", version="20091101")
+public class ProducerFieldWithTypeVariableTest extends AbstractJSR299Test
+{
+   @Test
+   @SpecAssertion(section = "3.4", id = "ha")
+   public void testProducerFieldWithTypeOfTypeVariableNotAllowed()
+   {
+      assert false;
+   }
+}

Added: cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/field/definition/broken/typeVariable2/Foo.java
===================================================================
--- cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/field/definition/broken/typeVariable2/Foo.java	                        (rev 0)
+++ cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/field/definition/broken/typeVariable2/Foo.java	2010-02-09 09:34:43 UTC (rev 5825)
@@ -0,0 +1,28 @@
+/*
+ * 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.implementation.producer.field.definition.broken.typeVariable2;
+
+import java.util.List;
+
+import javax.enterprise.context.RequestScoped;
+import javax.enterprise.inject.Produces;
+
+public class Foo<T>
+{
+   @Produces @RequestScoped
+   List<T> foo = null;
+}

Added: cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/field/definition/broken/typeVariable2/RequestScopedProducerFieldWithTypeVariableTest.java
===================================================================
--- cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/field/definition/broken/typeVariable2/RequestScopedProducerFieldWithTypeVariableTest.java	                        (rev 0)
+++ cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/field/definition/broken/typeVariable2/RequestScopedProducerFieldWithTypeVariableTest.java	2010-02-09 09:34:43 UTC (rev 5825)
@@ -0,0 +1,39 @@
+/*
+ * 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.implementation.producer.field.definition.broken.typeVariable2;
+
+
+import org.jboss.jsr299.tck.AbstractJSR299Test;
+import org.jboss.jsr299.tck.DeploymentFailure;
+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;
+
+ at Artifact
+ at ExpectedDeploymentException(DeploymentFailure.class)
+ at SpecVersion(spec="cdi", version="20091101")
+public class RequestScopedProducerFieldWithTypeVariableTest extends AbstractJSR299Test
+{
+   @Test
+   @SpecAssertion(section = "3.4", id = "gb")
+   public void testRequestScopedProducerFieldParameterizedWithTypeVariableNotAllowed()
+   {
+      assert false;
+   }
+}



More information about the weld-commits mailing list