JAL-3626 from JAL-3253-applet Cache applicationProperties made private
[jalview.git] / test / jalview / ws / PDBSequenceFetcherTest.java
index 9efcef2..9992137 100644 (file)
@@ -57,12 +57,12 @@ public class PDBSequenceFetcherTest
   {
     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(false);
+    sf = new SequenceFetcher();
   }
 
   /**
@@ -76,7 +76,7 @@ public class PDBSequenceFetcherTest
   @Test(groups = { "Network" }, enabled = true)
   public void testRnaSeqRetrieve() throws Exception
   {
-    Cache.applicationProperties.setProperty("PDB_DOWNLOAD_FORMAT", "PDB");
+    Cache.setPropertyNoSave("PDB_DOWNLOAD_FORMAT", "PDB");
     List<DbSourceProxy> sps = sf.getSourceProxy("PDB");
     AlignmentI response = sps.get(0).getSequenceRecords("2GIS");
     assertTrue(response != null);
@@ -132,6 +132,7 @@ public class PDBSequenceFetcherTest
   private void testRetrieveProteinSeqFromPDB() throws Exception
   {
     List<DbSourceProxy> sps = sf.getSourceProxy("PDB");
+    StringBuilder errors = new StringBuilder();
     for (TestRetrieveObject str : toRetrieve)
     {
       AlignmentI response = sps.get(0).getSequenceRecords(str.id);
@@ -174,11 +175,11 @@ public class PDBSequenceFetcherTest
             lastp = sq.findPosition(col - 1);
           }
         }
-        if (errors.length() > 0)
-        {
-          Assert.fail(errors.toString());
-        }
       }
     }
+    if (errors.length() > 0)
+    {
+      Assert.fail(errors.toString());
+    }
   }
 }