Author: michiel
Date: 2009-11-18 14:59:55 +0100 (Wed, 18 Nov 2009)
New Revision: 39772

Modified:
   mmbase/trunk/core/src/test/java/org/mmbase/util/ResourceLoaderTest.java
Log:
does this reproduce MMB-1894

Modified: 
mmbase/trunk/core/src/test/java/org/mmbase/util/ResourceLoaderTest.java
===================================================================
--- mmbase/trunk/core/src/test/java/org/mmbase/util/ResourceLoaderTest.java     
2009-11-18 13:54:36 UTC (rev 39771)
+++ mmbase/trunk/core/src/test/java/org/mmbase/util/ResourceLoaderTest.java     
2009-11-18 13:59:55 UTC (rev 39772)
@@ -31,7 +31,7 @@
      * perform lookup of non existing resource
      */
     @Test
-    public void testNonExistingResource() throws java.io.IOException {
+    public void nonExistingResource() throws java.io.IOException {
         URL url = 
ResourceLoader.getConfigurationRoot().getResource("nonExisting/test.xml");
         assertTrue("non existing resource should not be openable for input", 
!url.openConnection().getDoInput());
     }
@@ -40,27 +40,27 @@
      * perform lookup of mmbaseroot.xml using getConfigurationroot
      */
     @Test
-    public void testGetMMBaseRootModule() throws java.io.IOException {
+    public void getMMBaseRootModule() throws java.io.IOException {
         URL url = 
ResourceLoader.getConfigurationRoot().getResource("modules/mmbaseroot.xml");
         assertNotNull("did not find mmbaseroot.xml", url);
         assertTrue("non existing resource should openable for input", 
url.openConnection().getDoInput());
     }
 
     @Test
-    public void testGetPropertiesBuilder() throws java.io.IOException {
+    public void getPropertiesBuilder() throws java.io.IOException {
         URL url = 
ResourceLoader.getConfigurationRoot().getResource("builders/properties.xml");
         assertNotNull("did not find properties.xml", url);
         assertTrue("non existing resource should openable for input", 
url.openConnection().getDoInput());
     }
     @Test
-    public void testGetPropertiesBuilder2() throws java.io.IOException {
+    public void getPropertiesBuilder2() throws java.io.IOException {
         URL url = 
ResourceLoader.getConfigurationRoot().getChildResourceLoader("builders").getResource("properties.xml");
         assertNotNull("did not find properties.xml", url);
         assertTrue("non existing resource should openable for input", 
url.openConnection().getDoInput());
     }
 
     @Test
-    public void testGetPropertiesBuilder3() throws java.io.IOException {
+    public void getPropertiesBuilder3() throws java.io.IOException {
         URL url = 
ResourceLoader.getConfigurationRoot().getChildResourceLoader("builders").getResource("/properties.xml");
         assertNotNull("did not find /properties.xml", url);
         assertTrue("non existing resource should openable for input", 
url.openConnection().getDoInput());
@@ -68,7 +68,7 @@
     }
 
     @Test
-    public void testBuilders() throws java.io.IOException {
+    public void builders() throws java.io.IOException {
         Set<String> xmls = 
ResourceLoader.getConfigurationRoot().getChildResourceLoader("builders").getResourcePaths(ResourceLoader.XML_PATTERN,
 true);
         assertTrue("" + xmls + " did not contain  properties.xml", 
xmls.contains("properties.xml"));
         assertTrue("" + xmls + " did not contain  core/object.xml", 
xmls.contains("core/object.xml"));
@@ -76,16 +76,16 @@
     }
 
     @Test
-    public void testBuilders2() throws java.io.IOException {
+    public void builders2() throws java.io.IOException {
         List<URL> xmls1 = 
ResourceLoader.getConfigurationRoot().getChildResourceLoader("builders").getResourceList("/properties.xml");
         List<URL> xmls2 = 
ResourceLoader.getConfigurationRoot().getChildResourceLoader("builders").getResourceList("properties.xml");
         assertEquals(xmls1, xmls2);
 
     }
-    // @Test TODO, this test is broken now.
-    public void testWeightConfiguration() throws java.io.IOException {
+    //@Test // does work like this,
+    public void weightConfiguration() throws java.io.IOException {
         URL u  = 
ResourceLoader.getConfigurationRoot().getChildResourceLoader("builders").getResource("core/object.xml");
-        assertTrue(u.toString(), 
u.toString().endsWith("/mmbase-tests-1.jar!/org/mmbase/config/builders/core/object.xml"));
+        assertTrue(u.toString(), 
u.toString().endsWith("/mmbase-tests-1.jar!/org/mmbase/config/builders/core/object.xml"));
 // jar was in /tests
     }
 
     @Test
@@ -93,4 +93,18 @@
         
assertNull(ResourceLoader.getConfigurationRoot().getDocument("doesnotexist.xml"));
     }
 
+
+    @Test
+    public void spaces() throws Exception {
+        
assertNotNull(ResourceLoader.getConfigurationRoot().getDocument("directory with 
spaces/file with spaces.xml"));
+        ResourceLoader child = 
ResourceLoader.getConfigurationRoot().getChildResourceLoader("directory with 
spaces");
+        Set<String> xmls = child.getResourcePaths(ResourceLoader.XML_PATTERN, 
true);
+        assertEquals(1, xmls.size()); // MMB-1894?
+        for (String x : xmls) {
+            System.out.println(x);
+        }
+
+
+    }
+
 }

_______________________________________________
Cvs mailing list
[email protected]
http://lists.mmbase.org/mailman/listinfo/cvs

Reply via email to