X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=test%2FMCview%2FPDBChainTest.java;h=b84ca2848789b8e2e9508de862e838e4af6cb425;hb=06e3a52df5af8243cdb67c023c8ddd834711ad36;hp=193d294357b639417927e248147b98b9c14bfb86;hpb=3412b273e964fb1a9d22564b04a5f0c827ec2461;p=jalview.git diff --git a/test/MCview/PDBChainTest.java b/test/MCview/PDBChainTest.java index 193d294..b84ca28 100644 --- a/test/MCview/PDBChainTest.java +++ b/test/MCview/PDBChainTest.java @@ -1,12 +1,9 @@ package MCview; -import static org.testng.AssertJUnit.assertSame; import static org.testng.AssertJUnit.assertEquals; import static org.testng.AssertJUnit.assertFalse; +import static org.testng.AssertJUnit.assertSame; import static org.testng.AssertJUnit.assertTrue; -import org.testng.annotations.Test; -import java.awt.Color; -import java.util.Vector; import jalview.analysis.AlignSeq; import jalview.datamodel.AlignmentAnnotation; @@ -16,18 +13,32 @@ import jalview.datamodel.SequenceI; import jalview.schemes.ColourSchemeI; import jalview.schemes.TaylorColourScheme; +import java.awt.Color; +import java.util.Vector; + +import org.testng.annotations.BeforeMethod; +import org.testng.annotations.Test; + public class PDBChainTest { - PDBChain c = new PDBChain("1GAQ", "A"); - Atom a1 = new Atom(1f, 2f, 3f); + PDBChain c; + + final Atom a1 = new Atom(1f, 2f, 3f); - Atom a2 = new Atom(5f, 6f, 4f); + final Atom a2 = new Atom(5f, 6f, 4f); - Atom a3 = new Atom(2f, 5f, 6f); + final Atom a3 = new Atom(2f, 5f, 6f); - Atom a4 = new Atom(2f, 1f, 7f); + final Atom a4 = new Atom(2f, 1f, 7f); + + @BeforeMethod(alwaysRun = true) + public void setUp() + { + System.out.println("setup"); + c = new PDBChain("1GAQ", "A"); + } - @Test + @Test(groups ={ "Functional" }) public void testGetNewlineString() { assertEquals(System.lineSeparator(), c.getNewlineString()); @@ -35,7 +46,7 @@ public class PDBChainTest assertEquals("gaga", c.getNewlineString()); } - @Test + @Test(groups ={ "Functional" }) public void testPrint() { c.offset = 7; @@ -63,7 +74,7 @@ public class PDBChainTest * Test the method that constructs a Bond between two atoms and adds it to the * chain's list of bonds */ - @Test + @Test(groups ={ "Functional" }) public void testMakeBond() { /* @@ -98,7 +109,7 @@ public class PDBChainTest assertEquals(3f, b2.end[2], 0.0001f); } - @Test + @Test(groups ={ "Functional" }) public void testSetChainColours_colour() { c.makeBond(a1, a2); @@ -115,7 +126,7 @@ public class PDBChainTest * Test setting bond start/end colours based on a colour scheme i.e. colour by * residue */ - @Test + @Test(groups ={ "Functional" }) public void testSetChainColours_colourScheme() { Color alaColour = new Color(204, 255, 0); @@ -143,7 +154,7 @@ public class PDBChainTest assertEquals(Color.gray, b.endCol); } - @Test + @Test(groups ={ "Functional" }) public void testGetChargeColour() { assertEquals(Color.red, PDBChain.getChargeColour("ASP")); @@ -158,7 +169,7 @@ public class PDBChainTest /** * Test the method that sets bond start/end colours by residue charge property */ - @Test + @Test(groups ={ "Functional" }) public void testSetChargeColours() { a1.resName = "ASP"; // red @@ -187,7 +198,7 @@ public class PDBChainTest /** * Test the method that converts the raw list of atoms to a list of residues */ - @Test + @Test(groups ={ "Functional" }) public void testMakeResidueList_noAnnotation() { Vector atoms = new Vector(); @@ -245,7 +256,7 @@ public class PDBChainTest * Test the method that converts the raw list of atoms to a list of residues, * including parsing of tempFactor to an alignment annotation */ - @Test + @Test(groups ={ "Functional" }) public void testMakeResidueList_withTempFactor() { Vector atoms = new Vector(); @@ -296,7 +307,7 @@ public class PDBChainTest * Test the method that constructs bonds between successive residues' CA or P * atoms */ - @Test + @Test(groups ={ "Functional" }) public void testMakeCaBondList() { c.isNa = true; @@ -327,7 +338,7 @@ public class PDBChainTest assertTrue(c.isNa); } - @Test + @Test(groups ={ "Functional" }) public void testMakeCaBondList_nucleotide() { c.isNa = false; @@ -359,7 +370,7 @@ public class PDBChainTest /** * Test the method that updates atoms with their alignment positions */ - @Test + @Test(groups ={ "Functional" }) public void testMakeExactMapping() { Vector atoms = new Vector();