Fix Checkstyle issues

Signed-off-by: Gregor Zurowski <gre...@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 <gre...@zurowski.org>
Authored: Fri Jan 22 15:52:55 2016 +0100
Committer: Gregor Zurowski <gre...@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");
+    }
 
 }

Reply via email to