+ SequenceI expectedSeq = expectedSeqs.get(seq.getName());
+ AssertJUnit.assertTrue(
+ "Failed Sequence Test for >>> " + seq.getName(),
+ isSeqMatched(expectedSeq, seq));
+ passedCount++;
+ }
+ AssertJUnit.assertEquals("Some Sequences did not pass the test",
+ TEST_SEQ_HEIGHT, passedCount);
+ }
+
+ @Test(groups = { "Functional" })
+ public void hiddenColsTest()
+ {
+ ColumnSelection cs = testJsonFile.getColumnSelection();
+ Assert.assertNotNull(cs);
+ Assert.assertNotNull(cs.getHiddenColumns());
+ List<int[]> hiddenCols = cs.getHiddenColumns();
+ Assert.assertEquals(hiddenCols.size(), TEST_CS_HEIGHT);
+ Assert.assertEquals(hiddenCols, expectedColSel.getHiddenColumns(),
+ "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 sequece");
+ }
+
+ @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(groups = { "Functional" })
+ public void isShowSeqFeaturesSet()
+ {
+ Assert.assertTrue(testJsonFile.isShowSeqFeatures(),
+ "Sequence feature isDisplayed setting expected to be true");
+ }
+
+ @Test(groups = { "Functional" })
+ public void testGrpParsed()
+ {
+ Assert.assertNotNull(testAlignment.getGroups());
+ for (SequenceGroup seqGrp : testAlignment.getGroups())
+ {
+ SequenceGroup expectedGrp = expectedGrps.get(seqGrp.getName());
+ AssertJUnit.assertTrue(
+ "Failed SequenceGroup Test for >>> " + seqGrp.getName(),
+ isGroupMatched(expectedGrp, seqGrp));
+ passedCount++;
+ }
+ AssertJUnit.assertEquals("Some SequenceGroups did not pass the test",
+ TEST_GRP_HEIGHT, passedCount);
+ }
+
+ @Test(groups = { "Functional" })
+ public void testAnnotationParsed()
+ {
+ Assert.assertNotNull(testAlignment.getAlignmentAnnotation());
+ for (AlignmentAnnotation annot : testAlignment.getAlignmentAnnotation())
+ {
+ AlignmentAnnotation expectedAnnot = expectedAnnots.get(annot.label);
+ AssertJUnit.assertTrue("Failed AlignmentAnnotation Test for >>> "
+ + annot.label, isAnnotationMatched(expectedAnnot, annot));
+ passedCount++;
+ }
+ AssertJUnit.assertEquals("Some Sequences did not pass the test",
+ TEST_ANOT_HEIGHT, passedCount);
+ }
+
+ public boolean isAnnotationMatched(AlignmentAnnotation eAnnot,
+ AlignmentAnnotation annot)
+ {
+ if (!eAnnot.label.equals(annot.label)
+ || !eAnnot.description.equals(annot.description)
+ || eAnnot.annotations.length != annot.annotations.length)
+ {
+ return false;