camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gzurow...@apache.org
Subject [1/2] camel git commit: Fix Checkstyle issues
Date Fri, 22 Jan 2016 14:58:59 GMT
Repository: camel
Updated Branches:
  refs/heads/camel-2.16.x 12b91a01c -> 98d70169b


Fix Checkstyle issues

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

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

Branch: refs/heads/camel-2.16.x
Commit: b4e6c41a2d8b2a05728b774e8a29291a83532aa2
Parents: 12b91a0
Author: Gregor Zurowski <gregor@zurowski.org>
Authored: Fri Jan 22 15:52:55 2016 +0100
Committer: Gregor Zurowski <gregor@zurowski.org>
Committed: Fri Jan 22 15:56:07 2016 +0100

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


http://git-wip-us.apache.org/repos/asf/camel/blob/b4e6c41a/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");
+    }
 
 }


Mime
View raw message