[weld-commits] Weld SVN: r5829 - in cdi-tck/trunk/impl/src/main: java/org/jboss/jsr299/tck/tests/decorators/definition/broken/notAllDecoratedTypesImplemented and 5 other directories.
weld-commits at lists.jboss.org
weld-commits at lists.jboss.org
Tue Feb 9 06:06:57 EST 2010
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
+ *
+ */
+ at Artifact
+ at ExpectedDeploymentException(DeploymentFailure.class)
+ at BeansXml("beans.xml")
+ at 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;
+
+ at 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;
+
+ at 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;
+
+ at 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>
More information about the weld-commits
mailing list