I'm afraid this commit broke the CxfMtomPOJOProducerTest:
testInvokingServiceFromCxfProducer(org.apache.camel.component.cxf.mtom.CxfMtomPOJOProducerTest)
Time elapsed: 0.164 sec <<< FAILURE!
java.lang.AssertionError: The attachement size should be 0 expected:<0>
but was:<2>
at org.junit.Assert.fail(Assert.java:88)
at org.junit.Assert.failNotEquals(Assert.java:743)
at org.junit.Assert.assertEquals(Assert.java:118)
at org.junit.Assert.assertEquals(Assert.java:555)
at
org.apache.camel.component.cxf.mtom.CxfMtomPOJOProducerTest.testInvokingServiceFromCxfProducer(CxfMtomPOJOProducerTest.java:91)
Willem, could you please have a look?
Best,
Christian
-----------------
Software Integration Specialist
Apache Member
V.P. Apache Camel | Apache Camel PMC Member | Apache Camel committer
Apache Incubator PMC Member
https://www.linkedin.com/pub/christian-mueller/11/551/642
On Sat, Feb 8, 2014 at 3:37 AM, <[email protected]> wrote:
> Updated Branches:
> refs/heads/master 20f810a8a -> 8d361e604
>
>
> CAMEL-7181 Propagate the attachments information when the CXF endpoint is
> POJO without enabling the MTOM
>
>
> Project: http://git-wip-us.apache.org/repos/asf/camel/repo
> Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/8d361e60
> Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/8d361e60
> Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/8d361e60
>
> Branch: refs/heads/master
> Commit: 8d361e604d345c183a5fe0689ac08b5177ff2124
> Parents: 20f810a
> Author: Willem Jiang <[email protected]>
> Authored: Sat Feb 8 10:36:40 2014 +0800
> Committer: Willem Jiang <[email protected]>
> Committed: Sat Feb 8 10:36:40 2014 +0800
>
> ----------------------------------------------------------------------
> .../java/org/apache/camel/component/cxf/DefaultCxfBinding.java | 5 +++--
> 1 file changed, 3 insertions(+), 2 deletions(-)
> ----------------------------------------------------------------------
>
>
>
> http://git-wip-us.apache.org/repos/asf/camel/blob/8d361e60/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/DefaultCxfBinding.java
> ----------------------------------------------------------------------
> diff --git
> a/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/DefaultCxfBinding.java
> b/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/DefaultCxfBinding.java
> index f311573..bf7d324 100644
> ---
> a/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/DefaultCxfBinding.java
> +++
> b/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/DefaultCxfBinding.java
> @@ -169,8 +169,9 @@ public class DefaultCxfBinding implements CxfBinding,
> HeaderFilterStrategyAware
> propagateHeadersFromCxfToCamel(cxfMessage,
> camelExchange.getOut(), camelExchange);
> DataFormat dataFormat =
> camelExchange.getProperty(CxfConstants.DATA_FORMAT_PROPERTY,
>
> DataFormat.class);
> - // propagate attachments if the data format is not POJO
> - if (cxfMessage.getAttachments() != null &&
> !DataFormat.POJO.equals(dataFormat)) {
> + boolean isXop =
> Boolean.valueOf(camelExchange.getProperty(Message.MTOM_ENABLED,
> String.class));
> + // propagate attachments if the data format is not POJO with MTOM
> enabled
> + if (cxfMessage.getAttachments() != null &&
> !(DataFormat.POJO.equals(dataFormat) && !isXop)) {
> // propagate attachments
> for (Attachment attachment : cxfMessage.getAttachments()) {
> camelExchange.getOut().addAttachment(attachment.getId(),
> attachment.getDataHandler());
>
>