You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by gz...@apache.org on 2016/01/22 15:59:49 UTC

[1/2] camel git commit: Mark constant final

Repository: camel
Updated Branches:
  refs/heads/master 8be93278f -> 506f80e02


Mark constant final

Signed-off-by: Gregor Zurowski <gr...@zurowski.org>

Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/506f80e0
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/506f80e0
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/506f80e0

Branch: refs/heads/master
Commit: 506f80e025ca777e0f181b1c4f75c7865550446b
Parents: ccac114
Author: Gregor Zurowski <gr...@zurowski.org>
Authored: Fri Jan 22 15:54:27 2016 +0100
Committer: Gregor Zurowski <gr...@zurowski.org>
Committed: Fri Jan 22 15:59:35 2016 +0100

----------------------------------------------------------------------
 .../org/apache/camel/component/netty4/NettyProducerHangTest.java   | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/506f80e0/components/camel-netty4/src/test/java/org/apache/camel/component/netty4/NettyProducerHangTest.java
----------------------------------------------------------------------
diff --git a/components/camel-netty4/src/test/java/org/apache/camel/component/netty4/NettyProducerHangTest.java b/components/camel-netty4/src/test/java/org/apache/camel/component/netty4/NettyProducerHangTest.java
index 2a23d8e..2f61963 100644
--- a/components/camel-netty4/src/test/java/org/apache/camel/component/netty4/NettyProducerHangTest.java
+++ b/components/camel-netty4/src/test/java/org/apache/camel/component/netty4/NettyProducerHangTest.java
@@ -27,7 +27,7 @@ import org.junit.Test;
 
 public class NettyProducerHangTest extends CamelTestSupport {
 
-    private static int PORT = 4093;
+    private static final int PORT = 4093;
 
     @Test
     public void nettyProducerHangsOnTheSecondRequestToTheSocketWhichIsClosed() throws Exception {


[2/2] camel git commit: Fix Checkstyle issues

Posted by gz...@apache.org.
Fix Checkstyle issues

Signed-off-by: Gregor Zurowski <gr...@zurowski.org>

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

Branch: refs/heads/master
Commit: ccac114b8f30858ced2be908266ddc6cc3d34a6a
Parents: 8be9327
Author: Gregor Zurowski <gr...@zurowski.org>
Authored: Fri Jan 22 15:52:55 2016 +0100
Committer: Gregor Zurowski <gr...@zurowski.org>
Committed: Fri Jan 22 15:59:35 2016 +0100

----------------------------------------------------------------------
 .../component/netty4/NettyProducerHangTest.java | 58 ++++++++++----------
 1 file changed, 29 insertions(+), 29 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/ccac114b/components/camel-netty4/src/test/java/org/apache/camel/component/netty4/NettyProducerHangTest.java
----------------------------------------------------------------------
diff --git a/components/camel-netty4/src/test/java/org/apache/camel/component/netty4/NettyProducerHangTest.java b/components/camel-netty4/src/test/java/org/apache/camel/component/netty4/NettyProducerHangTest.java
index 199180d..2a23d8e 100644
--- a/components/camel-netty4/src/test/java/org/apache/camel/component/netty4/NettyProducerHangTest.java
+++ b/components/camel-netty4/src/test/java/org/apache/camel/component/netty4/NettyProducerHangTest.java
@@ -16,18 +16,18 @@
  */
 package org.apache.camel.component.netty4;
 
-import org.apache.camel.test.junit4.CamelTestSupport;
-import org.junit.Test;
-
 import java.io.IOException;
 import java.io.InputStream;
 import java.io.OutputStream;
 import java.net.ServerSocket;
 import java.net.Socket;
 
+import org.apache.camel.test.junit4.CamelTestSupport;
+import org.junit.Test;
+
 public class NettyProducerHangTest extends CamelTestSupport {
 
-	private static int PORT = 4093;
+    private static int PORT = 4093;
 
     @Test
     public void nettyProducerHangsOnTheSecondRequestToTheSocketWhichIsClosed() throws Exception {
@@ -40,7 +40,7 @@ public class NettyProducerHangTest extends CamelTestSupport {
                 } catch (IOException e) {
                     log.error("Exception occured: " + e.getMessage(), e);
                 }
-             }
+            }
         }).start();
 
         String response1 = template.requestBody("netty4:tcp://localhost:" + PORT + "?textline=true&sync=true", "request1", String.class);
@@ -48,7 +48,7 @@ public class NettyProducerHangTest extends CamelTestSupport {
 
         try {
             // our test server will close the socket now so we should get an error
-            template.requestBody("netty4:tcp://localhost:" + PORT + "?textline=true&sync=true", "request2", String.class);            
+            template.requestBody("netty4:tcp://localhost:" + PORT + "?textline=true&sync=true", "request2", String.class);
         } catch (Exception e) {
             assertStringContains(e.getCause().getMessage(), "No response received from remote server");
         }
@@ -58,36 +58,36 @@ public class NettyProducerHangTest extends CamelTestSupport {
 
         try {
             // our test server will close the socket now so we should get an error
-            template.requestBody("netty4:tcp://localhost:" + PORT + "?textline=true&sync=true", "request4", String.class);            
+            template.requestBody("netty4:tcp://localhost:" + PORT + "?textline=true&sync=true", "request4", String.class);
         } catch (Exception e) {
             assertStringContains(e.getCause().getMessage(), "No response received from remote server");
         }
     }
 
-	private void acceptReplyAcceptClose() throws IOException {
-		byte buf[] = new byte[128];
+    private void acceptReplyAcceptClose() throws IOException {
+        byte buf[] = new byte[128];
+
+        ServerSocket serverSocket = new ServerSocket(PORT);
+        Socket soc = serverSocket.accept();
 
-		ServerSocket serverSocket = new ServerSocket(PORT);
-		Socket soc = serverSocket.accept();
+        log.info("Open socket and accept data");
+        try (InputStream is = soc.getInputStream();
+                OutputStream os = soc.getOutputStream()) {
+            // read first message
+            is.read(buf);
 
-		log.info("Open socket and accept data");
-		try (InputStream is = soc.getInputStream();
-				OutputStream os = soc.getOutputStream()) {
-			// read first message
-			is.read(buf);
-						
-			// reply to the first message
-			os.write("response\n".getBytes());
-			
-			// read second message
-			is.read(buf);				
+            // reply to the first message
+            os.write("response\n".getBytes());
+            
+            // read second message
+            is.read(buf);
 
-			// do not reply, just close socket (emulate network problem)
-		} finally {
-			soc.close();
-			serverSocket.close();
-		}
-		log.info("Close socket");
-	}
+            // do not reply, just close socket (emulate network problem)
+        } finally {
+            soc.close();
+            serverSocket.close();
+        }
+        log.info("Close socket");
+    }
 
 }