[webbeans-commits] Webbeans SVN: r3108 - in extensions/trunk/se/src: main/java/org/jboss/webbeans/environment/se/beans and 2 other directories.
by webbeans-commits@lists.jboss.org
Author: peteroyle
Date: 2009-07-21 05:24:53 -0400 (Tue, 21 Jul 2009)
New Revision: 3108
Modified:
extensions/trunk/se/src/main/java/org/jboss/webbeans/environment/se/ShutdownManager.java
extensions/trunk/se/src/main/java/org/jboss/webbeans/environment/se/beans/ParametersFactory.java
extensions/trunk/se/src/main/java/org/jboss/webbeans/environment/se/util/WebBeansManagerUtils.java
extensions/trunk/se/src/test/java/org/jboss/webbeans/environment/se/test/beans/MainTestBean.java
Log:
Some basic API changes.
Modified: extensions/trunk/se/src/main/java/org/jboss/webbeans/environment/se/ShutdownManager.java
===================================================================
--- extensions/trunk/se/src/main/java/org/jboss/webbeans/environment/se/ShutdownManager.java 2009-07-21 09:03:23 UTC (rev 3107)
+++ extensions/trunk/se/src/main/java/org/jboss/webbeans/environment/se/ShutdownManager.java 2009-07-21 09:24:53 UTC (rev 3108)
@@ -1,9 +1,9 @@
package org.jboss.webbeans.environment.se;
import javax.enterprise.context.ApplicationScoped;
+import javax.enterprise.event.Observes;
import javax.enterprise.inject.Current;
import javax.enterprise.inject.spi.BeanManager;
-import javax.event.Observes;
import org.jboss.webbeans.bootstrap.api.Bootstrap;
import org.jboss.webbeans.environment.se.events.Shutdown;
Modified: extensions/trunk/se/src/main/java/org/jboss/webbeans/environment/se/beans/ParametersFactory.java
===================================================================
--- extensions/trunk/se/src/main/java/org/jboss/webbeans/environment/se/beans/ParametersFactory.java 2009-07-21 09:03:23 UTC (rev 3107)
+++ extensions/trunk/se/src/main/java/org/jboss/webbeans/environment/se/beans/ParametersFactory.java 2009-07-21 09:24:53 UTC (rev 3108)
@@ -22,10 +22,9 @@
import java.util.List;
import javax.enterprise.context.ApplicationScoped;
+import javax.enterprise.event.Observes;
import javax.enterprise.inject.Produces;
import javax.enterprise.inject.spi.AfterBeanDiscovery;
-import javax.enterprise.inject.spi.BeforeBeanDiscovery;
-import javax.event.Observes;
import org.jboss.webbeans.environment.se.StartMain;
import org.jboss.webbeans.environment.se.bindings.Parameters;
Modified: extensions/trunk/se/src/main/java/org/jboss/webbeans/environment/se/util/WebBeansManagerUtils.java
===================================================================
--- extensions/trunk/se/src/main/java/org/jboss/webbeans/environment/se/util/WebBeansManagerUtils.java 2009-07-21 09:03:23 UTC (rev 3107)
+++ extensions/trunk/se/src/main/java/org/jboss/webbeans/environment/se/util/WebBeansManagerUtils.java 2009-07-21 09:24:53 UTC (rev 3108)
@@ -21,12 +21,12 @@
/**
*
- * @author PeteR
+ * @author Peter Royle
*/
public class WebBeansManagerUtils {
public static <T> T getInstanceByType(BeanManager manager, Class<T> type, Annotation... bindings) {
return (T)manager.getReference(
- manager.getBeans(type).iterator().next(), type);
+ manager.getBeans(type).iterator().next(), type, null);
}
}
Modified: extensions/trunk/se/src/test/java/org/jboss/webbeans/environment/se/test/beans/MainTestBean.java
===================================================================
--- extensions/trunk/se/src/test/java/org/jboss/webbeans/environment/se/test/beans/MainTestBean.java 2009-07-21 09:03:23 UTC (rev 3107)
+++ extensions/trunk/se/src/test/java/org/jboss/webbeans/environment/se/test/beans/MainTestBean.java 2009-07-21 09:24:53 UTC (rev 3108)
@@ -17,10 +17,10 @@
package org.jboss.webbeans.environment.se.test.beans;
import javax.enterprise.context.ApplicationScoped;
+import javax.enterprise.event.Observes;
import javax.enterprise.inject.Current;
import javax.enterprise.inject.Initializer;
import javax.enterprise.inject.spi.AfterDeploymentValidation;
-import javax.event.Observes;
/**
*
15 years, 4 months
[webbeans-commits] Webbeans SVN: r3107 - tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/lookup/byname.
by webbeans-commits@lists.jboss.org
Author: jharting
Date: 2009-07-21 05:03:23 -0400 (Tue, 21 Jul 2009)
New Revision: 3107
Modified:
tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/lookup/byname/beans.xml
Log:
Resolution by name tests
Modified: tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/lookup/byname/beans.xml
===================================================================
--- tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/lookup/byname/beans.xml 2009-07-21 08:54:13 UTC (rev 3106)
+++ tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/lookup/byname/beans.xml 2009-07-21 09:03:23 UTC (rev 3107)
@@ -1,3 +1,5 @@
<beans>
-
+ <policies>
+ <class>org.jboss.jsr299.tck.tests.lookup.byname.Sole</class>
+ </policies>
</beans>
15 years, 4 months
[webbeans-commits] Webbeans SVN: r3106 - in tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/byname: duplicateNameResolution and 1 other directories.
by webbeans-commits@lists.jboss.org
Author: jharting
Date: 2009-07-21 04:54:13 -0400 (Tue, 21 Jul 2009)
New Revision: 3106
Added:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/byname/AlaskaPlaice.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/byname/duplicatePrefixResolution/
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/byname/duplicatePrefixResolution/DuplicateNamePrefixResolutionTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/byname/duplicatePrefixResolution/Example.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/byname/duplicatePrefixResolution/ExampleWebsite_Broken.java
Removed:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/byname/Chunky.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/byname/Haddock.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/byname/ScottishFish.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/byname/SeaBass.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/byname/Tuna.java
Modified:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/byname/Cod.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/byname/Plaice.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/byname/ResolutionByNameTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/byname/Salmon.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/byname/Sole.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/byname/duplicateNameResolution/Cod.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/byname/duplicateNameResolution/DuplicateNameResolutionTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/byname/duplicateNameResolution/Sole.java
Log:
Resolution by name tests
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/byname/AlaskaPlaice.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/byname/AlaskaPlaice.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/byname/AlaskaPlaice.java 2009-07-21 08:54:13 UTC (rev 3106)
@@ -0,0 +1,9 @@
+package org.jboss.jsr299.tck.tests.lookup.byname;
+
+import javax.enterprise.inject.Specializes;
+
+@Specializes
+class AlaskaPlaice extends Plaice
+{
+
+}
Deleted: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/byname/Chunky.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/byname/Chunky.java 2009-07-21 08:38:30 UTC (rev 3105)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/byname/Chunky.java 2009-07-21 08:54:13 UTC (rev 3106)
@@ -1,24 +0,0 @@
-package org.jboss.jsr299.tck.tests.lookup.byname;
-
-import static java.lang.annotation.ElementType.FIELD;
-import static java.lang.annotation.ElementType.METHOD;
-import static java.lang.annotation.ElementType.PARAMETER;
-import static java.lang.annotation.ElementType.TYPE;
-import static java.lang.annotation.RetentionPolicy.RUNTIME;
-
-import java.lang.annotation.Documented;
-import java.lang.annotation.Retention;
-import java.lang.annotation.Target;
-
-import javax.enterprise.inject.BindingType;
-
-@Target( { TYPE, METHOD, PARAMETER, FIELD })
-@Retention(RUNTIME)
-@Documented
-@BindingType
-@interface Chunky
-{
-
- boolean realChunky();
-
-}
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/byname/Cod.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/byname/Cod.java 2009-07-21 08:38:30 UTC (rev 3105)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/byname/Cod.java 2009-07-21 08:54:13 UTC (rev 3106)
@@ -1,13 +1,11 @@
package org.jboss.jsr299.tck.tests.lookup.byname;
import javax.enterprise.inject.Named;
-import javax.enterprise.inject.deployment.Production;
+import javax.enterprise.inject.Policy;
-@Production
-@Whitefish
-@Chunky(realChunky=true)
@Named("whitefish")
-class Cod implements ScottishFish
+@Policy
+class Cod implements Animal
{
}
Deleted: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/byname/Haddock.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/byname/Haddock.java 2009-07-21 08:38:30 UTC (rev 3105)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/byname/Haddock.java 2009-07-21 08:54:13 UTC (rev 3106)
@@ -1,11 +0,0 @@
-package org.jboss.jsr299.tck.tests.lookup.byname;
-
-import javax.enterprise.inject.Named;
-import javax.enterprise.inject.deployment.Production;
-
-@Production
-@Named
-class Haddock implements Animal
-{
-
-}
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/byname/Plaice.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/byname/Plaice.java 2009-07-21 08:38:30 UTC (rev 3105)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/byname/Plaice.java 2009-07-21 08:54:13 UTC (rev 3106)
@@ -2,9 +2,9 @@
import javax.enterprise.inject.Named;
+@Named("whitefish")
@Whitefish
-@Named("whitefish")
-final class Plaice implements Animal
+class Plaice implements Animal
{
}
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/byname/ResolutionByNameTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/byname/ResolutionByNameTest.java 2009-07-21 08:38:30 UTC (rev 3105)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/byname/ResolutionByNameTest.java 2009-07-21 08:54:13 UTC (rev 3106)
@@ -1,3 +1,19 @@
+/*
+ * 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.byname;
import org.hibernate.tck.annotations.SpecAssertion;
@@ -16,20 +32,21 @@
public class ResolutionByNameTest extends AbstractJSR299Test
{
- @Test(groups = { "resolution" })
- @SpecAssertion(section = "5.4", id = "review") // deployment types removed from spec
- public void testOnlyHighestPrecedenceResolved() throws Exception
+ @Test(groups = { "resolution" , "ri-broken"})
+ @SpecAssertion(section = "5.4.1", id = "c")
+ public void testAmbiguousELNamesResolved() throws Exception
{
- // Both Cod and Plaice are named "whitefish" - Plaice has the highest
- // deployment type (AnotherDeploymentType)
new RunInDependentContext()
{
-
@Override
protected void execute() throws Exception
{
+ // Cod, Plaice and AlaskaPlaice are named "whitefish" - Cod is a not-enabled policy, AlaskaPlaice specializes Plaice
assert getCurrentManager().getBeans("whitefish").size() == 1;
- assert getCurrentManager().getBeans("whitefish").iterator().next().getTypes().contains(Plaice.class);
+ assert getCurrentManager().getBeans("whitefish").iterator().next().getTypes().contains(AlaskaPlaice.class);
+ // Both Salmon and Sole are named "fish" - Sole is an enabled policy
+ assert getCurrentManager().getBeans("fish").size() == 1;
+ assert getCurrentManager().getBeans("fish").iterator().next().getTypes().contains(Sole.class);
}
}.run();
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/byname/Salmon.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/byname/Salmon.java 2009-07-21 08:38:30 UTC (rev 3105)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/byname/Salmon.java 2009-07-21 08:54:13 UTC (rev 3106)
@@ -1,11 +1,9 @@
package org.jboss.jsr299.tck.tests.lookup.byname;
import javax.enterprise.inject.Named;
-import javax.enterprise.inject.deployment.Production;
-@Production
-@Named
-class Salmon implements ScottishFish
+@Named("fish")
+class Salmon implements Animal
{
}
Deleted: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/byname/ScottishFish.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/byname/ScottishFish.java 2009-07-21 08:38:30 UTC (rev 3105)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/byname/ScottishFish.java 2009-07-21 08:54:13 UTC (rev 3106)
@@ -1,7 +0,0 @@
-package org.jboss.jsr299.tck.tests.lookup.byname;
-
-
-interface ScottishFish extends Animal
-{
-
-}
Deleted: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/byname/SeaBass.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/byname/SeaBass.java 2009-07-21 08:38:30 UTC (rev 3105)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/byname/SeaBass.java 2009-07-21 08:54:13 UTC (rev 3106)
@@ -1,11 +0,0 @@
-package org.jboss.jsr299.tck.tests.lookup.byname;
-
-import javax.enterprise.context.RequestScoped;
-import javax.enterprise.inject.deployment.Production;
-
-@Production
-@RequestScoped
-class SeaBass implements Animal
-{
-
-}
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/byname/Sole.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/byname/Sole.java 2009-07-21 08:38:30 UTC (rev 3105)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/byname/Sole.java 2009-07-21 08:54:13 UTC (rev 3106)
@@ -1,12 +1,11 @@
package org.jboss.jsr299.tck.tests.lookup.byname;
import javax.enterprise.inject.Named;
-import javax.enterprise.inject.deployment.Production;
+import javax.enterprise.inject.Policy;
-@Production
-@Whitefish
-@Named("whitefish")
-class Sole implements ScottishFish
+@Named("fish")
+@Policy
+class Sole implements Animal
{
}
Deleted: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/byname/Tuna.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/byname/Tuna.java 2009-07-21 08:38:30 UTC (rev 3105)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/byname/Tuna.java 2009-07-21 08:54:13 UTC (rev 3106)
@@ -1,14 +0,0 @@
-package org.jboss.jsr299.tck.tests.lookup.byname;
-
-import javax.enterprise.context.RequestScoped;
-
-@RequestScoped
-class Tuna
-{
-
- public String getName()
- {
- return "Ophir";
- }
-
-}
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/byname/duplicateNameResolution/Cod.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/byname/duplicateNameResolution/Cod.java 2009-07-21 08:38:30 UTC (rev 3105)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/byname/duplicateNameResolution/Cod.java 2009-07-21 08:54:13 UTC (rev 3106)
@@ -1,9 +1,23 @@
+/*
+ * 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.byname.duplicateNameResolution;
import javax.enterprise.inject.Named;
-import javax.enterprise.inject.deployment.Production;
-@Production
@Named("whitefish")
class Cod
{
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/byname/duplicateNameResolution/DuplicateNameResolutionTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/byname/duplicateNameResolution/DuplicateNameResolutionTest.java 2009-07-21 08:38:30 UTC (rev 3105)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/byname/duplicateNameResolution/DuplicateNameResolutionTest.java 2009-07-21 08:54:13 UTC (rev 3106)
@@ -19,38 +19,26 @@
import org.hibernate.tck.annotations.SpecAssertion;
import org.jboss.jsr299.tck.AbstractJSR299Test;
+import org.jboss.jsr299.tck.DeploymentError;
import org.jboss.testharness.impl.packaging.Artifact;
+import org.jboss.testharness.impl.packaging.ExpectedDeploymentException;
import org.testng.annotations.Test;
/**
*
- * Spec version: 20090519
+ * Spec version: 20090625
*
*/
@Artifact
+(a)ExpectedDeploymentException(DeploymentError.class)
public class DuplicateNameResolutionTest extends AbstractJSR299Test
{
- /**
- * Otherwise, if resolveByName() returned more than one Web Bean, throw an
- * AmbiguousDependencyException.
- *
- * @throws Exception
- */
- @Test(groups = { "resolution", "el", "rewrite" })
- // Needs to detect the problem
- @SpecAssertion(section = "5.2.1", id = "a")
+
+ @Test(groups = { "resolution", "el", "ri-broken" })
+ @SpecAssertion(section = "5.4.1", id = "d")
public void testDuplicateNamedBeans() throws Exception
{
- new RunInDependentContext()
- {
-
- @Override
- protected void execute() throws Exception
- {
- assert getCurrentManager().getBeans("whitefish").size() == 2;
- }
-
- }.run();
+ assert false;
}
}
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/byname/duplicateNameResolution/Sole.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/byname/duplicateNameResolution/Sole.java 2009-07-21 08:38:30 UTC (rev 3105)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/byname/duplicateNameResolution/Sole.java 2009-07-21 08:54:13 UTC (rev 3106)
@@ -1,9 +1,23 @@
+/*
+ * 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.byname.duplicateNameResolution;
import javax.enterprise.inject.Named;
-import javax.enterprise.inject.deployment.Production;
-@Production
@Named("whitefish")
class Sole
{
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/byname/duplicatePrefixResolution/DuplicateNamePrefixResolutionTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/byname/duplicatePrefixResolution/DuplicateNamePrefixResolutionTest.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/byname/duplicatePrefixResolution/DuplicateNamePrefixResolutionTest.java 2009-07-21 08:54:13 UTC (rev 3106)
@@ -0,0 +1,44 @@
+/*
+ * 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.byname.duplicatePrefixResolution;
+
+import org.hibernate.tck.annotations.SpecAssertion;
+import org.jboss.jsr299.tck.AbstractJSR299Test;
+import org.jboss.jsr299.tck.DeploymentError;
+import org.jboss.testharness.impl.packaging.Artifact;
+import org.jboss.testharness.impl.packaging.ExpectedDeploymentException;
+import org.testng.annotations.Test;
+
+/**
+ *
+ * Spec version: 20090625
+ *
+ */
+
+@Artifact
+(a)ExpectedDeploymentException(DeploymentError.class)
+public class DuplicateNamePrefixResolutionTest extends AbstractJSR299Test
+{
+
+ @Test(groups = { "resolution", "el", "ri-broken"})
+ @SpecAssertion(section="5.4.1", id="d")
+ public void testDuplicateBeanNamePrefix() {
+ assert false;
+ }
+
+}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/byname/duplicatePrefixResolution/Example.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/byname/duplicatePrefixResolution/Example.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/byname/duplicatePrefixResolution/Example.java 2009-07-21 08:54:13 UTC (rev 3106)
@@ -0,0 +1,26 @@
+/*
+ * 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.byname.duplicatePrefixResolution;
+
+import javax.enterprise.inject.Named;
+
+@Named("example")
+class Example
+{
+
+}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/byname/duplicatePrefixResolution/ExampleWebsite_Broken.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/byname/duplicatePrefixResolution/ExampleWebsite_Broken.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/byname/duplicatePrefixResolution/ExampleWebsite_Broken.java 2009-07-21 08:54:13 UTC (rev 3106)
@@ -0,0 +1,26 @@
+/*
+ * 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.byname.duplicatePrefixResolution;
+
+import javax.enterprise.inject.Named;
+
+@Named("example.com")
+class ExampleWebsite_Broken
+{
+
+}
15 years, 4 months
[webbeans-commits] Webbeans SVN: r3105 - in tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/clientProxy: unproxyable and 5 other directories.
by webbeans-commits@lists.jboss.org
Author: jharting
Date: 2009-07-21 04:38:30 -0400 (Tue, 21 Jul 2009)
New Revision: 3105
Added:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/clientProxy/unproxyable/array/
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/clientProxy/unproxyable/finalClass/
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/clientProxy/unproxyable/finalClass/FinalClassTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/clientProxy/unproxyable/finalClass/FishFarm.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/clientProxy/unproxyable/finalClass/Tuna_Broken.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/clientProxy/unproxyable/finalMethod/
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/clientProxy/unproxyable/finalMethod/FinalMethodTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/clientProxy/unproxyable/finalMethod/FishFarm.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/clientProxy/unproxyable/finalMethod/Tuna_Broken.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/clientProxy/unproxyable/primitive/
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/clientProxy/unproxyable/primitive/NumberProducer.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/clientProxy/unproxyable/primitive/Number_Broken.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/clientProxy/unproxyable/primitive/UnproxyableTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/clientProxy/unproxyable/privateConstructor/
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/clientProxy/unproxyable/privateConstructor/InjectionPointBean.java
Removed:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/clientProxy/array/
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/clientProxy/finalmethod/
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/clientProxy/privateconstructor/
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/clientProxy/unproxyable/FinalTuna_Broken.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/clientProxy/unproxyable/FishFarm.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/clientProxy/unproxyable/UnproxyableTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/clientProxy/unproxyable/privateConstructor/AnotherDeploymentType.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/clientProxy/unproxyable/privateConstructor/InjectionPointBean_Broken.java
Modified:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/clientProxy/ClientProxyTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/clientProxy/unproxyable/array/ArrayProducer.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/clientProxy/unproxyable/array/ArrayTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/clientProxy/unproxyable/array/InjectionPointBean_Broken.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/clientProxy/unproxyable/privateConstructor/PrivateConstructorTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/clientProxy/unproxyable/privateConstructor/Unproxyable_Broken.java
Log:
Client proxy tests
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/clientProxy/ClientProxyTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/clientProxy/ClientProxyTest.java 2009-07-21 08:04:41 UTC (rev 3104)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/clientProxy/ClientProxyTest.java 2009-07-21 08:38:30 UTC (rev 3105)
@@ -1,3 +1,19 @@
+/*
+ * 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.clientProxy;
import java.io.IOException;
@@ -2,2 +18,3 @@
+import javax.enterprise.context.ContextNotActiveException;
import javax.enterprise.inject.spi.Bean;
@@ -44,7 +61,7 @@
@Test
@SpecAssertion(section = "unknown", id = "unknown")
- public void testSimpleWebBeanClientProxyIsSerializable() throws IOException, ClassNotFoundException
+ public void testSimpleBeanClientProxyIsSerializable() throws IOException, ClassNotFoundException
{
TunedTuna tuna = getInstanceByType(TunedTuna.class);
assert getCurrentConfiguration().getBeans().isProxy(tuna);
@@ -62,5 +79,31 @@
TunedTuna tuna = (TunedTuna) getCurrentManager().getReference(tunaBean, TunedTuna.class, getCurrentManager().createCreationalContext(tunaBean));
assert getCurrentConfiguration().getBeans().isProxy(tuna);
assert tuna.getState().equals("tuned");
+ // TODO expand this test
}
+ @Test
+ @SpecAssertion(section="5.5.2", id="ab")
+ public void testInactiveScope() throws Exception {
+ new RunInDependentContext()
+ {
+ @Override
+ protected void execute() throws Exception
+ {
+ assert getCurrentConfiguration().getContexts().getRequestContext().isActive();
+ setContextInactive(getCurrentConfiguration().getContexts().getRequestContext());
+ assert !getCurrentConfiguration().getContexts().getRequestContext().isActive();
+ try {
+ getInstanceByType(TunedTuna.class).getState();
+ assert false;
+ } catch (ContextNotActiveException cnae) {
+ } catch (IllegalStateException ise) {
+ } catch (Throwable t) {
+ assert false;
+ }
+
+ // TODO need to set request scope active again, some other tests will fail otherwise
+ setContextActive(getCurrentConfiguration().getContexts().getRequestContext());
+ }
+ }.run();
+ }
}
Deleted: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/clientProxy/unproxyable/FinalTuna_Broken.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/clientProxy/unproxyable/FinalTuna_Broken.java 2009-07-21 08:04:41 UTC (rev 3104)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/clientProxy/unproxyable/FinalTuna_Broken.java 2009-07-21 08:38:30 UTC (rev 3105)
@@ -1,9 +0,0 @@
-package org.jboss.jsr299.tck.tests.lookup.clientProxy.unproxyable;
-
-import javax.enterprise.context.RequestScoped;
-
-@RequestScoped
-final class FinalTuna_Broken
-{
-
-}
Deleted: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/clientProxy/unproxyable/FishFarm.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/clientProxy/unproxyable/FishFarm.java 2009-07-21 08:04:41 UTC (rev 3104)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/clientProxy/unproxyable/FishFarm.java 2009-07-21 08:38:30 UTC (rev 3105)
@@ -1,10 +0,0 @@
-package org.jboss.jsr299.tck.tests.lookup.clientProxy.unproxyable;
-
-import javax.enterprise.inject.Current;
-
-public class FishFarm
-{
-
- @Current FinalTuna_Broken tuna;
-
-}
Deleted: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/clientProxy/unproxyable/UnproxyableTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/clientProxy/unproxyable/UnproxyableTest.java 2009-07-21 08:04:41 UTC (rev 3104)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/clientProxy/unproxyable/UnproxyableTest.java 2009-07-21 08:38:30 UTC (rev 3105)
@@ -1,24 +0,0 @@
-package org.jboss.jsr299.tck.tests.lookup.clientProxy.unproxyable;
-
-import org.hibernate.tck.annotations.SpecAssertion;
-import org.jboss.jsr299.tck.AbstractJSR299Test;
-import org.jboss.testharness.impl.packaging.Artifact;
-import org.testng.annotations.Test;
-
-/**
- *
- * Spec version: 20090625
- *
- */
-@Artifact
-public class UnproxyableTest extends AbstractJSR299Test
-{
- @Test(groups = "rewrite")
- // Needs to detect problem
- @SpecAssertion(section = "5.5.1", id = "baa")
- public void testInjectionPointWithUnproxyableTypeWhichResolvesToNormalScopedWebBean()
- {
- assert false;
- }
-
-}
Copied: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/clientProxy/unproxyable/array (from rev 3043, tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/clientProxy/array)
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/clientProxy/unproxyable/array/ArrayProducer.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/clientProxy/array/ArrayProducer.java 2009-07-09 23:42:02 UTC (rev 3043)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/clientProxy/unproxyable/array/ArrayProducer.java 2009-07-21 08:38:30 UTC (rev 3105)
@@ -1,4 +1,20 @@
-package org.jboss.jsr299.tck.tests.lookup.clientProxy.array;
+/*
+ * 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.clientProxy.unproxyable.array;
import javax.enterprise.context.RequestScoped;
import javax.enterprise.inject.Produces;
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/clientProxy/unproxyable/array/ArrayTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/clientProxy/array/ArrayTest.java 2009-07-09 23:42:02 UTC (rev 3043)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/clientProxy/unproxyable/array/ArrayTest.java 2009-07-21 08:38:30 UTC (rev 3105)
@@ -1,21 +1,39 @@
-package org.jboss.jsr299.tck.tests.lookup.clientProxy.array;
+/*
+ * 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.clientProxy.unproxyable.array;
import org.hibernate.tck.annotations.SpecAssertion;
import org.jboss.jsr299.tck.AbstractJSR299Test;
+import org.jboss.jsr299.tck.DeploymentError;
import org.jboss.testharness.impl.packaging.Artifact;
+import org.jboss.testharness.impl.packaging.ExpectedDeploymentException;
import org.testng.annotations.Test;
/**
* Test for problem detection of array injection.
*
- * Spec version: 20090519
+ * Spec version: 2009625
*/
@Artifact
+(a)ExpectedDeploymentException(DeploymentError.class)
public class ArrayTest extends AbstractJSR299Test
{
- @Test(groups = "rewrite")
- // Needs to detect problem
- @SpecAssertion(section = "5.3.1", id = "da")
+ @Test
+ @SpecAssertion(section = "5.5.1", id = "da")
public void testInjectionPointWithArrayType()
{
assert false;
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/clientProxy/unproxyable/array/InjectionPointBean_Broken.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/clientProxy/array/InjectionPointBean_Broken.java 2009-07-09 23:42:02 UTC (rev 3043)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/clientProxy/unproxyable/array/InjectionPointBean_Broken.java 2009-07-21 08:38:30 UTC (rev 3105)
@@ -1,4 +1,20 @@
-package org.jboss.jsr299.tck.tests.lookup.clientProxy.array;
+/*
+ * 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.clientProxy.unproxyable.array;
import javax.enterprise.inject.Current;
Copied: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/clientProxy/unproxyable/finalClass/FinalClassTest.java (from rev 3043, tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/clientProxy/unproxyable/UnproxyableTest.java)
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/clientProxy/unproxyable/finalClass/FinalClassTest.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/clientProxy/unproxyable/finalClass/FinalClassTest.java 2009-07-21 08:38:30 UTC (rev 3105)
@@ -0,0 +1,43 @@
+/*
+ * 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.clientProxy.unproxyable.finalClass;
+
+import org.hibernate.tck.annotations.SpecAssertion;
+import org.jboss.jsr299.tck.AbstractJSR299Test;
+import org.jboss.jsr299.tck.DeploymentError;
+import org.jboss.testharness.impl.packaging.Artifact;
+import org.jboss.testharness.impl.packaging.ExpectedDeploymentException;
+import org.testng.annotations.Test;
+
+/**
+ *
+ * Spec version: 20090625
+ *
+ */
+
+@Artifact
+(a)ExpectedDeploymentException(DeploymentError.class)
+public class FinalClassTest extends AbstractJSR299Test
+{
+ @Test
+ @SpecAssertion(section = "5.5.1", id = "baa")
+ public void testInjectionPointWithUnproxyableTypeWhichResolvesToNormalScopedBean()
+ {
+ assert false;
+ }
+
+}
Copied: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/clientProxy/unproxyable/finalClass/FishFarm.java (from rev 3043, tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/clientProxy/unproxyable/FishFarm.java)
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/clientProxy/unproxyable/finalClass/FishFarm.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/clientProxy/unproxyable/finalClass/FishFarm.java 2009-07-21 08:38:30 UTC (rev 3105)
@@ -0,0 +1,26 @@
+/*
+ * 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.clientProxy.unproxyable.finalClass;
+
+import javax.enterprise.inject.Current;
+
+class FishFarm
+{
+
+ @Current Tuna_Broken tuna;
+
+}
Copied: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/clientProxy/unproxyable/finalClass/Tuna_Broken.java (from rev 3043, tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/clientProxy/unproxyable/FinalTuna_Broken.java)
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/clientProxy/unproxyable/finalClass/Tuna_Broken.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/clientProxy/unproxyable/finalClass/Tuna_Broken.java 2009-07-21 08:38:30 UTC (rev 3105)
@@ -0,0 +1,25 @@
+/*
+ * 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.clientProxy.unproxyable.finalClass;
+
+import javax.enterprise.context.RequestScoped;
+
+@RequestScoped
+final class Tuna_Broken
+{
+
+}
Copied: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/clientProxy/unproxyable/finalMethod/FinalMethodTest.java (from rev 3043, tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/clientProxy/finalmethod/FinalMethodTest.java)
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/clientProxy/unproxyable/finalMethod/FinalMethodTest.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/clientProxy/unproxyable/finalMethod/FinalMethodTest.java 2009-07-21 08:38:30 UTC (rev 3105)
@@ -0,0 +1,42 @@
+/*
+ * 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.clientProxy.unproxyable.finalMethod;
+
+import org.hibernate.tck.annotations.SpecAssertion;
+import org.jboss.jsr299.tck.AbstractJSR299Test;
+import org.jboss.jsr299.tck.DeploymentError;
+import org.jboss.testharness.impl.packaging.Artifact;
+import org.jboss.testharness.impl.packaging.ExpectedDeploymentException;
+import org.testng.annotations.Test;
+
+/**
+ *
+ * Spec version: 20090625
+ *
+ */
+
+@Artifact
+(a)ExpectedDeploymentException(DeploymentError.class)
+public class FinalMethodTest extends AbstractJSR299Test
+{
+ @Test
+ @SpecAssertion(section = "5.5.1", id = "bba")
+ public void testClassWithFinalMethodCannotBeProxied()
+ {
+ assert false;
+ }
+}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/clientProxy/unproxyable/finalMethod/FishFarm.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/clientProxy/unproxyable/finalMethod/FishFarm.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/clientProxy/unproxyable/finalMethod/FishFarm.java 2009-07-21 08:38:30 UTC (rev 3105)
@@ -0,0 +1,24 @@
+/*
+ * 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.clientProxy.unproxyable.finalMethod;
+
+import javax.enterprise.inject.Current;
+
+class FishFarm
+{
+ @Current Tuna_Broken tuna;
+}
Copied: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/clientProxy/unproxyable/finalMethod/Tuna_Broken.java (from rev 3043, tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/clientProxy/finalmethod/Tuna_Broken.java)
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/clientProxy/unproxyable/finalMethod/Tuna_Broken.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/clientProxy/unproxyable/finalMethod/Tuna_Broken.java 2009-07-21 08:38:30 UTC (rev 3105)
@@ -0,0 +1,25 @@
+/*
+ * 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.clientProxy.unproxyable.finalMethod;
+
+import javax.enterprise.context.RequestScoped;
+
+@RequestScoped
+class Tuna_Broken
+{
+ public final String getFoo() { return null; }
+}
\ No newline at end of file
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/clientProxy/unproxyable/primitive/NumberProducer.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/clientProxy/unproxyable/primitive/NumberProducer.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/clientProxy/unproxyable/primitive/NumberProducer.java 2009-07-21 08:38:30 UTC (rev 3105)
@@ -0,0 +1,30 @@
+/*
+ * 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.clientProxy.unproxyable.primitive;
+
+import javax.enterprise.context.RequestScoped;
+import javax.enterprise.inject.Produces;
+
+class NumberProducer
+{
+
+ @Produces
+ @RequestScoped
+ public int produce() {
+ return 0;
+ }
+}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/clientProxy/unproxyable/primitive/Number_Broken.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/clientProxy/unproxyable/primitive/Number_Broken.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/clientProxy/unproxyable/primitive/Number_Broken.java 2009-07-21 08:38:30 UTC (rev 3105)
@@ -0,0 +1,27 @@
+/*
+ * 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.clientProxy.unproxyable.primitive;
+
+import javax.enterprise.inject.Current;
+
+class Number_Broken
+{
+
+ @SuppressWarnings("unused")
+ @Current private int number;
+
+}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/clientProxy/unproxyable/primitive/UnproxyableTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/clientProxy/unproxyable/primitive/UnproxyableTest.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/clientProxy/unproxyable/primitive/UnproxyableTest.java 2009-07-21 08:38:30 UTC (rev 3105)
@@ -0,0 +1,43 @@
+/*
+ * 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.clientProxy.unproxyable.primitive;
+
+import org.hibernate.tck.annotations.SpecAssertion;
+import org.jboss.jsr299.tck.AbstractJSR299Test;
+import org.jboss.jsr299.tck.DeploymentError;
+import org.jboss.testharness.impl.packaging.Artifact;
+import org.jboss.testharness.impl.packaging.ExpectedDeploymentException;
+import org.testng.annotations.Test;
+
+/**
+ *
+ * Spec version: 20090625
+ *
+ */
+
+@Artifact
+(a)ExpectedDeploymentException(DeploymentError.class)
+public class UnproxyableTest extends AbstractJSR299Test
+{
+ @Test
+ @SpecAssertion(section = "5.5.1", id = "ca")
+ public void testInjectionPointWithUnproxyableTypeWhichResolvesToNormalScopedBean()
+ {
+ assert false;
+ }
+
+}
Copied: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/clientProxy/unproxyable/privateConstructor (from rev 3043, tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/clientProxy/privateconstructor)
Deleted: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/clientProxy/unproxyable/privateConstructor/AnotherDeploymentType.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/clientProxy/privateconstructor/AnotherDeploymentType.java 2009-07-09 23:42:02 UTC (rev 3043)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/clientProxy/unproxyable/privateConstructor/AnotherDeploymentType.java 2009-07-21 08:38:30 UTC (rev 3105)
@@ -1,20 +0,0 @@
-package org.jboss.jsr299.tck.tests.lookup.clientProxy.privateconstructor;
-
-import static java.lang.annotation.ElementType.METHOD;
-import static java.lang.annotation.ElementType.TYPE;
-import static java.lang.annotation.RetentionPolicy.RUNTIME;
-
-import java.lang.annotation.Documented;
-import java.lang.annotation.Retention;
-import java.lang.annotation.Target;
-
-import javax.enterprise.inject.deployment.DeploymentType;
-
-@Target( { TYPE, METHOD })
-@Retention(RUNTIME)
-@Documented
-@DeploymentType
-@interface AnotherDeploymentType
-{
-
-}
Copied: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/clientProxy/unproxyable/privateConstructor/InjectionPointBean.java (from rev 3043, tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/clientProxy/privateconstructor/InjectionPointBean_Broken.java)
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/clientProxy/unproxyable/privateConstructor/InjectionPointBean.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/clientProxy/unproxyable/privateConstructor/InjectionPointBean.java 2009-07-21 08:38:30 UTC (rev 3105)
@@ -0,0 +1,24 @@
+/*
+ * 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.clientProxy.unproxyable.privateConstructor;
+
+import javax.enterprise.inject.Current;
+
+class InjectionPointBean
+{
+ @Current Unproxyable_Broken foo;
+}
Deleted: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/clientProxy/unproxyable/privateConstructor/InjectionPointBean_Broken.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/clientProxy/privateconstructor/InjectionPointBean_Broken.java 2009-07-09 23:42:02 UTC (rev 3043)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/clientProxy/unproxyable/privateConstructor/InjectionPointBean_Broken.java 2009-07-21 08:38:30 UTC (rev 3105)
@@ -1,9 +0,0 @@
-package org.jboss.jsr299.tck.tests.lookup.clientProxy.privateconstructor;
-
-import javax.enterprise.inject.Any;
-import javax.enterprise.inject.Instance;
-
-class InjectionPointBean_Broken
-{
- @Any Instance<Unproxyable_Broken> foo;
-}
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/clientProxy/unproxyable/privateConstructor/PrivateConstructorTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/clientProxy/privateconstructor/PrivateConstructorTest.java 2009-07-09 23:42:02 UTC (rev 3043)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/clientProxy/unproxyable/privateConstructor/PrivateConstructorTest.java 2009-07-21 08:38:30 UTC (rev 3105)
@@ -1,22 +1,40 @@
-package org.jboss.jsr299.tck.tests.lookup.clientProxy.privateconstructor;
+/*
+ * 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.clientProxy.unproxyable.privateConstructor;
import org.hibernate.tck.annotations.SpecAssertion;
import org.jboss.jsr299.tck.AbstractJSR299Test;
+import org.jboss.jsr299.tck.DeploymentError;
import org.jboss.testharness.impl.packaging.Artifact;
+import org.jboss.testharness.impl.packaging.ExpectedDeploymentException;
import org.testng.annotations.Test;
/**
* Test for problem detection of unproxyable bean with private constructor.
*
- * Spec version: 20090519
+ * Spec version: 20090625
*/
@Artifact
+(a)ExpectedDeploymentException(DeploymentError.class)
public class PrivateConstructorTest extends AbstractJSR299Test
{
- @Test(groups = "rewrite")
- // Needs to detect the problem
- @SpecAssertion(section = "5.3.1", id = "aa")
+ @Test
+ @SpecAssertion(section = "5.5.1", id = "aa")
public void testClassWithPrivateConstructor()
{
assert false;
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/clientProxy/unproxyable/privateConstructor/Unproxyable_Broken.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/clientProxy/privateconstructor/Unproxyable_Broken.java 2009-07-09 23:42:02 UTC (rev 3043)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/clientProxy/unproxyable/privateConstructor/Unproxyable_Broken.java 2009-07-21 08:38:30 UTC (rev 3105)
@@ -1,13 +1,26 @@
-package org.jboss.jsr299.tck.tests.lookup.clientProxy.privateconstructor;
+/*
+ * 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.clientProxy.unproxyable.privateConstructor;
import javax.enterprise.context.RequestScoped;
-@AnotherDeploymentType
@RequestScoped
class Unproxyable_Broken
{
- private Unproxyable_Broken()
- {
-
- }
+ private Unproxyable_Broken() {}
+
}
15 years, 4 months
[webbeans-commits] Webbeans SVN: r3104 - in tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dynamic: builtin and 1 other directory.
by webbeans-commits@lists.jboss.org
Author: jharting
Date: 2009-07-21 04:04:41 -0400 (Tue, 21 Jul 2009)
New Revision: 3104
Added:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dynamic/Asynchronous.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dynamic/AsynchronousBinding.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dynamic/SimplePaymentProcessor.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dynamic/Synchronous.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dynamic/SynchronousBinding.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dynamic/SynchronousChequePaymentProcessor.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dynamic/builtin/
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dynamic/builtin/AbstractAnimal.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dynamic/builtin/Animal.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dynamic/builtin/BuiltinInstanceTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dynamic/builtin/Cow.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dynamic/builtin/Farm.java
Modified:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dynamic/DynamicLookupTest.java
Log:
Programmatic lookup tests
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dynamic/Asynchronous.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dynamic/Asynchronous.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dynamic/Asynchronous.java 2009-07-21 08:04:41 UTC (rev 3104)
@@ -0,0 +1,19 @@
+package org.jboss.jsr299.tck.tests.lookup.dynamic;
+
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.ElementType.PARAMETER;
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+import java.lang.annotation.Documented;
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import javax.enterprise.inject.BindingType;
+
+@Target( { TYPE, METHOD, PARAMETER })
+@Retention(RUNTIME)
+@Documented
+@BindingType
+@interface Asynchronous {
+
+}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dynamic/AsynchronousBinding.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dynamic/AsynchronousBinding.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dynamic/AsynchronousBinding.java 2009-07-21 08:04:41 UTC (rev 3104)
@@ -0,0 +1,6 @@
+package org.jboss.jsr299.tck.tests.lookup.dynamic;
+
+import javax.enterprise.inject.AnnotationLiteral;
+
+class AsynchronousBinding extends AnnotationLiteral<Asynchronous> implements Asynchronous {
+}
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dynamic/DynamicLookupTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dynamic/DynamicLookupTest.java 2009-07-21 07:54:15 UTC (rev 3103)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dynamic/DynamicLookupTest.java 2009-07-21 08:04:41 UTC (rev 3104)
@@ -1,8 +1,25 @@
+/*
+ * 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.dynamic;
-import static org.jboss.jsr299.tck.tests.lookup.dynamic.PayBy.PaymentMethod.CHEQUE;
+import javax.enterprise.inject.AmbiguousResolutionException;
import javax.enterprise.inject.Instance;
+import javax.enterprise.inject.UnsatisfiedResolutionException;
import javax.enterprise.inject.spi.Bean;
import org.hibernate.tck.annotations.SpecAssertion;
@@ -15,6 +32,7 @@
* Tests for dynamic lookup features
*
* @author Shane Bryzak
+ * @author Jozef Hartinger
*
* Spec version: 20090625
*/
@@ -25,7 +43,7 @@
@SpecAssertions({
@SpecAssertion(section = "5.7", id ="aa")
})
- public void testInstanceMayBeInjected()
+ public void testObtainsInjectsInstanceOfInstance()
{
Bean<ObtainsInjectionPointBean> injectionPointBean =
getBeans(ObtainsInjectionPointBean.class).iterator().next();
@@ -37,42 +55,75 @@
@Test(groups = "ri-broken")
@SpecAssertions({
- @SpecAssertion(section = "5.7", id ="ba"),
+ @SpecAssertion(section = "5.7", id ="review"),
@SpecAssertion(section = "5.7", id ="ca"),
- @SpecAssertion(section = "5.7.1", id ="aa")
+ @SpecAssertion(section = "5.7.1", id ="ab"),
+ @SpecAssertion(section = "5.7.1", id ="ba")
})
- public void testInstanceReturnsContextualReference()
+ public void testDynamicLookup()
{
Bean<ObtainsInjectionPointBean> injectionPointBean =
getBeans(ObtainsInjectionPointBean.class).iterator().next();
ObtainsInjectionPointBean injectionPoint = (ObtainsInjectionPointBean)
getCurrentManager().getReference( injectionPointBean, ObtainsInjectionPointBean.class, getCurrentManager().createCreationalContext(injectionPointBean));
- assert injectionPoint.getPaymentProcessor().get() instanceof ChequePaymentProcessor;
+ assert injectionPoint.getPaymentProcessor().select(new SynchronousBinding()).get() instanceof SynchronousChequePaymentProcessor;
}
@Test(groups = "ri-broken", expectedExceptions = IllegalArgumentException.class)
@SpecAssertion(section = "5.7.1", id ="da")
- public void testSelectDuplicateBindingsThrowsException()
+ public void testDuplicateBindingsThrowsException()
{
Bean<ObtainsInjectionPointBean> injectionPointBean =
getBeans(ObtainsInjectionPointBean.class).iterator().next();
ObtainsInjectionPointBean injectionPoint = (ObtainsInjectionPointBean)
getCurrentManager().getReference(injectionPointBean,ObtainsInjectionPointBean.class, getCurrentManager().createCreationalContext(injectionPointBean));
- injectionPoint.getPaymentProcessor().select(new PayByBinding() { public PaymentMethod value() { return CHEQUE; }});
+ injectionPoint.getPaymentProcessor().select(new SynchronousBinding(), new SynchronousBinding());
}
@Test(groups = "ri-broken", expectedExceptions = IllegalArgumentException.class)
@SpecAssertion(section = "5.7.1", id = "e")
- public void testSelectNonBindingThrowsException()
+ public void testNonBindingThrowsException()
{
Bean<ObtainsInjectionPointBean> injectionPointBean =
getBeans(ObtainsInjectionPointBean.class).iterator().next();
ObtainsInjectionPointBean injectionPoint = (ObtainsInjectionPointBean)
getCurrentManager().getReference(injectionPointBean,ObtainsInjectionPointBean.class, getCurrentManager().createCreationalContext(injectionPointBean));
- injectionPoint.getPaymentProcessor().select(new NonBinding() );
+ injectionPoint.getPaymentProcessor().select(new NonBinding());
}
+ @Test(groups = "ri-broken", expectedExceptions = UnsatisfiedResolutionException.class)
+ @SpecAssertions({
+ @SpecAssertion(section = "5.7.1", id = "fb"),
+ @SpecAssertion(section = "5.7.1", id = "l")})
+ public void testUnsatisfiedDependencyThrowsException()
+ {
+ ObtainsInjectionPointBean injectionPoint = getInstanceByType(ObtainsInjectionPointBean.class);
+ assert !injectionPoint.getPaymentProcessor().isUnsatisfied();
+
+ Instance<PaymentProcessor> instance = injectionPoint.getPaymentProcessor().select(new AsynchronousBinding());
+ assert instance.isUnsatisfied();
+
+ instance.get();
+ }
+
+ @Test(expectedExceptions = AmbiguousResolutionException.class)
+ @SpecAssertion(section = "5.7.1", id = "fb")
+ public void testAmbiguousDependencyThrowsException()
+ {
+ ObtainsInjectionPointBean injectionPoint = getInstanceByType(ObtainsInjectionPointBean.class);
+ injectionPoint.getPaymentProcessor().get();
+ }
+
+ @Test(groups= "ri-broken")
+ @SpecAssertion(section = "5.7.1", id = "m")
+ public void testIsAmbiguous()
+ {
+ ObtainsInjectionPointBean injectionPoint = getInstanceByType(ObtainsInjectionPointBean.class);
+ assert injectionPoint.getPaymentProcessor().isAmbiguous();
+ Instance<PaymentProcessor> instance = injectionPoint.getPaymentProcessor().select(new SynchronousBinding());
+ assert !instance.isAmbiguous();
+ }
}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dynamic/SimplePaymentProcessor.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dynamic/SimplePaymentProcessor.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dynamic/SimplePaymentProcessor.java 2009-07-21 08:04:41 UTC (rev 3104)
@@ -0,0 +1,11 @@
+package org.jboss.jsr299.tck.tests.lookup.dynamic;
+
+class SimplePaymentProcessor implements PaymentProcessor
+{
+
+ public void process()
+ {
+
+ }
+
+}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dynamic/Synchronous.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dynamic/Synchronous.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dynamic/Synchronous.java 2009-07-21 08:04:41 UTC (rev 3104)
@@ -0,0 +1,19 @@
+package org.jboss.jsr299.tck.tests.lookup.dynamic;
+
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.ElementType.PARAMETER;
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+import java.lang.annotation.Documented;
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import javax.enterprise.inject.BindingType;
+
+@Target( { TYPE, METHOD, PARAMETER })
+@Retention(RUNTIME)
+@Documented
+@BindingType
+@interface Synchronous {
+
+}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dynamic/SynchronousBinding.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dynamic/SynchronousBinding.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dynamic/SynchronousBinding.java 2009-07-21 08:04:41 UTC (rev 3104)
@@ -0,0 +1,7 @@
+package org.jboss.jsr299.tck.tests.lookup.dynamic;
+
+import javax.enterprise.inject.AnnotationLiteral;
+
+public class SynchronousBinding extends AnnotationLiteral<Synchronous> implements Synchronous{
+
+}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dynamic/SynchronousChequePaymentProcessor.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dynamic/SynchronousChequePaymentProcessor.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dynamic/SynchronousChequePaymentProcessor.java 2009-07-21 08:04:41 UTC (rev 3104)
@@ -0,0 +1,12 @@
+package org.jboss.jsr299.tck.tests.lookup.dynamic;
+
+import static org.jboss.jsr299.tck.tests.lookup.dynamic.PayBy.PaymentMethod.CHEQUE;
+
+@PayBy(CHEQUE) @Synchronous
+class SynchronousChequePaymentProcessor implements PaymentProcessor
+{
+ public void process()
+ {
+
+ }
+}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dynamic/builtin/AbstractAnimal.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dynamic/builtin/AbstractAnimal.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dynamic/builtin/AbstractAnimal.java 2009-07-21 08:04:41 UTC (rev 3104)
@@ -0,0 +1,22 @@
+/*
+ * 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.dynamic.builtin;
+
+abstract class AbstractAnimal implements Animal
+{
+
+}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dynamic/builtin/Animal.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dynamic/builtin/Animal.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dynamic/builtin/Animal.java 2009-07-21 08:04:41 UTC (rev 3104)
@@ -0,0 +1,22 @@
+/*
+ * 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.dynamic.builtin;
+
+interface Animal
+{
+
+}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dynamic/builtin/BuiltinInstanceTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dynamic/builtin/BuiltinInstanceTest.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dynamic/builtin/BuiltinInstanceTest.java 2009-07-21 08:04:41 UTC (rev 3104)
@@ -0,0 +1,67 @@
+/*
+ * 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.dynamic.builtin;
+
+import javax.enterprise.context.Dependent;
+import javax.enterprise.inject.Instance;
+import javax.enterprise.inject.TypeLiteral;
+import javax.enterprise.inject.spi.Bean;
+
+import org.hibernate.tck.annotations.SpecAssertion;
+import org.jboss.jsr299.tck.AbstractJSR299Test;
+import org.jboss.testharness.impl.packaging.Artifact;
+import org.testng.annotations.Test;
+
+/**
+ * Tests for built-in Instance.
+ *
+ * Spec version: 2009625
+ */
+
+@Artifact
+public class BuiltinInstanceTest extends AbstractJSR299Test {
+
+ @Test
+ @SpecAssertion(section = "5.7.2", id = "d")
+ public void testScopeOfBuiltinInstance() {
+ Bean<Instance<Cow>> bean = getBeans(new TypeLiteral<Instance<Cow>>() {}).iterator().next();
+ assert Dependent.class.equals(bean.getScopeType());
+ }
+
+ @Test
+ @SpecAssertion(section = "5.7.2", id = "e")
+ public void testNameOfBuiltinInstance() {
+ Bean<Instance<Cow>> bean = getBeans(new TypeLiteral<Instance<Cow>>() {}).iterator().next();
+ assert bean.getName() == null;
+ }
+
+ @Test
+ @SpecAssertion(section = "5.7.2", id = "a")
+ public void testInstanceProvidedForEveryLegalBeanType() {
+ Farm farm = getInstanceByType(Farm.class);
+ assert farm.getAnimal() != null;
+ assert farm.getAbstractAnimal() != null;
+ assert farm.getCow() != null;
+ }
+
+ @Test
+ @SpecAssertion(section = "5.7.2", id = "g")
+ public void testInstanceIsPassivationCapable() {
+ Bean<Instance> instance = getBeans(Instance.class).iterator().next();
+ // TODO assert instance.isSerializable();
+ }
+}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dynamic/builtin/Cow.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dynamic/builtin/Cow.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dynamic/builtin/Cow.java 2009-07-21 08:04:41 UTC (rev 3104)
@@ -0,0 +1,22 @@
+/*
+ * 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.dynamic.builtin;
+
+class Cow extends AbstractAnimal
+{
+
+}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dynamic/builtin/Farm.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dynamic/builtin/Farm.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dynamic/builtin/Farm.java 2009-07-21 08:04:41 UTC (rev 3104)
@@ -0,0 +1,30 @@
+package org.jboss.jsr299.tck.tests.lookup.dynamic.builtin;
+
+import javax.enterprise.inject.Current;
+import javax.enterprise.inject.Instance;
+
+class Farm extends AbstractAnimal
+{
+ @Current
+ private Instance<Animal> animal;
+ @Current
+ private Instance<AbstractAnimal> abstractAnimal;
+ @Current
+ private Instance<Cow> cow;
+
+ public Instance<Animal> getAnimal()
+ {
+ return animal;
+ }
+
+ public Instance<AbstractAnimal> getAbstractAnimal()
+ {
+ return abstractAnimal;
+ }
+
+ public Instance<Cow> getCow()
+ {
+ return cow;
+ }
+
+}
15 years, 4 months
[webbeans-commits] Webbeans SVN: r3103 - in tck/trunk/impl/src/main: java/org/jboss/jsr299/tck/tests/lookup/injectionpoint/broken and 6 other directories.
by webbeans-commits@lists.jboss.org
Author: jharting
Date: 2009-07-21 03:54:15 -0400 (Tue, 21 Jul 2009)
New Revision: 3103
Added:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injectionpoint/Cat.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injectionpoint/CatDecorator.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injectionpoint/TransientFieldInjectionPointBean.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injectionpoint/broken/
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injectionpoint/broken/normal/
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injectionpoint/broken/normal/scope/
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injectionpoint/broken/normal/scope/Cat_Broken.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injectionpoint/broken/normal/scope/NormalScopedBeanWithInjectionPoint.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injectionpoint/broken/not/
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injectionpoint/broken/not/bean/
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injectionpoint/broken/not/bean/Dog.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injectionpoint/broken/not/bean/InjectionPointOnNonBeanTest.java
tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/lookup/injectionpoint/
tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/lookup/injectionpoint/beans.xml
Modified:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injectionpoint/FieldInjectionPointBean.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injectionpoint/InjectionPointTest.java
Log:
InjectionPoint tests
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injectionpoint/Cat.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injectionpoint/Cat.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injectionpoint/Cat.java 2009-07-21 07:54:15 UTC (rev 3103)
@@ -0,0 +1,17 @@
+package org.jboss.jsr299.tck.tests.lookup.injectionpoint;
+
+import javax.enterprise.inject.Current;
+import javax.enterprise.inject.spi.InjectionPoint;
+
+class Cat
+{
+ @Current private InjectionPoint injectionPoint;
+
+ public String hello() {
+ return "hello";
+ }
+
+ public InjectionPoint getInjectionPoint() {
+ return injectionPoint;
+ }
+}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injectionpoint/CatDecorator.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injectionpoint/CatDecorator.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injectionpoint/CatDecorator.java 2009-07-21 07:54:15 UTC (rev 3103)
@@ -0,0 +1,15 @@
+package org.jboss.jsr299.tck.tests.lookup.injectionpoint;
+
+import javax.decorator.Decorates;
+import javax.decorator.Decorator;
+
+@Decorator
+class CatDecorator extends Cat
+{
+ @Decorates Cat bean;
+
+ public String hello()
+ {
+ return bean.hello() + " world!";
+ }
+}
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injectionpoint/FieldInjectionPointBean.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injectionpoint/FieldInjectionPointBean.java 2009-07-21 07:31:00 UTC (rev 3102)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injectionpoint/FieldInjectionPointBean.java 2009-07-21 07:54:15 UTC (rev 3103)
@@ -30,7 +30,7 @@
@RequestScoped
class FieldInjectionPointBean
{
- @Current @AnimalStereotype
+ @Current @AnimalStereotype
private BeanWithInjectionPointMetadata injectedBean;
public BeanWithInjectionPointMetadata getInjectedBean()
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-21 07:31:00 UTC (rev 3102)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injectionpoint/InjectionPointTest.java 2009-07-21 07:54:15 UTC (rev 3103)
@@ -24,7 +24,8 @@
import javax.enterprise.context.Dependent;
import javax.enterprise.inject.Current;
-import javax.enterprise.inject.deployment.Standard;
+import javax.enterprise.inject.spi.AnnotatedField;
+import javax.enterprise.inject.spi.AnnotatedParameter;
import javax.enterprise.inject.spi.Bean;
import javax.enterprise.inject.spi.InjectionPoint;
@@ -33,16 +34,19 @@
import org.jboss.jsr299.tck.AbstractJSR299Test;
import org.jboss.jsr299.tck.literals.CurrentLiteral;
import org.jboss.testharness.impl.packaging.Artifact;
+import org.jboss.testharness.impl.packaging.jsr299.BeansXml;
import org.testng.annotations.Test;
/**
* Injection point metadata tests
*
* @author David Allen
+ * @author Jozef Hartinger
*
* Spec version: 20090625
*/
@Artifact
+@BeansXml("beans.xml")
public class InjectionPointTest extends AbstractJSR299Test
{
@@ -176,9 +180,9 @@
}.run();
}
- @Test(groups = { "injectionPoint", "rewrite" })
+ @Test(groups = { "injectionPoint", "ri-broken" })
@SpecAssertion(section = "5.6.9", id = "daa")
- public void testGetAnnotation() throws Exception
+ public void testGetAnnotatedField() throws Exception
{
// Get an instance of the bean which has another bean injected into it
new RunInDependentContext()
@@ -190,10 +194,31 @@
FieldInjectionPointBean beanWithInjectedBean = getInstanceByType(FieldInjectionPointBean.class,new CurrentLiteral());
BeanWithInjectionPointMetadata beanWithInjectionPoint = beanWithInjectedBean.getInjectedBean();
assert beanWithInjectionPoint.getInjectedMetadata() != null;
- assert beanWithInjectionPoint.getInjectedMetadata().getAnnotated().getAnnotation(AnimalStereotype.class) != null;
+ assert beanWithInjectionPoint.getInjectedMetadata().getAnnotated() instanceof AnnotatedField;
+ assert beanWithInjectionPoint.getInjectedMetadata().getAnnotated().isAnnotationPresent(AnimalStereotype.class);
}
}.run();
}
+
+ @Test(groups = { "injectionPoint", "ri-broken" })
+ @SpecAssertion(section = "5.6.9", id = "daa")
+ public void testGetAnnotatedParameter() throws Exception
+ {
+ // Get an instance of the bean which has another bean injected into it
+ new RunInDependentContext()
+ {
+
+ @Override
+ protected void execute() throws Exception
+ {
+ MethodInjectionPointBean beanWithInjectedBean = getInstanceByType(MethodInjectionPointBean.class,new CurrentLiteral());
+ BeanWithInjectionPointMetadata beanWithInjectionPoint = beanWithInjectedBean.getInjectedBean();
+ assert beanWithInjectionPoint.getInjectedMetadata() != null;
+ assert beanWithInjectionPoint.getInjectedMetadata().getAnnotated() instanceof AnnotatedParameter;
+ assert beanWithInjectionPoint.getInjectedMetadata().getAnnotated().isAnnotationPresent(Current.class);
+ }
+ }.run();
+ }
@Test(groups = { "injectionPoint" })
@SpecAssertion(section = "5.6.9", id = "e")
@@ -252,4 +277,41 @@
}
}.run();
}
+
+ @Test(groups = { "injectionPoint" })
+ @SpecAssertion(section = "5.6.9", id = "dca")
+ public void testIsTransient() throws Exception
+ {
+ new RunInDependentContext()
+ {
+ @Override
+ protected void execute() throws Exception
+ {
+ FieldInjectionPointBean bean1 = getInstanceByType(FieldInjectionPointBean.class,new CurrentLiteral());
+ TransientFieldInjectionPointBean bean2 = getInstanceByType(TransientFieldInjectionPointBean.class,new CurrentLiteral());
+ InjectionPoint ip1 = bean1.getInjectedBean().getInjectedMetadata();
+ InjectionPoint ip2 = bean2.getInjectedBean().getInjectedMetadata();
+ assert !ip1.isTransient();
+ assert ip2.isTransient();
+ }
+ }.run();
+ }
+
+ @Test(groups = { "injectionPoint", "ri-broken" })
+ @SpecAssertion(section = "5.6.9", id="dba")
+ public void testIsDelegate() throws Exception {
+ new RunInDependentContext()
+ {
+ @Override
+ protected void execute() throws Exception
+ {
+ assert !getInstanceByType(FieldInjectionPointBean.class,new CurrentLiteral()).getInjectedBean().getInjectedMetadata().isDelegate();
+
+ Cat cat = getInstanceByType(Cat.class, new CurrentLiteral());
+ assert cat.hello().equals("hello world!");
+ assert cat.getInjectionPoint() != null;
+ assert cat.getInjectionPoint().isDelegate();
+ }
+ }.run();
+ }
}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injectionpoint/TransientFieldInjectionPointBean.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injectionpoint/TransientFieldInjectionPointBean.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injectionpoint/TransientFieldInjectionPointBean.java 2009-07-21 07:54:15 UTC (rev 3103)
@@ -0,0 +1,40 @@
+/*
+ * 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.injectionpoint;
+
+import javax.enterprise.context.RequestScoped;
+import javax.enterprise.inject.Current;
+
+/**
+ * Test bean to inject another bean which uses injection point metadata in a
+ * field
+ *
+ * @author David Allen
+ *
+ */
+@RequestScoped
+class TransientFieldInjectionPointBean
+{
+ @Current @AnimalStereotype
+ private transient BeanWithInjectionPointMetadata injectedBean;
+
+ public BeanWithInjectionPointMetadata getInjectedBean()
+ {
+ return injectedBean;
+ }
+}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injectionpoint/broken/normal/scope/Cat_Broken.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injectionpoint/broken/normal/scope/Cat_Broken.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injectionpoint/broken/normal/scope/Cat_Broken.java 2009-07-21 07:54:15 UTC (rev 3103)
@@ -0,0 +1,30 @@
+/*
+ * 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.injectionpoint.broken.normal.scope;
+
+import javax.enterprise.context.RequestScoped;
+import javax.enterprise.context.SessionScoped;
+import javax.enterprise.inject.Current;
+import javax.enterprise.inject.spi.InjectionPoint;
+
+@SuppressWarnings("unused")
+@RequestScoped
+class Cat_Broken {
+
+ @Current private InjectionPoint ip;
+
+}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injectionpoint/broken/normal/scope/NormalScopedBeanWithInjectionPoint.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injectionpoint/broken/normal/scope/NormalScopedBeanWithInjectionPoint.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injectionpoint/broken/normal/scope/NormalScopedBeanWithInjectionPoint.java 2009-07-21 07:54:15 UTC (rev 3103)
@@ -0,0 +1,39 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.jboss.jsr299.tck.tests.lookup.injectionpoint.broken.normal.scope;
+
+import org.hibernate.tck.annotations.SpecAssertion;
+import org.jboss.jsr299.tck.DefinitionError;
+import org.jboss.testharness.impl.packaging.Artifact;
+import org.jboss.testharness.impl.packaging.ExpectedDeploymentException;
+import org.testng.annotations.Test;
+
+/**
+ *
+ * Spec version: 2009625
+ */
+@Artifact
+(a)ExpectedDeploymentException(DefinitionError.class)
+public class NormalScopedBeanWithInjectionPoint {
+
+ @Test(groups = { "injectionPoint", "ri-broken" })
+ @SpecAssertion(section="5.6.9", id="f")
+ public void testSessionScopedBeanWithInjectionPoint() {
+ assert false;
+ }
+
+}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injectionpoint/broken/not/bean/Dog.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injectionpoint/broken/not/bean/Dog.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injectionpoint/broken/not/bean/Dog.java 2009-07-21 07:54:15 UTC (rev 3103)
@@ -0,0 +1,27 @@
+/*
+ * 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.injectionpoint.broken.not.bean;
+
+import javax.enterprise.inject.Current;
+import javax.enterprise.inject.spi.InjectionPoint;
+
+class Dog
+{
+ public String bark(@Current InjectionPoint ip) {
+ return "ruff";
+ }
+}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injectionpoint/broken/not/bean/InjectionPointOnNonBeanTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injectionpoint/broken/not/bean/InjectionPointOnNonBeanTest.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injectionpoint/broken/not/bean/InjectionPointOnNonBeanTest.java 2009-07-21 07:54:15 UTC (rev 3103)
@@ -0,0 +1,39 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.jboss.jsr299.tck.tests.lookup.injectionpoint.broken.not.bean;
+
+import org.hibernate.tck.annotations.SpecAssertion;
+import org.jboss.jsr299.tck.DefinitionError;
+import org.jboss.testharness.impl.packaging.Artifact;
+import org.jboss.testharness.impl.packaging.ExpectedDeploymentException;
+import org.testng.annotations.Test;
+
+/**
+ *
+ * Spec version: 2009625
+ */
+@Artifact
+(a)ExpectedDeploymentException(DefinitionError.class)
+public class InjectionPointOnNonBeanTest
+{
+ @Test(groups = { "injectionPoint", "ri-broken" })
+ @SpecAssertion(section = "5.6.9", id = "g")
+ public void test()
+ {
+ assert false;
+ }
+}
Added: tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/lookup/injectionpoint/beans.xml
===================================================================
--- tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/lookup/injectionpoint/beans.xml (rev 0)
+++ tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/lookup/injectionpoint/beans.xml 2009-07-21 07:54:15 UTC (rev 3103)
@@ -0,0 +1,5 @@
+<beans>
+ <decorators>
+ <class>org.jboss.jsr299.tck.tests.lookup.injectionpoint.CatDecorator</class>
+ </decorators>
+</beans>
15 years, 4 months
[webbeans-commits] Webbeans SVN: r3102 - in tck/trunk/impl/src/main: java/org/jboss/jsr299/tck/tests/policy and 22 other directories.
by webbeans-commits@lists.jboss.org
Author: jharting
Date: 2009-07-21 03:31:00 -0400 (Tue, 21 Jul 2009)
New Revision: 3102
Added:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/policy/
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/policy/Animal.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/policy/Bird.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/policy/Cat.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/policy/Chicken.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/policy/Dog.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/policy/EnabledPolicyStereotype.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/policy/EnabledSheepProducer.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/policy/Horse.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/policy/NotEnabledPolicyStereotype.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/policy/NotEnabledSheepProducer.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/policy/PolicyAvailabilityTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/policy/Sheep.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/policy/Tame.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/policy/Wild.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/policy/broken/
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/policy/broken/incorrect/
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/policy/broken/incorrect/name/
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/policy/broken/incorrect/name/NoClassWithSpecifiedNameTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/policy/broken/incorrect/name/stereotype/
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/policy/broken/incorrect/name/stereotype/NoAnnotationWithSpecifiedNameTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/policy/broken/not/
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/policy/broken/not/policy/
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/policy/broken/not/policy/Cat.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/policy/broken/not/policy/ClassIsNotPolicyTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/policy/broken/not/policy/stereotype/
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/policy/broken/not/policy/stereotype/ClassIsNotPolicyTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/policy/broken/not/policy/stereotype/Mock.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/policy/broken/same/
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/policy/broken/same/type/
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/policy/broken/same/type/twice/
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/policy/broken/same/type/twice/Cat.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/policy/broken/same/type/twice/Dog.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/policy/broken/same/type/twice/SameTypeListedTwiceTest.java
tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/policy/
tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/policy/beans.xml
tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/policy/broken/
tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/policy/broken/incorrect/
tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/policy/broken/incorrect/name/
tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/policy/broken/incorrect/name/beans.xml
tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/policy/broken/incorrect/name/stereotype/
tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/policy/broken/incorrect/name/stereotype/beans.xml
tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/policy/broken/not/
tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/policy/broken/not/policy/
tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/policy/broken/not/policy/beans.xml
tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/policy/broken/not/policy/stereotype/
tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/policy/broken/not/policy/stereotype/beans.xml
tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/policy/broken/same/
tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/policy/broken/same/type/
tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/policy/broken/same/type/twice/
tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/policy/broken/same/type/twice/beans.xml
Log:
Added policy tests
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/policy/Animal.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/policy/Animal.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/policy/Animal.java 2009-07-21 07:31:00 UTC (rev 3102)
@@ -0,0 +1,22 @@
+/*
+ * 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.policy;
+
+interface Animal
+{
+
+}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/policy/Bird.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/policy/Bird.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/policy/Bird.java 2009-07-21 07:31:00 UTC (rev 3102)
@@ -0,0 +1,27 @@
+/*
+ * 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.policy;
+
+import javax.enterprise.inject.Named;
+
+@EnabledPolicyStereotype
+@NotEnabledPolicyStereotype
+@Named
+class Bird implements Animal
+{
+
+}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/policy/Cat.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/policy/Cat.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/policy/Cat.java 2009-07-21 07:31:00 UTC (rev 3102)
@@ -0,0 +1,26 @@
+/*
+ * 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.policy;
+
+import javax.enterprise.inject.Named;
+
+@EnabledPolicyStereotype
+@Named
+class Cat implements Animal
+{
+
+}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/policy/Chicken.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/policy/Chicken.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/policy/Chicken.java 2009-07-21 07:31:00 UTC (rev 3102)
@@ -0,0 +1,27 @@
+/*
+ * 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.policy;
+
+import javax.enterprise.context.RequestScoped;
+import javax.enterprise.inject.Policy;
+
+@Policy
+@RequestScoped
+class Chicken implements Animal
+{
+
+}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/policy/Dog.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/policy/Dog.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/policy/Dog.java 2009-07-21 07:31:00 UTC (rev 3102)
@@ -0,0 +1,26 @@
+/*
+ * 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.policy;
+
+import javax.enterprise.inject.Named;
+
+@NotEnabledPolicyStereotype
+@Named
+class Dog implements Animal
+{
+
+}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/policy/EnabledPolicyStereotype.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/policy/EnabledPolicyStereotype.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/policy/EnabledPolicyStereotype.java 2009-07-21 07:31:00 UTC (rev 3102)
@@ -0,0 +1,38 @@
+/*
+ * 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.policy;
+
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.ElementType.TYPE;
+
+import java.lang.annotation.Retention;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+import java.lang.annotation.Target;
+
+import javax.enterprise.context.RequestScoped;
+import javax.enterprise.inject.Policy;
+import javax.enterprise.inject.stereotype.Stereotype;
+
+@RequestScoped
+@Stereotype
+@Policy
+@Target( { TYPE, METHOD })
+@Retention(RUNTIME)
+@interface EnabledPolicyStereotype
+{
+
+}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/policy/EnabledSheepProducer.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/policy/EnabledSheepProducer.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/policy/EnabledSheepProducer.java 2009-07-21 07:31:00 UTC (rev 3102)
@@ -0,0 +1,32 @@
+/*
+ * 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.policy;
+
+import javax.enterprise.inject.Policy;
+import javax.enterprise.inject.Produces;
+
+@Policy
+class EnabledSheepProducer
+{
+ @Produces @Wild
+ public static final Sheep sheep = new Sheep();
+
+ @Produces @Wild
+ public Sheep produce() {
+ return sheep;
+ }
+}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/policy/Horse.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/policy/Horse.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/policy/Horse.java 2009-07-21 07:31:00 UTC (rev 3102)
@@ -0,0 +1,27 @@
+/*
+ * 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.policy;
+
+import javax.enterprise.context.RequestScoped;
+import javax.enterprise.inject.Policy;
+
+@Policy
+@RequestScoped
+public class Horse implements Animal
+{
+
+}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/policy/NotEnabledPolicyStereotype.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/policy/NotEnabledPolicyStereotype.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/policy/NotEnabledPolicyStereotype.java 2009-07-21 07:31:00 UTC (rev 3102)
@@ -0,0 +1,38 @@
+/*
+ * 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.policy;
+
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.ElementType.TYPE;
+
+import java.lang.annotation.Retention;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+import java.lang.annotation.Target;
+
+import javax.enterprise.context.RequestScoped;
+import javax.enterprise.inject.Policy;
+import javax.enterprise.inject.stereotype.Stereotype;
+
+@RequestScoped
+@Stereotype
+@Policy
+@Target( { TYPE, METHOD })
+@Retention(RUNTIME)
+@interface NotEnabledPolicyStereotype
+{
+
+}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/policy/NotEnabledSheepProducer.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/policy/NotEnabledSheepProducer.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/policy/NotEnabledSheepProducer.java 2009-07-21 07:31:00 UTC (rev 3102)
@@ -0,0 +1,32 @@
+/*
+ * 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.policy;
+
+import javax.enterprise.inject.Policy;
+import javax.enterprise.inject.Produces;
+
+@Policy
+class NotEnabledSheepProducer
+{
+ @Produces @Tame
+ public static final Sheep sheep = new Sheep();
+
+ @Produces @Tame
+ public Sheep produce() {
+ return sheep;
+ }
+}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/policy/PolicyAvailabilityTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/policy/PolicyAvailabilityTest.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/policy/PolicyAvailabilityTest.java 2009-07-21 07:31:00 UTC (rev 3102)
@@ -0,0 +1,99 @@
+/*
+ * 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.policy;
+
+import java.lang.reflect.Type;
+import java.util.HashSet;
+import java.util.Set;
+
+import javax.enterprise.inject.AnnotationLiteral;
+import javax.enterprise.inject.spi.Bean;
+
+import org.hibernate.tck.annotations.SpecAssertion;
+import org.hibernate.tck.annotations.SpecAssertions;
+import org.jboss.jsr299.tck.AbstractJSR299Test;
+import org.jboss.testharness.impl.packaging.Artifact;
+import org.jboss.testharness.impl.packaging.jsr299.BeansXml;
+import org.testng.annotations.Test;
+
+/**
+ *
+ * Spec version: 20090625
+ *
+ */
+@Artifact
+@BeansXml("beans.xml")
+public class PolicyAvailabilityTest extends AbstractJSR299Test
+{
+
+ @Test(groups = {"policy", "ri-broken"})
+ @SpecAssertions( {
+ @SpecAssertion(section = "5.2", id = "b"),
+ @SpecAssertion(section = "5.2", id = "c") })
+ public void testPolicyAvailability() throws Exception
+ {
+ new RunInDependentContext()
+ {
+ @Override
+ protected void execute() throws Exception
+ {
+ Set<Bean<Animal>> animals = getBeans(Animal.class);
+ Set<Type> types = new HashSet<Type>();
+ for (Bean<Animal> animal : animals) {
+ types.addAll(animal.getTypes());
+ }
+ assert types.contains(Chicken.class);
+ assert types.contains(Cat.class);
+ assert !types.contains(Horse.class);
+ assert !types.contains(Dog.class);
+
+ assert getCurrentManager().getBeans("cat").size() == 1;
+ assert getCurrentManager().getBeans("dog").size() == 0;
+ }
+ }.run();
+ }
+
+ @Test(groups = {"policy"})
+ @SpecAssertion(section = "5.2", id = "g")
+ public void testAnyEnabledPolicyStereotypeMakesPolicyEnabled() throws Exception
+ {
+ new RunInDependentContext()
+ {
+ @Override
+ protected void execute() throws Exception
+ {
+ assert getBeans(Bird.class).size() == 1;
+ assert getCurrentManager().getBeans("bird").size() == 1;
+ }
+ }.run();
+ }
+
+ @Test(groups = {"policy", "ri-broken"})
+ @SpecAssertion(section = "5.2", id = "f")
+ public void testProducerPolicies() throws Exception
+ {
+ new RunInDependentContext()
+ {
+ @Override
+ protected void execute() throws Exception
+ {
+ assert getBeans(Sheep.class, new AnnotationLiteral<Wild>(){}).size() == 2;
+ assert getBeans(Sheep.class, new AnnotationLiteral<Tame>(){}).size() == 0;
+ }
+ }.run();
+ }
+}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/policy/Sheep.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/policy/Sheep.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/policy/Sheep.java 2009-07-21 07:31:00 UTC (rev 3102)
@@ -0,0 +1,22 @@
+/*
+ * 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.policy;
+
+class Sheep
+{
+
+}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/policy/Tame.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/policy/Tame.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/policy/Tame.java 2009-07-21 07:31:00 UTC (rev 3102)
@@ -0,0 +1,36 @@
+/*
+ * 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.policy;
+
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.ElementType.PARAMETER;
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import javax.enterprise.inject.BindingType;
+
+@Target( { TYPE, METHOD, PARAMETER, FIELD })
+@Retention(RUNTIME)
+@BindingType
+@interface Tame
+{
+
+}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/policy/Wild.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/policy/Wild.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/policy/Wild.java 2009-07-21 07:31:00 UTC (rev 3102)
@@ -0,0 +1,36 @@
+/*
+ * 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.policy;
+
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.ElementType.PARAMETER;
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import javax.enterprise.inject.BindingType;
+
+@Target( { TYPE, METHOD, PARAMETER, FIELD })
+@Retention(RUNTIME)
+@BindingType
+@interface Wild
+{
+
+}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/policy/broken/incorrect/name/NoClassWithSpecifiedNameTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/policy/broken/incorrect/name/NoClassWithSpecifiedNameTest.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/policy/broken/incorrect/name/NoClassWithSpecifiedNameTest.java 2009-07-21 07:31:00 UTC (rev 3102)
@@ -0,0 +1,44 @@
+/*
+ * 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.policy.broken.incorrect.name;
+
+import org.hibernate.tck.annotations.SpecAssertion;
+import org.jboss.jsr299.tck.AbstractJSR299Test;
+import org.jboss.jsr299.tck.DeploymentError;
+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;
+
+/**
+ *
+ * Spec version: 20090625
+ *
+ */
+@Artifact
+@BeansXml("beans.xml")
+(a)ExpectedDeploymentException(DeploymentError.class)
+public class NoClassWithSpecifiedNameTest extends AbstractJSR299Test
+{
+
+ @Test(groups = { "policy", "ri-broken" })
+ @SpecAssertion(section="5.2", id="h")
+ public void test()
+ {
+ assert false;
+ }
+}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/policy/broken/incorrect/name/stereotype/NoAnnotationWithSpecifiedNameTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/policy/broken/incorrect/name/stereotype/NoAnnotationWithSpecifiedNameTest.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/policy/broken/incorrect/name/stereotype/NoAnnotationWithSpecifiedNameTest.java 2009-07-21 07:31:00 UTC (rev 3102)
@@ -0,0 +1,45 @@
+/*
+ * 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.policy.broken.incorrect.name.stereotype;
+
+import org.hibernate.tck.annotations.SpecAssertion;
+import org.jboss.jsr299.tck.AbstractJSR299Test;
+import org.jboss.jsr299.tck.DeploymentError;
+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;
+
+/**
+ *
+ * Spec version: 20090625
+ *
+ */
+@Artifact
+@BeansXml("beans.xml")
+(a)ExpectedDeploymentException(DeploymentError.class)
+public class NoAnnotationWithSpecifiedNameTest extends AbstractJSR299Test
+{
+
+ @Test(groups = { "policy", "ri-broken" })
+ @SpecAssertion(section="5.2", id="i")
+ public void test()
+ {
+ assert false;
+ }
+
+}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/policy/broken/not/policy/Cat.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/policy/broken/not/policy/Cat.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/policy/broken/not/policy/Cat.java 2009-07-21 07:31:00 UTC (rev 3102)
@@ -0,0 +1,27 @@
+/*
+ * 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.policy.broken.not.policy;
+
+import javax.enterprise.context.RequestScoped;
+import javax.enterprise.inject.Named;
+
+@RequestScoped
+@Named
+class Cat
+{
+
+}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/policy/broken/not/policy/ClassIsNotPolicyTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/policy/broken/not/policy/ClassIsNotPolicyTest.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/policy/broken/not/policy/ClassIsNotPolicyTest.java 2009-07-21 07:31:00 UTC (rev 3102)
@@ -0,0 +1,44 @@
+/*
+ * 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.policy.broken.not.policy;
+
+import org.hibernate.tck.annotations.SpecAssertion;
+import org.jboss.jsr299.tck.AbstractJSR299Test;
+import org.jboss.jsr299.tck.DeploymentError;
+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;
+
+/**
+ *
+ * Spec version: 20090625
+ *
+ */
+@Artifact
+@BeansXml("beans.xml")
+(a)ExpectedDeploymentException(DeploymentError.class)
+public class ClassIsNotPolicyTest extends AbstractJSR299Test
+{
+
+ @Test(groups = { "policy", "ri-broken" })
+ @SpecAssertion(section="5.2", id="h")
+ public void test()
+ {
+ assert false;
+ }
+}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/policy/broken/not/policy/stereotype/ClassIsNotPolicyTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/policy/broken/not/policy/stereotype/ClassIsNotPolicyTest.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/policy/broken/not/policy/stereotype/ClassIsNotPolicyTest.java 2009-07-21 07:31:00 UTC (rev 3102)
@@ -0,0 +1,45 @@
+/*
+ * 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.policy.broken.not.policy.stereotype;
+
+import org.hibernate.tck.annotations.SpecAssertion;
+import org.jboss.jsr299.tck.AbstractJSR299Test;
+import org.jboss.jsr299.tck.DeploymentError;
+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;
+
+/**
+ *
+ * Spec version: 20090625
+ *
+ */
+@Artifact
+@BeansXml("beans.xml")
+(a)ExpectedDeploymentException(DeploymentError.class)
+public class ClassIsNotPolicyTest extends AbstractJSR299Test
+{
+
+ @Test(groups = { "policy", "ri-broken" })
+ @SpecAssertion(section="5.2", id="i")
+ public void test()
+ {
+ assert false;
+ }
+
+}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/policy/broken/not/policy/stereotype/Mock.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/policy/broken/not/policy/stereotype/Mock.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/policy/broken/not/policy/stereotype/Mock.java 2009-07-21 07:31:00 UTC (rev 3102)
@@ -0,0 +1,36 @@
+/*
+ * 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.policy.broken.not.policy.stereotype;
+
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.ElementType.TYPE;
+
+import java.lang.annotation.Retention;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+import java.lang.annotation.Target;
+
+import javax.enterprise.context.RequestScoped;
+import javax.enterprise.inject.stereotype.Stereotype;
+
+@Stereotype
+@Target( { TYPE, METHOD })
+@Retention(RUNTIME)
+@RequestScoped
+@interface Mock
+{
+
+}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/policy/broken/same/type/twice/Cat.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/policy/broken/same/type/twice/Cat.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/policy/broken/same/type/twice/Cat.java 2009-07-21 07:31:00 UTC (rev 3102)
@@ -0,0 +1,27 @@
+/*
+ * 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.policy.broken.same.type.twice;
+
+import javax.enterprise.context.RequestScoped;
+import javax.enterprise.inject.Policy;
+
+@RequestScoped
+@Policy
+class Cat
+{
+
+}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/policy/broken/same/type/twice/Dog.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/policy/broken/same/type/twice/Dog.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/policy/broken/same/type/twice/Dog.java 2009-07-21 07:31:00 UTC (rev 3102)
@@ -0,0 +1,29 @@
+/*
+ * 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.policy.broken.same.type.twice;
+
+import javax.enterprise.context.RequestScoped;
+import javax.enterprise.inject.Named;
+import javax.enterprise.inject.Policy;
+
+@RequestScoped
+@Named
+@Policy
+class Dog
+{
+
+}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/policy/broken/same/type/twice/SameTypeListedTwiceTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/policy/broken/same/type/twice/SameTypeListedTwiceTest.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/policy/broken/same/type/twice/SameTypeListedTwiceTest.java 2009-07-21 07:31:00 UTC (rev 3102)
@@ -0,0 +1,45 @@
+/*
+ * 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.policy.broken.same.type.twice;
+
+import org.hibernate.tck.annotations.SpecAssertion;
+import org.jboss.jsr299.tck.AbstractJSR299Test;
+import org.jboss.jsr299.tck.DeploymentError;
+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;
+
+/**
+ *
+ * Spec version: 20090625
+ *
+ */
+@Artifact
+@BeansXml("beans.xml")
+(a)ExpectedDeploymentException(DeploymentError.class)
+public class SameTypeListedTwiceTest extends AbstractJSR299Test
+{
+
+ @Test(groups = { "policy", "ri-broken" })
+ @SpecAssertion(section="5.2", id="j")
+ public void test()
+ {
+ assert false;
+ }
+
+}
Added: tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/policy/beans.xml
===================================================================
--- tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/policy/beans.xml (rev 0)
+++ tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/policy/beans.xml 2009-07-21 07:31:00 UTC (rev 3102)
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<beans>
+ <policies>
+ <class>org.jboss.jsr299.tck.tests.policy.Chicken</class>
+ <class>org.jboss.jsr299.tck.tests.policy.EnabledSheepProducer</class>
+ <stereotype>org.jboss.jsr299.tck.tests.policy.EnabledPolicyStereotype</stereotype>
+ </policies>
+</beans>
\ No newline at end of file
Added: tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/policy/broken/incorrect/name/beans.xml
===================================================================
--- tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/policy/broken/incorrect/name/beans.xml (rev 0)
+++ tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/policy/broken/incorrect/name/beans.xml 2009-07-21 07:31:00 UTC (rev 3102)
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<beans>
+ <policies>
+ <class>org.jboss.jsr299.tck.tests.policy.broken.incorrect.name.NonExistingClass</class>
+ </policies>
+</beans>
\ No newline at end of file
Added: tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/policy/broken/incorrect/name/stereotype/beans.xml
===================================================================
--- tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/policy/broken/incorrect/name/stereotype/beans.xml (rev 0)
+++ tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/policy/broken/incorrect/name/stereotype/beans.xml 2009-07-21 07:31:00 UTC (rev 3102)
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<beans>
+ <policies>
+ <stereotype>org.jboss.jsr299.tck.tests.policy.broken.incorrect.name.stereotype.Mock</stereotype>
+ </policies>
+</beans>
\ No newline at end of file
Added: tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/policy/broken/not/policy/beans.xml
===================================================================
--- tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/policy/broken/not/policy/beans.xml (rev 0)
+++ tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/policy/broken/not/policy/beans.xml 2009-07-21 07:31:00 UTC (rev 3102)
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<beans>
+ <policies>
+ <class>org.jboss.jsr299.tck.tests.policy.broken.not.policy.Cat</class>
+ </policies>
+</beans>
\ No newline at end of file
Added: tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/policy/broken/not/policy/stereotype/beans.xml
===================================================================
--- tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/policy/broken/not/policy/stereotype/beans.xml (rev 0)
+++ tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/policy/broken/not/policy/stereotype/beans.xml 2009-07-21 07:31:00 UTC (rev 3102)
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<beans>
+ <policies>
+ <stereotype>org.jboss.jsr299.tck.tests.policy.broken.not.policy.stereotype.Mock</stereotype>
+ </policies>
+</beans>
\ No newline at end of file
Added: tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/policy/broken/same/type/twice/beans.xml
===================================================================
--- tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/policy/broken/same/type/twice/beans.xml (rev 0)
+++ tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/policy/broken/same/type/twice/beans.xml 2009-07-21 07:31:00 UTC (rev 3102)
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<beans>
+ <policies>
+ <class>org.jboss.jsr299.tck.tests.policy.broken.same.type.twice.Dog</class>
+ <class>org.jboss.jsr299.tck.tests.policy.broken.same.type.twice.Cat</class>
+ <class>org.jboss.jsr299.tck.tests.policy.broken.same.type.twice.Cat</class>
+ </policies>
+</beans>
\ No newline at end of file
15 years, 4 months
[webbeans-commits] Webbeans SVN: r3101 - tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/field/definition.
by webbeans-commits@lists.jboss.org
Author: shane.bryzak(a)jboss.com
Date: 2009-07-21 02:33:40 -0400 (Tue, 21 Jul 2009)
New Revision: 3101
Removed:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/field/definition/TarantulaConsumer.java
Modified:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/field/definition/DefangedTarantula.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/field/definition/ProducerFieldDefinitionTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/field/definition/TameTarantulaProducer.java
Log:
fix producer field definition tests
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/field/definition/DefangedTarantula.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/field/definition/DefangedTarantula.java 2009-07-21 04:22:46 UTC (rev 3100)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/field/definition/DefangedTarantula.java 2009-07-21 06:33:40 UTC (rev 3101)
@@ -1,6 +1,5 @@
package org.jboss.jsr299.tck.tests.implementation.producer.field.definition;
-
class DefangedTarantula extends Tarantula
{
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/field/definition/ProducerFieldDefinitionTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/field/definition/ProducerFieldDefinitionTest.java 2009-07-21 04:22:46 UTC (rev 3100)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/field/definition/ProducerFieldDefinitionTest.java 2009-07-21 06:33:40 UTC (rev 3101)
@@ -29,14 +29,6 @@
private static final Annotation FOO_LITERAL = new AnnotationLiteral<Foo>() {};
private static final Annotation STATIC_LITERAL = new AnnotationLiteral<Static>() {};
- @Test(groups = { "producerField", "deployment" })
- @SpecAssertion(section = "review", id = "review")
- public void testProducerFieldInheritsDeploymentTypeOfDeclaringWebBean() throws Exception
- {
- Set<Bean<Tarantula>> tarantulaBeans = getBeans(Tarantula.class);
- assert tarantulaBeans.size() == 1;
- }
-
@Test(groups = "producerField")
@SpecAssertion(section = "3.4", id = "fa")
public void testParameterizedReturnType() throws Exception
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/field/definition/TameTarantulaProducer.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/field/definition/TameTarantulaProducer.java 2009-07-21 04:22:46 UTC (rev 3100)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/field/definition/TameTarantulaProducer.java 2009-07-21 06:33:40 UTC (rev 3101)
@@ -6,6 +6,6 @@
class TameTarantulaProducer
{
- @Produces @Foo @Tame @RequestScoped @Production public Tarantula produceTarantula = new DefangedTarantula();
+ @Produces @Foo @Tame @RequestScoped public Tarantula produceTarantula = new DefangedTarantula();
}
Deleted: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/field/definition/TarantulaConsumer.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/field/definition/TarantulaConsumer.java 2009-07-21 04:22:46 UTC (rev 3100)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/field/definition/TarantulaConsumer.java 2009-07-21 06:33:40 UTC (rev 3101)
@@ -1,39 +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.implementation.producer.field.definition;
-
-import javax.enterprise.inject.Current;
-
-/**
- * This bean contains an injection point for a Tarantula that must be provided
- * by the container via a (static) producer field.
- *
- * @author David Allen
- *
- */
-class TarantulaConsumer
-{
- @Current
- private Tarantula consumedTarantula;
-
- public Tarantula getConsumedTarantula()
- {
- return consumedTarantula;
- }
-
-}
15 years, 4 months
[webbeans-commits] Webbeans SVN: r3100 - in tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating: broken9 and 1 other directory.
by webbeans-commits@lists.jboss.org
Author: dan.j.allen
Date: 2009-07-21 00:22:46 -0400 (Tue, 21 Jul 2009)
New Revision: 3100
Added:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/NonBean.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/SerializableCity.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/SerializableCityConsumer.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/Sleeping.java
Removed:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/FooConsumer.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/SerializableFoo.java
Modified:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/CityProducer.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/CityProducer2.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/Generator.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/HelsinkiNonSerializable.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/PassivatingContextTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/Violation.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/broken9/NonSerializableTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/broken9/Violation.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/broken9/Violation2.java
Log:
fix broken integration tests
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/CityProducer.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/CityProducer.java 2009-07-21 04:22:07 UTC (rev 3099)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/CityProducer.java 2009-07-21 04:22:46 UTC (rev 3100)
@@ -1,12 +1,11 @@
package org.jboss.jsr299.tck.tests.context.passivating;
-import javax.enterprise.context.Dependent;
import javax.enterprise.context.SessionScoped;
import javax.enterprise.inject.Produces;
class CityProducer
{
- @Produces @Dependent public Violation reference = new Violation();
+ @Produces public Violation reference = new Violation();
- @Produces @SessionScoped public HelsinkiNonSerializable helsinki = new HelsinkiNonSerializable();
+ @Produces @SessionScoped public HelsinkiNonSerializable helsinki = new HelsinkiNonSerializable();
}
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/CityProducer2.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/CityProducer2.java 2009-07-21 04:22:07 UTC (rev 3099)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/CityProducer2.java 2009-07-21 04:22:46 UTC (rev 3100)
@@ -1,11 +1,10 @@
package org.jboss.jsr299.tck.tests.context.passivating;
-import javax.enterprise.context.Dependent;
import javax.enterprise.inject.Produces;
class CityProducer2
{
- @Produces @Dependent @Big
+ @Produces @Big
public Violation create()
{
return new Violation();
Deleted: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/FooConsumer.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/FooConsumer.java 2009-07-21 04:22:07 UTC (rev 3099)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/FooConsumer.java 2009-07-21 04:22:46 UTC (rev 3100)
@@ -1,14 +0,0 @@
-package org.jboss.jsr299.tck.tests.context.passivating;
-
-import javax.enterprise.context.RequestScoped;
-import javax.enterprise.inject.Current;
-
-@RequestScoped
-class FooConsumer
-{
-
- @Current SerializableFoo foo;
-
- public void ping(){};
-
-}
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/Generator.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/Generator.java 2009-07-21 04:22:07 UTC (rev 3099)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/Generator.java 2009-07-21 04:22:46 UTC (rev 3100)
@@ -1,13 +1,12 @@
package org.jboss.jsr299.tck.tests.context.passivating;
-
import java.io.Serializable;
import javax.enterprise.context.ApplicationScoped;
import javax.enterprise.inject.Produces;
@ApplicationScoped
-class Generator implements Serializable
+class Generator implements Serializable
{
private static final long serialVersionUID = -7213673465118041882L;
@@ -19,9 +18,9 @@
return number;
}
- @Produces SerializableFoo getFoo()
+ @Produces @Sleeping SerializableCity getCity()
{
- return new SerializableFoo();
+ return new SerializableCity();
}
-}
+}
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/HelsinkiNonSerializable.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/HelsinkiNonSerializable.java 2009-07-21 04:22:07 UTC (rev 3099)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/HelsinkiNonSerializable.java 2009-07-21 04:22:46 UTC (rev 3100)
@@ -1,6 +1,6 @@
package org.jboss.jsr299.tck.tests.context.passivating;
-class HelsinkiNonSerializable
+@NonBean class HelsinkiNonSerializable
{
public void ping()
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/NonBean.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/NonBean.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/NonBean.java 2009-07-21 04:22:46 UTC (rev 3100)
@@ -0,0 +1,21 @@
+package org.jboss.jsr299.tck.tests.context.passivating;
+
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.ElementType.PARAMETER;
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+import java.lang.annotation.Documented;
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import javax.enterprise.inject.deployment.DeploymentType;
+
+@Target( { TYPE, METHOD, PARAMETER, FIELD })
+@Retention(RUNTIME)
+@Documented
+@DeploymentType
+@interface NonBean
+{
+}
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/PassivatingContextTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/PassivatingContextTest.java 2009-07-21 04:22:07 UTC (rev 3099)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/PassivatingContextTest.java 2009-07-21 04:22:46 UTC (rev 3100)
@@ -2,12 +2,10 @@
import java.io.IOException;
import java.io.Serializable;
-import java.lang.annotation.Annotation;
import java.util.Set;
import javax.enterprise.context.SessionScoped;
import javax.enterprise.context.spi.Context;
-import javax.enterprise.inject.AnnotationLiteral;
import javax.enterprise.inject.IllegalProductException;
import javax.enterprise.inject.spi.Bean;
@@ -18,7 +16,6 @@
import org.jboss.testharness.impl.packaging.Packaging;
import org.jboss.testharness.impl.packaging.PackagingType;
import org.jboss.testharness.impl.packaging.jsr299.BeansXml;
-import org.jboss.testharness.impl.util.Reflections;
import org.testng.annotations.Test;
/**
@@ -43,15 +40,15 @@
}
@Test @SpecAssertion(section="unknown", id = "unknown")
- public void testInjectionOfDependentSerializableProductIntoNormalBean()
+ public void testInjectionOfDependentPrimitiveProductIntoNormalBean()
{
getInstanceByType(NumberConsumer.class).ping();
}
@Test @SpecAssertion(section="unknown", id = "unknown")
- public void testInjectionOfDependentPrimitiveProductIntoNormalBean()
+ public void testInjectionOfDependentSerializableProductIntoNormalBean()
{
- getInstanceByType(FooConsumer.class).ping();
+ getInstanceByType(SerializableCityConsumer.class).ping();
}
@Test(groups = { "contexts", "passivation" })
@@ -77,6 +74,7 @@
T instance = getCurrentManager().getContext(bean.getScopeType()).get(bean);
byte[] data = serialize(instance);
T resurrected = (T) deserialize(data);
+ assert resurrected != null;
return resurrected.toString().equals(instance.toString());
}
@@ -125,7 +123,7 @@
}
@Test(expectedExceptions = IllegalProductException.class)
- @SpecAssertion(section = "6.6.4", id = "d")
+ @SpecAssertion(section = "6.6.4", id = "d")
public void testNonSerializableProducerFieldDeclaredPassivatingThrowsIllegalProductException()
{
getInstanceByType(HelsinkiNonSerializable.class).ping();
Copied: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/SerializableCity.java (from rev 3098, tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/SerializableFoo.java)
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/SerializableCity.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/SerializableCity.java 2009-07-21 04:22:46 UTC (rev 3100)
@@ -0,0 +1,7 @@
+package org.jboss.jsr299.tck.tests.context.passivating;
+
+import java.io.Serializable;
+
+public class SerializableCity extends City implements Serializable
+{
+}
Copied: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/SerializableCityConsumer.java (from rev 3098, tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/FooConsumer.java)
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/SerializableCityConsumer.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/SerializableCityConsumer.java 2009-07-21 04:22:46 UTC (rev 3100)
@@ -0,0 +1,15 @@
+package org.jboss.jsr299.tck.tests.context.passivating;
+
+import javax.enterprise.context.RequestScoped;
+
+@RequestScoped
+class SerializableCityConsumer
+{
+
+ @Sleeping SerializableCity city;
+
+ public void ping()
+ {
+ };
+
+}
Deleted: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/SerializableFoo.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/SerializableFoo.java 2009-07-21 04:22:07 UTC (rev 3099)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/SerializableFoo.java 2009-07-21 04:22:46 UTC (rev 3100)
@@ -1,8 +0,0 @@
-package org.jboss.jsr299.tck.tests.context.passivating;
-
-import java.io.Serializable;
-
-public class SerializableFoo implements Serializable
-{
-
-}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/Sleeping.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/Sleeping.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/Sleeping.java 2009-07-21 04:22:46 UTC (rev 3100)
@@ -0,0 +1,22 @@
+package org.jboss.jsr299.tck.tests.context.passivating;
+
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.ElementType.PARAMETER;
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+import java.lang.annotation.Documented;
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import javax.enterprise.inject.BindingType;
+
+@Target( { TYPE, METHOD, PARAMETER, FIELD })
+@Retention(RUNTIME)
+@Documented
+@BindingType
+@interface Sleeping
+{
+
+}
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/Violation.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/Violation.java 2009-07-21 04:22:07 UTC (rev 3099)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/Violation.java 2009-07-21 04:22:46 UTC (rev 3100)
@@ -1,14 +1,8 @@
package org.jboss.jsr299.tck.tests.context.passivating;
-import javax.enterprise.context.Dependent;
-
-@Dependent
-class Violation
+@NonBean class Violation
{
-
public void ping()
{
-
}
-
}
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/broken9/NonSerializableTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/broken9/NonSerializableTest.java 2009-07-21 04:22:07 UTC (rev 3099)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/broken9/NonSerializableTest.java 2009-07-21 04:22:46 UTC (rev 3100)
@@ -7,12 +7,15 @@
import org.jboss.testharness.impl.packaging.ExpectedDeploymentException;
import org.testng.annotations.Test;
+/**
+ * Spec version: 20090625
+ */
@Artifact
@ExpectedDeploymentException(DeploymentError.class)
public class NonSerializableTest extends AbstractJSR299Test
{
@Test(groups = { "contexts", "passivation" })
- @SpecAssertion(section = "8.4", id = "o")
+ @SpecAssertion(section = "6.6.4", id = "cb")
public void testSimpleDependentWebBeanWithNonSerializableImplementationInjectedIntoProducerMethodParameterWithPassivatingScopeFails()
{
assert false;
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/broken9/Violation.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/broken9/Violation.java 2009-07-21 04:22:07 UTC (rev 3099)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/broken9/Violation.java 2009-07-21 04:22:46 UTC (rev 3100)
@@ -1,9 +1,5 @@
package org.jboss.jsr299.tck.tests.context.passivating.broken9;
-import javax.enterprise.context.Dependent;
-
-@Dependent
class Violation
{
-
}
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/broken9/Violation2.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/broken9/Violation2.java 2009-07-21 04:22:07 UTC (rev 3099)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/broken9/Violation2.java 2009-07-21 04:22:46 UTC (rev 3100)
@@ -1,9 +1,5 @@
package org.jboss.jsr299.tck.tests.context.passivating.broken9;
-import javax.enterprise.context.Dependent;
-
-@Dependent
class Violation2
{
-
}
15 years, 4 months
[webbeans-commits] Webbeans SVN: r3099 - tck/trunk/impl/src/main/resources.
by webbeans-commits@lists.jboss.org
Author: dan.j.allen
Date: 2009-07-21 00:22:07 -0400 (Tue, 21 Jul 2009)
New Revision: 3099
Modified:
tck/trunk/impl/src/main/resources/tck-audit.xml
Log:
split 6.6.4.c into two assertions
Modified: tck/trunk/impl/src/main/resources/tck-audit.xml
===================================================================
--- tck/trunk/impl/src/main/resources/tck-audit.xml 2009-07-21 00:56:12 UTC (rev 3098)
+++ tck/trunk/impl/src/main/resources/tck-audit.xml 2009-07-21 04:22:07 UTC (rev 3099)
@@ -2583,10 +2583,14 @@
<text>If a stateful session bean has an interceptor or decorator with a non-transient injected field, bean constructor parameter or initializer method parameter that does not resolve to a passivation capable dependency, then the container automatically detects the problem and treats it as a deployment problem, as defined in Section 12.4, "Problems detected automatically by the container".</text>
</assertion>
- <assertion id="c">
- <text>If a producer method declares a passivating scope and the container is able to determine that it is not passivation capable by inspecting its return type, or has a parameter that does not resolve to a passivation capable dependency, then the container automatically detects the problem and treats it as a deployment problem, as defined in Section 12.4, "Problems detected automatically by the container".</text>
+ <assertion id="ca">
+ <text>If a producer method declares a passivating scope and the container is able to determine that it is not passivation capable by inspecting its return type~, or has a parameter that does not resolve to a passivation capable dependency,~ then the container automatically detects the problem and treats it as a deployment problem, as defined in Section 12.4, "Problems detected automatically by the container".</text>
</assertion>
+ <assertion id="cb">
+ <text>If a producer method declares a passivating scope and the container is able to determine that it~ is not passivation capable by inspecting its return type, or~ has a parameter that does not resolve to a passivation capable dependency, then the container automatically detects the problem and treats it as a deployment problem, as defined in Section 12.4, "Problems detected automatically by the container".</text>
+ </assertion>
+
<assertion id="d">
<text>If a producer field declares a passivating scope and the container is able to determine that it is not passivation capable by inspecting its type, then the container automatically detects the problem and treats it as a deployment problem, as defined in Section 12.4,
"Problems detected automatically by the container".</text>
15 years, 4 months