X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=test%2Fjalview%2Fws%2Fjabaws%2FDisorderAnnotExportImport.java;h=35d5ccd9a8b9f06b3c71e6929203d5d7029ff813;hb=17e77c3f2949a0729322b4a8d907f3f34b6a9914;hp=58aa0197357a129e308af88c1f48c0d1e60519d6;hpb=47168f025aefdaa044802bd5f8f510ffe43a4808;p=jalview.git diff --git a/test/jalview/ws/jabaws/DisorderAnnotExportImport.java b/test/jalview/ws/jabaws/DisorderAnnotExportImport.java index 58aa019..35d5ccd 100644 --- a/test/jalview/ws/jabaws/DisorderAnnotExportImport.java +++ b/test/jalview/ws/jabaws/DisorderAnnotExportImport.java @@ -1,6 +1,6 @@ /* - * Jalview - A Sequence Alignment Editor and Viewer (Version 2.8.2) - * Copyright (C) 2014 The Jalview Authors + * Jalview - A Sequence Alignment Editor and Viewer (Version 2.9) + * Copyright (C) 2015 The Jalview Authors * * This file is part of Jalview. * @@ -20,10 +20,8 @@ */ package jalview.ws.jabaws; -import static org.junit.Assert.*; - -import java.util.ArrayList; -import java.util.List; +import static org.testng.AssertJUnit.assertNotNull; +import static org.testng.AssertJUnit.assertTrue; import jalview.datamodel.AlignmentAnnotation; import jalview.datamodel.AlignmentI; @@ -34,10 +32,15 @@ import jalview.ws.jws2.AADisorderClient; import jalview.ws.jws2.Jws2Discoverer; import jalview.ws.jws2.jabaws2.Jws2Instance; -import org.junit.AfterClass; -import org.junit.BeforeClass; -import org.junit.Test; +import java.util.ArrayList; +import java.util.List; + +import org.testng.Assert; +import org.testng.annotations.AfterClass; +import org.testng.annotations.BeforeClass; +import org.testng.annotations.Test; +@Test(groups = { "Network" }) public class DisorderAnnotExportImport { public static String testseqs = "examples/uniref50.fa"; @@ -50,7 +53,7 @@ public class DisorderAnnotExportImport public static jalview.gui.AlignFrame af = null; - @BeforeClass + @BeforeClass(inheritGroups = true) public static void setUpBeforeClass() throws Exception { @@ -71,13 +74,14 @@ public class DisorderAnnotExportImport assertNotNull("Couldn't load test data ('" + testseqs + "')", af); } - @AfterClass + @AfterClass(alwaysRun = true) public static void tearDownAfterClass() throws Exception { if (af != null) { af.setVisible(false); af.dispose(); + af = null; } } @@ -100,16 +104,17 @@ public class DisorderAnnotExportImport ; } while (af.getViewport().getCalcManager().isWorking()); AlignmentI orig_alig = af.getViewport().getAlignment(); - // NOTE: Consensus annotation row cannot be exported and reimported faithfully - so we remove them + // NOTE: Consensus annotation row cannot be exported and reimported + // faithfully - so we remove them List toremove = new ArrayList(); - for (AlignmentAnnotation aa:orig_alig.getAlignmentAnnotation()) + for (AlignmentAnnotation aa : orig_alig.getAlignmentAnnotation()) { if (aa.autoCalculated) { toremove.add(aa); } } - for (AlignmentAnnotation aa:toremove) + for (AlignmentAnnotation aa : toremove) { orig_alig.deleteAnnotation(aa); } @@ -123,9 +128,8 @@ public class DisorderAnnotExportImport { String aligfileout = new FormatAdapter().formatSequences("PFAM", al.getSequencesArray()); - String anfileout = new AnnotationFile().printAnnotations( - al.getAlignmentAnnotation(), al.getGroups(), - al.getProperties()); + String anfileout = new AnnotationFile() + .printAnnotationsForAlignment(al); assertTrue( "Test " + testname @@ -150,13 +154,13 @@ public class DisorderAnnotExportImport FormatAdapter.PASTE)); // test for consistency in io - StockholmFileTest.testAlignmentEquivalence(al, al_new); + StockholmFileTest.testAlignmentEquivalence(al, al_new, true); return; } catch (Exception e) { e.printStackTrace(); } - fail("Test " + Assert.fail("Test " + testname + "\nCouldn't complete Annotation file roundtrip input/output/input test."); }