*/
public class TestAlignSeq
{
+ private static final String NL = System.lineSeparator();
@BeforeClass(alwaysRun = true)
public void setUpJvOptionPane()
@Override
public void print(String x)
{
- baos.append(x.replaceAll("\r", ""));
+ baos.append(x);
}
@Override
public void println()
{
- baos.append("\n");
+ baos.append(NL);
}
};
as.printAlignment(ps);
- String expected = "Score = 320.0\n" + "Length of alignment = 10\n"
- + "Sequence Seq1/4-13 (Sequence length = 14)\n"
- + "Sequence 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";
+ String expected = "Score = 320.0" + NL + "Length of alignment = 10" + NL
+ + "Sequence Seq1/4-13 (Sequence length = 14)" + NL
+ + "Sequence Seq3/1-10 (Sequence length = 10)" + NL + NL
+ + "Seq1/4-13 SDFAQQQRRR" + NL + " ||||||| " + NL
+ + "Seq3/1-10 SDFAQQQSSS" + NL + NL + "Percentage ID = 70.00"
+ + NL + NL;
String s = baos.toString();
System.out.println(s);
public class RotatableMatrixTest
{
+ private static final String NL = System.lineSeparator();
+
private RotatableMatrix rm;
@BeforeMethod(alwaysRun = true)
@Test(groups = "Functional")
public void testPrint()
{
- String expected = "0.5 1.0 1.5\n1.0 2.0 3.0\n1.5 3.0 4.5\n";
+ String expected = "0.5 1.0 1.5" + NL + "1.0 2.0 3.0" + NL
+ + "1.5 3.0 4.5" + NL;
ByteArrayOutputStream os = new ByteArrayOutputStream();
PrintStream ps = new PrintStream(os, true);
rm.print(ps);
String result = new String(os.toByteArray());
- assertEquals(result.replaceAll("\r", ""), expected);
+ assertEquals(result, expected);
}
@Test(groups = "Functional")