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 2014/01/07 10:26:44 UTC
[1/3] git commit: CAMEL-7109: Message attachments should preserve
order using linked map. Thanks to Ronald Dehuysser for patch.
Updated Branches:
refs/heads/camel-2.11.x 2e9d12124 -> c4d27c5c5
refs/heads/camel-2.12.x 6cd00c034 -> ab71264d5
refs/heads/master a0726c895 -> 1cc2316f9
CAMEL-7109: Message attachments should preserve order using linked map. Thanks to Ronald Dehuysser for patch.
Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/1cc2316f
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/1cc2316f
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/1cc2316f
Branch: refs/heads/master
Commit: 1cc2316f93bc2dd8e35a656e727799ff7bef3ba6
Parents: a0726c8
Author: Claus Ibsen <da...@apache.org>
Authored: Tue Jan 7 10:29:45 2014 +0100
Committer: Claus Ibsen <da...@apache.org>
Committed: Tue Jan 7 10:29:45 2014 +0100
----------------------------------------------------------------------
.../org/apache/camel/impl/DefaultMessage.java | 4 +-
.../apache/camel/impl/DefaultMessageTest.java | 39 ++++++++++++++++++++
2 files changed, 41 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/camel/blob/1cc2316f/camel-core/src/main/java/org/apache/camel/impl/DefaultMessage.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/impl/DefaultMessage.java b/camel-core/src/main/java/org/apache/camel/impl/DefaultMessage.java
index da60279..ebc8c25 100644
--- a/camel-core/src/main/java/org/apache/camel/impl/DefaultMessage.java
+++ b/camel-core/src/main/java/org/apache/camel/impl/DefaultMessage.java
@@ -16,7 +16,7 @@
*/
package org.apache.camel.impl;
-import java.util.HashMap;
+import java.util.LinkedHashMap;
import java.util.Map;
import java.util.Set;
import javax.activation.DataHandler;
@@ -205,7 +205,7 @@ public class DefaultMessage extends MessageSupport {
* @return return a newly constructed Map
*/
protected Map<String, DataHandler> createAttachments() {
- Map<String, DataHandler> map = new HashMap<String, DataHandler>();
+ Map<String, DataHandler> map = new LinkedHashMap<String, DataHandler>();
populateInitialAttachments(map);
return map;
}
http://git-wip-us.apache.org/repos/asf/camel/blob/1cc2316f/camel-core/src/test/java/org/apache/camel/impl/DefaultMessageTest.java
----------------------------------------------------------------------
diff --git a/camel-core/src/test/java/org/apache/camel/impl/DefaultMessageTest.java b/camel-core/src/test/java/org/apache/camel/impl/DefaultMessageTest.java
new file mode 100644
index 0000000..59b4cdc
--- /dev/null
+++ b/camel-core/src/test/java/org/apache/camel/impl/DefaultMessageTest.java
@@ -0,0 +1,39 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.impl;
+
+import java.util.LinkedHashMap;
+import java.util.Map;
+import javax.activation.DataHandler;
+
+import org.junit.Test;
+
+import static org.hamcrest.CoreMatchers.instanceOf;
+import static org.hamcrest.MatcherAssert.assertThat;
+
+public class DefaultMessageTest {
+
+ @Test
+ public void testAttachmentsAreSorted() {
+ DefaultMessage message = new DefaultMessage();
+
+ Map<String, DataHandler> attachments = message.createAttachments();
+
+ assertThat(attachments, instanceOf(LinkedHashMap.class));
+ }
+
+}
[2/3] git commit: CAMEL-7109: Message attachments should preserve
order using linked map. Thanks to Ronald Dehuysser for patch.
Posted by da...@apache.org.
CAMEL-7109: Message attachments should preserve order using linked map. Thanks to Ronald Dehuysser for patch.
Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/ab71264d
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/ab71264d
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/ab71264d
Branch: refs/heads/camel-2.12.x
Commit: ab71264d5668c13484302e25d9b9ae6a53ed4834
Parents: 6cd00c0
Author: Claus Ibsen <da...@apache.org>
Authored: Tue Jan 7 10:29:45 2014 +0100
Committer: Claus Ibsen <da...@apache.org>
Committed: Tue Jan 7 10:30:08 2014 +0100
----------------------------------------------------------------------
.../org/apache/camel/impl/DefaultMessage.java | 4 +-
.../apache/camel/impl/DefaultMessageTest.java | 39 ++++++++++++++++++++
2 files changed, 41 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/camel/blob/ab71264d/camel-core/src/main/java/org/apache/camel/impl/DefaultMessage.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/impl/DefaultMessage.java b/camel-core/src/main/java/org/apache/camel/impl/DefaultMessage.java
index da60279..ebc8c25 100644
--- a/camel-core/src/main/java/org/apache/camel/impl/DefaultMessage.java
+++ b/camel-core/src/main/java/org/apache/camel/impl/DefaultMessage.java
@@ -16,7 +16,7 @@
*/
package org.apache.camel.impl;
-import java.util.HashMap;
+import java.util.LinkedHashMap;
import java.util.Map;
import java.util.Set;
import javax.activation.DataHandler;
@@ -205,7 +205,7 @@ public class DefaultMessage extends MessageSupport {
* @return return a newly constructed Map
*/
protected Map<String, DataHandler> createAttachments() {
- Map<String, DataHandler> map = new HashMap<String, DataHandler>();
+ Map<String, DataHandler> map = new LinkedHashMap<String, DataHandler>();
populateInitialAttachments(map);
return map;
}
http://git-wip-us.apache.org/repos/asf/camel/blob/ab71264d/camel-core/src/test/java/org/apache/camel/impl/DefaultMessageTest.java
----------------------------------------------------------------------
diff --git a/camel-core/src/test/java/org/apache/camel/impl/DefaultMessageTest.java b/camel-core/src/test/java/org/apache/camel/impl/DefaultMessageTest.java
new file mode 100644
index 0000000..59b4cdc
--- /dev/null
+++ b/camel-core/src/test/java/org/apache/camel/impl/DefaultMessageTest.java
@@ -0,0 +1,39 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.impl;
+
+import java.util.LinkedHashMap;
+import java.util.Map;
+import javax.activation.DataHandler;
+
+import org.junit.Test;
+
+import static org.hamcrest.CoreMatchers.instanceOf;
+import static org.hamcrest.MatcherAssert.assertThat;
+
+public class DefaultMessageTest {
+
+ @Test
+ public void testAttachmentsAreSorted() {
+ DefaultMessage message = new DefaultMessage();
+
+ Map<String, DataHandler> attachments = message.createAttachments();
+
+ assertThat(attachments, instanceOf(LinkedHashMap.class));
+ }
+
+}
[3/3] git commit: CAMEL-7109: Message attachments should preserve
order using linked map. Thanks to Ronald Dehuysser for patch.
Posted by da...@apache.org.
CAMEL-7109: Message attachments should preserve order using linked map. Thanks to Ronald Dehuysser for patch.
Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/c4d27c5c
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/c4d27c5c
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/c4d27c5c
Branch: refs/heads/camel-2.11.x
Commit: c4d27c5c5c4d09803c85ddc90e38ad3cace52f0b
Parents: 2e9d121
Author: Claus Ibsen <da...@apache.org>
Authored: Tue Jan 7 10:29:45 2014 +0100
Committer: Claus Ibsen <da...@apache.org>
Committed: Tue Jan 7 10:30:26 2014 +0100
----------------------------------------------------------------------
.../org/apache/camel/impl/DefaultMessage.java | 4 +-
.../apache/camel/impl/DefaultMessageTest.java | 39 ++++++++++++++++++++
2 files changed, 41 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/camel/blob/c4d27c5c/camel-core/src/main/java/org/apache/camel/impl/DefaultMessage.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/impl/DefaultMessage.java b/camel-core/src/main/java/org/apache/camel/impl/DefaultMessage.java
index da60279..ebc8c25 100644
--- a/camel-core/src/main/java/org/apache/camel/impl/DefaultMessage.java
+++ b/camel-core/src/main/java/org/apache/camel/impl/DefaultMessage.java
@@ -16,7 +16,7 @@
*/
package org.apache.camel.impl;
-import java.util.HashMap;
+import java.util.LinkedHashMap;
import java.util.Map;
import java.util.Set;
import javax.activation.DataHandler;
@@ -205,7 +205,7 @@ public class DefaultMessage extends MessageSupport {
* @return return a newly constructed Map
*/
protected Map<String, DataHandler> createAttachments() {
- Map<String, DataHandler> map = new HashMap<String, DataHandler>();
+ Map<String, DataHandler> map = new LinkedHashMap<String, DataHandler>();
populateInitialAttachments(map);
return map;
}
http://git-wip-us.apache.org/repos/asf/camel/blob/c4d27c5c/camel-core/src/test/java/org/apache/camel/impl/DefaultMessageTest.java
----------------------------------------------------------------------
diff --git a/camel-core/src/test/java/org/apache/camel/impl/DefaultMessageTest.java b/camel-core/src/test/java/org/apache/camel/impl/DefaultMessageTest.java
new file mode 100644
index 0000000..59b4cdc
--- /dev/null
+++ b/camel-core/src/test/java/org/apache/camel/impl/DefaultMessageTest.java
@@ -0,0 +1,39 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.impl;
+
+import java.util.LinkedHashMap;
+import java.util.Map;
+import javax.activation.DataHandler;
+
+import org.junit.Test;
+
+import static org.hamcrest.CoreMatchers.instanceOf;
+import static org.hamcrest.MatcherAssert.assertThat;
+
+public class DefaultMessageTest {
+
+ @Test
+ public void testAttachmentsAreSorted() {
+ DefaultMessage message = new DefaultMessage();
+
+ Map<String, DataHandler> attachments = message.createAttachments();
+
+ assertThat(attachments, instanceOf(LinkedHashMap.class));
+ }
+
+}