openwebbeans-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From strub...@apache.org
Subject svn commit: r802588 - in /incubator/openwebbeans/trunk/webbeans-impl/src: main/java/org/apache/webbeans/xml/XMLUtil.java test/java/org/apache/webbeans/test/unittests/xml/XMLTest.java test/resources/org/apache/webbeans/test/xml/nameSpaceNotDeclared.xml
Date Sun, 09 Aug 2009 20:40:43 GMT
Author: struberg
Date: Sun Aug  9 20:40:43 2009
New Revision: 802588

URL: http://svn.apache.org/viewvc?rev=802588&view=rev
Log:
OWB-126 remove namespace not declared checks. This has been removed from the spec

Removed:
    incubator/openwebbeans/trunk/webbeans-impl/src/test/resources/org/apache/webbeans/test/xml/nameSpaceNotDeclared.xml
Modified:
    incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/xml/XMLUtil.java
    incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/xml/XMLTest.java

Modified: incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/xml/XMLUtil.java
URL: http://svn.apache.org/viewvc/incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/xml/XMLUtil.java?rev=802588&r1=802587&r2=802588&view=diff
==============================================================================
--- incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/xml/XMLUtil.java
(original)
+++ incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/xml/XMLUtil.java
Sun Aug  9 20:40:43 2009
@@ -103,24 +103,18 @@
                 public void onStart(ElementPath path)
                 {
                     Element element = path.getCurrent();
-                    if (element.getNamespaceURI() == null || element.getNamespaceURI().equals(""))
-                    {
-                        throw new WebBeansConfigurationException("All elements in the beans.xml
file have to declare name space.");
-                    }
-                    else
+
+                    if (element.isRootElement())
                     {
-                        if (element.isRootElement())
-                        {
-                            WebBeansNameSpaceContainer.getInstance().addNewPackageNameSpace(element.getNamespace().getURI());
+                        WebBeansNameSpaceContainer.getInstance().addNewPackageNameSpace(element.getNamespace().getURI());
 
-                            List allNs = element.declaredNamespaces();
-                            Iterator itNs = allNs.iterator();
+                        List allNs = element.declaredNamespaces();
+                        Iterator itNs = allNs.iterator();
 
-                            while (itNs.hasNext())
-                            {
-                                Namespace namespace = (Namespace)itNs.next();
-                                WebBeansNameSpaceContainer.getInstance().addNewPackageNameSpace(namespace.getURI());
-                            }
+                        while (itNs.hasNext())
+                        {
+                            Namespace namespace = (Namespace)itNs.next();
+                            WebBeansNameSpaceContainer.getInstance().addNewPackageNameSpace(namespace.getURI());
                         }
                     }
                 }

Modified: incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/xml/XMLTest.java
URL: http://svn.apache.org/viewvc/incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/xml/XMLTest.java?rev=802588&r1=802587&r2=802588&view=diff
==============================================================================
--- incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/xml/XMLTest.java
(original)
+++ incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/xml/XMLTest.java
Sun Aug  9 20:40:43 2009
@@ -74,23 +74,4 @@
         Assert.assertNull(e);
     }
 
-    @Test
-    public void nameSpacesNotDeclared()
-    {
-        Throwable e = null;
-        try
-        {
-            InputStream stream = XMLTest.class.getClassLoader().getResourceAsStream("org/apache/webbeans/test/xml/nameSpaceNotDeclared.xml");
-            Assert.assertNotNull(stream);
-
-            XMLUtil.getRootElement(stream);
-
-        }
-        catch (Throwable e1)
-        {
-            e = e1;
-        }
-
-        Assert.assertNotNull(e);
-    }
 }



Mime
View raw message