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 2019/01/15 14:00:16 UTC
[camel] branch master updated: Fixed camel-jetty9 tests
This is an automated email from the ASF dual-hosted git repository.
davsclaus pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel.git
The following commit(s) were added to refs/heads/master by this push:
new 325694b Fixed camel-jetty9 tests
325694b is described below
commit 325694b8040a05ce52a80f47305afecdb011dcf9
Author: Claus Ibsen <cl...@gmail.com>
AuthorDate: Tue Jan 15 14:53:04 2019 +0100
Fixed camel-jetty9 tests
---
.../apache/camel/component/jetty/MultiPartFormTest.java | 10 +++++-----
.../component/jetty/MultiPartFormWithCustomFilterTest.java | 14 +++++++-------
2 files changed, 12 insertions(+), 12 deletions(-)
diff --git a/components/camel-jetty9/src/test/java/org/apache/camel/component/jetty/MultiPartFormTest.java b/components/camel-jetty9/src/test/java/org/apache/camel/component/jetty/MultiPartFormTest.java
index a2434f0..bea0347 100644
--- a/components/camel-jetty9/src/test/java/org/apache/camel/component/jetty/MultiPartFormTest.java
+++ b/components/camel-jetty9/src/test/java/org/apache/camel/component/jetty/MultiPartFormTest.java
@@ -34,7 +34,7 @@ import org.junit.Test;
public class MultiPartFormTest extends BaseJettyTest {
private HttpEntity createMultipartRequestEntity() throws Exception {
- File file = new File("src/main/resources/META-INF/NOTICE.txt");
+ File file = new File("src/test/resources/log4j2.properties");
return MultipartEntityBuilder.create()
.addTextBody("comment", "A binary file of some kind")
.addBinaryBody(file.getName(), file)
@@ -79,9 +79,9 @@ public class MultiPartFormTest extends BaseJettyTest {
Message in = exchange.getIn();
assertEquals("Get a wrong attachement size", 2, in.getAttachments().size());
// The file name is attachment id
- DataHandler data = in.getAttachment("NOTICE.txt");
+ DataHandler data = in.getAttachment("log4j2.properties");
- assertNotNull("Should get the DataHandle NOTICE.txt", data);
+ assertNotNull("Should get the DataHandle log4j2.properties", data);
// This assert is wrong, but the correct content-type
// (application/octet-stream)
// will not be returned until Jetty makes it available -
@@ -90,7 +90,7 @@ public class MultiPartFormTest extends BaseJettyTest {
// the implentation being used)
// assertEquals("Get a wrong content type",
// "text/plain", data.getContentType());
- assertEquals("Got the wrong name", "NOTICE.txt", data.getName());
+ assertEquals("Got the wrong name", "log4j2.properties", data.getName());
assertTrue("We should get the data from the DataHandle", data.getDataSource()
.getInputStream().available() > 0);
@@ -99,7 +99,7 @@ public class MultiPartFormTest extends BaseJettyTest {
// header
// For binary attachment, header should also be populated by DataHandler but not payload
- Object header = in.getHeader("NOTICE.txt");
+ Object header = in.getHeader("log4j2.properties");
assertEquals(DataHandler.class, header.getClass());
assertEquals(data, header);
diff --git a/components/camel-jetty9/src/test/java/org/apache/camel/component/jetty/MultiPartFormWithCustomFilterTest.java b/components/camel-jetty9/src/test/java/org/apache/camel/component/jetty/MultiPartFormWithCustomFilterTest.java
index 230ccc4..35632f2 100644
--- a/components/camel-jetty9/src/test/java/org/apache/camel/component/jetty/MultiPartFormWithCustomFilterTest.java
+++ b/components/camel-jetty9/src/test/java/org/apache/camel/component/jetty/MultiPartFormWithCustomFilterTest.java
@@ -55,7 +55,7 @@ public class MultiPartFormWithCustomFilterTest extends BaseJettyTest {
@Test
public void testSendMultiPartForm() throws Exception {
HttpClient httpclient = new HttpClient();
- File file = new File("src/main/resources/META-INF/NOTICE.txt");
+ File file = new File("src/test/resources/log4j2.properties");
PostMethod httppost = new PostMethod("http://localhost:" + getPort() + "/test");
Part[] parts = {
new StringPart("comment", "A binary file of some kind"),
@@ -78,7 +78,7 @@ public class MultiPartFormWithCustomFilterTest extends BaseJettyTest {
public void testSendMultiPartFormOverrideEnableMultpartFilterFalse() throws Exception {
HttpClient httpclient = new HttpClient();
- File file = new File("src/main/resources/META-INF/NOTICE.txt");
+ File file = new File("src/test/resources/log4j2.properties");
PostMethod httppost = new PostMethod("http://localhost:" + getPort() + "/test2");
Part[] parts = {
@@ -116,14 +116,14 @@ public class MultiPartFormWithCustomFilterTest extends BaseJettyTest {
Message in = exchange.getIn();
assertEquals("Get a wrong attachement size", 2, in.getAttachments().size());
// The file name is attachment id
- DataHandler data = in.getAttachment("NOTICE.txt");
+ DataHandler data = in.getAttachment("log4j2.properties");
- assertNotNull("Should get the DataHandle NOTICE.txt", data);
+ assertNotNull("Should get the DataHandle log4j2.properties", data);
// This assert is wrong, but the correct content-type (application/octet-stream)
// will not be returned until Jetty makes it available - currently the content-type
// returned is just the default for FileDataHandler (for the implentation being used)
//assertEquals("Get a wrong content type", "text/plain", data.getContentType());
- assertEquals("Got the wrong name", "NOTICE.txt", data.getName());
+ assertEquals("Got the wrong name", "log4j2.properties", data.getName());
assertTrue("We should get the data from the DataHandle", data.getDataSource()
.getInputStream().available() > 0);
@@ -139,9 +139,9 @@ public class MultiPartFormWithCustomFilterTest extends BaseJettyTest {
public void process(Exchange exchange) throws Exception {
Message in = exchange.getIn();
assertEquals("Get a wrong attachement size", 2, in.getAttachments().size());
- DataHandler data = in.getAttachment("NOTICE.txt");
+ DataHandler data = in.getAttachment("log4j2.properties");
- assertNotNull("Should get the DataHandle NOTICE.txt", data);
+ assertNotNull("Should get the DataHandle log4j2.properties", data);
// The other form date can be get from the message header
exchange.getOut().setBody(in.getHeader("comment"));
}