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;
+ }
+}