Weld SVN: r5837 - cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/interceptors/tests/lifecycleCallback.
by weld-commits@lists.jboss.org
Author: jharting
Date: 2010-02-15 06:02:52 -0500 (Mon, 15 Feb 2010)
New Revision: 5837
Added:
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/interceptors/tests/lifecycleCallback/AnimalInterceptor.java
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/interceptors/tests/lifecycleCallback/Cow.java
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/interceptors/tests/lifecycleCallback/Hen.java
Removed:
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/interceptors/tests/lifecycleCallback/GoatInterceptor.java
Modified:
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/interceptors/tests/lifecycleCallback/Goat.java
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/interceptors/tests/lifecycleCallback/LifecycleCallbackInterceptorTest.java
Log:
Tests for WELD-436
Copied: cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/interceptors/tests/lifecycleCallback/AnimalInterceptor.java (from rev 5715, cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/interceptors/tests/lifecycleCallback/GoatInterceptor.java)
===================================================================
--- cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/interceptors/tests/lifecycleCallback/AnimalInterceptor.java (rev 0)
+++ cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/interceptors/tests/lifecycleCallback/AnimalInterceptor.java 2010-02-15 11:02:52 UTC (rev 5837)
@@ -0,0 +1,82 @@
+/*
+ * 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.interceptors.tests.lifecycleCallback;
+
+import java.util.HashSet;
+import java.util.Set;
+
+import javax.annotation.PostConstruct;
+import javax.annotation.PreDestroy;
+import javax.interceptor.AroundInvoke;
+import javax.interceptor.InvocationContext;
+
+class AnimalInterceptor
+{
+ private static Set<Class<?>> postConstructInterceptorCalledFor = new HashSet<Class<?>>();
+ private static Set<Class<?>> preDestroyInterceptorCalledFor = new HashSet<Class<?>>();
+
+ @PostConstruct
+ public void postConstruct(InvocationContext ctx)
+ {
+ postConstructInterceptorCalledFor.add(ctx.getTarget().getClass());
+ try
+ {
+ ctx.proceed();
+ }
+ catch (Exception e)
+ {
+ throw new RuntimeException(e);
+ }
+ }
+
+ @AroundInvoke
+ public Object intercept(InvocationContext ctx) throws Exception
+ {
+ if (ctx.getMethod().getName().equals("echo"))
+ {
+ return ctx.proceed() + ctx.getParameters()[0].toString();
+ }
+ else
+ {
+ return ctx.proceed();
+ }
+ }
+
+ @PreDestroy
+ public void preDestroy(InvocationContext ctx)
+ {
+ preDestroyInterceptorCalledFor.add(ctx.getTarget().getClass());
+ try
+ {
+ ctx.proceed();
+ }
+ catch (Exception e)
+ {
+ throw new RuntimeException(e);
+ }
+ }
+
+ public static boolean isPostConstructInterceptorCalled(Class<?> clazz)
+ {
+ return postConstructInterceptorCalledFor.contains(clazz);
+ }
+
+ public static boolean isPreDestroyInterceptorCalled(Class<?> clazz)
+ {
+ return preDestroyInterceptorCalledFor.contains(clazz);
+ }
+}
Added: cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/interceptors/tests/lifecycleCallback/Cow.java
===================================================================
--- cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/interceptors/tests/lifecycleCallback/Cow.java (rev 0)
+++ cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/interceptors/tests/lifecycleCallback/Cow.java 2010-02-15 11:02:52 UTC (rev 5837)
@@ -0,0 +1,57 @@
+/*
+ * 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.interceptors.tests.lifecycleCallback;
+
+import javax.annotation.PostConstruct;
+import javax.annotation.PreDestroy;
+import javax.enterprise.context.RequestScoped;
+import javax.interceptor.Interceptors;
+
+(a)Interceptors(AnimalInterceptor.class)
+@RequestScoped
+class Cow
+{
+ private static boolean postConstructInterceptorCalled = false;
+ private static boolean preDestroyInterceptorCalled = false;
+
+ @PostConstruct
+ public void postConstruct()
+ {
+ postConstructInterceptorCalled = true;
+ }
+
+ public String echo(String message)
+ {
+ return message;
+ }
+
+ @PreDestroy
+ public void preDestroy()
+ {
+ preDestroyInterceptorCalled = true;
+ }
+
+ public static boolean isPostConstructInterceptorCalled()
+ {
+ return postConstructInterceptorCalled;
+ }
+
+ public static boolean isPreDestroyInterceptorCalled()
+ {
+ return preDestroyInterceptorCalled;
+ }
+}
Modified: cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/interceptors/tests/lifecycleCallback/Goat.java
===================================================================
--- cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/interceptors/tests/lifecycleCallback/Goat.java 2010-02-15 08:42:46 UTC (rev 5836)
+++ cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/interceptors/tests/lifecycleCallback/Goat.java 2010-02-15 11:02:52 UTC (rev 5837)
@@ -20,7 +20,7 @@
import javax.annotation.PreDestroy;
import javax.interceptor.Interceptors;
-(a)Interceptors(GoatInterceptor.class)
+(a)Interceptors(AnimalInterceptor.class)
class Goat
{
private static boolean postConstructInterceptorCalled = false;
@@ -31,12 +31,12 @@
{
postConstructInterceptorCalled = true;
}
-
+
public String echo(String message)
{
return message;
}
-
+
@PreDestroy
public void preDestroy()
{
Deleted: cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/interceptors/tests/lifecycleCallback/GoatInterceptor.java
===================================================================
--- cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/interceptors/tests/lifecycleCallback/GoatInterceptor.java 2010-02-15 08:42:46 UTC (rev 5836)
+++ cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/interceptors/tests/lifecycleCallback/GoatInterceptor.java 2010-02-15 11:02:52 UTC (rev 5837)
@@ -1,71 +0,0 @@
-/*
- * 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.interceptors.tests.lifecycleCallback;
-
-import javax.annotation.PostConstruct;
-import javax.annotation.PreDestroy;
-import javax.interceptor.AroundInvoke;
-import javax.interceptor.InvocationContext;
-
-class GoatInterceptor
-{
- private static boolean postConstructInterceptorCalled = false;
- private static boolean preDestroyInterceptorCalled = false;
-
- @PostConstruct
- public void postConstruct(InvocationContext ctx)
- {
- postConstructInterceptorCalled = true;
- try
- {
- ctx.proceed();
- }
- catch (Exception e)
- {
- throw new RuntimeException(e);
- }
- }
-
- @AroundInvoke
- public Object intercept(InvocationContext ctx) throws Exception {
- return ctx.proceed() + ctx.getParameters()[0].toString();
- }
-
- @PreDestroy
- public void preDestroy(InvocationContext ctx)
- {
- preDestroyInterceptorCalled = true;
- try
- {
- ctx.proceed();
- }
- catch (Exception e)
- {
- throw new RuntimeException(e);
- }
- }
-
- public static boolean isPostConstructInterceptorCalled()
- {
- return postConstructInterceptorCalled;
- }
-
- public static boolean isPreDestroyInterceptorCalled()
- {
- return preDestroyInterceptorCalled;
- }
-}
Added: cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/interceptors/tests/lifecycleCallback/Hen.java
===================================================================
--- cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/interceptors/tests/lifecycleCallback/Hen.java (rev 0)
+++ cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/interceptors/tests/lifecycleCallback/Hen.java 2010-02-15 11:02:52 UTC (rev 5837)
@@ -0,0 +1,57 @@
+/*
+ * 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.interceptors.tests.lifecycleCallback;
+
+import javax.annotation.PostConstruct;
+import javax.annotation.PreDestroy;
+import javax.enterprise.context.ApplicationScoped;
+import javax.interceptor.Interceptors;
+
+(a)Interceptors(AnimalInterceptor.class)
+@ApplicationScoped
+class Hen
+{
+ private static boolean postConstructInterceptorCalled = false;
+ private static boolean preDestroyInterceptorCalled = false;
+
+ @PostConstruct
+ public void postConstruct()
+ {
+ postConstructInterceptorCalled = true;
+ }
+
+ public String echo(String message)
+ {
+ return message;
+ }
+
+ @PreDestroy
+ public void preDestroy()
+ {
+ preDestroyInterceptorCalled = true;
+ }
+
+ public static boolean isPostConstructInterceptorCalled()
+ {
+ return postConstructInterceptorCalled;
+ }
+
+ public static boolean isPreDestroyInterceptorCalled()
+ {
+ return preDestroyInterceptorCalled;
+ }
+}
Modified: cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/interceptors/tests/lifecycleCallback/LifecycleCallbackInterceptorTest.java
===================================================================
--- cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/interceptors/tests/lifecycleCallback/LifecycleCallbackInterceptorTest.java 2010-02-15 08:42:46 UTC (rev 5836)
+++ cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/interceptors/tests/lifecycleCallback/LifecycleCallbackInterceptorTest.java 2010-02-15 11:02:52 UTC (rev 5837)
@@ -31,34 +31,53 @@
{
@Test
@SpecAssertion(section = "5", id = "a")
+ // WELD-436
public void testPostConstructInterceptor()
{
getInstanceByType(Goat.class);
assert Goat.isPostConstructInterceptorCalled();
- assert GoatInterceptor.isPostConstructInterceptorCalled();
+ assert AnimalInterceptor.isPostConstructInterceptorCalled(Goat.class);
+ getInstanceByType(Hen.class);
+ assert Hen.isPostConstructInterceptorCalled();
+ assert AnimalInterceptor.isPostConstructInterceptorCalled(Hen.class);
+ getInstanceByType(Cow.class);
+ assert Cow.isPostConstructInterceptorCalled();
+ assert AnimalInterceptor.isPostConstructInterceptorCalled(Cow.class);
}
-
+
@Test
@SpecAssertion(section = "5", id = "a")
+ // WELD-436
public void testPreDestroyInterceptor()
{
- // create the instance
- Bean<Goat> bean = getBeans(Goat.class).iterator().next();
- CreationalContext<Goat> ctx = getCurrentManager().createCreationalContext(bean);
- Goat instance = (Goat) getCurrentManager().getReference(bean, Goat.class, ctx);
+ createAndDestroyInstance(Goat.class);
+ assert Goat.isPreDestroyInterceptorCalled();
+ assert AnimalInterceptor.isPreDestroyInterceptorCalled(Goat.class);
+ createAndDestroyInstance(Hen.class);
+ assert Hen.isPreDestroyInterceptorCalled();
+ assert AnimalInterceptor.isPreDestroyInterceptorCalled(Hen.class);
+ createAndDestroyInstance(Hen.class);
+ assert Hen.isPreDestroyInterceptorCalled();
+ assert AnimalInterceptor.isPreDestroyInterceptorCalled(Hen.class);
+ }
+
+ @SuppressWarnings("unchecked")
+ private <T> void createAndDestroyInstance(Class<T> clazz)
+ {
+ Bean<T> bean = getBeans(clazz).iterator().next();
+ CreationalContext<T> ctx = getCurrentManager().createCreationalContext(bean);
+ T instance = (T) getCurrentManager().getReference(bean, clazz, ctx);
// destroy the instance
bean.destroy(instance, ctx);
- assert Goat.isPreDestroyInterceptorCalled();
- assert GoatInterceptor.isPreDestroyInterceptorCalled();
}
-
+
@Test
@SpecAssertion(section = "5", id = "c")
public void testAroundInvokeAndLifeCycleCallbackInterceptorsCanBeDefinedOnTheSameClass()
{
assert getInstanceByType(Goat.class).echo("foo").equals("foofoo");
}
-
+
@Test
@SpecAssertion(section = "5", id = "j")
public void testPublicLifecycleInterceptorMethod()
@@ -66,7 +85,7 @@
getInstanceByType(Chicken.class);
assert PublicLifecycleInterceptor.isIntercepted();
}
-
+
@Test
@SpecAssertion(section = "5", id = "k")
public void testProtectedLifecycleInterceptorMethod()
@@ -74,7 +93,7 @@
getInstanceByType(Chicken.class);
assert ProtectedLifecycleInterceptor.isIntercepted();
}
-
+
@Test
@SpecAssertion(section = "5", id = "l")
public void testPrivateLifecycleInterceptorMethod()
@@ -82,7 +101,7 @@
getInstanceByType(Chicken.class);
assert PrivateLifecycleInterceptor.isIntercepted();
}
-
+
@Test
@SpecAssertion(section = "5", id = "m")
public void testPackagePrivateLifecycleInterceptorMethod()
@@ -90,7 +109,7 @@
getInstanceByType(Chicken.class);
assert PackagePrivateLifecycleInterceptor.isIntercepted();
}
-
+
@Test
@SpecAssertion(section = "8", id = "c")
public void testLifeCycleCallbackInterceptorNotInvokedForMethodLevelInterceptor()
15 years, 7 months
Weld SVN: r5836 - core/trunk/jboss-as.
by weld-commits@lists.jboss.org
Author: mgencur(a)redhat.com
Date: 2010-02-15 03:42:46 -0500 (Mon, 15 Feb 2010)
New Revision: 5836
Modified:
core/trunk/jboss-as/pom.xml
Log:
added deleting of weld.deployer in all configuration before creating new
Modified: core/trunk/jboss-as/pom.xml
===================================================================
--- core/trunk/jboss-as/pom.xml 2010-02-12 13:55:19 UTC (rev 5835)
+++ core/trunk/jboss-as/pom.xml 2010-02-15 08:42:46 UTC (rev 5836)
@@ -88,7 +88,10 @@
<delete
dir="${jboss.home}/server/default/deployers/webbeans.deployer"
failonerror="false" />
-
+ <delete
+ dir="${jboss.home}/server/all/deployers/weld.deployer"
+ failonerror="false" />
+
<unzip dest="${project.build.directory}"
src="${project.build.directory}/dependency/lib/weld-jboss-int-deployer-assembly.zip" />
15 years, 7 months
Weld SVN: r5835 - in cdi-tck/branches/1.0/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation: simple/lifecycle and 1 other directory.
by weld-commits@lists.jboss.org
Author: oskutka(a)redhat.com
Date: 2010-02-12 08:55:19 -0500 (Fri, 12 Feb 2010)
New Revision: 5835
Modified:
cdi-tck/branches/1.0/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/initializer/EjbInitializerMethodTest.java
cdi-tck/branches/1.0/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/lifecycle/SimpleBeanLifecycleTest.java
Log:
Minor typo bug fixes.
Modified: cdi-tck/branches/1.0/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/initializer/EjbInitializerMethodTest.java
===================================================================
--- cdi-tck/branches/1.0/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/initializer/EjbInitializerMethodTest.java 2010-02-12 12:44:20 UTC (rev 5834)
+++ cdi-tck/branches/1.0/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/initializer/EjbInitializerMethodTest.java 2010-02-12 13:55:19 UTC (rev 5835)
@@ -41,6 +41,6 @@
{
AndalusianChicken.nonBusinessMethodCalled = false;
getInstanceByType(LocalChicken.class).cluck();
- assert AndalusianChicken.nonBusinessMethodCalled = true;
+ assert AndalusianChicken.nonBusinessMethodCalled;
}
}
Modified: cdi-tck/branches/1.0/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/lifecycle/SimpleBeanLifecycleTest.java
===================================================================
--- cdi-tck/branches/1.0/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/lifecycle/SimpleBeanLifecycleTest.java 2010-02-12 12:44:20 UTC (rev 5834)
+++ cdi-tck/branches/1.0/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/lifecycle/SimpleBeanLifecycleTest.java 2010-02-12 13:55:19 UTC (rev 5835)
@@ -155,7 +155,7 @@
assert fishPond.goldfish instanceof Goldfish;
assert fishPond.goose != null;
assert fishPond.salmon != null;
- assert fishPond.postConstructCalled = true; // required by Managed Bean specification
+ assert fishPond.postConstructCalled; // required by Managed Bean specification
}
@Test(groups = {"beanLifecycle"})
15 years, 7 months
Weld SVN: r5834 - in cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation: simple/lifecycle and 1 other directory.
by weld-commits@lists.jboss.org
Author: oskutka(a)redhat.com
Date: 2010-02-12 07:44:20 -0500 (Fri, 12 Feb 2010)
New Revision: 5834
Modified:
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/initializer/EjbInitializerMethodTest.java
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/lifecycle/SimpleBeanLifecycleTest.java
Log:
Minor typo bug fixes.
Modified: cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/initializer/EjbInitializerMethodTest.java
===================================================================
--- cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/initializer/EjbInitializerMethodTest.java 2010-02-12 05:07:37 UTC (rev 5833)
+++ cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/initializer/EjbInitializerMethodTest.java 2010-02-12 12:44:20 UTC (rev 5834)
@@ -41,6 +41,6 @@
{
AndalusianChicken.nonBusinessMethodCalled = false;
getInstanceByType(LocalChicken.class).cluck();
- assert AndalusianChicken.nonBusinessMethodCalled = true;
+ assert AndalusianChicken.nonBusinessMethodCalled;
}
}
Modified: cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/lifecycle/SimpleBeanLifecycleTest.java
===================================================================
--- cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/lifecycle/SimpleBeanLifecycleTest.java 2010-02-12 05:07:37 UTC (rev 5833)
+++ cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/lifecycle/SimpleBeanLifecycleTest.java 2010-02-12 12:44:20 UTC (rev 5834)
@@ -155,7 +155,7 @@
assert fishPond.goldfish instanceof Goldfish;
assert fishPond.goose != null;
assert fishPond.salmon != null;
- assert fishPond.postConstructCalled = true; // required by Managed Bean specification
+ assert fishPond.postConstructCalled; // required by Managed Bean specification
}
@Test(groups = {"beanLifecycle"})
15 years, 7 months
Weld SVN: r5833 - in core/trunk/tests: src/test/java/org/jboss/weld/tests and 1 other directories.
by weld-commits@lists.jboss.org
Author: dan.j.allen
Date: 2010-02-12 00:07:37 -0500 (Fri, 12 Feb 2010)
New Revision: 5833
Added:
core/trunk/tests/src/test/java/org/jboss/weld/tests/jsf/
core/trunk/tests/src/test/java/org/jboss/weld/tests/jsf/JsfApiAbstractionTest.java
Modified:
core/trunk/tests/pom.xml
Log:
WELD-434
Also added tests for JsfApiAbstraction, both in the case of JSF 1.2 and 2.0
Modified: core/trunk/tests/pom.xml
===================================================================
--- core/trunk/tests/pom.xml 2010-02-09 12:24:56 UTC (rev 5832)
+++ core/trunk/tests/pom.xml 2010-02-12 05:07:37 UTC (rev 5833)
@@ -116,6 +116,8 @@
<dependency>
<groupId>javax.faces</groupId>
<artifactId>jsf-api</artifactId>
+ <!-- override for testing compatibility w/ JSF 2.0 -->
+ <version>2.0.2-FCS</version>
</dependency>
<dependency>
Added: core/trunk/tests/src/test/java/org/jboss/weld/tests/jsf/JsfApiAbstractionTest.java
===================================================================
--- core/trunk/tests/src/test/java/org/jboss/weld/tests/jsf/JsfApiAbstractionTest.java (rev 0)
+++ core/trunk/tests/src/test/java/org/jboss/weld/tests/jsf/JsfApiAbstractionTest.java 2010-02-12 05:07:37 UTC (rev 5833)
@@ -0,0 +1,64 @@
+package org.jboss.weld.tests.jsf;
+
+import javax.faces.component.behavior.Behavior;
+import javax.faces.context.FacesContext;
+import org.jboss.testharness.impl.packaging.Artifact;
+import org.jboss.weld.jsf.JsfApiAbstraction;
+import org.jboss.weld.resources.DefaultResourceLoader;
+import org.jboss.weld.resources.spi.ResourceLoader;
+import org.jboss.weld.resources.spi.ResourceLoadingException;
+import org.jboss.weld.test.AbstractWeldTest;
+import org.jboss.weld.util.ApiAbstraction.Dummy;
+import org.testng.annotations.Test;
+
+/**
+ * @author Dan Allen
+ */
+@Artifact
+public class JsfApiAbstractionTest extends AbstractWeldTest {
+ @Test
+ public void testDetectsJsf12Version() {
+ JsfApiAbstraction abstraction = new JsfApiAbstraction(getResourceLoaderHidingJsf20Classes());
+ assert abstraction.MINIMUM_API_VERSION == 1.2;
+ assert abstraction.isApiVersionCompatibleWith(2.0) == false;
+ }
+
+ @Test
+ public void testLoadsJsf12Classes() {
+ JsfApiAbstraction abstraction = new JsfApiAbstraction(getResourceLoaderHidingJsf20Classes());
+ assert FacesContext.class.equals(abstraction.FACES_CONTEXT);
+ assert Dummy.class.equals(abstraction.BEHAVIOR_CLASS);
+ }
+
+ @Test
+ public void testDetectsJsf20Version() {
+ JsfApiAbstraction abstraction = new JsfApiAbstraction(getResourceLoader());
+ assert abstraction.MINIMUM_API_VERSION == 2.0;
+ assert abstraction.isApiVersionCompatibleWith(2.0);
+ }
+
+ @Test
+ public void testLoadsJsf20Classes() {
+ JsfApiAbstraction abstraction = new JsfApiAbstraction(getResourceLoader());
+ assert FacesContext.class.equals(abstraction.FACES_CONTEXT);
+ assert Behavior.class.equals(abstraction.BEHAVIOR_CLASS);
+ }
+
+ private ResourceLoader getResourceLoader() {
+ return new DefaultResourceLoader();
+ }
+
+ private ResourceLoader getResourceLoaderHidingJsf20Classes() {
+ return new DefaultResourceLoader() {
+
+ @Override
+ public Class<?> classForName(String name) {
+ if ("javax.faces.component.behavior.Behavior".equals(name)) {
+ throw new ResourceLoadingException("Hidden class");
+ }
+ return super.classForName(name);
+ }
+
+ };
+ }
+}
15 years, 7 months
Weld SVN: r5832 - cdi-tck/branches/1.0/impl/src/main/java/org/jboss/jsr299/tck/tests/decorators/custom.
by weld-commits@lists.jboss.org
Author: jharting
Date: 2010-02-09 07:24:56 -0500 (Tue, 09 Feb 2010)
New Revision: 5832
Modified:
cdi-tck/branches/1.0/impl/src/main/java/org/jboss/jsr299/tck/tests/decorators/custom/CustomDecoratorTest.java
Log:
CDITCK-107
Modified: cdi-tck/branches/1.0/impl/src/main/java/org/jboss/jsr299/tck/tests/decorators/custom/CustomDecoratorTest.java
===================================================================
--- cdi-tck/branches/1.0/impl/src/main/java/org/jboss/jsr299/tck/tests/decorators/custom/CustomDecoratorTest.java 2010-02-09 12:24:26 UTC (rev 5831)
+++ cdi-tck/branches/1.0/impl/src/main/java/org/jboss/jsr299/tck/tests/decorators/custom/CustomDecoratorTest.java 2010-02-09 12:24:56 UTC (rev 5832)
@@ -36,6 +36,7 @@
@Extension("javax.enterprise.inject.spi.Extension")
public class CustomDecoratorTest extends AbstractJSR299Test
{
+ @SuppressWarnings("unchecked")
@Test
@SpecAssertion(section = "8.3", id = "b")
public void testCustomImplementationOfDecoratorInterface()
15 years, 7 months
Weld SVN: r5831 - cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/decorators/custom.
by weld-commits@lists.jboss.org
Author: jharting
Date: 2010-02-09 07:24:26 -0500 (Tue, 09 Feb 2010)
New Revision: 5831
Modified:
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/decorators/custom/CustomDecoratorTest.java
Log:
CDITCK-107
Modified: cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/decorators/custom/CustomDecoratorTest.java
===================================================================
--- cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/decorators/custom/CustomDecoratorTest.java 2010-02-09 12:22:42 UTC (rev 5830)
+++ cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/decorators/custom/CustomDecoratorTest.java 2010-02-09 12:24:26 UTC (rev 5831)
@@ -36,6 +36,7 @@
@Extension("javax.enterprise.inject.spi.Extension")
public class CustomDecoratorTest extends AbstractJSR299Test
{
+ @SuppressWarnings("unchecked")
@Test
@SpecAssertion(section = "8.3", id = "b")
public void testCustomImplementationOfDecoratorInterface()
@@ -46,6 +47,6 @@
assert AfterBeanDiscoveryObserver.getDecorator().isGetDelegateQualifiersCalled();
assert AfterBeanDiscoveryObserver.getDecorator().isGetDelegateTypeCalled();
assert !getCurrentManager().resolveDecorators(new HashSet<Type>(Arrays.asList(Vehicle.class))).isEmpty();
- assert !getCurrentManager().resolveDecorators(new HashSet<Type>(Arrays.asList(Bus.class))).isEmpty();
+ assert !getCurrentManager().resolveDecorators(new HashSet<Type>(Arrays.asList(Vehicle.class, Bus.class))).isEmpty();
}
}
15 years, 7 months
Weld SVN: r5830 - cdi-tck/branches/1.0/impl/src/main/java/org/jboss/jsr299/tck/tests/decorators/custom.
by weld-commits@lists.jboss.org
Author: jharting
Date: 2010-02-09 07:22:42 -0500 (Tue, 09 Feb 2010)
New Revision: 5830
Modified:
cdi-tck/branches/1.0/impl/src/main/java/org/jboss/jsr299/tck/tests/decorators/custom/CustomDecoratorTest.java
Log:
CDITCK-107
Modified: cdi-tck/branches/1.0/impl/src/main/java/org/jboss/jsr299/tck/tests/decorators/custom/CustomDecoratorTest.java
===================================================================
--- cdi-tck/branches/1.0/impl/src/main/java/org/jboss/jsr299/tck/tests/decorators/custom/CustomDecoratorTest.java 2010-02-09 11:06:56 UTC (rev 5829)
+++ cdi-tck/branches/1.0/impl/src/main/java/org/jboss/jsr299/tck/tests/decorators/custom/CustomDecoratorTest.java 2010-02-09 12:22:42 UTC (rev 5830)
@@ -46,6 +46,6 @@
assert AfterBeanDiscoveryObserver.getDecorator().isGetDelegateQualifiersCalled();
assert AfterBeanDiscoveryObserver.getDecorator().isGetDelegateTypeCalled();
assert !getCurrentManager().resolveDecorators(new HashSet<Type>(Arrays.asList(Vehicle.class))).isEmpty();
- assert !getCurrentManager().resolveDecorators(new HashSet<Type>(Arrays.asList(Bus.class))).isEmpty();
+ assert !getCurrentManager().resolveDecorators(new HashSet<Type>(Arrays.asList(Vehicle.class, Bus.class))).isEmpty();
}
}
15 years, 7 months
Weld SVN: r5829 - in cdi-tck/trunk/impl/src/main: java/org/jboss/jsr299/tck/tests/decorators/definition/broken/notAllDecoratedTypesImplemented and 5 other directories.
by weld-commits@lists.jboss.org
Author: jharting
Date: 2010-02-09 06:06:56 -0500 (Tue, 09 Feb 2010)
New Revision: 5829
Added:
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/decorators/definition/broken/parameterizedTypesWithDifferentTypeParameters/
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/decorators/definition/broken/parameterizedTypesWithDifferentTypeParameters/DifferentTypeParametersTest.java
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/decorators/definition/broken/parameterizedTypesWithDifferentTypeParameters/Radio.java
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/decorators/definition/broken/parameterizedTypesWithDifferentTypeParameters/RadioDecorator.java
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/decorators/definition/broken/parameterizedTypesWithDifferentTypeParameters/RadioProducer.java
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/decorators/invocation/Bar.java
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/decorators/invocation/BarDecorator.java
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/decorators/invocation/BarImpl.java
cdi-tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/decorators/definition/broken/parameterizedTypesWithDifferentTypeParameters/
cdi-tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/decorators/definition/broken/parameterizedTypesWithDifferentTypeParameters/beans.xml
Modified:
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/decorators/definition/broken/notAllDecoratedTypesImplemented/NotAllDecoratedTypesImplementedTest.java
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/decorators/invocation/DecoratorInvocationTest.java
cdi-tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/decorators/invocation/beans.xml
Log:
Tests for decorators
Modified: cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/decorators/definition/broken/notAllDecoratedTypesImplemented/NotAllDecoratedTypesImplementedTest.java
===================================================================
--- cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/decorators/definition/broken/notAllDecoratedTypesImplemented/NotAllDecoratedTypesImplementedTest.java 2010-02-09 09:44:08 UTC (rev 5828)
+++ cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/decorators/definition/broken/notAllDecoratedTypesImplemented/NotAllDecoratedTypesImplementedTest.java 2010-02-09 11:06:56 UTC (rev 5829)
@@ -40,7 +40,7 @@
@SpecAssertion(section="8.1.3", id="a")
public void testNotAllDecoratedTypesImplemented()
{
-
+ assert false;
}
}
Added: cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/decorators/definition/broken/parameterizedTypesWithDifferentTypeParameters/DifferentTypeParametersTest.java
===================================================================
--- cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/decorators/definition/broken/parameterizedTypesWithDifferentTypeParameters/DifferentTypeParametersTest.java (rev 0)
+++ cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/decorators/definition/broken/parameterizedTypesWithDifferentTypeParameters/DifferentTypeParametersTest.java 2010-02-09 11:06:56 UTC (rev 5829)
@@ -0,0 +1,45 @@
+/*
+ * 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.decorators.definition.broken.parameterizedTypesWithDifferentTypeParameters;
+
+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;
+
+/**
+ * @author pmuir
+ *
+ */
+@Artifact
+(a)ExpectedDeploymentException(DeploymentFailure.class)
+@BeansXml("beans.xml")
+@SpecVersion(spec="cdi", version="20091101")
+public class DifferentTypeParametersTest extends AbstractJSR299Test
+{
+
+ @Test
+ @SpecAssertion(section="8.1.3", id="ab")
+ public void testTypeParametersOnDecoratedTypeAndDelegateTypeDoNotMatch()
+ {
+ assert false;
+ }
+}
Added: cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/decorators/definition/broken/parameterizedTypesWithDifferentTypeParameters/Radio.java
===================================================================
--- cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/decorators/definition/broken/parameterizedTypesWithDifferentTypeParameters/Radio.java (rev 0)
+++ cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/decorators/definition/broken/parameterizedTypesWithDifferentTypeParameters/Radio.java 2010-02-09 11:06:56 UTC (rev 5829)
@@ -0,0 +1,22 @@
+/*
+ * 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.decorators.definition.broken.parameterizedTypesWithDifferentTypeParameters;
+
+public interface Radio<T1, T2>
+{
+
+}
Added: cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/decorators/definition/broken/parameterizedTypesWithDifferentTypeParameters/RadioDecorator.java
===================================================================
--- cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/decorators/definition/broken/parameterizedTypesWithDifferentTypeParameters/RadioDecorator.java (rev 0)
+++ cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/decorators/definition/broken/parameterizedTypesWithDifferentTypeParameters/RadioDecorator.java 2010-02-09 11:06:56 UTC (rev 5829)
@@ -0,0 +1,30 @@
+/*
+ * 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.decorators.definition.broken.parameterizedTypesWithDifferentTypeParameters;
+
+import java.util.List;
+
+import javax.decorator.Decorator;
+import javax.decorator.Delegate;
+import javax.inject.Inject;
+
+@Decorator
+public class RadioDecorator implements Radio<String, List<Number>>
+{
+ @Inject @Delegate
+ Radio<String, List<Integer>> delegate;
+}
Added: cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/decorators/definition/broken/parameterizedTypesWithDifferentTypeParameters/RadioProducer.java
===================================================================
--- cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/decorators/definition/broken/parameterizedTypesWithDifferentTypeParameters/RadioProducer.java (rev 0)
+++ cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/decorators/definition/broken/parameterizedTypesWithDifferentTypeParameters/RadioProducer.java 2010-02-09 11:06:56 UTC (rev 5829)
@@ -0,0 +1,31 @@
+/*
+ * 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.decorators.definition.broken.parameterizedTypesWithDifferentTypeParameters;
+
+import java.util.List;
+
+import javax.enterprise.context.RequestScoped;
+import javax.enterprise.inject.Produces;
+
+@RequestScoped
+public class RadioProducer
+{
+ @Produces
+ Radio<String, List<Integer>> radio = new Radio<String, List<Integer>>()
+ {
+ };
+}
Added: cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/decorators/invocation/Bar.java
===================================================================
--- cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/decorators/invocation/Bar.java (rev 0)
+++ cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/decorators/invocation/Bar.java 2010-02-09 11:06:56 UTC (rev 5829)
@@ -0,0 +1,22 @@
+/*
+ * 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.decorators.invocation;
+
+public interface Bar
+{
+ boolean foo();
+}
Added: cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/decorators/invocation/BarDecorator.java
===================================================================
--- cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/decorators/invocation/BarDecorator.java (rev 0)
+++ cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/decorators/invocation/BarDecorator.java 2010-02-09 11:06:56 UTC (rev 5829)
@@ -0,0 +1,45 @@
+/*
+ * 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.decorators.invocation;
+
+import javax.decorator.Decorator;
+import javax.decorator.Delegate;
+import javax.inject.Inject;
+
+@Decorator
+public class BarDecorator implements Bar
+{
+ private static BarDecorator decorator;
+
+ public BarDecorator()
+ {
+ decorator = this;
+ }
+
+ @Inject @Delegate
+ private Bar delegate;
+
+ public boolean foo()
+ {
+ return ! delegate.foo();
+ }
+
+ public static void invokeFooOutsideOfBusinessMethodInterception()
+ {
+ decorator.foo();
+ }
+}
Added: cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/decorators/invocation/BarImpl.java
===================================================================
--- cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/decorators/invocation/BarImpl.java (rev 0)
+++ cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/decorators/invocation/BarImpl.java 2010-02-09 11:06:56 UTC (rev 5829)
@@ -0,0 +1,26 @@
+/*
+ * 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.decorators.invocation;
+
+public class BarImpl implements Bar
+{
+
+ public boolean foo()
+ {
+ return false;
+ }
+}
Modified: cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/decorators/invocation/DecoratorInvocationTest.java
===================================================================
--- cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/decorators/invocation/DecoratorInvocationTest.java 2010-02-09 09:44:08 UTC (rev 5828)
+++ cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/decorators/invocation/DecoratorInvocationTest.java 2010-02-09 11:06:56 UTC (rev 5829)
@@ -84,4 +84,12 @@
FooImpl.reset();
}
+ @Test(expectedExceptions = IllegalStateException.class)
+ @SpecAssertion(section="8.1.2", id="g")
+ //WELD-430
+ public void testDecoratorInvokesDelegateMethodOutsideOfBusinessMethodInterception()
+ {
+ assert getInstanceByType(Bar.class).foo();
+ BarDecorator.invokeFooOutsideOfBusinessMethodInterception();
+ }
}
Added: cdi-tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/decorators/definition/broken/parameterizedTypesWithDifferentTypeParameters/beans.xml
===================================================================
--- cdi-tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/decorators/definition/broken/parameterizedTypesWithDifferentTypeParameters/beans.xml (rev 0)
+++ cdi-tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/decorators/definition/broken/parameterizedTypesWithDifferentTypeParameters/beans.xml 2010-02-09 11:06:56 UTC (rev 5829)
@@ -0,0 +1,5 @@
+<beans>
+ <decorators>
+ <class>org.jboss.jsr299.tck.tests.decorators.definition.broken.parameterizedTypesWithDifferentTypeParameters.RadioDecorator</class>
+ </decorators>
+</beans>
Modified: cdi-tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/decorators/invocation/beans.xml
===================================================================
--- cdi-tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/decorators/invocation/beans.xml 2010-02-09 09:44:08 UTC (rev 5828)
+++ cdi-tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/decorators/invocation/beans.xml 2010-02-09 11:06:56 UTC (rev 5829)
@@ -4,5 +4,6 @@
<class>org.jboss.jsr299.tck.tests.decorators.invocation.FooDecorator1</class>
<class>org.jboss.jsr299.tck.tests.decorators.invocation.FooDecorator2</class>
<class>org.jboss.jsr299.tck.tests.decorators.invocation.PigStyDecorator</class>
+ <class>org.jboss.jsr299.tck.tests.decorators.invocation.BarDecorator</class>
</decorators>
</beans>
15 years, 7 months
Weld SVN: r5828 - cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dynamic.
by weld-commits@lists.jboss.org
Author: jharting
Date: 2010-02-09 04:44:08 -0500 (Tue, 09 Feb 2010)
New Revision: 5828
Modified:
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dynamic/DynamicLookupTest.java
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dynamic/ObtainsNewInstanceBean.java
Log:
Added test for TypeLiteral
Modified: cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dynamic/DynamicLookupTest.java
===================================================================
--- cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dynamic/DynamicLookupTest.java 2010-02-09 09:40:13 UTC (rev 5827)
+++ cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dynamic/DynamicLookupTest.java 2010-02-09 09:44:08 UTC (rev 5828)
@@ -17,12 +17,15 @@
package org.jboss.jsr299.tck.tests.lookup.dynamic;
+import java.util.ArrayList;
import java.util.Iterator;
+import java.util.List;
import javax.enterprise.inject.AmbiguousResolutionException;
import javax.enterprise.inject.Instance;
import javax.enterprise.inject.UnsatisfiedResolutionException;
import javax.enterprise.util.AnnotationLiteral;
+import javax.enterprise.util.TypeLiteral;
import org.jboss.jsr299.tck.AbstractJSR299Test;
import org.jboss.jsr299.tck.literals.AnyLiteral;
@@ -106,7 +109,8 @@
@SpecAssertion(section="5.6.1", id="aa"),
@SpecAssertion(section="5.6.1", id="ba"),
@SpecAssertion(section="5.6.1", id="ja"),
- @SpecAssertion(section="5.6.1", id="ka")
+ @SpecAssertion(section="5.6.1", id="ka"),
+ @SpecAssertion(section="5.6.3", id="a")
})
public void testIteratorMethod()
{
@@ -178,10 +182,15 @@
}
@Test
- @SpecAssertion(section = "5.6", id = "e")
+ @SpecAssertions({
+ @SpecAssertion(section = "5.6", id = "e"),
+ @SpecAssertion(section = "5.6.3", id = "b")
+ })
+ @SuppressWarnings("serial")
public void testNewBean()
{
- assert getInstanceByType(ObtainsNewInstanceBean.class).getNpe().get() != null;
+ Instance<List<String>> instance = getInstanceByType(ObtainsNewInstanceBean.class).getStrings();
+ assert instance.select(new TypeLiteral<ArrayList<String>>(){}).get() instanceof ArrayList<?>;
}
@Test
Modified: cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dynamic/ObtainsNewInstanceBean.java
===================================================================
--- cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dynamic/ObtainsNewInstanceBean.java 2010-02-09 09:40:13 UTC (rev 5827)
+++ cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dynamic/ObtainsNewInstanceBean.java 2010-02-09 09:44:08 UTC (rev 5828)
@@ -16,6 +16,9 @@
*/
package org.jboss.jsr299.tck.tests.lookup.dynamic;
+import java.util.ArrayList;
+import java.util.List;
+
import javax.enterprise.inject.Instance;
import javax.enterprise.inject.New;
import javax.inject.Inject;
@@ -24,12 +27,12 @@
public class ObtainsNewInstanceBean
{
- @Inject @New(NullPointerException.class) Instance<NullPointerException> npe;
+ @Inject @New(ArrayList.class) Instance<List<String>> strings;
@Inject Instance<IllegalArgumentException> iae;
- public Instance<NullPointerException> getNpe()
+ public Instance<List<String>> getStrings()
{
- return npe;
+ return strings;
}
public Instance<IllegalArgumentException> getIae()
15 years, 7 months