You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by ac...@apache.org on 2017/02/23 09:03:39 UTC
[03/10] camel git commit: CAMEL-10883: show that payloads with
multiple pauses are not read correctly
CAMEL-10883: show that payloads with multiple pauses are not read correctly
Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/4c043a8b
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/4c043a8b
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/4c043a8b
Branch: refs/heads/master
Commit: 4c043a8b6a174a90dd0767ba8e97bff86c7140b5
Parents: dc42a59
Author: rohan <ro...@fronde.com>
Authored: Tue Feb 21 14:24:42 2017 +1300
Committer: Andrea Cosentino <an...@gmail.com>
Committed: Thu Feb 23 10:00:24 2017 +0100
----------------------------------------------------------------------
.../DefaultUndertowHttpBindingTest.java | 21 ++++++++++++++++++--
1 file changed, 19 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/camel/blob/4c043a8b/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/DefaultUndertowHttpBindingTest.java
----------------------------------------------------------------------
diff --git a/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/DefaultUndertowHttpBindingTest.java b/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/DefaultUndertowHttpBindingTest.java
index 797196f..e8e1726 100644
--- a/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/DefaultUndertowHttpBindingTest.java
+++ b/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/DefaultUndertowHttpBindingTest.java
@@ -49,11 +49,28 @@ public class DefaultUndertowHttpBindingTest {
.collect(Collectors.joining())));
}
+ @Test(timeout = 1000)
+ public void readEntireMultiDelayedWithPausePayload() throws Exception {
+ String[] delayedPayloads = new String[] {
+ "first ",
+ "",
+ "second",
+ };
+
+ StreamSourceChannel source = source(delayedPayloads);
+
+ DefaultUndertowHttpBinding binding = new DefaultUndertowHttpBinding();
+ String result = new String(binding.readFromChannel(source));
+
+ assertThat(result, is(
+ Stream.of(delayedPayloads)
+ .collect(Collectors.joining())));
+ }
+
private StreamSourceChannel source(final String[] delayedPayloads) {
- XnioIoThread thread = thread();
Thread sourceThread = Thread.currentThread();
- return new EmptyStreamSourceChannel(thread) {
+ return new EmptyStreamSourceChannel(thread()) {
int chunk = 0;
@Override