canQueryTDB = true;
if (needCanonical)
{
- notQueriedTDBYet = false;
+ // triggers display of the 'Query TDB' button
+ notQueriedTDBYet = true;
}
}
};
&& mainFrame.isVisible()
&& cmb_filterOption.getSelectedItem() != null;
}
+ /**
+ *
+ * @return true if the 3D-Beacons query button will/has been displayed
+ */
+ public boolean isCanQueryTDB() {
+ return canQueryTDB;
+ }
+
+ public boolean isNotQueriedTDBYet()
+ {
+ return notQueriedTDBYet;
+ }
}
JvOptionPane.setMockResponse(JvOptionPane.CANCEL_OPTION);
}
- Sequence seq,upSeq;
+ Sequence seq,upSeq,upSeq_nocanonical;
@BeforeMethod(alwaysRun = true)
public void setUp() throws Exception
+ "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)
{
seq = null;
upSeq=null;
+ upSeq_nocanonical=null;
}
@Test(groups = { "Functional" })
}
+ @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()
{