From: Jim Procter Date: Wed, 14 Dec 2022 17:09:09 +0000 (+0000) Subject: JAL-4107 fix test compilation issues X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=3f4b01ff53be81b3a04a9893f9bd2a93dbee0a6f;p=jalview.git JAL-4107 fix test compilation issues --- diff --git a/.settings/org.eclipse.buildship.core.prefs b/.settings/org.eclipse.buildship.core.prefs index e889521..e479558 100644 --- a/.settings/org.eclipse.buildship.core.prefs +++ b/.settings/org.eclipse.buildship.core.prefs @@ -1,2 +1,13 @@ +arguments= +auto.sync=false +build.scans.enabled=false +connection.gradle.distribution=GRADLE_DISTRIBUTION(WRAPPER) connection.project.dir= eclipse.preferences.version=1 +gradle.user.home= +java.home= +jvm.arguments= +offline.mode=false +override.workspace.settings=false +show.console.view=false +show.executions.view=false diff --git a/test/jalview/bin/HiDPISettingTest1.java b/test/jalview/bin/HiDPISettingTest1.java index 137d3e1..ef76fe5 100644 --- a/test/jalview/bin/HiDPISettingTest1.java +++ b/test/jalview/bin/HiDPISettingTest1.java @@ -84,7 +84,7 @@ public class HiDPISettingTest1 @AfterClass(alwaysRun = true) public void tearDown() { - Desktop.instance.closeAll_actionPerformed(null); + Desktop.getInstance().closeAll_actionPerformed(null); } @Test(groups = { "Functional" }) diff --git a/test/jalview/gui/FreeUpMemoryTest.java b/test/jalview/gui/FreeUpMemoryTest.java index 9746af1..ba81c77 100644 --- a/test/jalview/gui/FreeUpMemoryTest.java +++ b/test/jalview/gui/FreeUpMemoryTest.java @@ -188,7 +188,7 @@ public class FreeUpMemoryTest * * @param expectedMax */ - protected void checkUsedMemory(int expectedMax) + protected void checkUsedMemory(long expectedMax) { /* * request garbage collection and wait for it to run (up to 3 times); diff --git a/test/jalview/gui/SeqPanelTest.java b/test/jalview/gui/SeqPanelTest.java index 82b4619..92f8d4e 100644 --- a/test/jalview/gui/SeqPanelTest.java +++ b/test/jalview/gui/SeqPanelTest.java @@ -251,14 +251,14 @@ public class SeqPanelTest @AfterMethod(alwaysRun = true) public void tearDown() { - Desktop.instance.closeAll_actionPerformed(null); + Desktop.getInstance().closeAll_actionPerformed(null); } @Test(groups = "Functional") public void testFindMousePosition_wrapped_annotations() { - Cache.applicationProperties.setProperty("SHOW_ANNOTATIONS", "true"); - Cache.applicationProperties.setProperty("WRAP_ALIGNMENT", "true"); + Cache.setPropertyNoSave("SHOW_ANNOTATIONS", "true"); + Cache.setPropertyNoSave("WRAP_ALIGNMENT", "true"); AlignFrame alignFrame = new FileLoader().LoadFileWaitTillLoaded( "examples/uniref50.fa", DataSourceType.FILE); AlignViewportI av = alignFrame.getViewport(); @@ -432,8 +432,8 @@ public class SeqPanelTest @Test(groups = "Functional") public void testFindMousePosition_wrapped_scaleAbove() { - Cache.applicationProperties.setProperty("SHOW_ANNOTATIONS", "true"); - Cache.applicationProperties.setProperty("WRAP_ALIGNMENT", "true"); + Cache.setPropertyNoSave("SHOW_ANNOTATIONS", "true"); + Cache.setPropertyNoSave("WRAP_ALIGNMENT", "true"); AlignFrame alignFrame = new FileLoader().LoadFileWaitTillLoaded( "examples/uniref50.fa", DataSourceType.FILE); AlignViewportI av = alignFrame.getViewport(); @@ -633,9 +633,9 @@ public class SeqPanelTest @Test(groups = "Functional") public void testFindMousePosition_wrapped_noAnnotations() { - Cache.applicationProperties.setProperty("SHOW_ANNOTATIONS", "false"); - Cache.applicationProperties.setProperty("WRAP_ALIGNMENT", "true"); - Cache.applicationProperties.setProperty("FONT_SIZE", "10"); + Cache.setPropertyNoSave("SHOW_ANNOTATIONS", "false"); + Cache.setPropertyNoSave("WRAP_ALIGNMENT", "true"); + Cache.setPropertyNoSave("FONT_SIZE", "10"); AlignFrame alignFrame = new FileLoader().LoadFileWaitTillLoaded( "examples/uniref50.fa", DataSourceType.FILE); AlignViewportI av = alignFrame.getViewport(); @@ -722,7 +722,7 @@ public class SeqPanelTest @Test(groups = "Functional") public void testFindColumn_unwrapped() { - Cache.applicationProperties.setProperty("WRAP_ALIGNMENT", "false"); + Cache.setPropertyNoSave("WRAP_ALIGNMENT", "false"); AlignFrame alignFrame = new FileLoader().LoadFileWaitTillLoaded( "examples/uniref50.fa", DataSourceType.FILE); SeqPanel testee = alignFrame.alignPanel.getSeqPanel(); @@ -791,7 +791,7 @@ public class SeqPanelTest @Test(groups = "Functional") public void testFindColumn_wrapped() { - Cache.applicationProperties.setProperty("WRAP_ALIGNMENT", "true"); + Cache.setPropertyNoSave("WRAP_ALIGNMENT", "true"); AlignFrame alignFrame = new FileLoader().LoadFileWaitTillLoaded( "examples/uniref50.fa", DataSourceType.FILE); AlignViewport av = alignFrame.getViewport(); @@ -908,11 +908,11 @@ public class SeqPanelTest @Test(groups = "Functional") public void testFindMousePosition_wrapped_scales_longSequence() { - Cache.applicationProperties.setProperty("SHOW_ANNOTATIONS", "false"); - Cache.applicationProperties.setProperty("WRAP_ALIGNMENT", "true"); - Cache.applicationProperties.setProperty("FONT_SIZE", "14"); - Cache.applicationProperties.setProperty("FONT_NAME", "SansSerif"); - Cache.applicationProperties.setProperty("FONT_STYLE", "0"); + Cache.setPropertyNoSave("SHOW_ANNOTATIONS", "false"); + Cache.setPropertyNoSave("WRAP_ALIGNMENT", "true"); + Cache.setPropertyNoSave("FONT_SIZE", "14"); + Cache.setPropertyNoSave("FONT_NAME", "SansSerif"); + Cache.setPropertyNoSave("FONT_STYLE", "0"); // sequence of 50 bases, doubled 10 times, = 51200 bases String dna = "ATGGCCATTGGGCCCAAATTTCCCAAAGGGTTTCCCTGAGGTCAGTCAGA"; for (int i = 0; i < 10; i++) diff --git a/test/jalview/io/FileFormatsTest.java b/test/jalview/io/FileFormatsTest.java index b589e94..525709f 100644 --- a/test/jalview/io/FileFormatsTest.java +++ b/test/jalview/io/FileFormatsTest.java @@ -28,6 +28,7 @@ import static org.testng.Assert.assertSame; import static org.testng.Assert.assertTrue; import java.util.Iterator; +import java.util.Locale; import org.testng.annotations.AfterMethod; import org.testng.annotations.BeforeMethod; @@ -75,7 +76,7 @@ public class FileFormatsTest @Test(groups = "Functional") public void testGetReadableFormats() { - String expected = "[Fasta, PFAM, Stockholm, PIR, BLC, AMSA, HTML, RNAML, JSON, PileUp, MSF, Clustal, PHYLIP, GenBank Flatfile, ENA Flatfile, GFF or Jalview features, PDB, mmCIF, Jalview]"; + String expected = "[Fasta, PFAM, Stockholm, PIR, BLC, AMSA, HTML, RNAML, JSON, PileUp, MSF, Clustal, PHYLIP, GenBank Flatfile, ENA Flatfile, GFF or Jalview features, PDB, mmCIF, Jalview, HMMER3, BSML]"; FileFormats formats = FileFormats.getInstance(); assertEquals(formats.getReadableFormats().toString(), expected); } diff --git a/test/jalview/structures/models/AAStructureBindingModelTest.java b/test/jalview/structures/models/AAStructureBindingModelTest.java index 8818bf1..f335563 100644 --- a/test/jalview/structures/models/AAStructureBindingModelTest.java +++ b/test/jalview/structures/models/AAStructureBindingModelTest.java @@ -439,7 +439,7 @@ public class AAStructureBindingModelTest PDBEntry[] pdbFiles = new PDBEntry[2]; pdbFiles[0] = new PDBEntry("PDB1", "A", Type.PDB, "seq1.pdb"); pdbFiles[1] = new PDBEntry("PDB2", "B", Type.PDB, "seq2.pdb"); - StructureSelectionManager ssm = new StructureSelectionManager(); + StructureSelectionManager ssm = StructureSelectionManager.getStructureSelectionManager(null); /* * map residues 1-10 to residues 21-30 (atoms 105-150) in structures diff --git a/test/jalview/ws/jabaws/AAConAnnotAndSettingsIO.java b/test/jalview/ws/jabaws/AAConAnnotAndSettingsIO.java index 5428acd..ac7b37c 100644 --- a/test/jalview/ws/jabaws/AAConAnnotAndSettingsIO.java +++ b/test/jalview/ws/jabaws/AAConAnnotAndSettingsIO.java @@ -70,7 +70,6 @@ public class AAConAnnotAndSettingsIO public static void setUpBeforeClass() throws Exception { Cache.loadProperties("test/jalview/io/testProps.jvprops"); - Cache.initLogger(); disc = JalviewJabawsTestUtils.getJabawsDiscoverer(); while (disc.isRunning()) diff --git a/test/jalview/ws/jabaws/DisorderAnnotExportImport.java b/test/jalview/ws/jabaws/DisorderAnnotExportImport.java index 6bcc1da..4602e93 100644 --- a/test/jalview/ws/jabaws/DisorderAnnotExportImport.java +++ b/test/jalview/ws/jabaws/DisorderAnnotExportImport.java @@ -90,8 +90,12 @@ public class DisorderAnnotExportImport disc2.startDiscoverer(); while (disc2.isRunning()) { - if (svc.getServiceTypeURI().toLowerCase(Locale.ROOT) - .contains("iupredws")) + Thread.sleep(100); + } + iupreds = new ArrayList<>(); + for (ServiceWithParameters svc : disc2.getServices()) + { + if (svc.getNameURI().toLowerCase().contains("iupred")) { iupreds.add(svc); } diff --git a/test/jalview/ws/jabaws/RNAStructExportImport.java b/test/jalview/ws/jabaws/RNAStructExportImport.java index 0a9cb19..1748ec5 100644 --- a/test/jalview/ws/jabaws/RNAStructExportImport.java +++ b/test/jalview/ws/jabaws/RNAStructExportImport.java @@ -102,7 +102,7 @@ public class RNAStructExportImport for (ServiceWithParameters svc : disc.getServices()) { - if (svc.getServiceTypeURI().toLowerCase(Locale.ROOT) + if (svc.getServiceType().toLowerCase(Locale.ROOT) .contains("rnaalifoldws")) { rnaalifoldws = (Jws2Instance) svc; diff --git a/test/jalview/ws/jws2/ParameterUtilsTest.java b/test/jalview/ws/jws2/ParameterUtilsTest.java index 1d3c191..97d7cb3 100644 --- a/test/jalview/ws/jws2/ParameterUtilsTest.java +++ b/test/jalview/ws/jws2/ParameterUtilsTest.java @@ -136,7 +136,7 @@ public class ParameterUtilsTest public boolean isForTesting(UIinfo service) { return serviceTests.size() == 0 || serviceTests - .contains(service.serviceType.toLowerCase(Locale.ROOT)); + .contains(service.getServiceType().toLowerCase(Locale.ROOT)); } @Test(groups = { "Network" })