You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by da...@apache.org on 2023/08/12 14:38:33 UTC
[camel] branch xml-pair created (now 6cb5a12e855)
This is an automated email from the ASF dual-hosted git repository.
davsclaus pushed a change to branch xml-pair
in repository https://gitbox.apache.org/repos/asf/camel.git
at 6cb5a12e855 Fix flaky test
This branch includes the following new commits:
new 6cb5a12e855 Fix flaky test
The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
[camel] 01/01: Fix flaky test
Posted by da...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
davsclaus pushed a commit to branch xml-pair
in repository https://gitbox.apache.org/repos/asf/camel.git
commit 6cb5a12e8552ca23b4231e0627aac7944c0dad82
Author: Claus Ibsen <cl...@gmail.com>
AuthorDate: Sat Aug 12 16:34:24 2023 +0200
Fix flaky test
---
.../camel/language/SpringTokenXMLPairNamespaceSplitTest.xml | 4 +---
.../camel/language/TokenXMLPairMultiNamespaceSplitTest.java | 3 +--
.../language/TokenXMLPairNamespaceMultilineSplitTest.java | 3 +--
.../apache/camel/language/TokenXMLPairNamespaceSplitTest.java | 11 ++++-------
4 files changed, 7 insertions(+), 14 deletions(-)
diff --git a/components/camel-spring-xml/src/test/resources/org/apache/camel/language/SpringTokenXMLPairNamespaceSplitTest.xml b/components/camel-spring-xml/src/test/resources/org/apache/camel/language/SpringTokenXMLPairNamespaceSplitTest.xml
index 039bafd8016..0aa672542c8 100644
--- a/components/camel-spring-xml/src/test/resources/org/apache/camel/language/SpringTokenXMLPairNamespaceSplitTest.xml
+++ b/components/camel-spring-xml/src/test/resources/org/apache/camel/language/SpringTokenXMLPairNamespaceSplitTest.xml
@@ -24,11 +24,10 @@
http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd
">
- <!-- START SNIPPET: e1 -->
<camelContext xmlns="http://camel.apache.org/schema/spring">
<jmxAgent id="jmx" disabled="true"/>
<route>
- <from uri="file:target/data/SpringTokenXMLPairNamespaceSplitTest/pair?initialDelay=0&delay=10"/>
+ <from uri="direct:pair"/>
<split>
<!-- split the file using XML tokenizer, where we grab the order tag,
and inherit the namespaces from the parent/root orders tag
@@ -38,6 +37,5 @@
</split>
</route>
</camelContext>
- <!-- END SNIPPET: e1 -->
</beans>
diff --git a/core/camel-core/src/test/java/org/apache/camel/language/TokenXMLPairMultiNamespaceSplitTest.java b/core/camel-core/src/test/java/org/apache/camel/language/TokenXMLPairMultiNamespaceSplitTest.java
index 3b6b988be6e..ac9db755a9e 100644
--- a/core/camel-core/src/test/java/org/apache/camel/language/TokenXMLPairMultiNamespaceSplitTest.java
+++ b/core/camel-core/src/test/java/org/apache/camel/language/TokenXMLPairMultiNamespaceSplitTest.java
@@ -16,7 +16,6 @@
*/
package org.apache.camel.language;
-import org.apache.camel.Exchange;
import org.apache.camel.component.mock.MockEndpoint;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
@@ -39,7 +38,7 @@ public class TokenXMLPairMultiNamespaceSplitTest extends TokenXMLPairNamespaceSp
.isEqualTo("<order id=\"3\" xmlns=\"http:acme.com\" xmlns:foo=\"http:foo.com\">DSL in Action</order>");
String body = createBody();
- template.sendBodyAndHeader(fileUri("pair"), body, Exchange.FILE_NAME, "orders.xml");
+ template.sendBody("direct:pair", body);
assertMockEndpointsSatisfied();
}
diff --git a/core/camel-core/src/test/java/org/apache/camel/language/TokenXMLPairNamespaceMultilineSplitTest.java b/core/camel-core/src/test/java/org/apache/camel/language/TokenXMLPairNamespaceMultilineSplitTest.java
index ac2ce845da6..13f96807dfe 100644
--- a/core/camel-core/src/test/java/org/apache/camel/language/TokenXMLPairNamespaceMultilineSplitTest.java
+++ b/core/camel-core/src/test/java/org/apache/camel/language/TokenXMLPairNamespaceMultilineSplitTest.java
@@ -16,7 +16,6 @@
*/
package org.apache.camel.language;
-import org.apache.camel.Exchange;
import org.apache.camel.component.mock.MockEndpoint;
import org.junit.jupiter.api.Test;
@@ -38,7 +37,7 @@ public class TokenXMLPairNamespaceMultilineSplitTest extends TokenXMLPairNamespa
.isEqualTo("<order id=\"3\" xmlns=\"http:acme.com\" xmlns:foo=\"http:foo.com\">DSL in Action</order>");
String body = createBody();
- template.sendBodyAndHeader(fileUri("pair"), body, Exchange.FILE_NAME, "orders.xml");
+ template.sendBody("direct:pair", body);
assertMockEndpointsSatisfied();
}
diff --git a/core/camel-core/src/test/java/org/apache/camel/language/TokenXMLPairNamespaceSplitTest.java b/core/camel-core/src/test/java/org/apache/camel/language/TokenXMLPairNamespaceSplitTest.java
index 24762407e0f..4f56b74e7eb 100644
--- a/core/camel-core/src/test/java/org/apache/camel/language/TokenXMLPairNamespaceSplitTest.java
+++ b/core/camel-core/src/test/java/org/apache/camel/language/TokenXMLPairNamespaceSplitTest.java
@@ -17,7 +17,6 @@
package org.apache.camel.language;
import org.apache.camel.ContextTestSupport;
-import org.apache.camel.Exchange;
import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.component.mock.MockEndpoint;
import org.junit.jupiter.api.Test;
@@ -36,7 +35,7 @@ public class TokenXMLPairNamespaceSplitTest extends ContextTestSupport {
mock.message(2).body().isEqualTo("<order id=\"3\" xmlns=\"http:acme.com\">DSL in Action</order>");
String body = createBody();
- template.sendBodyAndHeader(fileUri("pair"), body, Exchange.FILE_NAME, "orders.xml");
+ template.sendBody("direct:pair", body);
assertMockEndpointsSatisfied();
}
@@ -50,7 +49,7 @@ public class TokenXMLPairNamespaceSplitTest extends ContextTestSupport {
mock.message(2).body().isEqualTo("<order id=\"3\" xmlns=\"http:acme.com\">DSL in Action</order>");
String body = createBody();
- template.sendBodyAndHeader(fileUri("pair2"), body, Exchange.FILE_NAME, "orders.xml");
+ template.sendBody("direct:pair2", body);
assertMockEndpointsSatisfied();
}
@@ -70,14 +69,12 @@ public class TokenXMLPairNamespaceSplitTest extends ContextTestSupport {
return new RouteBuilder() {
@Override
public void configure() throws Exception {
- // START SNIPPET: e1
- from(fileUri("pair?initialDelay=0&delay=10"))
+ from("direct:pair")
// split the order child tags, and inherit namespaces from
// the orders root tag
.split().tokenizeXML("order", "orders").to("mock:split");
- // END SNIPPET: e1
- from(fileUri("pair2?initialDelay=0&delay=10"))
+ from("direct:pair2")
// split the order child tags, and inherit namespaces from
// the orders root tag
.split(body().tokenizeXML("order", "orders")).to("mock:split");