X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=test%2Fjalview%2Fgui%2FStructureChooserTest.java;h=f183e5cbbac0c32a230076d57435bbe309fb54c2;hb=ee942237fe5155b25f5419ece71a4084a47e2f41;hp=a87e1c6513295607f496887222c14d70971a7b99;hpb=3dd93fb0694a3375dedb4ad5f9596a1781b30caa;p=jalview.git diff --git a/test/jalview/gui/StructureChooserTest.java b/test/jalview/gui/StructureChooserTest.java index a87e1c6..f183e5c 100644 --- a/test/jalview/gui/StructureChooserTest.java +++ b/test/jalview/gui/StructureChooserTest.java @@ -58,7 +58,7 @@ public class StructureChooserTest JvOptionPane.setMockResponse(JvOptionPane.CANCEL_OPTION); } - Sequence seq,upSeq; + Sequence seq,upSeq,upSeq_nocanonical; @BeforeMethod(alwaysRun = true) public void setUp() throws Exception @@ -111,9 +111,15 @@ public class StructureChooserTest + "GTGVHPIVVVQPDAWTEDNGFHAIGQMCEAPVVTREWVLDSVALYQCQELDTYLIPQIPHSHY\n" + "", 1, 1863); - upSeq.createDatasetSequence(); upSeq.setDescription("Breast cancer type 1 susceptibility protein"); + upSeq_nocanonical = new Sequence(upSeq); + upSeq.createDatasetSequence(); upSeq.addDBRef(new DBRefEntry("UNIPROT","0","P38398",null,true)); + + upSeq_nocanonical.createDatasetSequence(); + // not a canonical reference + upSeq_nocanonical.addDBRef(new DBRefEntry("UNIPROT","0","P38398",null,false)); + } @AfterMethod(alwaysRun = true) @@ -121,6 +127,7 @@ public class StructureChooserTest { seq = null; upSeq=null; + upSeq_nocanonical=null; } @Test(groups = { "Functional" }) @@ -163,6 +170,20 @@ public class StructureChooserTest } + @Test(groups = { "Functional" }) + public void displayTDBQueryTest() throws InterruptedException + { + TDBeaconsFTSRestClientTest.setMock(); + PDBFTSRestClientTest.setMock(); + + SequenceI[] selectedSeqs = new SequenceI[] { upSeq_nocanonical }; + StructureChooser sc = new StructureChooser(selectedSeqs, upSeq_nocanonical, null); + // mock so should be quick. Exceptions from mocked PDBFTS are expected too + ThreadwaitFor(500, sc); + + assertTrue(sc.isCanQueryTDB() && sc.isNotQueriedTDBYet()); + } + @Test(groups = { "Network" }) public void fetchStructuresInfoTest() {