IDEA-229461 Help Resolving XML Catalog URIs

test for relative-catalogs=true

GitOrigin-RevId: fe2aad0fd555edb27e48d2b68f22f6d6e8feb721
This commit is contained in:
Dmitry Avdeev
2019-12-23 10:33:50 +00:00
committed by intellij-monorepo-bot
parent 68df2df462
commit 52d08f9222
2 changed files with 16 additions and 0 deletions
@@ -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);
@@ -0,0 +1,4 @@
# Catalogs are relative to this properties file
relative-catalogs=true
# Catalog list
catalogs=catalog.xml