From 52d08f9222469282c59c8a4dba100bc9d44ddcff Mon Sep 17 00:00:00 2001 From: Dmitry Avdeev Date: Mon, 23 Dec 2019 13:24:49 +0300 Subject: [PATCH] IDEA-229461 Help Resolving XML Catalog URIs test for relative-catalogs=true GitOrigin-RevId: fe2aad0fd555edb27e48d2b68f22f6d6e8feb721 --- .../src/com/intellij/xml/XMLCatalogManagerTest.java | 12 ++++++++++++ xml/tests/testData/catalog/relative.properties | 4 ++++ 2 files changed, 16 insertions(+) create mode 100644 xml/tests/testData/catalog/relative.properties 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