Author: jharting
Date: 2009-07-28 03:26:03 -0400 (Tue, 28 Jul 2009)
New Revision: 3301
Added:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/decorator/
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/decorator/Cat.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/decorator/CatDecorator.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/decorator/DecoratorNotResolvedTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/interceptor/
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/interceptor/Cat.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/interceptor/CatInterceptor.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/interceptor/InterceptorBinding.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/interceptor/InterceptorNotResolvedTest.java
tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/
tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/decorator/
tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/decorator/beans.xml
tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/interceptor/
tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/interceptor/beans.xml
Modified:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injectionpoint/InjectionPointTest.java
Log:
Moved decorator and interceptor tests to separate packages
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-28
07:15:20 UTC (rev 3300)
+++
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injectionpoint/InjectionPointTest.java 2009-07-28
07:26:03 UTC (rev 3301)
@@ -20,6 +20,8 @@
import java.lang.reflect.Constructor;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
+import java.lang.reflect.Type;
+import java.util.HashSet;
import java.util.Set;
import javax.enterprise.context.Dependent;
@@ -217,14 +219,4 @@
assert cat.getInjectionPoint() != null;
assert cat.getInjectionPoint().isDelegate();
}
-
- @Test(groups = { "ri-broken", "resolution" })
- @SpecAssertion(section = "5.3", id = "hb")
- // WBRI-296
- public void testDecoratorNotResolved()
- {
- Cat cat = getInstanceByType(Cat.class);
- assert cat != null;
- assert cat.getClass().equals(Cat.class);
- }
}
Added:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/decorator/Cat.java
===================================================================
---
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/decorator/Cat.java
(rev 0)
+++
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/decorator/Cat.java 2009-07-28
07:26:03 UTC (rev 3301)
@@ -0,0 +1,8 @@
+package org.jboss.jsr299.tck.tests.lookup.typesafe.resolution.decorator;
+
+class Cat
+{
+ public String hello() {
+ return "hello";
+ }
+}
Added:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/decorator/CatDecorator.java
===================================================================
---
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/decorator/CatDecorator.java
(rev 0)
+++
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/decorator/CatDecorator.java 2009-07-28
07:26:03 UTC (rev 3301)
@@ -0,0 +1,15 @@
+package org.jboss.jsr299.tck.tests.lookup.typesafe.resolution.decorator;
+
+import javax.decorator.Decorates;
+import javax.decorator.Decorator;
+
+@Decorator
+class CatDecorator extends Cat
+{
+ @Decorates Cat bean;
+
+ public String hello()
+ {
+ return bean.hello() + " world!";
+ }
+}
Added:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/decorator/DecoratorNotResolvedTest.java
===================================================================
---
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/decorator/DecoratorNotResolvedTest.java
(rev 0)
+++
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/decorator/DecoratorNotResolvedTest.java 2009-07-28
07:26:03 UTC (rev 3301)
@@ -0,0 +1,51 @@
+/*
+ * 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;
+
+@Artifact
+(a)BeansXml("beans.xml")
+@SpecVersion("20090625")
+public class DecoratorNotResolvedTest extends AbstractJSR299Test
+{
+
+ @Test(groups = { "ri-broken", "resolution" })
+ @SpecAssertion(section = "5.3", id = "hb")
+ // WBRI-260
+ // WBRI-296
+ 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:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/interceptor/Cat.java
===================================================================
---
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/interceptor/Cat.java
(rev 0)
+++
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/interceptor/Cat.java 2009-07-28
07:26:03 UTC (rev 3301)
@@ -0,0 +1,9 @@
+package org.jboss.jsr299.tck.tests.lookup.typesafe.resolution.interceptor;
+
+class Cat
+{
+ @InterceptorBinding
+ public String hello() {
+ return "hello";
+ }
+}
Added:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/interceptor/CatInterceptor.java
===================================================================
---
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/interceptor/CatInterceptor.java
(rev 0)
+++
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/interceptor/CatInterceptor.java 2009-07-28
07:26:03 UTC (rev 3301)
@@ -0,0 +1,16 @@
+package org.jboss.jsr299.tck.tests.lookup.typesafe.resolution.interceptor;
+
+import javax.interceptor.AroundInvoke;
+import javax.interceptor.Interceptor;
+import javax.interceptor.InvocationContext;
+
+@Interceptor
+@InterceptorBinding
+class CatInterceptor extends Cat
+{
+
+ @AroundInvoke
+ public Object intercept(InvocationContext ctx) throws Exception {
+ return ctx.proceed();
+ }
+}
Added:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/interceptor/InterceptorBinding.java
===================================================================
---
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/interceptor/InterceptorBinding.java
(rev 0)
+++
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/interceptor/InterceptorBinding.java 2009-07-28
07:26:03 UTC (rev 3301)
@@ -0,0 +1,18 @@
+package org.jboss.jsr299.tck.tests.lookup.typesafe.resolution.interceptor;
+
+import java.lang.annotation.Inherited;
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+import javax.interceptor.InterceptorBindingType;
+
+@Inherited
+@InterceptorBindingType
+@Target( { TYPE, METHOD })
+@Retention(RUNTIME)
+@interface InterceptorBinding
+{
+}
Added:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/interceptor/InterceptorNotResolvedTest.java
===================================================================
---
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/interceptor/InterceptorNotResolvedTest.java
(rev 0)
+++
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/interceptor/InterceptorNotResolvedTest.java 2009-07-28
07:26:03 UTC (rev 3301)
@@ -0,0 +1,51 @@
+/*
+ * 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.interceptor;
+
+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;
+
+@Artifact
+(a)BeansXml("beans.xml")
+@SpecVersion("20090625")
+public class InterceptorNotResolvedTest extends AbstractJSR299Test
+{
+
+ @Test(groups = { "ri-broken", "resolution" })
+ @SpecAssertion(section = "5.3", id = "hq")
+ // WBRI-260
+ // WBRI-321
+ public void testInterceptorNotResolved()
+ {
+ Set<Type> types = new HashSet<Type>();
+ for (Bean<Cat> bean : getBeans(Cat.class)) {
+ types.addAll(bean.getTypes());
+ }
+ assert !types.contains(CatInterceptor.class);
+ assert getInstanceByType(Cat.class) != null;
+ }
+}
Added:
tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/decorator/beans.xml
===================================================================
---
tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/decorator/beans.xml
(rev 0)
+++
tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/decorator/beans.xml 2009-07-28
07:26:03 UTC (rev 3301)
@@ -0,0 +1,5 @@
+<beans>
+ <decorators>
+
<class>org.jboss.jsr299.tck.tests.lookup.typesafe.resolution.decorator.CatDecorator</class>
+ </decorators>
+</beans>
Added:
tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/interceptor/beans.xml
===================================================================
---
tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/interceptor/beans.xml
(rev 0)
+++
tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/interceptor/beans.xml 2009-07-28
07:26:03 UTC (rev 3301)
@@ -0,0 +1,5 @@
+<beans>
+ <interceptors>
+
<class>org.jboss.jsr299.tck.tests.lookup.typesafe.resolution.interceptor.CatInterceptor</class>
+ </interceptors>
+</beans>