X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=test%2Fjalview%2Fgui%2FFreeUpMemoryTest.java;h=18ff7f26ade5d92518aff43f5c8d90b62c5e454e;hb=83866eaabbbcb744a8c2076091bf67a3f961c2ff;hp=78beb311f5cca7dcea3b90eea1c077ec619e4392;hpb=710b4dbd18b7ec764ba8c24d173371541f65297d;p=jalview.git diff --git a/test/jalview/gui/FreeUpMemoryTest.java b/test/jalview/gui/FreeUpMemoryTest.java index 78beb31..18ff7f2 100644 --- a/test/jalview/gui/FreeUpMemoryTest.java +++ b/test/jalview/gui/FreeUpMemoryTest.java @@ -35,11 +35,11 @@ public class FreeUpMemoryTest Jalview.main(new String[] { "-nonews", "-props", "test/jalview/testProps.jvprops" }); String True = Boolean.TRUE.toString(); - Cache.applicationProperties.setProperty("SHOW_ANNOTATIONS", True); - Cache.applicationProperties.setProperty("SHOW_QUALITY", True); - Cache.applicationProperties.setProperty("SHOW_CONSERVATION", True); - Cache.applicationProperties.setProperty("SHOW_OCCUPANCY", True); - Cache.applicationProperties.setProperty("SHOW_IDENTITY", True); + Cache.setPropertyNoSave("SHOW_ANNOTATIONS", True); + Cache.setPropertyNoSave("SHOW_QUALITY", True); + Cache.setPropertyNoSave("SHOW_CONSERVATION", True); + Cache.setPropertyNoSave("SHOW_OCCUPANCY", True); + Cache.setPropertyNoSave("SHOW_IDENTITY", True); } /** @@ -70,7 +70,7 @@ public class FreeUpMemoryTest doStuffInJalview(f); - Desktop.instance.closeAll_actionPerformed(null); + Desktop.getInstance().closeAll_actionPerformed(null); checkUsedMemory(35L); } @@ -84,18 +84,19 @@ public class FreeUpMemoryTest protected void checkUsedMemory(long expectedMax) { /* - * request garbage collection and wait briefly for it to run; + * request garbage collection and wait for it to run; * NB there is no guarantee when, or whether, it will do so + * wait time depends on JRE/processor, generous allowance here */ System.gc(); - waitFor(100); + waitFor(1500); /* * a second gc() call should not be necessary - but it is! * the test passes with it, and fails without it */ System.gc(); - waitFor(100); + waitFor(1500); /* * check used memory is 'reasonably low' @@ -108,7 +109,7 @@ public class FreeUpMemoryTest * sanity check - fails if any frame was added after * closeAll_actionPerformed */ - assertEquals(Desktop.instance.getAllFrames().length, 0); + assertEquals(Desktop.getInstance().getAllFrames().length, 0); /* * if this assertion fails