mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
better autodetection of platform prefix
This commit is contained in:
@@ -43,11 +43,6 @@ public abstract class IdeaTestCase extends PlatformTestCase {
|
||||
super.tearDown();
|
||||
}
|
||||
|
||||
@SuppressWarnings({"JUnitTestCaseWithNonTrivialConstructors"})
|
||||
protected IdeaTestCase() {
|
||||
initPlatformPrefix();
|
||||
}
|
||||
|
||||
public final JavaPsiFacadeEx getJavaFacade() {
|
||||
return myJavaFacade;
|
||||
}
|
||||
|
||||
@@ -83,6 +83,7 @@ import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
import java.net.URL;
|
||||
import java.util.Collection;
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
@@ -125,6 +126,7 @@ public abstract class PlatformTestCase extends UsefulTestCase implements DataPro
|
||||
|
||||
protected void initApplication() throws Exception {
|
||||
boolean firstTime = ourApplication == null;
|
||||
autodetectPlatformPrefix();
|
||||
ourApplication = IdeaTestApplication.getInstance(getApplicationConfigDirPath());
|
||||
ourApplication.setDataProvider(this);
|
||||
|
||||
@@ -133,6 +135,22 @@ public abstract class PlatformTestCase extends UsefulTestCase implements DataPro
|
||||
}
|
||||
}
|
||||
|
||||
private static void autodetectPlatformPrefix() {
|
||||
if (ourPlatformPrefixInitialized) {
|
||||
return;
|
||||
}
|
||||
URL resource = PlatformTestCase.class.getClassLoader().getResource("idea/ApplicationInfo.xml");
|
||||
if (resource == null) {
|
||||
resource = PlatformTestCase.class.getClassLoader().getResource("idea/IdeaApplicationInfo.xml");
|
||||
if (resource == null) {
|
||||
System.setProperty("idea.platform.prefix", "PlatformLangXml");
|
||||
}
|
||||
else {
|
||||
System.setProperty("idea.platform.prefix", "Idea");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static void cleanPersistedVFSContent() {
|
||||
((PersistentFS)ManagingFS.getInstance()).cleanPersistedContents();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user