Unit test return the following error :
java.lang.AssertionError: mock://result Body of message: 0.
Expected:
<[{org.apache.camel.dataformat.bindy.model.fix.simple.Header=Model :
org.apache.camel.dataformat.bindy.model.fix.simple.Header, FIX 4.1,
20, 10, INVMGR, BRKR,
org.apache.camel.dataformat.
Hi
If you are comparing objects it will use equals and it may not be able
to detect that they are identical.
If they have a nice toString you can convert them to String and do a
string equals.
At least their to string output in this mail looks as if they are identical.
On Tue, Oct 20, 2009 at 4
I have customized the toString method of each Class. What is strange
is that in another the test generating the same objects, it works.
I will adapt the test to compare object differently.
Charles Moulliard
Senior Enterprise Architect
Apache Camel Committer
*
blog : h
In Java Objects are comared via equals() method, not toString(). I usually
use Jakarta Lang libarary to automate it. For example:
import java.io.Serializable;
import org.apache.commons.lang.builder.EqualsBuilder;
import org.apache.commons.lang.builder.HashCodeBuilder;
import org.apache.commons.la
Thks. I will try.
Charles Moulliard
Senior Enterprise Architect
Apache Camel Committer
*
blog : http://cmoulliard.blogspot.com
twitter : http://twitter.com/cmoulliard
On Wed, Oct 21, 2009 at 9:16 AM, Dmitry Ulanov wrote:
> In Java Objects are comared via equals() m
How do you do the comparison ?
If I extend my model class with the AbstractParent and that I use the
following method :
result.expectedBodiesReceived( generateModel().toString() );
to compare what I receive from camel-bindy unmarshalling with a model
generated from scratch, the test fail
On Wed, Oct 21, 2009 at 10:41 AM, Charles Moulliard
wrote:
> How do you do the comparison ?
>
> If I extend my model class with the AbstractParent and that I use the
> following method :
>
> result.expectedBodiesReceived( generateModel().toString() );
This one does a simple assertEquals fr
Assertion error is also generated using what you propose Claus :
java.lang.AssertionError: mock://result body ==
[{org.apache.camel.dataformat.bindy.model.fix.simple.header=org.apache.camel.dataformat.bindy.model.fix.simple.hea...@35bb0f[
beginString=FIX 4.1
bodyLength=20
msgSeqNum=1
msgTy
Yeah they are not String equals
See below:
> [{org.apache.camel.dataformat.bindy.model.fix.simple.header=org.apache.camel.dataformat.bindy.model.fix.simple.hea...@35bb0f[
> [{org.apache.camel.dataformat.bindy.model.fix.simple.header=org.apache.camel.dataformat.bindy.model.fix.simple.hea...@366573[
The result.expectedBodiesReceived( generateModel().toString() ); was working
There was a stupid "." character instead of a " " in the expected string.
So forget my question
Charles Moulliard
Senior Enterprise Architect
Apache Camel Committer
*
blog : http://cmoulliar
10 matches
Mail list logo