1 package jalview.analysis;
3 import static org.testng.AssertJUnit.assertEquals;
4 import static org.testng.AssertJUnit.fail;
6 import jalview.analysis.SecStrConsensus.SimpleBP;
8 import java.util.Vector;
10 import org.testng.annotations.Test;
13 @Test(groups ={ "Functional" })
14 public void testGetSimpleBPs() throws WUSSParseException
16 String rna = "([{})]"; // JAL-1081 example
17 Vector<SimpleBP> bps = Rna.GetSimpleBPs(rna);
18 assertEquals(3, bps.size());
21 * the base pairs are added in the order in which the matching base is found
23 assertEquals(2, bps.get(0).bp5); // {
24 assertEquals(3, bps.get(0).bp3); // }
25 assertEquals(0, bps.get(1).bp5); // (
26 assertEquals(4, bps.get(1).bp3); // )
27 assertEquals(1, bps.get(2).bp5); // [
28 assertEquals(5, bps.get(2).bp3); // ]
31 @Test(groups ={ "Functional" })
32 public void testGetSimpleBPs_unmatchedOpener()
34 String rna = "(([{})]";
37 Rna.GetSimpleBPs(rna);
38 fail("expected exception");
39 } catch (WUSSParseException e)
45 @Test(groups ={ "Functional" })
46 public void testGetSimpleBPs_unmatchedCloser()
48 String rna = "([{})]]";
51 Rna.GetSimpleBPs(rna);
52 fail("expected exception");
53 } catch (WUSSParseException e)