The error is solved.
Question :
Why the template.sendBody(Object) must be placed in the code after the
MockEndpoint.expectedBodiesReceived() and not the inverse ?
this code works :
resultEndpoint.expectedBodiesReceived(result);
template.sendBody(generateModel());
Not this one
template.sendBody(generateModel()
resultEndpoint.expectedBodiesReceived(result);
cmoulliard wrote:
>
> So this code is not correct to send to the body through the marshalling
> method string corresponding to CSV record :
>
> public void marshal(Exchange arg0, Object object, OutputStream
> outputStream) throws Exception {
>
> List<HashMap<String, Object>> models =
> (ArrayList<HashMap<String,
> Object>>) object;
> HashMap<String, Object> modelObjects = new HashMap<String,
> Object>();
>
> OutputStreamWriter out = new OutputStreamWriter(outputStream);
>
> try {
> Iterator it = models.iterator();
>
> while (it.hasNext()) {
> String result = getFactory().unbind((HashMap<String,
> Object>)
> it.next());
> System.out.println("Result string : " + result);
> out.write(result);
> }
> } finally {
> out.close();
> }
>
>
> James.Strachan wrote:
>>
>> Looks like a bug :) I've just added a fix. Basically its thrown if you
>> don't receive the right actual number of values you are asserting.
>>
>> 2009/1/14 cmoulliard <[email protected]>:
>>>
>>> Hi,
>>>
>>> Can someone tell me why MockEndpoint generates the following error when
>>> executing the method 'assertIsSatisfied()' ?
>>>
>>> java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
>>> at java.util.ArrayList.RangeCheck(ArrayList.java:546)
>>> at java.util.ArrayList.get(ArrayList.java:321)
>>> at
>>> org.apache.camel.component.mock.MockEndpoint$3.run(MockEndpoint.java:344)
>>> at
>>> org.apache.camel.component.mock.MockEndpoint.assertIsSatisfied(MockEndpoint.java:251)
>>> at
>>> org.apache.camel.component.mock.MockEndpoint.assertIsSatisfied(MockEndpoint.java:218)
>>> at
>>> org.apache.camel.bindy.csv.BindyCSVMarshallTest.testMarshallMessage(BindyCSVMarshallTest.java:53)
>>>
>>>
>>>
>>> -----
>>> Charles Moulliard
>>> SOA Architect
>>>
>>> My Blog : http://cmoulliard.blogspot.com/
>>> http://cmoulliard.blogspot.com/
>>> --
>>> View this message in context:
>>> http://www.nabble.com/Reason-why-Mockendpoint-generates-an-IndexOutOfBoundsException-error---tp21453025s22882p21453025.html
>>> Sent from the Camel - Users mailing list archive at Nabble.com.
>>>
>>>
>>
>>
>>
>> --
>> James
>> -------
>> http://macstrac.blogspot.com/
>>
>> Open Source Integration
>> http://fusesource.com/
>>
>>
>
>
-----
Charles Moulliard
SOA Architect
My Blog : http://cmoulliard.blogspot.com/ http://cmoulliard.blogspot.com/
--
View this message in context:
http://www.nabble.com/Reason-why-Mockendpoint-generates-an-IndexOutOfBoundsException-error---tp21453025s22882p21458286.html
Sent from the Camel - Users mailing list archive at Nabble.com.