[weld-commits] Weld SVN: r5296 - in cdi-tck/branches/1.0/impl/src/main: java/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/decorator and 2 other directories.

weld-commits at lists.jboss.org weld-commits at lists.jboss.org
Tue Dec 15 08:36:14 EST 2009


Author: jharting
Date: 2009-12-15 08:36:13 -0500 (Tue, 15 Dec 2009)
New Revision: 5296

Added:
   cdi-tck/branches/1.0/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injectionpoint/AnimalDecorator.java
   cdi-tck/branches/1.0/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/decorator/Animal.java
   cdi-tck/branches/1.0/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/decorator/AnimalDecorator.java
   cdi-tck/branches/1.0/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/decorator/DecoratorNotInjectedTest.java
   cdi-tck/branches/1.0/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/decorator/House.java
Removed:
   cdi-tck/branches/1.0/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injectionpoint/CatDecorator.java
   cdi-tck/branches/1.0/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/decorator/CatDecorator.java
   cdi-tck/branches/1.0/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/decorator/DecoratorNotResolvedTest.java
Modified:
   cdi-tck/branches/1.0/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injectionpoint/Animal.java
   cdi-tck/branches/1.0/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injectionpoint/Cat.java
   cdi-tck/branches/1.0/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injectionpoint/InjectionPointTest.java
   cdi-tck/branches/1.0/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/decorator/Cat.java
   cdi-tck/branches/1.0/impl/src/main/resources/org/jboss/jsr299/tck/tests/lookup/injectionpoint/beans.xml
   cdi-tck/branches/1.0/impl/src/main/resources/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/decorator/beans.xml
Log:
CDITCK-83

Modified: cdi-tck/branches/1.0/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injectionpoint/Animal.java
===================================================================
--- cdi-tck/branches/1.0/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injectionpoint/Animal.java	2009-12-15 13:23:38 UTC (rev 5295)
+++ cdi-tck/branches/1.0/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injectionpoint/Animal.java	2009-12-15 13:36:13 UTC (rev 5296)
@@ -2,5 +2,5 @@
 
 interface Animal
 {
-
+	String hello();
 }

Added: cdi-tck/branches/1.0/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injectionpoint/AnimalDecorator.java
===================================================================
--- cdi-tck/branches/1.0/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injectionpoint/AnimalDecorator.java	                        (rev 0)
+++ cdi-tck/branches/1.0/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injectionpoint/AnimalDecorator.java	2009-12-15 13:36:13 UTC (rev 5296)
@@ -0,0 +1,16 @@
+package org.jboss.jsr299.tck.tests.lookup.injectionpoint;
+
+import javax.decorator.Decorator;
+import javax.decorator.Delegate;
+import javax.inject.Inject;
+
+ at Decorator
+class AnimalDecorator implements Animal {
+	
+	@Inject	@Delegate
+	private Animal bean;
+
+	public String hello() {
+		return bean.hello() + " world!";
+	}
+}

Modified: cdi-tck/branches/1.0/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injectionpoint/Cat.java
===================================================================
--- cdi-tck/branches/1.0/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injectionpoint/Cat.java	2009-12-15 13:23:38 UTC (rev 5295)
+++ cdi-tck/branches/1.0/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injectionpoint/Cat.java	2009-12-15 13:36:13 UTC (rev 5296)
@@ -4,7 +4,7 @@
 import javax.enterprise.inject.spi.InjectionPoint;
 import javax.inject.Inject;
 
-class Cat
+class Cat implements Animal
 {
    @Inject private InjectionPoint injectionPoint;
    

Deleted: cdi-tck/branches/1.0/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injectionpoint/CatDecorator.java
===================================================================
--- cdi-tck/branches/1.0/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injectionpoint/CatDecorator.java	2009-12-15 13:23:38 UTC (rev 5295)
+++ cdi-tck/branches/1.0/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injectionpoint/CatDecorator.java	2009-12-15 13:36:13 UTC (rev 5296)
@@ -1,17 +0,0 @@
-package org.jboss.jsr299.tck.tests.lookup.injectionpoint;
-
-import javax.decorator.Decorator;
-import javax.decorator.Delegate;
-import javax.inject.Inject;
-
- at Decorator
-class CatDecorator extends Cat
-{
-   @Inject @Delegate Cat bean;
-
-   @Override
-   public String hello()
-   {
-      return bean.hello() + " world!";
-   }
-}

Modified: cdi-tck/branches/1.0/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injectionpoint/InjectionPointTest.java
===================================================================
--- cdi-tck/branches/1.0/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injectionpoint/InjectionPointTest.java	2009-12-15 13:23:38 UTC (rev 5295)
+++ cdi-tck/branches/1.0/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injectionpoint/InjectionPointTest.java	2009-12-15 13:36:13 UTC (rev 5296)
@@ -143,7 +143,7 @@
       FieldInjectionPointBean beanWithInjectedBean = getInstanceByType(FieldInjectionPointBean.class);
       BeanWithInjectionPointMetadata beanWithInjectionPoint = beanWithInjectedBean.getInjectedBean();
       assert beanWithInjectionPoint.getInjectedMetadata() != null;
-      assert beanWithInjectionPoint.getInjectedMetadata().getAnnotated() instanceof AnnotatedField;
+      assert beanWithInjectionPoint.getInjectedMetadata().getAnnotated() instanceof AnnotatedField<?>;
       assert beanWithInjectionPoint.getInjectedMetadata().getAnnotated().isAnnotationPresent(AnimalStereotype.class);
    }
 
@@ -155,7 +155,7 @@
       MethodInjectionPointBean beanWithInjectedBean = getInstanceByType(MethodInjectionPointBean.class);
       BeanWithInjectionPointMetadata beanWithInjectionPoint = beanWithInjectedBean.getInjectedBean();
       assert beanWithInjectionPoint.getInjectedMetadata() != null;
-      assert beanWithInjectionPoint.getInjectedMetadata().getAnnotated() instanceof AnnotatedParameter;
+      assert beanWithInjectionPoint.getInjectedMetadata().getAnnotated() instanceof AnnotatedParameter<?>;
       assert annotationSetMatches(beanWithInjectionPoint.getInjectedMetadata().getQualifiers(), Default.class);
    }
 

Added: cdi-tck/branches/1.0/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/decorator/Animal.java
===================================================================
--- cdi-tck/branches/1.0/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/decorator/Animal.java	                        (rev 0)
+++ cdi-tck/branches/1.0/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/decorator/Animal.java	2009-12-15 13:36:13 UTC (rev 5296)
@@ -0,0 +1,5 @@
+package org.jboss.jsr299.tck.tests.lookup.typesafe.resolution.decorator;
+
+interface Animal {
+	String hello();
+}

Added: cdi-tck/branches/1.0/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/decorator/AnimalDecorator.java
===================================================================
--- cdi-tck/branches/1.0/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/decorator/AnimalDecorator.java	                        (rev 0)
+++ cdi-tck/branches/1.0/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/decorator/AnimalDecorator.java	2009-12-15 13:36:13 UTC (rev 5296)
@@ -0,0 +1,16 @@
+package org.jboss.jsr299.tck.tests.lookup.typesafe.resolution.decorator;
+
+import javax.decorator.Decorator;
+import javax.decorator.Delegate;
+import javax.inject.Inject;
+
+ at Decorator
+class AnimalDecorator implements Animal
+{
+   @Inject @Delegate Animal bean;
+
+   public String hello()
+   {
+      return bean.hello() + " world!";
+   }
+}

Modified: cdi-tck/branches/1.0/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/decorator/Cat.java
===================================================================
--- cdi-tck/branches/1.0/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/decorator/Cat.java	2009-12-15 13:23:38 UTC (rev 5295)
+++ cdi-tck/branches/1.0/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/decorator/Cat.java	2009-12-15 13:36:13 UTC (rev 5296)
@@ -1,6 +1,6 @@
 package org.jboss.jsr299.tck.tests.lookup.typesafe.resolution.decorator;
 
-class Cat
+class Cat implements Animal
 {
    public String hello() {
       return "hello";

Deleted: cdi-tck/branches/1.0/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/decorator/CatDecorator.java
===================================================================
--- cdi-tck/branches/1.0/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/decorator/CatDecorator.java	2009-12-15 13:23:38 UTC (rev 5295)
+++ cdi-tck/branches/1.0/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/decorator/CatDecorator.java	2009-12-15 13:36:13 UTC (rev 5296)
@@ -1,17 +0,0 @@
-package org.jboss.jsr299.tck.tests.lookup.typesafe.resolution.decorator;
-
-import javax.decorator.Decorator;
-import javax.decorator.Delegate;
-import javax.inject.Inject;
-
- at Decorator
-class CatDecorator extends Cat
-{
-   @Inject @Delegate Cat bean;
-
-   @Override
-   public String hello()
-   {
-      return bean.hello() + " world!";
-   }
-}

Added: cdi-tck/branches/1.0/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/decorator/DecoratorNotInjectedTest.java
===================================================================
--- cdi-tck/branches/1.0/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/decorator/DecoratorNotInjectedTest.java	                        (rev 0)
+++ cdi-tck/branches/1.0/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/decorator/DecoratorNotInjectedTest.java	2009-12-15 13:36:13 UTC (rev 5296)
@@ -0,0 +1,41 @@
+/*
+ * 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.decorator;
+
+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.jboss.testharness.impl.packaging.jsr299.BeansXml;
+import org.testng.annotations.Test;
+
+ at Artifact
+ at BeansXml("beans.xml")
+ at SpecVersion(spec="cdi", version="20091101")
+ at ExpectedDeploymentException(DeploymentFailure.class)
+public class DecoratorNotInjectedTest extends AbstractJSR299Test
+{
+
+   @Test(groups = { "injection" })
+   @SpecAssertion(section = "5.1.4", id = "a")
+   public void testDecoratorNotResolved() 
+   {
+	   assert false;
+   }
+}

Deleted: cdi-tck/branches/1.0/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/decorator/DecoratorNotResolvedTest.java
===================================================================
--- cdi-tck/branches/1.0/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/decorator/DecoratorNotResolvedTest.java	2009-12-15 13:23:38 UTC (rev 5295)
+++ cdi-tck/branches/1.0/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/decorator/DecoratorNotResolvedTest.java	2009-12-15 13:36:13 UTC (rev 5296)
@@ -1,50 +0,0 @@
-/*
- * 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.decorator;
-
-import java.lang.reflect.Type;
-import java.util.HashSet;
-import java.util.Set;
-
-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.jsr299.BeansXml;
-import org.testng.annotations.Test;
-
- at Artifact
- at BeansXml("beans.xml")
- at SpecVersion(spec="cdi", version="20091101")
-public class DecoratorNotResolvedTest extends AbstractJSR299Test
-{
-
-   @Test(groups = { "resolution", "rewrite" })
-   @SpecAssertion(section = "5.1.4", id = "a")
-   // TODO PLM should check injection, not resolution
-   public void testDecoratorNotResolved() 
-   {
-      Set<Type> types = new HashSet<Type>();
-      for (Bean<Cat> bean : getBeans(Cat.class)) {
-         types.addAll(bean.getTypes());
-      }
-      assert !types.contains(CatDecorator.class);
-      assert getInstanceByType(Cat.class) != null;
-   }
-}

Added: cdi-tck/branches/1.0/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/decorator/House.java
===================================================================
--- cdi-tck/branches/1.0/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/decorator/House.java	                        (rev 0)
+++ cdi-tck/branches/1.0/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/decorator/House.java	2009-12-15 13:36:13 UTC (rev 5296)
@@ -0,0 +1,9 @@
+package org.jboss.jsr299.tck.tests.lookup.typesafe.resolution.decorator;
+
+import javax.inject.Inject;
+
+class House {
+	@SuppressWarnings("unused")
+	@Inject
+	private AnimalDecorator decorator;
+}

Modified: cdi-tck/branches/1.0/impl/src/main/resources/org/jboss/jsr299/tck/tests/lookup/injectionpoint/beans.xml
===================================================================
--- cdi-tck/branches/1.0/impl/src/main/resources/org/jboss/jsr299/tck/tests/lookup/injectionpoint/beans.xml	2009-12-15 13:23:38 UTC (rev 5295)
+++ cdi-tck/branches/1.0/impl/src/main/resources/org/jboss/jsr299/tck/tests/lookup/injectionpoint/beans.xml	2009-12-15 13:36:13 UTC (rev 5296)
@@ -1,6 +1,6 @@
 <beans> 
    <decorators>
       <class>org.jboss.jsr299.tck.tests.lookup.injectionpoint.TimestampLogger</class>
-      <class>org.jboss.jsr299.tck.tests.lookup.injectionpoint.CatDecorator</class>
+      <class>org.jboss.jsr299.tck.tests.lookup.injectionpoint.AnimalDecorator</class>
    </decorators>
 </beans>

Modified: cdi-tck/branches/1.0/impl/src/main/resources/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/decorator/beans.xml
===================================================================
--- cdi-tck/branches/1.0/impl/src/main/resources/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/decorator/beans.xml	2009-12-15 13:23:38 UTC (rev 5295)
+++ cdi-tck/branches/1.0/impl/src/main/resources/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/decorator/beans.xml	2009-12-15 13:36:13 UTC (rev 5296)
@@ -1,5 +1,5 @@
 <beans> 
    <decorators>
-      <class>org.jboss.jsr299.tck.tests.lookup.typesafe.resolution.decorator.CatDecorator</class>
+      <class>org.jboss.jsr299.tck.tests.lookup.typesafe.resolution.decorator.AnimalDecorator</class>
    </decorators>
 </beans>



More information about the weld-commits mailing list