JAL-2482 unit test for bug fix
authortcofoegbu <tcnofoegbu@dundee.ac.uk>
Mon, 1 May 2017 17:08:05 +0000 (18:08 +0100)
committertcofoegbu <tcnofoegbu@dundee.ac.uk>
Mon, 1 May 2017 17:08:05 +0000 (18:08 +0100)
test/jalview/ws/sifts/SiftsClientTest.java

index 7f8adc9..b92766e 100644 (file)
@@ -514,4 +514,22 @@ groups = { "Network" },
     Assert.assertNull(entityP);
 
   }
+
+  @Test(groups = { "Network" })
+  public void getLeadingIntegerFromString()
+  {
+    Assert.assertEquals(
+            SiftsClient.getLeadingIntegerValue("1234abcd", -1), 1234);
+    Assert.assertEquals(
+            SiftsClient.getLeadingIntegerValue("1234", -1),
+            1234);
+    Assert.assertEquals(
+            SiftsClient.getLeadingIntegerValue("abcd", -1), -1);
+    Assert.assertEquals(
+            SiftsClient.getLeadingIntegerValue("abcd1234", -1), -1);
+    Assert.assertEquals(
+            SiftsClient.getLeadingIntegerValue("None", -1), -1);
+    Assert.assertEquals(
+            SiftsClient.getLeadingIntegerValue("Null", -1), -1);
+  }
 }