try to make hg test failing less fatal for other tests
authorpeter <peter@jetbrains.com>
Thu, 5 Feb 2015 19:54:17 +0000 (20:54 +0100)
committerpeter <peter@jetbrains.com>
Thu, 5 Feb 2015 19:56:17 +0000 (20:56 +0100)
plugins/hg4idea/testSrc/hg4idea/test/HgPlatformTest.java

index 28d69f9340ac56405fa043c8c7ea4106f62cdf1b..017e63053a82832c4f810de726fb4fd5be45de45 100644 (file)
@@ -70,22 +70,27 @@ public abstract class HgPlatformTest extends UsefulTestCase {
   @Override
   protected void setUp() throws Exception {
     super.setUp();
-    myProjectFixture = IdeaTestFixtureFactory.getFixtureFactory().createFixtureBuilder(getTestName(true)).getFixture();
-    myProjectFixture.setUp();
-
-    myProject = myProjectFixture.getProject();
-    myProjectRoot = myProject.getBaseDir();
-
-    cd(myProjectRoot);
-    hg("version");
-
-    createRepository(myProjectRoot);
-    myVcs = HgVcs.getInstance(myProject);
-    assertNotNull(myVcs);
-    myVcs.getGlobalSettings().setHgExecutable(HgExecutor.getHgExecutable());
-    myVcs.checkVersion();
-    myRepository = myProjectRoot;
-    setUpHgrc(myRepository);
+    try {
+      myProjectFixture = IdeaTestFixtureFactory.getFixtureFactory().createFixtureBuilder(getTestName(true)).getFixture();
+      myProjectFixture.setUp();
+
+      myProject = myProjectFixture.getProject();
+      myProjectRoot = myProject.getBaseDir();
+
+      cd(myProjectRoot);
+      hg("version");
+
+      createRepository(myProjectRoot);
+      myVcs = HgVcs.getInstance(myProject);
+      assertNotNull(myVcs);
+      myVcs.getGlobalSettings().setHgExecutable(HgExecutor.getHgExecutable());
+      myVcs.checkVersion();
+      myRepository = myProjectRoot;
+      setUpHgrc(myRepository);
+    }
+    catch (Exception e) {
+      tearDown();
+    }
   }
 
   @Override