From: gmungoc Date: Thu, 11 Jun 2020 15:11:48 +0000 (+0100) Subject: JAL-3624 code tidy X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=b41c7258e1d63f99bda01c06c204273bdd732ea8;p=jalview.git JAL-3624 code tidy --- diff --git a/test/jalview/util/PlatformTest.java b/test/jalview/util/PlatformTest.java index d2c48f1..49f1335 100644 --- a/test/jalview/util/PlatformTest.java +++ b/test/jalview/util/PlatformTest.java @@ -32,6 +32,7 @@ import java.awt.Toolkit; import java.awt.event.InputEvent; import java.awt.event.MouseEvent; +import org.testng.Assert; import org.testng.annotations.BeforeClass; import org.testng.annotations.Test; @@ -141,4 +142,17 @@ public class PlatformTest assertEquals(Platform.escapeBackslashes("hello world"), "hello world"); assertEquals(Platform.escapeBackslashes("hello\\world"), "hello\\\\world"); } + + @Test(groups = { "Functional" }) + public void getLeadingIntegerFromString() + { + Assert.assertEquals(Platform.getLeadingIntegerValue("1234abcd", -1), + 1234); + Assert.assertEquals(Platform.getLeadingIntegerValue("1234", -1), 1234); + Assert.assertEquals(Platform.getLeadingIntegerValue("abcd", -1), -1); + Assert.assertEquals(Platform.getLeadingIntegerValue("abcd1234", -1), + -1); + Assert.assertEquals(Platform.getLeadingIntegerValue("None", -1), -1); + Assert.assertEquals(Platform.getLeadingIntegerValue("Null", -1), -1); + } } diff --git a/test/jalview/ws/sifts/SiftsClientTest.java b/test/jalview/ws/sifts/SiftsClientTest.java index 4540bd8..c0f9b66 100644 --- a/test/jalview/ws/sifts/SiftsClientTest.java +++ b/test/jalview/ws/sifts/SiftsClientTest.java @@ -23,18 +23,6 @@ package jalview.ws.sifts; import static org.testng.Assert.assertEquals; import static org.testng.Assert.assertTrue; -import jalview.api.DBRefEntryI; -import jalview.bin.Cache; -import jalview.datamodel.DBRefEntry; -import jalview.datamodel.DBRefSource; -import jalview.datamodel.Sequence; -import jalview.datamodel.SequenceI; -import jalview.gui.JvOptionPane; -import jalview.io.DataSourceType; -import jalview.structure.StructureMapping; -import jalview.util.Platform; -import jalview.xml.binding.sifts.Entry.Entity; - import java.io.File; import java.io.IOException; import java.util.ArrayList; @@ -49,6 +37,16 @@ import org.testng.annotations.BeforeClass; import org.testng.annotations.BeforeTest; import org.testng.annotations.Test; +import jalview.api.DBRefEntryI; +import jalview.bin.Cache; +import jalview.datamodel.DBRefEntry; +import jalview.datamodel.DBRefSource; +import jalview.datamodel.Sequence; +import jalview.datamodel.SequenceI; +import jalview.gui.JvOptionPane; +import jalview.io.DataSourceType; +import jalview.structure.StructureMapping; +import jalview.xml.binding.sifts.Entry.Entity; import mc_view.Atom; import mc_view.PDBfile; @@ -311,7 +309,7 @@ public class SiftsClientTest atom.atomIndex = 7; atoms.add(atom); int actualAtomIndex = siftsClient.getAtomIndex(1, atoms); - Assert.assertEquals(actualAtomIndex, siftsClient.UNASSIGNED); + Assert.assertEquals(actualAtomIndex, SiftsClient.UNASSIGNED); actualAtomIndex = siftsClient.getAtomIndex(43, atoms); Assert.assertEquals(actualAtomIndex, 7); } @@ -514,22 +512,4 @@ groups = { "Network" }, Assert.assertNull(entityP); } - - @Test(groups = { "Network" }) - public void getLeadingIntegerFromString() - { - Assert.assertEquals( - Platform.getLeadingIntegerValue("1234abcd", -1), 1234); - Assert.assertEquals( - Platform.getLeadingIntegerValue("1234", -1), - 1234); - Assert.assertEquals( - Platform.getLeadingIntegerValue("abcd", -1), -1); - Assert.assertEquals( - Platform.getLeadingIntegerValue("abcd1234", -1), -1); - Assert.assertEquals( - Platform.getLeadingIntegerValue("None", -1), -1); - Assert.assertEquals( - Platform.getLeadingIntegerValue("Null", -1), -1); - } }