@Override protected RouteBuilder createRouteBuilder() { return new SpringRouteBuilder() { public void configure() throws Exception { JpaEndpoint jpa = new JpaEndpoint(); jpa.setCamelContext(context); jpa.setEntityType(SendEmail.class); jpa.setEntityManagerFactory(context.getRegistry().lookupByNameAndType("entityManagerFactory", EntityManagerFactory.class)); from("direct:start").to(jpa).to("mock:result"); } }; }
private void assertEntityInDB() throws Exception { JpaEndpoint endpoint = context.getEndpoint("jpa:camelinaction.PurchaseOrder", JpaEndpoint.class); EntityManager em = endpoint.getEntityManagerFactory().createEntityManager(); List list = em.createQuery("select x from camelinaction.PurchaseOrder x").getResultList(); assertEquals(1, list.size()); assertIsInstanceOf(PurchaseOrder.class, list.get(0)); em.close(); }
@SuppressWarnings("unchecked") private void assertEntityInDB() throws Exception { JpaEndpoint endpoint = (JpaEndpoint) context.getEndpoint("jpa:camelinaction.PurchaseOrder"); EntityManager em = endpoint.getEntityManagerFactory().createEntityManager(); List list = em.createQuery("select x from camelinaction.PurchaseOrder x").getResultList(); assertEquals(1, list.size()); assertIsInstanceOf(PurchaseOrder.class, list.get(0)); em.close(); }
@SuppressWarnings("unchecked") private void assertEntityInDB() throws Exception { JpaEndpoint endpoint = (JpaEndpoint) context.getEndpoint("jpa:camelinaction.PurchaseOrder"); jpaTemplate = endpoint.getTemplate(); List list = jpaTemplate.find("select x from camelinaction.PurchaseOrder x"); assertEquals(1, list.size()); assertIsInstanceOf(PurchaseOrderImmutable.class, list.get(0)); }
public V1CamelJpaBindingModelTest() { super(JpaEndpoint.class, CAMEL_XML); setSkipCamelEndpointTesting(true); }
public V1CamelJpaConsumerBindingModelTest() { super(JpaEndpoint.class, CAMEL_XML); setSkipCamelEndpointTesting(true); }
public V1CamelJpaProducerBindingModelTest() { super(JpaEndpoint.class, CAMEL_XML); setSkipCamelEndpointTesting(true); }