From 8c2df9aa1581b9fdea9ae6708f50e2a81f6efcb2 Mon Sep 17 00:00:00 2001 From: Jim Procter Date: Sat, 11 Sep 2021 11:53:05 +0100 Subject: [PATCH] JAL-3829 patch failing tests and todo for future --- src/jalview/jbgui/GStructureChooser.java | 2 +- test/jalview/gui/StructureChooserTest.java | 4 +--- .../structurechooser/StructureChooserQuerySourceTest.java | 12 +++++++++--- 3 files changed, 11 insertions(+), 7 deletions(-) diff --git a/src/jalview/jbgui/GStructureChooser.java b/src/jalview/jbgui/GStructureChooser.java index 50c9a2e..2a6c1f2 100644 --- a/src/jalview/jbgui/GStructureChooser.java +++ b/src/jalview/jbgui/GStructureChooser.java @@ -88,7 +88,7 @@ public abstract class GStructureChooser extends JPanel { private static final Font VERDANA_12 = new Font("Verdana", 0, 12); - protected static final String VIEWS_FILTER = "VIEWS_FILTER"; + public static final String VIEWS_FILTER = "VIEWS_FILTER"; protected static final String VIEWS_FROM_FILE = "VIEWS_FROM_FILE"; diff --git a/test/jalview/gui/StructureChooserTest.java b/test/jalview/gui/StructureChooserTest.java index 685e1bc..dbe0906 100644 --- a/test/jalview/gui/StructureChooserTest.java +++ b/test/jalview/gui/StructureChooserTest.java @@ -163,10 +163,8 @@ public class StructureChooserTest @Test(groups = { "Functional" }) public void fetchStructuresInfoMockedTest() { - Assert.fail("Not yet implemented"); TDBeaconsFTSRestClientTest.setMock(); - - // PDBFTSRestClient.setMock(); + PDBFTSRestClient.setMock(); SequenceI[] selectedSeqs = new SequenceI[] { upSeq }; StructureChooser sc = new StructureChooser(selectedSeqs, seq, null); sc.fetchStructuresMetaData(); diff --git a/test/jalview/gui/structurechooser/StructureChooserQuerySourceTest.java b/test/jalview/gui/structurechooser/StructureChooserQuerySourceTest.java index 59c4a50..414e8a7 100644 --- a/test/jalview/gui/structurechooser/StructureChooserQuerySourceTest.java +++ b/test/jalview/gui/structurechooser/StructureChooserQuerySourceTest.java @@ -45,6 +45,7 @@ import jalview.fts.core.FTSRestResponse; import jalview.fts.service.pdb.PDBFTSRestClient; import jalview.fts.threedbeacons.TDBeaconsFTSRestClientTest; import jalview.gui.JvOptionPane; +import jalview.gui.StructureChooser; import jalview.jbgui.FilterOption; public class StructureChooserQuerySourceTest @@ -261,11 +262,16 @@ public class StructureChooserQuerySourceTest FTSRestResponse upResponse = null; FTSRestResponse pdbResponse = null; - + // TODO test available options + // Best coverage + // Best Alphafold Model + // Best model (by confidence score) + // Will also need to develop a more sophisticated filtering system + FilterOption opt = tdbquery.getAvailableFilterOptions(StructureChooser.VIEWS_FILTER).get(0); try { - upResponse = tdbquery.fetchStructuresMetaData(upSeq, tdbquery.getDocFieldPrefs().getStructureSummaryFields(), null, false); + upResponse = tdbquery.fetchStructuresMetaData(upSeq, tdbquery.getDocFieldPrefs().getStructureSummaryFields(), opt, false); // test ranking without additional PDBe data - FTSRestResponse firstRanked = tdbquery.selectFirstRankedQuery(upSeq, upResponse.getSearchSummary(), tdbquery.getDocFieldPrefs().getStructureSummaryFields(), "", false); + FTSRestResponse firstRanked = tdbquery.selectFirstRankedQuery(upSeq, upResponse.getSearchSummary(), tdbquery.getDocFieldPrefs().getStructureSummaryFields(), opt.getValue(), false); assertTrue(firstRanked.getNumberOfItemsFound()