git://source.jalview.org
/
jalview.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
JAL-4134 efficiency improvement
[jalview.git]
/
test
/
jalview
/
analysis
/
TestAlignSeq.java
diff --git
a/test/jalview/analysis/TestAlignSeq.java
b/test/jalview/analysis/TestAlignSeq.java
index
2845d91
..
5134511
100644
(file)
--- a/
test/jalview/analysis/TestAlignSeq.java
+++ b/
test/jalview/analysis/TestAlignSeq.java
@@
-22,13
+22,17
@@
package jalview.analysis;
import static org.testng.AssertJUnit.assertEquals;
import static org.testng.AssertJUnit.assertNull;
import static org.testng.AssertJUnit.assertEquals;
import static org.testng.AssertJUnit.assertNull;
-import org.testng.annotations.Test;
-import org.testng.annotations.BeforeMethod;
-import java.io.PrintStream;
import jalview.datamodel.Mapping;
import jalview.datamodel.Sequence;
import jalview.datamodel.SequenceI;
import jalview.datamodel.Mapping;
import jalview.datamodel.Sequence;
import jalview.datamodel.SequenceI;
+import jalview.gui.JvOptionPane;
+
+import java.io.PrintStream;
+
+import org.testng.annotations.BeforeClass;
+import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.Test;
/**
* Test the alignment -> Mapping routines
/**
* Test the alignment -> Mapping routines
@@
-39,12
+43,19
@@
import jalview.datamodel.SequenceI;
public class TestAlignSeq
{
public class TestAlignSeq
{
+ @BeforeClass(alwaysRun = true)
+ public void setUpJvOptionPane()
+ {
+ JvOptionPane.setInteractiveMode(false);
+ JvOptionPane.setMockResponse(JvOptionPane.CANCEL_OPTION);
+ }
+
SequenceI s1, s2, s3;
/**
* @throws java.lang.Exception
*/
SequenceI s1, s2, s3;
/**
* @throws java.lang.Exception
*/
- @BeforeMethod
+ @BeforeMethod(alwaysRun = true)
public void setUp() throws Exception
{
s1 = new Sequence("Seq1", "ASDFAQQQRRRSSS");
public void setUp() throws Exception
{
s1 = new Sequence("Seq1", "ASDFAQQQRRRSSS");
@@
-53,18
+64,17
@@
public class TestAlignSeq
s2 = new Sequence("Seq2", "ASDFA");
s2.setStart(5);
s2.setEnd(9);
s2 = new Sequence("Seq2", "ASDFA");
s2.setStart(5);
s2.setEnd(9);
- s3 = new Sequence("Seq1", "SDFAQQQSSS");
+ s3 = new Sequence("Seq3", "SDFAQQQSSS");
}
}
- @Test
+ @Test(groups = { "Functional" })
/**
* simple test that mapping from alignment corresponds identical positions.
*/
public void testGetMappingForS1()
{
/**
* simple test that mapping from alignment corresponds identical positions.
*/
public void testGetMappingForS1()
{
- AlignSeq as = AlignSeq
- .doGlobalNWAlignment(s1, s2, AlignSeq.PEP);
+ AlignSeq as = AlignSeq.doGlobalNWAlignment(s1, s2, AlignSeq.PEP);
System.out.println("s1: " + as.getAStr1());
System.out.println("s2: " + as.getAStr2());
System.out.println("s1: " + as.getAStr1());
System.out.println("s2: " + as.getAStr2());
@@
-84,7
+94,7
@@
public class TestAlignSeq
}
}
}
}
- @Test
+ @Test(groups = { "Functional" })
public void testExtractGaps()
{
assertNull(AlignSeq.extractGaps(null, null));
public void testExtractGaps()
{
assertNull(AlignSeq.extractGaps(null, null));
@@
-94,7
+104,7
@@
public class TestAlignSeq
assertEquals("ABCD", AlignSeq.extractGaps(" .-", ". -A-B.C D."));
}
assertEquals("ABCD", AlignSeq.extractGaps(" .-", ". -A-B.C D."));
}
- @Test
+ @Test(groups = { "Functional" })
public void testPrintAlignment()
{
AlignSeq as = AlignSeq.doGlobalNWAlignment(s1, s3, AlignSeq.PEP);
public void testPrintAlignment()
{
AlignSeq as = AlignSeq.doGlobalNWAlignment(s1, s3, AlignSeq.PEP);
@@
-115,10
+125,9
@@
public class TestAlignSeq
};
as.printAlignment(ps);
};
as.printAlignment(ps);
- String expected = "Score = 320\nLength of alignment = 10\nSequence Seq1 : 3 - 18 (Sequence length = 14)\nSequence Seq1 : 1 - 10 (Sequence length = 10)\n\n"
- + "Seq1 SDFAQQQRRR\n"
- + " ||||||| \n"
- + "Seq1 SDFAQQQSSS\n\n" + "Percentage ID = 70.00\n\n";
+ String expected = "Score = 320.0\nLength of alignment = 10\nSequence Seq1/4-13 (Sequence length = 14)\nSequence Seq3/1-10 (Sequence length = 10)\n\n"
+ + "Seq1/4-13 SDFAQQQRRR\n" + " ||||||| \n"
+ + "Seq3/1-10 SDFAQQQSSS\n\n" + "Percentage ID = 70.00\n\n";
assertEquals(expected, baos.toString());
}
}
assertEquals(expected, baos.toString());
}
}