JAL-1645 Version-Rel Version 2.9 Year-Rel 2015 Licensing glob
[jalview.git] / test / jalview / io / JSONFileTest.java
index 108dd31..9bdc2b5 100644 (file)
@@ -1,6 +1,25 @@
+/*
+ * Jalview - A Sequence Alignment Editor and Viewer (Version 2.9)
+ * Copyright (C) 2015 The Jalview Authors
+ * 
+ * This file is part of Jalview.
+ * 
+ * Jalview is free software: you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License 
+ * as published by the Free Software Foundation, either version 3
+ * of the License, or (at your option) any later version.
+ *  
+ * Jalview is distributed in the hope that it will be useful, but 
+ * WITHOUT ANY WARRANTY; without even the implied warranty 
+ * of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
+ * PURPOSE.  See the GNU General Public License for more details.
+ * 
+ * You should have received a copy of the GNU General Public License
+ * along with Jalview.  If not, see <http://www.gnu.org/licenses/>.
+ * The Jalview Authors are detailed in the 'AUTHORS' file.
+ */
 package jalview.io;
 
-
 import static org.testng.AssertJUnit.assertNotNull;
 
 import jalview.api.AlignExportSettingI;
@@ -62,7 +81,7 @@ public class JSONFileTest
 
   private JSONFile jf;
 
-  @BeforeTest
+  @BeforeTest(alwaysRun = true)
   public void setup() throws Exception
   {
     // create and add sequences
@@ -93,7 +112,6 @@ public class JSONFileTest
     seqs[3].addSequenceFeature(seqFeature3);
     seqs[4].addSequenceFeature(seqFeature4);
 
-
     for (Sequence seq : seqs)
     {
       seq.setDatasetSequence(seq);
@@ -195,6 +213,12 @@ public class JSONFileTest
       {
         return true;
       }
+
+      @Override
+      public boolean isCancelled()
+      {
+        return false;
+      }
     };
 
     AppletFormatAdapter formatAdapter = new AppletFormatAdapter();
@@ -211,7 +235,6 @@ public class JSONFileTest
       af.changeColour(jf.getColourScheme());
       af.getViewport().setFeaturesDisplayed(jf.getDisplayedFeatures());
 
-
       formatAdapter = new AppletFormatAdapter(af.alignPanel, exportSettings);
       String jsonOutput = formatAdapter.formatSequences(JSONFile.FILE_DESC,
               af.alignPanel.getAlignment(), false);
@@ -228,7 +251,7 @@ public class JSONFileTest
 
   }
 
-  @BeforeMethod
+  @BeforeMethod(alwaysRun = true)
   public void methodSetup()
   {
     passedCount = 0;
@@ -246,13 +269,13 @@ public class JSONFileTest
     jf = null;
   }
 
-  @Test(groups ={ "Functional" })
+  @Test(groups = { "Functional" })
   public void roundTripTest()
   {
     assertNotNull("JSON roundtrip test failed!", testJsonFile);
   }
 
-  @Test(groups ={ "Functional" })
+  @Test(groups = { "Functional" })
   public void testSeqParsed()
   {
     assertNotNull("Couldn't read supplied alignment data.", testAlignment);
@@ -268,8 +291,8 @@ public class JSONFileTest
     AssertJUnit.assertEquals("Some Sequences did not pass the test",
             TEST_SEQ_HEIGHT, passedCount);
   }
-  
-  @Test(groups ={ "Functional" })
+
+  @Test(groups = { "Functional" })
   public void hiddenColsTest()
   {
     ColumnSelection cs = testJsonFile.getColumnSelection();
@@ -281,16 +304,15 @@ public class JSONFileTest
             "Mismatched hidden columns!");
   }
 
-  @Test(groups ={ "Functional" })
+  @Test(groups = { "Functional" })
   public void hiddenSeqsTest()
   {
     Assert.assertNotNull(testJsonFile.getHiddenSequences(),
             "Hidden sequence Expected but found Null");
-    Assert.assertEquals(jf.getHiddenSequences().length, 1,
-            "Hidden sequece");
+    Assert.assertEquals(jf.getHiddenSequences().length, 1, "Hidden sequece");
   }
 
-  @Test(groups ={ "Functional" })
+  @Test(groups = { "Functional" })
   public void colorSchemeTest()
   {
     Assert.assertNotNull(testJsonFile.getColourScheme(),
@@ -300,14 +322,14 @@ public class JSONFileTest
             "Zappo colour scheme expected!");
   }
 
-  @Test(groups ={ "Functional" })
+  @Test(groups = { "Functional" })
   public void isShowSeqFeaturesSet()
   {
     Assert.assertTrue(testJsonFile.isShowSeqFeatures(),
             "Sequence feature isDisplayed setting expected to be true");
   }
 
-  @Test(groups ={ "Functional" })
+  @Test(groups = { "Functional" })
   public void testGrpParsed()
   {
     Assert.assertNotNull(testAlignment.getGroups());
@@ -323,7 +345,7 @@ public class JSONFileTest
             TEST_GRP_HEIGHT, passedCount);
   }
 
-  @Test(groups ={ "Functional" })
+  @Test(groups = { "Functional" })
   public void testAnnotationParsed()
   {
     Assert.assertNotNull(testAlignment.getAlignmentAnnotation());