svn commit: r1812061 - in /ofbiz/ofbiz-framework/trunk/framework/service/src/main/java/org/apache/ofbiz/service/test: ServiceEngineTestServices.java ServiceSOAPTests.java XmlRpcTests.java

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

svn commit: r1812061 - in /ofbiz/ofbiz-framework/trunk/framework/service/src/main/java/org/apache/ofbiz/service/test: ServiceEngineTestServices.java ServiceSOAPTests.java XmlRpcTests.java

mbrohl
Author: mbrohl
Date: Thu Oct 12 22:54:12 2017
New Revision: 1812061

URL: http://svn.apache.org/viewvc?rev=1812061&view=rev
Log:
Improved: Fixing defects reported by FindBugs, package
org.apache.ofbiz.service.test.
(OFBIZ-9694)

Thanks Dennis Balkir for reporting and providing the patch.

Modified:
    ofbiz/ofbiz-framework/trunk/framework/service/src/main/java/org/apache/ofbiz/service/test/ServiceEngineTestServices.java
    ofbiz/ofbiz-framework/trunk/framework/service/src/main/java/org/apache/ofbiz/service/test/ServiceSOAPTests.java
    ofbiz/ofbiz-framework/trunk/framework/service/src/main/java/org/apache/ofbiz/service/test/XmlRpcTests.java

Modified: ofbiz/ofbiz-framework/trunk/framework/service/src/main/java/org/apache/ofbiz/service/test/ServiceEngineTestServices.java
URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/framework/service/src/main/java/org/apache/ofbiz/service/test/ServiceEngineTestServices.java?rev=1812061&r1=1812060&r2=1812061&view=diff
==============================================================================
--- ofbiz/ofbiz-framework/trunk/framework/service/src/main/java/org/apache/ofbiz/service/test/ServiceEngineTestServices.java (original)
+++ ofbiz/ofbiz-framework/trunk/framework/service/src/main/java/org/apache/ofbiz/service/test/ServiceEngineTestServices.java Thu Oct 12 22:54:12 2017
@@ -52,7 +52,7 @@ public class ServiceEngineTestServices {
             // make sure to wait for these to both finish to make sure results aren't checked until they are done
             Map<String, Object> threadAResult = threadAWaiter.waitForResult();
             Map<String, Object> threadBResult = threadBWaiter.waitForResult();
-            List<Object> errorList = new LinkedList<Object>();
+            List<Object> errorList = new LinkedList<>();
             if (ServiceUtil.isError(threadAResult)) {
                 errorList.add(UtilProperties.getMessage(resource, "ServiceTestDeadLockThreadA", UtilMisc.toMap("errorString", ServiceUtil.getErrorMessage(threadAResult)), locale));
             }
@@ -147,7 +147,7 @@ public class ServiceEngineTestServices {
             // make sure to wait for these to both finish to make sure results aren't checked until they are done
             Map<String, Object> grabberResult = grabberWaiter.waitForResult();
             Map<String, Object> waiterResult = waiterWaiter.waitForResult();
-            List<Object> errorList = new LinkedList<Object>();
+            List<Object> errorList = new LinkedList<>();
             if (ServiceUtil.isError(grabberResult)) {
                 errorList.add("Error running testServiceLockWaitTimeoutRetryGrabber: " + ServiceUtil.getErrorMessage(grabberResult));
             }

Modified: ofbiz/ofbiz-framework/trunk/framework/service/src/main/java/org/apache/ofbiz/service/test/ServiceSOAPTests.java
URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/framework/service/src/main/java/org/apache/ofbiz/service/test/ServiceSOAPTests.java?rev=1812061&r1=1812060&r2=1812061&view=diff
==============================================================================
--- ofbiz/ofbiz-framework/trunk/framework/service/src/main/java/org/apache/ofbiz/service/test/ServiceSOAPTests.java (original)
+++ ofbiz/ofbiz-framework/trunk/framework/service/src/main/java/org/apache/ofbiz/service/test/ServiceSOAPTests.java Thu Oct 12 22:54:12 2017
@@ -32,19 +32,18 @@ public class ServiceSOAPTests extends OF
     public final static String module = ServiceSOAPTests.class.getName();
 
     public ServiceSOAPTests(String name) {
-        // TODO Auto-generated constructor stub
         super(name);
     }
 
     public void testSOAPSimpleService() throws Exception {
-        Map<String, Object> serviceContext = new HashMap<String, Object>();
-        serviceContext.put("defaultValue", new Double("123.4567"));
+        Map<String, Object> serviceContext = new HashMap<>();
+        serviceContext.put("defaultValue", Double.valueOf("123.4567"));
         serviceContext.put("message", "Test Message !!!");
         dispatcher.runSync("testSoapSimple", serviceContext);
     }
 
     public void testSOAPService() throws Exception {
-        Map<String, Object> serviceContext = new HashMap<String, Object>();
+        Map<String, Object> serviceContext = new HashMap<>();
         GenericValue testing = delegator.makeValue("Testing");
         testing.put("testingId", "COMPLEX_TYPE_TEST");
         testing.put("testingTypeId", "SOAP_TEST");

Modified: ofbiz/ofbiz-framework/trunk/framework/service/src/main/java/org/apache/ofbiz/service/test/XmlRpcTests.java
URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/framework/service/src/main/java/org/apache/ofbiz/service/test/XmlRpcTests.java?rev=1812061&r1=1812060&r2=1812061&view=diff
==============================================================================
--- ofbiz/ofbiz-framework/trunk/framework/service/src/main/java/org/apache/ofbiz/service/test/XmlRpcTests.java (original)
+++ ofbiz/ofbiz-framework/trunk/framework/service/src/main/java/org/apache/ofbiz/service/test/XmlRpcTests.java Thu Oct 12 22:54:12 2017
@@ -38,7 +38,7 @@ public class XmlRpcTests extends Abstrac
 
     public static final String module = XmlRpcTests.class.getName();
     public static final String resource = "ServiceErrorUiLabels";
-    public static String url = "http://localhost:8080/webtools/control/xmlrpc";
+    private static String url = "http://localhost:8080/webtools/control/xmlrpc";
 
     public XmlRpcTests(String name) {
         super(name);