cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ningji...@apache.org
Subject [1/3] git commit: Fixed PMD error of transport-jms systest with JDK8
Date Wed, 25 Jun 2014 13:48:11 GMT
Repository: cxf
Updated Branches:
  refs/heads/master 35b9209c0 -> 0652be3b0


Fixed PMD error of transport-jms systest with JDK8


Project: http://git-wip-us.apache.org/repos/asf/cxf/repo
Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/732ad179
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/732ad179
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/732ad179

Branch: refs/heads/master
Commit: 732ad179ea9f9e320a8fea5f910c4170798e0874
Parents: 35b9209
Author: Willem Jiang <willem.jiang@gmail.com>
Authored: Wed Jun 25 15:49:42 2014 +0800
Committer: Willem Jiang <willem.jiang@gmail.com>
Committed: Wed Jun 25 15:49:42 2014 +0800

----------------------------------------------------------------------
 .../systest/jms/shared/JMSSharedQueueTest.java  | 84 ++++++++++----------
 1 file changed, 42 insertions(+), 42 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/732ad179/systests/transport-jms/src/test/java/org/apache/cxf/systest/jms/shared/JMSSharedQueueTest.java
----------------------------------------------------------------------
diff --git a/systests/transport-jms/src/test/java/org/apache/cxf/systest/jms/shared/JMSSharedQueueTest.java
b/systests/transport-jms/src/test/java/org/apache/cxf/systest/jms/shared/JMSSharedQueueTest.java
index f469589..b644d5a 100644
--- a/systests/transport-jms/src/test/java/org/apache/cxf/systest/jms/shared/JMSSharedQueueTest.java
+++ b/systests/transport-jms/src/test/java/org/apache/cxf/systest/jms/shared/JMSSharedQueueTest.java
@@ -46,7 +46,7 @@ import org.junit.Test;
 public class JMSSharedQueueTest extends AbstractVmJMSTest {
     private static final String WSDL = "/wsdl/jms_test.wsdl";
     private static final String SERVICE_NS = "http://cxf.apache.org/hello_world_jms";
-    
+
     @BeforeClass
     public static void startServers() throws Exception {
         startBusAndJMS(JMSSharedQueueTest.class);
@@ -59,11 +59,11 @@ public class JMSSharedQueueTest extends AbstractVmJMSTest {
         publish(new GreeterImplTwoWayJMSAppCorrelationIDEng());
         publish(new GreeterImplTwoWayJMSAppCorrelationIDSales());
     }
-    
+
     private interface CorrelationIDFactory {
         String createCorrealtionID();
     }
-    
+
     private static class ClientRunnable implements Runnable {
         private HelloWorldPortType port;
         private CorrelationIDFactory corrFactory;
@@ -83,11 +83,11 @@ public class JMSSharedQueueTest extends AbstractVmJMSTest {
             this.port = port;
             this.corrFactory = factory;
         }
-        
+
         public Throwable getException() {
             return ex;
         }
-        
+
         public void run() {
             try {
                 for (int idx = 0; idx < 5; idx++) {
@@ -116,19 +116,19 @@ public class JMSSharedQueueTest extends AbstractVmJMSTest {
             Assert.assertEquals("Response didn't match expected request", expected, response);
             if (corrFactory != null) {
                 Map<String, Object> responseContext = bp.getResponseContext();
-                JMSMessageHeadersType responseHeader = 
+                JMSMessageHeadersType responseHeader =
                     (JMSMessageHeadersType)responseContext.get(
                             JMSConstants.JMS_CLIENT_RESPONSE_HEADERS);
-                Assert.assertEquals("Request and Response CorrelationID didn't match", 
+                Assert.assertEquals("Request and Response CorrelationID didn't match",
                               correlationID, responseHeader.getJMSCorrelationID());
             }
         }
     }
-    
-    private void executeAsync(ClientRunnable... clients) throws Throwable {
+
+    private void executeAsync(ClientRunnable[] clients) throws Throwable {
         executeAsync(Arrays.asList(clients));
     }
-    
+
     private void executeAsync(Collection<ClientRunnable> clients) throws Throwable
{
         ExecutorService executor = Executors.newCachedThreadPool();
         for (ClientRunnable client : clients) {
@@ -143,7 +143,7 @@ public class JMSSharedQueueTest extends AbstractVmJMSTest {
             }
         }
     }
-    
+
     @Test
     public void testTwoWayQueueAppCorrelationID() throws Throwable {
         QName serviceName = new QName(SERVICE_NS, "HelloWorldServiceAppCorrelationID");
@@ -154,7 +154,7 @@ public class JMSSharedQueueTest extends AbstractVmJMSTest {
         HelloWorldServiceAppCorrelationID service = new HelloWorldServiceAppCorrelationID(wsdl,
serviceName);
 
         HelloWorldPortType portEng = markForClose(service.getPort(portNameEng, HelloWorldPortType.class,
cff));
-        ClientRunnable engClient = 
+        ClientRunnable engClient =
             new ClientRunnable(portEng,
                 new CorrelationIDFactory() {
                     private int counter;
@@ -162,9 +162,9 @@ public class JMSSharedQueueTest extends AbstractVmJMSTest {
                         return "com.mycompany.eng:" + counter++;
                     }
                 });
-        
+
         HelloWorldPortType portSales = markForClose(service.getPort(portNameSales, HelloWorldPortType.class,
cff));
-        ClientRunnable salesClient = 
+        ClientRunnable salesClient =
              new ClientRunnable(portSales,
                 new CorrelationIDFactory() {
                     private int counter;
@@ -172,10 +172,10 @@ public class JMSSharedQueueTest extends AbstractVmJMSTest {
                         return "com.mycompany.sales:" + counter++;
                     }
                 });
-     
-        executeAsync(engClient, salesClient);
+
+        executeAsync(new ClientRunnable[]{engClient, salesClient});
     }
-    
+
     @Test
     public void testTwoWayQueueAppCorrelationIDStaticPrefix() throws Throwable {
         QName serviceName = new QName(SERVICE_NS, "HelloWorldServiceAppCorrelationIDStaticPrefix");
@@ -183,21 +183,21 @@ public class JMSSharedQueueTest extends AbstractVmJMSTest {
         QName portNameSales = new QName(SERVICE_NS, "HelloWorldPortAppCorrelationIDStaticPrefixSales");
 
         URL wsdl = getWSDLURL(WSDL);
-        HelloWorldServiceAppCorrelationIDStaticPrefix service = 
+        HelloWorldServiceAppCorrelationIDStaticPrefix service =
             new HelloWorldServiceAppCorrelationIDStaticPrefix(wsdl, serviceName);
 
         HelloWorldPortType portEng = markForClose(service.getPort(portNameEng, HelloWorldPortType.class,
cff));
         HelloWorldPortType portSales = markForClose(service.getPort(portNameSales, HelloWorldPortType.class,
cff));
 
-        executeAsync(new ClientRunnable(portEng), new ClientRunnable(portSales));
+        executeAsync(new ClientRunnable[]{new ClientRunnable(portEng), new ClientRunnable(portSales)});
     }
 
     /* TO DO:
      * This tests shows a missing QoS. When CXF clients share a named (persistent) reply
queue
      *  with an application provided correlationID there will be a guaranteed response
-     * message loss. 
-     * 
-     * A large number of threads is used to ensure message loss and avoid a false 
+     * message loss.
+     *
+     * A large number of threads is used to ensure message loss and avoid a false
      * positive assertion
      */
     @Test
@@ -205,14 +205,14 @@ public class JMSSharedQueueTest extends AbstractVmJMSTest {
         QName serviceName = new QName(SERVICE_NS, "HelloWorldServiceAppCorrelationIDNoPrefix");
         QName portName = new QName(SERVICE_NS, "HelloWorldPortAppCorrelationIDNoPrefix");
         URL wsdl = getWSDLURL(WSDL);
-        HelloWorldServiceAppCorrelationIDNoPrefix service = 
+        HelloWorldServiceAppCorrelationIDNoPrefix service =
             new HelloWorldServiceAppCorrelationIDNoPrefix(wsdl, serviceName);
-        
+
         HelloWorldPortType port = markForClose(service.getPort(portName, HelloWorldPortType.class,
cff));
 
         Collection<ClientRunnable> clients = new ArrayList<ClientRunnable>();
         for (int i = 0; i < 1; ++i) {
-            clients.add(new ClientRunnable(port));            
+            clients.add(new ClientRunnable(port));
         }
         executeAsync(clients);
     }
@@ -221,26 +221,26 @@ public class JMSSharedQueueTest extends AbstractVmJMSTest {
      * This tests a use case where there is a shared request and reply queues between
      * two servers (Eng and Sales). However each server has a design time provided selector
      * which allows them to share the same queue and do not consume the other's
-     * messages. 
-     * 
+     * messages.
+     *
      * The clients to these two servers use the same request and reply queues.
-     * An Eng client uses a design time selector prefix to form request message 
+     * An Eng client uses a design time selector prefix to form request message
      * correlationID and to form a reply consumer that filters only reply
      * messages originated from the Eng server. To differentiate between
      * one Eng client instance from another this suffix is supplemented by
      * a runtime value of ConduitId which has 1-1 relation to a client instance
-     * This guarantees that an Eng client instance will only consume its own reply 
-     * messages. 
-     * 
+     * This guarantees that an Eng client instance will only consume its own reply
+     * messages.
+     *
      * In case of a single client instance being shared among multiple threads
-     * the third portion of the request message correlationID, 
+     * the third portion of the request message correlationID,
      * an atomic rolling message counter, ensures that each message gets a unique ID
-     *  
+     *
      * So the model is:
-     * 
-     * Many concurrent Sales clients to a single request and reply queues (Q1, Q2) 
+     *
+     * Many concurrent Sales clients to a single request and reply queues (Q1, Q2)
      * to a single Sales server
-     * Many concurrent Eng clients to a single request and reply queues (Q1, Q2) 
+     * Many concurrent Eng clients to a single request and reply queues (Q1, Q2)
      * to a single Eng server
      */
     @Test
@@ -250,9 +250,9 @@ public class JMSSharedQueueTest extends AbstractVmJMSTest {
         QName portNameSales = new QName(SERVICE_NS, "HelloWorldPortRuntimeCorrelationIDStaticPrefixSales");
 
         URL wsdl = getWSDLURL(WSDL);
-        HelloWorldServiceRuntimeCorrelationIDStaticPrefix service = 
+        HelloWorldServiceRuntimeCorrelationIDStaticPrefix service =
             new HelloWorldServiceRuntimeCorrelationIDStaticPrefix(wsdl, serviceName);
-        
+
         HelloWorldPortType portEng = markForClose(service.getPort(portNameEng, HelloWorldPortType.class,
cff));
         HelloWorldPortType portSales = markForClose(service.getPort(portNameSales, HelloWorldPortType.class,
cff));
 
@@ -268,17 +268,17 @@ public class JMSSharedQueueTest extends AbstractVmJMSTest {
     public void testTwoWayQueueRuntimeCorrelationDynamicPrefix() throws Throwable {
         QName serviceName = new QName(SERVICE_NS, "HelloWorldServiceRuntimeCorrelationIDDynamicPrefix");
         QName portName = new QName(SERVICE_NS, "HelloWorldPortRuntimeCorrelationIDDynamicPrefix");
-        
+
         URL wsdl = getWSDLURL(WSDL);
-        HelloWorldServiceRuntimeCorrelationIDDynamicPrefix service = 
+        HelloWorldServiceRuntimeCorrelationIDDynamicPrefix service =
             new HelloWorldServiceRuntimeCorrelationIDDynamicPrefix(wsdl, serviceName);
         HelloWorldPortType port = markForClose(service.getPort(portName, HelloWorldPortType.class,
cff));
 
-        Collection<ClientRunnable> clients = new ArrayList<ClientRunnable>();
       
+        Collection<ClientRunnable> clients = new ArrayList<ClientRunnable>();
         for (int i = 0; i < 10; ++i) {
             clients.add(new ClientRunnable(port));
         }
         executeAsync(clients);
     }
-    
+
 }


Mime
View raw message