X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=test%2Fjalview%2Fio%2FSequenceAnnotationReportTest.java;h=28958748720c559c1623e70116ff6a0e3e624ea9;hb=371978b7fd3a9252d3362f01a1449b15d88fca5c;hp=07ae0ab442f7ef4702a3789bccda926ac023e4c8;hpb=528c0f1815bc67b54618ad5b16c2162946974caf;p=jalview.git diff --git a/test/jalview/io/SequenceAnnotationReportTest.java b/test/jalview/io/SequenceAnnotationReportTest.java index 07ae0ab..2895874 100644 --- a/test/jalview/io/SequenceAnnotationReportTest.java +++ b/test/jalview/io/SequenceAnnotationReportTest.java @@ -1,21 +1,51 @@ +/* + * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$) + * Copyright (C) $$Year-Rel$$ 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 . + * The Jalview Authors are detailed in the 'AUTHORS' file. + */ package jalview.io; import static org.testng.AssertJUnit.assertEquals; import jalview.datamodel.SequenceFeature; +import jalview.gui.JvOptionPane; import java.util.Hashtable; import java.util.Map; +import org.testng.annotations.BeforeClass; import org.testng.annotations.Test; public class SequenceAnnotationReportTest { + + @BeforeClass(alwaysRun = true) + public void setUpJvOptionPane() + { + JvOptionPane.setInteractiveMode(false); + JvOptionPane.setMockResponse(JvOptionPane.CANCEL_OPTION); + } + @Test(groups = "Functional") public void testAppendFeature_disulfideBond() { SequenceAnnotationReport sar = new SequenceAnnotationReport(null); - StringBuffer sb = new StringBuffer(); + StringBuilder sb = new StringBuilder(); sb.append("123456"); SequenceFeature sf = new SequenceFeature("disulfide bond", "desc", 1, 3, 1.2f, "group"); @@ -40,7 +70,7 @@ public class SequenceAnnotationReportTest public void testAppendFeature_status() { SequenceAnnotationReport sar = new SequenceAnnotationReport(null); - StringBuffer sb = new StringBuffer(); + StringBuilder sb = new StringBuilder(); SequenceFeature sf = new SequenceFeature("METAL", "Fe2-S", 1, 3, Float.NaN, "group"); sf.setStatus("Confirmed"); @@ -53,7 +83,7 @@ public class SequenceAnnotationReportTest public void testAppendFeature_withScore() { SequenceAnnotationReport sar = new SequenceAnnotationReport(null); - StringBuffer sb = new StringBuffer(); + StringBuilder sb = new StringBuilder(); SequenceFeature sf = new SequenceFeature("METAL", "Fe2-S", 1, 3, 1.3f, "group"); @@ -86,7 +116,7 @@ public class SequenceAnnotationReportTest public void testAppendFeature_noScore() { SequenceAnnotationReport sar = new SequenceAnnotationReport(null); - StringBuffer sb = new StringBuffer(); + StringBuilder sb = new StringBuilder(); SequenceFeature sf = new SequenceFeature("METAL", "Fe2-S", 1, 3, Float.NaN, "group"); @@ -98,7 +128,7 @@ public class SequenceAnnotationReportTest public void testAppendFeature_clinicalSignificance() { SequenceAnnotationReport sar = new SequenceAnnotationReport(null); - StringBuffer sb = new StringBuffer(); + StringBuilder sb = new StringBuilder(); SequenceFeature sf = new SequenceFeature("METAL", "Fe2-S", 1, 3, Float.NaN, "group"); sf.setValue("clinical_significance", "Benign"); @@ -111,7 +141,7 @@ public class SequenceAnnotationReportTest public void testAppendFeature_withScoreStatusClinicalSignificance() { SequenceAnnotationReport sar = new SequenceAnnotationReport(null); - StringBuffer sb = new StringBuffer(); + StringBuilder sb = new StringBuilder(); SequenceFeature sf = new SequenceFeature("METAL", "Fe2-S", 1, 3, 1.3f, "group"); sf.setStatus("Confirmed"); @@ -128,7 +158,7 @@ public class SequenceAnnotationReportTest public void testAppendFeature_DescEqualsType() { SequenceAnnotationReport sar = new SequenceAnnotationReport(null); - StringBuffer sb = new StringBuffer(); + StringBuilder sb = new StringBuilder(); SequenceFeature sf = new SequenceFeature("METAL", "METAL", 1, 3, Float.NaN, "group"); @@ -147,7 +177,7 @@ public class SequenceAnnotationReportTest public void testAppendFeature_stripHtml() { SequenceAnnotationReport sar = new SequenceAnnotationReport(null); - StringBuffer sb = new StringBuffer(); + StringBuilder sb = new StringBuilder(); SequenceFeature sf = new SequenceFeature("METAL", "helloworld", 1, 3, Float.NaN, "group");