+ AssertJUnit.assertEquals("Some Sequences did not pass the test",
+ TEST_SEQ_HEIGHT, passedCount);
+ }
+
+ @Test(groups = { "Functional" })
+ public void hiddenColsTest()
+ {
+ HiddenColumns cs = testJsonFile.getHiddenColumns();
+ Assert.assertNotNull(cs);
+ Assert.assertNotNull(cs.getHiddenRegions());
+ List<int[]> hiddenCols = cs.getHiddenRegions();
+ Assert.assertEquals(hiddenCols.size(), TEST_CS_HEIGHT);
+ Assert.assertEquals(hiddenCols.get(0), expectedColSel
+ .getHiddenRegions().get(0),
+ "Mismatched hidden columns!");
+ }
+
+ @Test(groups = { "Functional" })
+ public void hiddenSeqsTest()
+ {
+ Assert.assertNotNull(testJsonFile.getHiddenSequences(),
+ "Hidden sequence Expected but found Null");
+ Assert.assertEquals(jf.getHiddenSequences().length, 1,
+ "Hidden sequence");
+ }
+
+ @Test(groups = { "Functional" })
+ public void colorSchemeTest()
+ {
+ Assert.assertNotNull(testJsonFile.getGlobalColourScheme(),
+ "Colourscheme is null, parsing failed!");
+ Assert.assertEquals(testJsonFile.getGlobalColourScheme(), "Zappo",
+ "Zappo colour scheme expected!");
+ }
+
+ /**
+ * Test for bug JAL-2489, NPE when exporting BioJSON with global colour
+ * scheme, and a group colour scheme, set as 'None'
+ */
+ @Test(groups = { "Functional" })
+ public void testBioJSONRoundTripWithColourSchemeNone()
+ {
+ AppletFormatAdapter formatAdapter = new AppletFormatAdapter();
+
+ Alignment _alignment;
+ try
+ {
+ // load example BioJSON file
+ _alignment = (Alignment) formatAdapter.readFile(TEST_JSON_FILE,
+ DataSourceType.FILE, FileFormat.Json);
+ JSONFile bioJsonFile = (JSONFile) formatAdapter.getAlignFile();
+ AlignFrame alignFrame = new AlignFrame(_alignment,
+ bioJsonFile.getHiddenSequences(),
+ bioJsonFile.getHiddenColumns(), AlignFrame.DEFAULT_WIDTH,
+ AlignFrame.DEFAULT_HEIGHT);