diff --git a/build.xml b/build.xml index 9963fdf3a..83384bb2c 100644 --- a/build.xml +++ b/build.xml @@ -292,7 +292,6 @@ - catalog1 --> catalog - DTDLocation dtd = new DTDLocation(); + ResourceLocation dtd = new ResourceLocation(); dtd.setPublicId(publicId); dtd.setLocation(sysid); catalog.addDTD(dtd); @@ -268,7 +282,7 @@ public class XMLCatalogTest extends TestCase { String uri = "http://foo.com/bar/blah.xml"; String uriLoc = "src/etc/testcases/taskdefs/optional/xml/about.xml"; - DTDLocation entity = new DTDLocation(); + ResourceLocation entity = new ResourceLocation(); entity.setPublicId(uri); entity.setLocation(uriLoc); catalog.addEntity(entity); @@ -310,7 +324,7 @@ public class XMLCatalogTest extends TestCase { String publicId = "-//stevo//DTD doc 1.0//EN"; String dtdLoc = "src/etc/testcases/taskdefs/optional/xml/doc.dtd"; - DTDLocation dtd = new DTDLocation(); + ResourceLocation dtd = new ResourceLocation(); dtd.setPublicId(publicId); dtd.setLocation(dtdLoc); catalog.addDTD(dtd); @@ -319,7 +333,7 @@ public class XMLCatalogTest extends TestCase { String uri = "http://foo.com/bar/blah.xml"; String uriLoc = "src/etc/testcases/taskdefs/optional/xml/about.xml"; - DTDLocation entity = new DTDLocation(); + ResourceLocation entity = new ResourceLocation(); entity.setPublicId(uri); entity.setLocation(uriLoc); catalog.addEntity(entity); @@ -355,12 +369,12 @@ public class XMLCatalogTest extends TestCase { String uriLoc = "etc/testcases/taskdefs/optional/xml/about.xml"; String base = null; try { - base = toURLString(project.getBaseDir()) + "src/"; + base = toURLString(project.getBaseDir()) + "/src/"; } catch (MalformedURLException ex) { fail (ex.toString()); } - DTDLocation entity = new DTDLocation(); + ResourceLocation entity = new ResourceLocation(); entity.setPublicId(uri); entity.setLocation(uriLoc); catalog.addEntity(entity); @@ -383,7 +397,7 @@ public class XMLCatalogTest extends TestCase { String dtdLoc = "testcases/taskdefs/optional/xml/doc.dtd"; String path1 = project.getBaseDir().toString() + "/src/etc"; - DTDLocation dtd = new DTDLocation(); + ResourceLocation dtd = new ResourceLocation(); dtd.setPublicId(publicId); dtd.setLocation(dtdLoc); catalog.addDTD(dtd); @@ -393,7 +407,7 @@ public class XMLCatalogTest extends TestCase { String uriLoc = "etc/testcases/taskdefs/optional/xml/about.xml"; String path2 = project.getBaseDir().toString() + "/src"; - DTDLocation entity = new DTDLocation(); + ResourceLocation entity = new ResourceLocation(); entity.setPublicId(uri); entity.setLocation(uriLoc); catalog.addEntity(entity); @@ -407,8 +421,8 @@ public class XMLCatalogTest extends TestCase { InputSource result = catalog.resolveEntity(publicId, "nap:chemical+brothers"); assertNotNull(result); - assertEquals(toURLString(dtdFile), - result.getSystemId()); + String resultStr = new URL(result.getSystemId()).getFile(); + assertTrue(toURLString(dtdFile).endsWith(resultStr)); } catch (Exception e) { fail("resolveEntity() failed!" + e.toString()); } @@ -416,8 +430,8 @@ public class XMLCatalogTest extends TestCase { try { Source result = catalog.resolve(uri, null); assertNotNull(result); - assertEquals(toURLString(xmlFile), - result.getSystemId()); + String resultStr = new URL(result.getSystemId()).getFile(); + assertTrue(toURLString(xmlFile).endsWith(resultStr)); } catch (Exception e) { fail("resolve() failed!" + e.toString()); }