mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
com.intellij.javaee.ExternalResourceManagerImpl.addTestResource
This commit is contained in:
@@ -226,6 +226,25 @@ public class ExternalResourceManagerImpl extends ExternalResourceManagerEx imple
|
||||
result.addAll(resources.keySet());
|
||||
}
|
||||
|
||||
@TestOnly
|
||||
public static void addTestResource(final String url, final String location, Disposable parentDisposable) {
|
||||
final ExternalResourceManagerImpl instance = (ExternalResourceManagerImpl)getInstance();
|
||||
ApplicationManager.getApplication().runWriteAction(new Runnable() {
|
||||
public void run() {
|
||||
instance.addResource(url, location);
|
||||
}
|
||||
});
|
||||
Disposer.register(parentDisposable, new Disposable() {
|
||||
@Override
|
||||
public void dispose() {
|
||||
ApplicationManager.getApplication().runWriteAction(new Runnable() {
|
||||
public void run() {
|
||||
instance.removeResource(url);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
public void addResource(String url, String location) {
|
||||
addResource(url, DEFAULT_VERSION, location);
|
||||
}
|
||||
|
||||
@@ -15,8 +15,7 @@
|
||||
*/
|
||||
package org.intellij.plugins.relaxNG;
|
||||
|
||||
import com.intellij.javaee.ExternalResourceManagerEx;
|
||||
import com.intellij.openapi.application.ApplicationManager;
|
||||
import com.intellij.javaee.ExternalResourceManagerImpl;
|
||||
|
||||
/**
|
||||
* @author Eugene.Kudelevsky
|
||||
@@ -33,12 +32,8 @@ public class RngHtml5CompletionTest extends HighlightingTestBase {
|
||||
protected void init() {
|
||||
super.init();
|
||||
|
||||
ApplicationManager.getApplication().runWriteAction(new Runnable() {
|
||||
public void run() {
|
||||
final ExternalResourceManagerEx m = ExternalResourceManagerEx.getInstanceEx();
|
||||
m.addResource("http://www.w3.org/1999/xhtml/html5", toAbsolutePath("/highlighting/html5/html5.rnc"));
|
||||
}
|
||||
});
|
||||
ExternalResourceManagerImpl.addTestResource("http://www.w3.org/1999/xhtml/html5", toAbsolutePath("/highlighting/html5/html5.rnc"),
|
||||
myTestRootDisposable);
|
||||
}
|
||||
|
||||
public void testHtml5_1() throws Throwable {
|
||||
|
||||
Reference in New Issue
Block a user