JAL-629 null checks for Desktop.instance.closeAll(). Props re-loaded after CommandsTest.
[jalview.git] / test / jalview / bin / CommandsTest.java
index 65162f3..c5f8bff 100644 (file)
@@ -3,6 +3,7 @@ package jalview.bin;
 import java.util.Date;
 
 import org.testng.Assert;
+import org.testng.annotations.AfterClass;
 import org.testng.annotations.AfterMethod;
 import org.testng.annotations.BeforeClass;
 import org.testng.annotations.DataProvider;
@@ -24,6 +25,12 @@ public class CommandsTest
     Cache.setDateProperty("JALVIEW_NEWS_RSS_LASTMODIFIED", oneHourFromNow);
   }
 
+  @AfterClass(alwaysRun = true)
+  public static void resetProps()
+  {
+    Cache.loadProperties("test/jalview/testProps.jvprops");
+  }
+
   @BeforeClass(alwaysRun = true)
   public void setUpJvOptionPane()
   {
@@ -34,7 +41,8 @@ public class CommandsTest
   @AfterMethod(alwaysRun = true)
   public void tearDown()
   {
-    Desktop.instance.closeAll_actionPerformed(null);
+    if (Desktop.instance != null)
+      Desktop.instance.closeAll_actionPerformed(null);
   }
 
   @Test(groups = "Functional", dataProvider = "cmdLines")