X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=test%2Fjalview%2Fdatamodel%2FMatchTest.java;h=e7d04d77db078134587f20e5778666ef97bda5c4;hb=0a37e3b824b46b026916e124b42400590242d145;hp=9b5e97bf46011015c8306a6a6f075a23d1e529e2;hpb=0c37e7cea9a7028130b6f2164961af24c3c48ec2;p=jalview.git diff --git a/test/jalview/datamodel/MatchTest.java b/test/jalview/datamodel/MatchTest.java index 9b5e97b..e7d04d7 100644 --- a/test/jalview/datamodel/MatchTest.java +++ b/test/jalview/datamodel/MatchTest.java @@ -1,21 +1,50 @@ +/* + * 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.AssertJUnit.assertEquals; import static org.testng.AssertJUnit.assertFalse; import static org.testng.AssertJUnit.assertTrue; -import jalview.datamodel.SearchResults.Match; +import jalview.gui.JvOptionPane; +import org.testng.annotations.BeforeClass; import org.testng.annotations.Test; public class MatchTest { + @BeforeClass(alwaysRun = true) + public void setUpJvOptionPane() + { + JvOptionPane.setInteractiveMode(false); + JvOptionPane.setMockResponse(JvOptionPane.CANCEL_OPTION); + } + @Test(groups = { "Functional" }) public void testToString() { - SequenceI seq = new Sequence("", "abcdefghijklm"); - Match m = new SearchResults().new Match(seq, 3, 5); - assertEquals("2cde", m.toString()); + SequenceI seq = new Sequence("Seq1", "abcdefghijklm"); + SearchResultMatchI m = new SearchResults().new Match(seq, 3, 5); + assertEquals("Seq1/3-5", m.toString()); } @Test(groups = { "Functional" }) @@ -23,8 +52,8 @@ public class MatchTest { SequenceI seq1 = new Sequence("", "abcdefghijklm"); SequenceI seq2 = new Sequence("", "abcdefghijklm"); - SearchResults sr1 = new SearchResults(); - SearchResults sr2 = new SearchResults(); + SearchResultsI sr1 = new SearchResults(); + SearchResultsI sr2 = new SearchResults(); assertFalse(sr1.equals(null)); assertFalse(sr1.equals(seq1)); @@ -43,7 +72,7 @@ public class MatchTest /* * same match but on different sequences - not equal */ - SearchResults sr3 = new SearchResults(); + SearchResultsI sr3 = new SearchResults(); sr3.addResult(seq2, 1, 1); assertFalse(sr1.equals(sr3)); assertFalse(sr3.equals(sr1));