JAL-3624 code tidy
authorgmungoc <g.m.carstairs@dundee.ac.uk>
Thu, 11 Jun 2020 15:11:48 +0000 (16:11 +0100)
committergmungoc <g.m.carstairs@dundee.ac.uk>
Thu, 11 Jun 2020 15:11:48 +0000 (16:11 +0100)
test/jalview/util/PlatformTest.java
test/jalview/ws/sifts/SiftsClientTest.java

index d2c48f1..49f1335 100644 (file)
@@ -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);
+  }
 }
index 4540bd8..c0f9b66 100644 (file)
@@ -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);
-  }
 }