JAL-3453 test changes needed to allow tests to proceed unheeded by
[jalview.git] / test / jalview / ws / dbsources / RemoteFormatTest.java
index e04d195..840f439 100644 (file)
@@ -17,6 +17,7 @@ import jalview.fts.api.FTSRestClientI;
 import jalview.fts.core.FTSRestRequest;
 import jalview.fts.core.FTSRestResponse;
 import jalview.fts.service.uniprot.UniProtFTSRestClient;
+import jalview.gui.Desktop;
 import jalview.ws.SequenceFetcher;
 import jalview.ws.seqfetcher.DbSourceProxy;
 
@@ -44,14 +45,15 @@ public class RemoteFormatTest
   @BeforeTest(alwaysRun = true)
   public void setUp() throws Exception
   {
+    Desktop.getInstanceOnly();
     Cache.loadProperties("test/jalview/io/testProps.jvprops");
     // ensure 'add annotation from structure' is selected
-    Cache.applicationProperties.setProperty("STRUCT_FROM_PDB",
+    Cache.setPropertyNoSave("STRUCT_FROM_PDB",
             Boolean.TRUE.toString());
-    Cache.applicationProperties.setProperty("ADD_SS_ANN",
+    Cache.setPropertyNoSave("ADD_SS_ANN",
             Boolean.TRUE.toString());
 
-    sf = new SequenceFetcher();
+    sf = SequenceFetcher.getInstance();
   }
 
   @DataProvider(name = "AccessionData")
@@ -72,6 +74,9 @@ public class RemoteFormatTest
           throws Exception
   {
     System.out.println("Fetching " + accessionId + " from " + dbSource);
+    System.err.println(
+            "BH 2019.10.06 note see JAL-2114 JUL 2016 for why this test fails.");
+
     List<DbSourceProxy> sps = sf.getSourceProxy(dbSource);
     assertFalse(sps.isEmpty());
     AlignmentI al = sps.get(0).getSequenceRecords(accessionId);
@@ -80,7 +85,7 @@ public class RemoteFormatTest
     SequenceI sq = al.getSequenceAt(0);
     // suppress this check as only Uniprot and PDB acquire PDB refs
     // assertTrue(sq.getAllPDBEntries().size() > 0, "No PDBEntry on sequence.");
-    assertTrue(sq.getDBRefs().length > 0, "No DBRef on sequence.");
+    assertTrue(sq.getDBRefs().size() > 0, "No DBRef on sequence.");
     // suppress this test as only certain databases provide 'primary' dbrefs
     // assertFalse(sq.getPrimaryDBRefs().isEmpty());
     int length = AlignSeq.extractGaps("-. ", sq.getSequenceAsString())