[webbeans-commits] Webbeans SVN: r3415 - tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/byname/duplicatePrefixResolution and 1 other directory.
webbeans-commits at lists.jboss.org
webbeans-commits at lists.jboss.org
Sun Aug 9 17:59:46 EDT 2009
Author: pete.muir at jboss.org
Date: 2009-08-09 17:59:46 -0400 (Sun, 09 Aug 2009)
New Revision: 3415
Modified:
ri/trunk/impl/src/main/java/org/jboss/webbeans/BeanManagerImpl.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/Validator.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/byname/duplicatePrefixResolution/DuplicateNamePrefixResolutionTest.java
Log:
WBRI-305
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/BeanManagerImpl.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/BeanManagerImpl.java 2009-08-09 21:50:07 UTC (rev 3414)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/BeanManagerImpl.java 2009-08-09 21:59:46 UTC (rev 3415)
@@ -1217,6 +1217,12 @@
return namespaces;
}
+ public Iterable<String> getAccessibleNamespaces()
+ {
+ // TODO Cache this
+ return createDynamicAccessibleIterable(Transform.NAMESPACE);
+ }
+
protected AtomicInteger getIds()
{
return ids;
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/Validator.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/Validator.java 2009-08-09 21:50:07 UTC (rev 3414)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/Validator.java 2009-08-09 21:59:46 UTC (rev 3415)
@@ -230,6 +230,13 @@
namedAccessibleBeans.put(bean.getName(), bean);
}
}
+
+ List<String> accessibleNamespaces = new ArrayList<String>();
+ for (String namespace : beanManager.getAccessibleNamespaces())
+ {
+ accessibleNamespaces.add(namespace);
+ }
+
for (String name : namedAccessibleBeans.keySet())
{
Set<Bean<?>> resolvedBeans = beanManager.getBeanResolver().resolve(namedAccessibleBeans.get(name));
@@ -237,6 +244,10 @@
{
throw new DeploymentException("An unresolvable ambiguous EL name exists for " + name + "; found " + resolvedBeans );
}
+ if (accessibleNamespaces.contains(name))
+ {
+ throw new DeploymentException("The bean name " + name + " is used as a prefix for another bean");
+ }
}
}
Modified: 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 2009-08-09 21:50:07 UTC (rev 3414)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/byname/duplicatePrefixResolution/DuplicateNamePrefixResolutionTest.java 2009-08-09 21:59:46 UTC (rev 3415)
@@ -17,10 +17,10 @@
package org.jboss.jsr299.tck.tests.lookup.byname.duplicatePrefixResolution;
-import org.jboss.test.audit.annotations.SpecAssertion;
-import org.jboss.test.audit.annotations.SpecVersion;
import org.jboss.jsr299.tck.AbstractJSR299Test;
import org.jboss.jsr299.tck.DeploymentError;
+import org.jboss.test.audit.annotations.SpecAssertion;
+import org.jboss.test.audit.annotations.SpecVersion;
import org.jboss.testharness.impl.packaging.Artifact;
import org.jboss.testharness.impl.packaging.ExpectedDeploymentException;
import org.testng.annotations.Test;
@@ -31,9 +31,8 @@
public class DuplicateNamePrefixResolutionTest extends AbstractJSR299Test
{
- @Test(groups = { "resolution", "el", "ri-broken" })
+ @Test(groups = { "resolution", "el"})
@SpecAssertion(section = "5.4.1", id = "db")
- // WBRI-305
public void testDuplicateBeanNamePrefix()
{
assert false;
More information about the weld-commits
mailing list