From: tcofoegbu Date: Mon, 28 Nov 2016 16:02:32 +0000 (+0000) Subject: Merge branch 'features/JAL-2326_JOptionPane-refactoring' into develop X-Git-Tag: Release_2_10_3b1~399^2 X-Git-Url: http://source.jalview.org/gitweb/?p=jalview.git;a=commitdiff_plain;h=19424d4e1623bfcdcf30567f7a233fe81c4a9e4e;hp=-c Merge branch 'features/JAL-2326_JOptionPane-refactoring' into develop --- 19424d4e1623bfcdcf30567f7a233fe81c4a9e4e diff --combined test/jalview/analysis/ConservationTest.java index 39eb309,5d21672..fb58655 --- a/test/jalview/analysis/ConservationTest.java +++ b/test/jalview/analysis/ConservationTest.java @@@ -1,23 -1,3 +1,23 @@@ +/* + * 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.analysis; import static org.testng.Assert.assertEquals; @@@ -25,16 -5,26 +25,26 @@@ import static org.testng.Assert.assertT import jalview.datamodel.Sequence; import jalview.datamodel.SequenceI; + import jalview.gui.JvOptionPane; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; + import org.testng.annotations.BeforeClass; import org.testng.annotations.Test; public class ConservationTest { + + @BeforeClass(alwaysRun = true) + public void setUpJvOptionPane() + { + JvOptionPane.setInteractiveMode(false); + JvOptionPane.setMockResponse(JvOptionPane.CANCEL_OPTION); + } + @Test(groups = "Functional") public void testRecordConservation() { diff --combined test/jalview/analysis/FinderTest.java index 91ceb82,bae98c5..e215b6b --- a/test/jalview/analysis/FinderTest.java +++ b/test/jalview/analysis/FinderTest.java @@@ -1,23 -1,3 +1,23 @@@ +/* + * 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.analysis; import static org.testng.Assert.assertEquals; @@@ -30,6 -10,7 +30,7 @@@ import jalview.datamodel.SearchResultMa import jalview.datamodel.SearchResultsI; import jalview.datamodel.Sequence; import jalview.gui.AlignFrame; + import jalview.gui.JvOptionPane; import jalview.io.FileLoader; import jalview.io.FormatAdapter; @@@ -40,6 -21,13 +41,13 @@@ import org.testng.annotations.Test public class FinderTest { + @BeforeClass(alwaysRun = true) + public void setUpJvOptionPane() + { + JvOptionPane.setInteractiveMode(false); + JvOptionPane.setMockResponse(JvOptionPane.CANCEL_OPTION); + } + private AlignFrame af; private AlignmentI al; diff --combined test/jalview/analysis/scoremodels/FeatureScoreModelTest.java index 292b576,2b48032..1da23ea --- a/test/jalview/analysis/scoremodels/FeatureScoreModelTest.java +++ b/test/jalview/analysis/scoremodels/FeatureScoreModelTest.java @@@ -24,16 -24,24 +24,26 @@@ import jalview.datamodel.AlignmentI import jalview.datamodel.SequenceFeature; import jalview.datamodel.SequenceI; import jalview.gui.AlignFrame; + import jalview.gui.JvOptionPane; import jalview.io.FileLoader; import jalview.io.FormatAdapter; +import java.util.Arrays; + import org.testng.Assert; + import org.testng.annotations.BeforeClass; import org.testng.annotations.Test; public class FeatureScoreModelTest { + + @BeforeClass(alwaysRun = true) + public void setUpJvOptionPane() + { + JvOptionPane.setInteractiveMode(false); + JvOptionPane.setMockResponse(JvOptionPane.CANCEL_OPTION); + } + public static String alntestFile = "FER1_MESCR/72-76 DVYIL\nFER1_SPIOL/71-75 DVYIL\nFER3_RAPSA/21-25 DVYVL\nFER1_MAIZE/73-77 DVYIL\n"; int[] sf1 = new int[] { 74, 74, 73, 73, 23, 23, -1, -1 }; @@@ -139,45 -147,4 +149,45 @@@ + "(" + s + ") should still be distinct from FER1_MAIZE (3)"); } } + + /** + * Check findFeatureAt doesn't return contact features except at contact + * points TODO:move to under the FeatureRendererModel test suite + */ + @Test(groups = { "Functional" }) + public void testFindFeatureAt_PointFeature() throws Exception + { + String alignment = "a CCCCCCGGGGGGCCCCCC\n" + "b CCCCCCGGGGGGCCCCCC\n" + + "c CCCCCCGGGGGGCCCCCC\n"; + AlignFrame af = new jalview.io.FileLoader(false) + .LoadFileWaitTillLoaded(alignment, FormatAdapter.PASTE); + SequenceI aseq = af.getViewport().getAlignment().getSequenceAt(0); + SequenceFeature sf = null; + sf = new SequenceFeature("disulphide bond", "", 2, 5, Float.NaN, ""); + aseq.addSequenceFeature(sf); + Assert.assertTrue(sf.isContactFeature()); + af.refreshFeatureUI(true); + af.getFeatureRenderer().setAllVisible(Arrays.asList("disulphide bond")); + Assert.assertEquals(af.getFeatureRenderer().getDisplayedFeatureTypes() + .size(), 1, "Should be just one feature type displayed"); + // step through and check for pointwise feature presence/absence + Assert.assertEquals(af.getFeatureRenderer().findFeaturesAtRes(aseq, 1) + .size(), 0); + // step through and check for pointwise feature presence/absence + Assert.assertEquals(af.getFeatureRenderer().findFeaturesAtRes(aseq, 2) + .size(), 1); + // step through and check for pointwise feature presence/absence + Assert.assertEquals(af.getFeatureRenderer().findFeaturesAtRes(aseq, 3) + .size(), 0); + // step through and check for pointwise feature presence/absence + Assert.assertEquals(af.getFeatureRenderer().findFeaturesAtRes(aseq, 4) + .size(), 0); + // step through and check for pointwise feature presence/absence + Assert.assertEquals(af.getFeatureRenderer().findFeaturesAtRes(aseq, 5) + .size(), 1); + // step through and check for pointwise feature presence/absence + Assert.assertEquals(af.getFeatureRenderer().findFeaturesAtRes(aseq, 6) + .size(), 0); + } + } diff --combined test/jalview/controller/AlignViewControllerTest.java index e2c2130,7ac1452..f8ea142 --- a/test/jalview/controller/AlignViewControllerTest.java +++ b/test/jalview/controller/AlignViewControllerTest.java @@@ -32,23 -32,33 +32,33 @@@ import jalview.datamodel.SequenceFeatur import jalview.datamodel.SequenceGroup; import jalview.datamodel.SequenceI; import jalview.gui.AlignFrame; + import jalview.gui.JvOptionPane; import jalview.io.FileLoader; import jalview.io.FormatAdapter; import java.util.Arrays; import java.util.BitSet; + import org.testng.annotations.BeforeClass; import org.testng.annotations.Test; public class AlignViewControllerTest { + + @BeforeClass(alwaysRun = true) + public void setUpJvOptionPane() + { + JvOptionPane.setInteractiveMode(false); + JvOptionPane.setMockResponse(JvOptionPane.CANCEL_OPTION); + } + @Test(groups = "Functional") public void testFindColumnsWithFeature() { - SequenceI seq1 = new Sequence("seq1", "aMMMaaaaaaaaaaaaaaaa"); - SequenceI seq2 = new Sequence("seq2", "aaaMMMMMMMaaaaaaaaaa"); - SequenceI seq3 = new Sequence("seq3", "aaaaaaaaaaMMMMMaaaaa"); - SequenceI seq4 = new Sequence("seq3", "aaaaaaaaaaaaaaaaaaaa"); + SequenceI seq1 = new Sequence("seq1", "-a-MMMaaaaaaaaaaaaaaaa"); + SequenceI seq2 = new Sequence("seq2", "aa--aMM-MMMMMaaaaaaaaaa"); + SequenceI seq3 = new Sequence("seq3", "abcab-caD-aaMMMMMaaaaa"); + SequenceI seq4 = new Sequence("seq4", "abc--abcaaaaaaaaaaaaaa"); /* * features start/end are base 1 @@@ -61,16 -71,13 +71,16 @@@ null)); seq3.addSequenceFeature(new SequenceFeature("Metal", "desc", 11, 15, 0f, null)); + // disulfide bond is a 'contact feature' - only select its 'start' and 'end' + seq3.addSequenceFeature(new SequenceFeature("disulfide bond", "desc", 8, 12, + 0f, null)); /* - * select the first three columns --> Metal in seq1 2-3 + * select the first five columns --> Metal in seq1 cols 4-5 */ SequenceGroup sg = new SequenceGroup(); sg.setStartRes(0); // base 0 - sg.setEndRes(2); + sg.setEndRes(4); sg.addSequence(seq1, false); sg.addSequence(seq2, false); sg.addSequence(seq3, false); @@@ -81,37 -88,36 +91,37 @@@ bs); assertEquals(1, seqCount); assertEquals(2, bs.cardinality()); - assertTrue(bs.get(1)); - assertTrue(bs.get(2)); + assertTrue(bs.get(3)); // base 0 + assertTrue(bs.get(4)); /* - * select the first four columns: Metal in seq1 2:4, seq2 4:4 + * select the first seven columns: Metal in seq1 cols 4-6, seq2 cols 6-7 */ - sg.setEndRes(3); + sg.setEndRes(6); bs.clear(); seqCount = AlignViewController.findColumnsWithFeature("Metal", sg, bs); assertEquals(2, seqCount); - assertEquals(3, bs.cardinality()); - assertTrue(bs.get(1)); - assertTrue(bs.get(2)); + assertEquals(4, bs.cardinality()); assertTrue(bs.get(3)); + assertTrue(bs.get(4)); + assertTrue(bs.get(5)); + assertTrue(bs.get(6)); /* - * select column 11: Metal in seq3 only + * select column 14: Metal in seq3 only */ - sg.setStartRes(10); - sg.setEndRes(10); + sg.setStartRes(13); + sg.setEndRes(13); bs.clear(); seqCount = AlignViewController.findColumnsWithFeature("Metal", sg, bs); assertEquals(1, seqCount); assertEquals(1, bs.cardinality()); - assertTrue(bs.get(10)); + assertTrue(bs.get(13)); /* - * select columns 16-20: no Metal feature + * select columns 18-20: no Metal feature */ - sg.setStartRes(15); + sg.setStartRes(17); sg.setEndRes(19); bs.clear(); seqCount = AlignViewController.findColumnsWithFeature("Metal", sg, bs); @@@ -119,30 -125,6 +129,30 @@@ assertEquals(0, bs.cardinality()); /* + * columns 11-13 should not match disulfide bond at 8/12 + */ + sg.setStartRes(10); + sg.setEndRes(12); + bs.clear(); + seqCount = AlignViewController.findColumnsWithFeature("disulfide bond", + sg, bs); + assertEquals(0, seqCount); + assertEquals(0, bs.cardinality()); + + /* + * columns 6-18 should match disulfide bond at columns 9, 14 + */ + sg.setStartRes(5); + sg.setEndRes(17); + bs.clear(); + seqCount = AlignViewController.findColumnsWithFeature("disulfide bond", + sg, bs); + assertEquals(1, seqCount); + assertEquals(2, bs.cardinality()); + assertTrue(bs.get(8)); + assertTrue(bs.get(13)); + + /* * look for a feature that isn't there */ sg.setStartRes(0); diff --combined test/jalview/datamodel/ResidueCountTest.java index 6c6e36a,ac3ee69..4eb6dbf --- a/test/jalview/datamodel/ResidueCountTest.java +++ b/test/jalview/datamodel/ResidueCountTest.java @@@ -1,23 -1,3 +1,23 @@@ +/* + * 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.datamodel; import static org.testng.Assert.assertEquals; @@@ -25,12 -5,22 +25,22 @@@ import static org.testng.Assert.assertF import static org.testng.Assert.assertTrue; import jalview.datamodel.ResidueCount.SymbolCounts; + import jalview.gui.JvOptionPane; import org.junit.Assert; + import org.testng.annotations.BeforeClass; import org.testng.annotations.Test; public class ResidueCountTest { + + @BeforeClass(alwaysRun = true) + public void setUpJvOptionPane() + { + JvOptionPane.setInteractiveMode(false); + JvOptionPane.setMockResponse(JvOptionPane.CANCEL_OPTION); + } + /** * Test a mix of add and put for nucleotide counting */ diff --combined test/jalview/datamodel/SequenceFeatureTest.java index 23812ea,e87d7e5..2da8918 --- a/test/jalview/datamodel/SequenceFeatureTest.java +++ b/test/jalview/datamodel/SequenceFeatureTest.java @@@ -26,10 -26,21 +26,21 @@@ import static org.testng.AssertJUnit.as import static org.testng.AssertJUnit.assertSame; import static org.testng.AssertJUnit.assertTrue; + import jalview.gui.JvOptionPane; + + import org.testng.annotations.BeforeClass; import org.testng.annotations.Test; public class SequenceFeatureTest { + + @BeforeClass(alwaysRun = true) + public void setUpJvOptionPane() + { + JvOptionPane.setInteractiveMode(false); + JvOptionPane.setMockResponse(JvOptionPane.CANCEL_OPTION); + } + @Test(groups = { "Functional" }) public void testCopyConstructor() { @@@ -197,24 -208,4 +208,24 @@@ sf1.setStatus("new"); assertTrue(sf1.equals(sf2)); } + + @Test(groups = { "Functional" }) + public void testIsContactFeature() + { + SequenceFeature sf = new SequenceFeature("type", "desc", 22, 33, 12.5f, + "group"); + assertFalse(sf.isContactFeature()); + sf.setType(""); + assertFalse(sf.isContactFeature()); + sf.setType(null); + assertFalse(sf.isContactFeature()); + sf.setType("Disulfide Bond"); + assertTrue(sf.isContactFeature()); + sf.setType("disulfide bond"); + assertTrue(sf.isContactFeature()); + sf.setType("Disulphide Bond"); + assertTrue(sf.isContactFeature()); + sf.setType("disulphide bond"); + assertTrue(sf.isContactFeature()); + } } diff --combined test/jalview/ext/android/SparseIntArrayTest.java index be95d6e,2da45ed..d9ed73d --- a/test/jalview/ext/android/SparseIntArrayTest.java +++ b/test/jalview/ext/android/SparseIntArrayTest.java @@@ -1,28 -1,11 +1,31 @@@ +/* + * 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.ext.android; import static org.testng.Assert.assertEquals; import static org.testng.Assert.fail; + import jalview.gui.JvOptionPane; + + import org.testng.annotations.BeforeClass; import org.testng.annotations.Test; /* @@@ -31,6 -14,14 +34,14 @@@ */ public class SparseIntArrayTest { + + @BeforeClass(alwaysRun = true) + public void setUpJvOptionPane() + { + JvOptionPane.setInteractiveMode(false); + JvOptionPane.setMockResponse(JvOptionPane.CANCEL_OPTION); + } + @Test(groups = "Functional") public void testPut() { diff --combined test/jalview/ext/android/SparseShortArrayTest.java index df161b7,2a89e65..034368f --- a/test/jalview/ext/android/SparseShortArrayTest.java +++ b/test/jalview/ext/android/SparseShortArrayTest.java @@@ -1,32 -1,23 +1,43 @@@ +/* + * 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.ext.android; import static org.testng.Assert.assertEquals; import static org.testng.Assert.fail; + import jalview.gui.JvOptionPane; + + import org.testng.annotations.BeforeClass; import org.testng.annotations.Test; public class SparseShortArrayTest { + + @BeforeClass(alwaysRun = true) + public void setUpJvOptionPane() + { + JvOptionPane.setInteractiveMode(false); + JvOptionPane.setMockResponse(JvOptionPane.CANCEL_OPTION); + } + @Test(groups = "Functional") public void testPut() { diff --combined test/jalview/schemes/ResidueColourSchemeTest.java index a02ca06,12a5491..d3a4fff --- a/test/jalview/schemes/ResidueColourSchemeTest.java +++ b/test/jalview/schemes/ResidueColourSchemeTest.java @@@ -1,23 -1,3 +1,23 @@@ +/* + * 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.schemes; import static org.testng.AssertJUnit.assertEquals; @@@ -27,13 -7,23 +27,23 @@@ import static org.testng.AssertJUnit.as import jalview.datamodel.Profile; import jalview.datamodel.ProfileI; import jalview.datamodel.Profiles; + import jalview.gui.JvOptionPane; import java.awt.Color; + import org.testng.annotations.BeforeClass; import org.testng.annotations.Test; public class ResidueColourSchemeTest { + + @BeforeClass(alwaysRun = true) + public void setUpJvOptionPane() + { + JvOptionPane.setInteractiveMode(false); + JvOptionPane.setMockResponse(JvOptionPane.CANCEL_OPTION); + } + @Test(groups = "Functional") public void testAboveThreshold() { diff --combined test/jalview/util/FormatTest.java index d957b7c,24cb573..1404f0b --- a/test/jalview/util/FormatTest.java +++ b/test/jalview/util/FormatTest.java @@@ -1,31 -1,22 +1,42 @@@ +/* + * 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.util; import static org.testng.Assert.assertEquals; + import jalview.gui.JvOptionPane; + + import org.testng.annotations.BeforeClass; import org.testng.annotations.Test; public class FormatTest { + + @BeforeClass(alwaysRun = true) + public void setUpJvOptionPane() + { + JvOptionPane.setInteractiveMode(false); + JvOptionPane.setMockResponse(JvOptionPane.CANCEL_OPTION); + } + @Test(groups = "Functional") public void testAppendPercentage() { diff --combined test/jalview/util/PlatformTest.java index e9e4628,1f7db54..307f450 --- a/test/jalview/util/PlatformTest.java +++ b/test/jalview/util/PlatformTest.java @@@ -1,36 -1,27 +1,47 @@@ +/* + * 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.util; import static org.testng.Assert.assertFalse; import static org.testng.Assert.assertTrue; + import jalview.gui.JvOptionPane; + import java.awt.Button; import java.awt.Event; import java.awt.event.MouseEvent; + import org.testng.annotations.BeforeClass; import org.testng.annotations.Test; public class PlatformTest { + + @BeforeClass(alwaysRun = true) + public void setUpJvOptionPane() + { + JvOptionPane.setInteractiveMode(false); + JvOptionPane.setMockResponse(JvOptionPane.CANCEL_OPTION); + } + Button b = new Button(); /** diff --combined test/jalview/util/SparseCountTest.java index f4a0c97,4c5b55b..c4d67b6 --- a/test/jalview/util/SparseCountTest.java +++ b/test/jalview/util/SparseCountTest.java @@@ -1,32 -1,23 +1,43 @@@ +/* + * 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.util; import static org.testng.Assert.assertEquals; import static org.testng.Assert.assertFalse; import static org.testng.Assert.assertTrue; + import jalview.gui.JvOptionPane; + + import org.testng.annotations.BeforeClass; import org.testng.annotations.Test; public class SparseCountTest { + + @BeforeClass(alwaysRun = true) + public void setUpJvOptionPane() + { + JvOptionPane.setInteractiveMode(false); + JvOptionPane.setMockResponse(JvOptionPane.CANCEL_OPTION); + } + @Test(groups = "Functional") public void testAdd() {