You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@netbeans.apache.org by lk...@apache.org on 2019/05/24 05:24:47 UTC

[netbeans] 01/12: Ensuring important DTDs are used locally when running java.completion… (#1206)

This is an automated email from the ASF dual-hosted git repository.

lkishalmi pushed a commit to branch release110
in repository https://gitbox.apache.org/repos/asf/netbeans.git

commit 2e0f5ad850ba9aecd1650c9332aaee23cc145b63
Author: Jan Lahoda <la...@gmail.com>
AuthorDate: Sat Apr 20 20:34:14 2019 +0200

    Ensuring important DTDs are used locally when running java.completion… (#1206)
    
    * Ensuring important DTDs are used locally when running java.completion tests.
    
    * Removing debug output.
---
 .../modules/java/completion/CompletionTestBase.java  | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)

diff --git a/java/java.completion/test/unit/src/org/netbeans/modules/java/completion/CompletionTestBase.java b/java/java.completion/test/unit/src/org/netbeans/modules/java/completion/CompletionTestBase.java
index 9ba6021..744b831 100644
--- a/java/java.completion/test/unit/src/org/netbeans/modules/java/completion/CompletionTestBase.java
+++ b/java/java.completion/test/unit/src/org/netbeans/modules/java/completion/CompletionTestBase.java
@@ -45,6 +45,10 @@ import org.openide.cookies.EditorCookie;
 import org.openide.filesystems.FileObject;
 import org.openide.filesystems.FileUtil;
 import org.openide.loaders.DataObject;
+import org.openide.util.lookup.ServiceProvider;
+import org.openide.xml.EntityCatalog;
+import org.xml.sax.InputSource;
+import org.xml.sax.SAXException;
 
 /**
  *
@@ -710,4 +714,20 @@ public class CompletionTestBase extends CompletionTestBaseBase {
             return text1.length() - text2.length();
         }
     }
+
+    @ServiceProvider(service=EntityCatalog.class)
+    public static final class TestEntityCatalogImpl extends EntityCatalog {
+
+        @Override
+        public InputSource resolveEntity(String publicID, String systemID) throws SAXException, IOException {
+            switch (publicID) {
+                case "-//NetBeans//DTD Editor KeyBindings settings 1.1//EN":
+                    return new InputSource(TestEntityCatalogImpl.class.getResourceAsStream("/org/netbeans/modules/editor/settings/storage/keybindings/EditorKeyBindings-1_1.dtd"));
+                case "-//NetBeans//DTD Editor Preferences 1.0//EN":
+                    return new InputSource(TestEntityCatalogImpl.class.getResourceAsStream("/org/netbeans/modules/editor/settings/storage/preferences/EditorPreferences-1_0.dtd"));
+            }
+            return null;
+        }
+
+    }
 }


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@netbeans.apache.org
For additional commands, e-mail: commits-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists