diff --git a/xml/tests/src/com/intellij/xml/XMLCatalogManagerTest.java b/xml/tests/src/com/intellij/xml/XMLCatalogManagerTest.java index 2312b7b2522f..629d3d678a92 100644 --- a/xml/tests/src/com/intellij/xml/XMLCatalogManagerTest.java +++ b/xml/tests/src/com/intellij/xml/XMLCatalogManagerTest.java @@ -43,6 +43,18 @@ public class XMLCatalogManagerTest extends BasePlatformTestCase { assertTrue(filePath, new File(new URI(filePath)).exists()); } + public void testRelativeCatalogs() { + XMLCatalogManager manager = new XMLCatalogManager(getTestDataPath() + "relative.properties"); + CatalogManager catalogManager = manager.getManager(); + Vector files = catalogManager.getCatalogFiles(); + assertEquals(1, files.size()); + String filePath = (String)files.get(0); + assertTrue(filePath, filePath.endsWith("catalog.xml")); + String resolve = getManager().resolve("-//W3C//DTD XHTML 1.0 Strict//EN"); + assertNotNull(resolve); + assertTrue(resolve, resolve.endsWith("/catalog/xhtml1-strict.dtd")); + } + public void testResolvePublic() { String resolve = getManager().resolve("-//W3C//DTD XHTML 1.0 Strict//EN"); assertNotNull(resolve); diff --git a/xml/tests/testData/catalog/relative.properties b/xml/tests/testData/catalog/relative.properties new file mode 100644 index 000000000000..c04f76e59ceb --- /dev/null +++ b/xml/tests/testData/catalog/relative.properties @@ -0,0 +1,4 @@ +# Catalogs are relative to this properties file +relative-catalogs=true +# Catalog list +catalogs=catalog.xml \ No newline at end of file