1 /* Copyright (c) 2009 Peter Troshin
\r
3 * JAva Bioinformatics Analysis Web Services (JABAWS) @version: 1.0
\r
5 * This library is free software; you can redistribute it and/or modify it under the terms of the
\r
6 * Apache License version 2 as published by the Apache Software Foundation
\r
8 * This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
\r
9 * even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the Apache
\r
10 * License for more details.
\r
12 * A copy of the license is in apache_license.txt. It is also available here:
\r
13 * @see: http://www.apache.org/licenses/LICENSE-2.0.txt
\r
15 * Any republication or derived work distributed in source code form
\r
16 * must include this copyright and license notice.
\r
19 package compbio.data.sequence;
\r
21 import static org.testng.AssertJUnit.assertEquals;
\r
23 import org.testng.annotations.Test;
\r
25 public class FastaSequenceTester {
\r
28 public void testGetFormattedFasta() {
\r
29 FastaSequence fs = new FastaSequence(
\r
31 "kjashf asjkdfhjkahsdfkadf fewyweyrfhjajfasdjkfkjhasdjkfaskhdfjhasdjkf "
\r
32 + "hdflhdghuetirwhglhasdghfjkhdfs gdsfkjghsdjfgjhdsfglkhskdjfgjhjsdkfgkhsdjkfghsdkjfgh "
\r
33 + "sdfjglkjhsdflkjg sdfgklhsdkfgdfkjghjkshgdflsdfgjkshdfghksdjfgkjhsdfgjkh");
\r
34 assertEquals(219, fs.getSequence().length());
\r
35 assertEquals(11, fs.getFormatedSequence(20).split("\n").length);
\r
36 assertEquals(3, fs.getFormatedSequence(80).split("\n").length);
\r
37 fs = new FastaSequence("test", "kjashf f ");
\r
38 assertEquals(1, fs.getFormatedSequence(80).split("\n").length);
\r
39 assertEquals(7, fs.getFormatedSequence(1).split("\n").length);
\r