On Wed, Feb 27, 2013 at 10:55 PM, shyenuganti <shyenuga...@gmail.com> wrote:
> Here is my sample route. It is working fine with camel:run. I am able to read
> from the DB.
>
>
> from("oracleJpa://com.model.EventQueue?consumeDelete=false&consumer.delay=25000")
>                 .id("OracleListener")
>                 .to("log:{body}")
>                 .to("mock:JPAMock");
>
> For testing the route, I have setup an inmemory Derby Database and am trying
> to assert on the mock.
>
>                 EventQueue event = new EventQueue();
>                 event.setEventLastChangeUser("yenuganti");
>                 event.setEventMessage("TestMessage");
>
>                 List<EventQueue> expectedBodies = new ArrayList<EventQueue>();
>                 expectedBodies.add(event);
>
>                 mock.setExpectedMessageCount(1);
>                 mock.expectedBodiesReceived(expectedBodies);
>                 mock.setResultWaitTime(15000);
>                 mock.assertIsSatisfied();
>
> It is failing on the assertion
>
> *java.lang.AssertionError: mock://JMSMock Received message count. Expected:
> <1> but was: <0>*
>
> There is one record in my derby DB. But why is my JPA endpoint not able to
> read it ?
>

I suggest to look at the camel-jpa unit test source code as we use
Derby for unit testing that component itself
https://svn.apache.org/repos/asf/camel/trunk/components/camel-jpa/

You really should try harder to solve this yourselves before posting.
For example can you see any errors in the logs. Have you configured
the JPA correctly? And what do you see if you enable DEBUG/TRACE
logging etc?



> Please help.
>
>
>
>
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/JPA-Endpoint-Testing-with-Derby-in-memory-DB-tp5728253.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-----------------
Red Hat, Inc.
FuseSource is now part of Red Hat
Email: cib...@redhat.com
Web: http://fusesource.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen

Reply via email to