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;
14 @Test(groups = { "Functional" })
15 public void testGetSimpleBPs() throws WUSSParseException
17 String rna = "([{})]"; // JAL-1081 example
18 Vector<SimpleBP> bps = Rna.GetSimpleBPs(rna);
19 assertEquals(3, bps.size());
22 * the base pairs are added in the order in which the matching base is found
24 assertEquals(2, bps.get(0).bp5); // {
25 assertEquals(3, bps.get(0).bp3); // }
26 assertEquals(0, bps.get(1).bp5); // (
27 assertEquals(4, bps.get(1).bp3); // )
28 assertEquals(1, bps.get(2).bp5); // [
29 assertEquals(5, bps.get(2).bp3); // ]
32 @Test(groups = { "Functional" })
33 public void testGetSimpleBPs_unmatchedOpener()
35 String rna = "(([{})]";
38 Rna.GetSimpleBPs(rna);
39 fail("expected exception");
40 } catch (WUSSParseException e)
46 @Test(groups = { "Functional" })
47 public void testGetSimpleBPs_unmatchedCloser()
49 String rna = "([{})]]";
52 Rna.GetSimpleBPs(rna);
53 fail("expected exception");
54 } catch (WUSSParseException e)