JAL-3691 automatic insertion of Locale.ROOT to toUpperCase() and toLowerCase() and...
[jalview.git] / test / jalview / ws / jws2 / ParameterUtilsTest.java
index 1e02213..51ff19c 100644 (file)
  */
 package jalview.ws.jws2;
 
+import java.util.Locale;
+
 import static org.testng.AssertJUnit.assertEquals;
 import static org.testng.AssertJUnit.assertFalse;
 import static org.testng.AssertJUnit.assertTrue;
 
 import jalview.bin.Cache;
+import jalview.gui.JvOptionPane;
 import jalview.ws.jabaws.JalviewJabawsTestUtils;
 import jalview.ws.jws2.jabaws2.Jws2Instance;
 
@@ -41,8 +44,21 @@ import compbio.metadata.Preset;
 import compbio.metadata.PresetManager;
 import compbio.metadata.WrongParameterException;
 
+/*
+ * All methods in this class are set to the Network group because setUpBeforeClass will fail
+ * if there is no network.
+ */
+@Test(singleThreaded = true)
 public class ParameterUtilsTest
 {
+
+  @BeforeClass(alwaysRun = true)
+  public void setUpJvOptionPane()
+  {
+    JvOptionPane.setInteractiveMode(false);
+    JvOptionPane.setMockResponse(JvOptionPane.CANCEL_OPTION);
+  }
+
   /*
    * To limit tests to specify services, add them to this list; leave list empty
    * to test all
@@ -54,13 +70,13 @@ public class ParameterUtilsTest
   @BeforeClass(alwaysRun = true)
   public static void setUpBeforeClass() throws Exception
   {
-    serviceTests.add("AAConWS".toLowerCase());
+    serviceTests.add("AAConWS".toLowerCase(Locale.ROOT));
     Cache.loadProperties("test/jalview/io/testProps.jvprops");
     Cache.initLogger();
     disc = JalviewJabawsTestUtils.getJabawsDiscoverer();
   }
 
-  @Test(groups = { "Functional" })
+  @Test(groups = { "Network" })
   public void testWriteParameterSet() throws WrongParameterException
   {
     for (Jws2Instance service : disc.getServices())
@@ -117,10 +133,10 @@ public class ParameterUtilsTest
   public boolean isForTesting(Jws2Instance service)
   {
     return serviceTests.size() == 0
-            || serviceTests.contains(service.serviceType.toLowerCase());
+            || serviceTests.contains(service.serviceType.toLowerCase(Locale.ROOT));
   }
 
-  @Test(groups = { "Functional" })
+  @Test(groups = { "Network" })
   public void testCopyOption()
   {
     for (Jws2Instance service : disc.getServices())
@@ -144,7 +160,7 @@ public class ParameterUtilsTest
 
   /**
    */
-  @Test(groups = { "Functional" })
+  @Test(groups = { "Network" })
   public void testCopyParameter()
   {
     for (Jws2Instance service : disc.getServices())