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;
+
+(a)Named("example.com")
+class ExampleWebsite_Broken
+{
+
+}