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:58:59 UTC
[1/2] camel git commit: Fix Checkstyle issues
Repository: camel
Updated Branches:
refs/heads/camel-2.16.x 12b91a01c -> 98d70169b
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/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 <gr...@zurowski.org>
Authored: Fri Jan 22 15:52:55 2016 +0100
Committer: Gregor Zurowski <gr...@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");
+ }
}
[2/2] camel git commit: Mark constant final
Posted by gz...@apache.org.
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/98d70169
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/98d70169
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/98d70169
Branch: refs/heads/camel-2.16.x
Commit: 98d70169bb184d11a95d41b05d04ed6bff853ba2
Parents: b4e6c41
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:56:53 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/98d70169/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 {