mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
VCS tests: removed dangerous code which disables plugins inside test
This commit is contained in:
+16
-34
@@ -59,8 +59,6 @@ public abstract class AbstractVcsTestCase {
|
||||
protected IdeaProjectTestFixture myProjectFixture;
|
||||
protected boolean myInitChangeListManager = true;
|
||||
|
||||
protected abstract String getPluginName();
|
||||
|
||||
protected TestClientRunner createClientRunner() {
|
||||
return createClientRunner(null);
|
||||
}
|
||||
@@ -90,42 +88,26 @@ public abstract class AbstractVcsTestCase {
|
||||
}
|
||||
|
||||
protected void initProject(final File clientRoot, String testName) throws Exception {
|
||||
final String key = "idea.load.plugins.id";
|
||||
final String was = System.getProperty(key);
|
||||
try {
|
||||
final String pluginName = getPluginName();
|
||||
if (pluginName != null) {
|
||||
System.setProperty(key, pluginName);
|
||||
}
|
||||
String name = testName;
|
||||
final TestFixtureBuilder<IdeaProjectTestFixture> testFixtureBuilder = IdeaTestFixtureFactory.getFixtureFactory().createFixtureBuilder(name);
|
||||
myProjectFixture = testFixtureBuilder.getFixture();
|
||||
testFixtureBuilder.addModule(EmptyModuleFixtureBuilder.class).addContentRoot(clientRoot.toString());
|
||||
myProjectFixture.setUp();
|
||||
myProject = myProjectFixture.getProject();
|
||||
final TestFixtureBuilder<IdeaProjectTestFixture> testFixtureBuilder = IdeaTestFixtureFactory.getFixtureFactory().createFixtureBuilder(testName);
|
||||
myProjectFixture = testFixtureBuilder.getFixture();
|
||||
testFixtureBuilder.addModule(EmptyModuleFixtureBuilder.class).addContentRoot(clientRoot.toString());
|
||||
myProjectFixture.setUp();
|
||||
myProject = myProjectFixture.getProject();
|
||||
|
||||
projectCreated();
|
||||
projectCreated();
|
||||
|
||||
if (myInitChangeListManager) {
|
||||
((ProjectComponent) ChangeListManager.getInstance(myProject)).projectOpened();
|
||||
}
|
||||
((ProjectComponent) VcsDirtyScopeManager.getInstance(myProject)).projectOpened();
|
||||
|
||||
ApplicationManager.getApplication().runWriteAction(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
myWorkingCopyDir = LocalFileSystem.getInstance().refreshAndFindFileByIoFile(clientRoot);
|
||||
assert myWorkingCopyDir != null;
|
||||
}
|
||||
});
|
||||
if (myInitChangeListManager) {
|
||||
((ProjectComponent) ChangeListManager.getInstance(myProject)).projectOpened();
|
||||
}
|
||||
finally {
|
||||
if (was != null) {
|
||||
System.setProperty(key, was);
|
||||
} else {
|
||||
System.clearProperty(key);
|
||||
((ProjectComponent) VcsDirtyScopeManager.getInstance(myProject)).projectOpened();
|
||||
|
||||
ApplicationManager.getApplication().runWriteAction(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
myWorkingCopyDir = LocalFileSystem.getInstance().refreshAndFindFileByIoFile(clientRoot);
|
||||
assert myWorkingCopyDir != null;
|
||||
}
|
||||
}
|
||||
});
|
||||
((ProjectLevelVcsManagerImpl)ProjectLevelVcsManager.getInstance(myProject)).waitForInitialized();
|
||||
}
|
||||
|
||||
|
||||
@@ -111,11 +111,6 @@ public abstract class HgTest extends AbstractVcsTestCase {
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getPluginName() {
|
||||
return "hg4idea";
|
||||
}
|
||||
|
||||
protected abstract HgTestRepository initRepositories() throws Exception;
|
||||
|
||||
protected abstract void tearDownRepositories() throws Exception;
|
||||
|
||||
@@ -113,11 +113,6 @@ public abstract class SvnTestCase extends AbstractJunitVcsTestCase {
|
||||
listener.after(events);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getPluginName() {
|
||||
return "Subversion";
|
||||
}
|
||||
|
||||
@Before
|
||||
public void setUp() throws Exception {
|
||||
System.out.println("Native client for status: " + isUseNativeAcceleration());
|
||||
|
||||
Reference in New Issue
Block a user