camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davscl...@apache.org
Subject svn commit: r1165193 - in /camel/trunk/components/camel-jpa/src: main/java/org/apache/camel/component/jpa/ main/java/org/apache/camel/processor/idempotent/jpa/ main/java/org/apache/camel/processor/interceptor/jpa/ test/java/org/apache/camel/component/j...
Date Mon, 05 Sep 2011 07:51:29 GMT
Author: davsclaus
Date: Mon Sep  5 07:51:28 2011
New Revision: 1165193

URL: http://svn.apache.org/viewvc?rev=1165193&view=rev
Log:
CAMEL-3142: Polished code. Thanks to Mathieu Lalonde for the patch.

Modified:
    camel/trunk/components/camel-jpa/src/main/java/org/apache/camel/component/jpa/JpaConsumer.java
    camel/trunk/components/camel-jpa/src/main/java/org/apache/camel/component/jpa/JpaEndpoint.java
    camel/trunk/components/camel-jpa/src/main/java/org/apache/camel/component/jpa/JpaProducer.java
    camel/trunk/components/camel-jpa/src/main/java/org/apache/camel/component/jpa/JpaTemplateTransactionStrategy.java
    camel/trunk/components/camel-jpa/src/main/java/org/apache/camel/component/jpa/QueryBuilder.java
    camel/trunk/components/camel-jpa/src/main/java/org/apache/camel/component/jpa/TransactionStrategy.java
    camel/trunk/components/camel-jpa/src/main/java/org/apache/camel/processor/idempotent/jpa/JpaMessageIdRepository.java
    camel/trunk/components/camel-jpa/src/main/java/org/apache/camel/processor/idempotent/jpa/MessageProcessed.java
    camel/trunk/components/camel-jpa/src/main/java/org/apache/camel/processor/interceptor/jpa/JpaTraceEventMessage.java
    camel/trunk/components/camel-jpa/src/test/java/org/apache/camel/component/jpa/AbstractJpaMethodTest.java
    camel/trunk/components/camel-jpa/src/test/java/org/apache/camel/component/jpa/JpaEndpointTest.java
    camel/trunk/components/camel-jpa/src/test/java/org/apache/camel/component/jpa/JpaTest.java
    camel/trunk/components/camel-jpa/src/test/java/org/apache/camel/component/jpa/JpaUseMergeTest.java
    camel/trunk/components/camel-jpa/src/test/java/org/apache/camel/component/jpa/JpaWithNamedQueryTest.java
    camel/trunk/components/camel-jpa/src/test/java/org/apache/camel/component/jpa/QueryBuilderTest.java
    camel/trunk/components/camel-jpa/src/test/java/org/apache/camel/processor/interceptor/JpaTraceEventMessageTest.java
    camel/trunk/components/camel-jpa/src/test/java/org/apache/camel/processor/jpa/FileConsumerJpaIdempotentTest.java
    camel/trunk/components/camel-jpa/src/test/java/org/apache/camel/processor/jpa/JpaBatchConsumerTest.java
    camel/trunk/components/camel-jpa/src/test/java/org/apache/camel/processor/jpa/JpaFlushOnSendTest.java
    camel/trunk/components/camel-jpa/src/test/java/org/apache/camel/processor/jpa/JpaIdempotentConsumerTest.java
    camel/trunk/components/camel-jpa/src/test/java/org/apache/camel/processor/jpa/JpaProducerConcurrentTest.java
    camel/trunk/components/camel-jpa/src/test/java/org/apache/camel/processor/jpa/JpaProducerNoBodyTest.java
    camel/trunk/components/camel-jpa/src/test/java/org/apache/camel/processor/jpa/JpaRouteConsumeLockEntityTest.java
    camel/trunk/components/camel-jpa/src/test/java/org/apache/camel/processor/jpa/JpaRouteMaximumResultsTest.java
    camel/trunk/components/camel-jpa/src/test/java/org/apache/camel/processor/jpa/JpaRouteTest.java
    camel/trunk/components/camel-jpa/src/test/java/org/apache/camel/processor/jpa/JpaRoutemaxMessagesPerPollTest.java

Modified: camel/trunk/components/camel-jpa/src/main/java/org/apache/camel/component/jpa/JpaConsumer.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-jpa/src/main/java/org/apache/camel/component/jpa/JpaConsumer.java?rev=1165193&r1=1165192&r2=1165193&view=diff
==============================================================================
--- camel/trunk/components/camel-jpa/src/main/java/org/apache/camel/component/jpa/JpaConsumer.java (original)
+++ camel/trunk/components/camel-jpa/src/main/java/org/apache/camel/component/jpa/JpaConsumer.java Mon Sep  5 07:51:28 2011
@@ -52,7 +52,7 @@ public class JpaConsumer extends Schedul
     private String query;
     private String namedQuery;
     private String nativeQuery;
-    private Class resultClass;
+    private Class<?> resultClass;
     private int maxMessagesPerPoll;
     private volatile ShutdownRunningTask shutdownRunningTask;
     private volatile int pendingExchanges;
@@ -77,7 +77,7 @@ public class JpaConsumer extends Schedul
         shutdownRunningTask = null;
         pendingExchanges = 0;
 
-        Object messagePolled = template.execute(new JpaCallback() {
+        Object messagePolled = template.execute(new JpaCallback<Object>() {
             public Object doInJpa(EntityManager entityManager) throws PersistenceException {
                 Queue<DataHolder> answer = new LinkedList<DataHolder>();
 
@@ -242,11 +242,11 @@ public class JpaConsumer extends Schedul
         this.query = query;
     }
     
-    public Class getResultClass() {
+    public Class<?> getResultClass() {
         return resultClass;
     }
 
-    public void setResultClass(Class resultClass) {
+    public void setResultClass(Class<?> resultClass) {
         this.resultClass = resultClass;
     }    
 

Modified: camel/trunk/components/camel-jpa/src/main/java/org/apache/camel/component/jpa/JpaEndpoint.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-jpa/src/main/java/org/apache/camel/component/jpa/JpaEndpoint.java?rev=1165193&r1=1165192&r2=1165193&view=diff
==============================================================================
--- camel/trunk/components/camel-jpa/src/main/java/org/apache/camel/component/jpa/JpaEndpoint.java (original)
+++ camel/trunk/components/camel-jpa/src/main/java/org/apache/camel/component/jpa/JpaEndpoint.java Mon Sep  5 07:51:28 2011
@@ -58,6 +58,11 @@ public class JpaEndpoint extends Schedul
     public JpaEndpoint() {
     }
 
+    /**
+     * 
+     * @param endpointUri
+     * @deprecated use {@link JpaEndpoint#JpaEndpoint(String, JpaComponent)} instead
+     */
     public JpaEndpoint(String endpointUri) {
         super(endpointUri);
     }
@@ -68,11 +73,24 @@ public class JpaEndpoint extends Schedul
         transactionManager = component.getTransactionManager();
     }
 
+    /**
+     * 
+     * @param endpointUri
+     * @param entityManagerFactory
+     * @deprecated use {@link JpaEndpoint#JpaEndpoint(String, JpaComponent)} instead
+     */
     public JpaEndpoint(String endpointUri, EntityManagerFactory entityManagerFactory) {
         super(endpointUri);
         this.entityManagerFactory = entityManagerFactory;
     }
 
+    /**
+     * 
+     * @param endpointUri
+     * @param entityManagerFactory
+     * @param transactionManager
+     * @deprecated use {@link JpaEndpoint#JpaEndpoint(String, JpaComponent)} instead
+     */
     public JpaEndpoint(String endpointUri, EntityManagerFactory entityManagerFactory, PlatformTransactionManager transactionManager) {
         super(endpointUri);
         this.entityManagerFactory = entityManagerFactory;

Modified: camel/trunk/components/camel-jpa/src/main/java/org/apache/camel/component/jpa/JpaProducer.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-jpa/src/main/java/org/apache/camel/component/jpa/JpaProducer.java?rev=1165193&r1=1165192&r2=1165193&view=diff
==============================================================================
--- camel/trunk/components/camel-jpa/src/main/java/org/apache/camel/component/jpa/JpaProducer.java (original)
+++ camel/trunk/components/camel-jpa/src/main/java/org/apache/camel/component/jpa/JpaProducer.java Mon Sep  5 07:51:28 2011
@@ -48,8 +48,8 @@ public class JpaProducer extends Default
         exchange.getIn().setHeader(JpaConstants.JPA_TEMPLATE, endpoint.getTemplate());
         final Object values = expression.evaluate(exchange, Object.class);
         if (values != null) {
-            template.execute(new JpaCallback() {
-                @SuppressWarnings("unchecked")
+            template.execute(new JpaCallback<Object>() {
+                
                 public Object doInJpa(EntityManager entityManager) throws PersistenceException {
                     if (values.getClass().isArray()) {
                         Object[] array = (Object[]) values;
@@ -60,9 +60,10 @@ public class JpaProducer extends Default
                             }
                         }
                     } else if (values instanceof Collection) {
-                        Collection collection = (Collection) values;
-                        List managedEntities = new ArrayList();
-                        for (Iterator iter = collection.iterator(); iter.hasNext();) {
+                        @SuppressWarnings("unchecked")
+                        Collection<Object> collection = (Collection<Object>) values;
+                        List<Object> managedEntities = new ArrayList<Object>();
+                        for (Iterator<?> iter = collection.iterator(); iter.hasNext();) {
                             Object managedEntity = save(iter.next(), entityManager);
                             managedEntities.add(managedEntity);
                         }

Modified: camel/trunk/components/camel-jpa/src/main/java/org/apache/camel/component/jpa/JpaTemplateTransactionStrategy.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-jpa/src/main/java/org/apache/camel/component/jpa/JpaTemplateTransactionStrategy.java?rev=1165193&r1=1165192&r2=1165193&view=diff
==============================================================================
--- camel/trunk/components/camel-jpa/src/main/java/org/apache/camel/component/jpa/JpaTemplateTransactionStrategy.java (original)
+++ camel/trunk/components/camel-jpa/src/main/java/org/apache/camel/component/jpa/JpaTemplateTransactionStrategy.java Mon Sep  5 07:51:28 2011
@@ -73,11 +73,11 @@ public class JpaTemplateTransactionStrat
         return new JpaTemplateTransactionStrategy(template, tranasctionTemplate);
     }
 
-    @SuppressWarnings("unchecked")
-    public Object execute(final JpaCallback callback) {
-        return transactionTemplate.execute(new TransactionCallback() {
+    
+    public Object execute(final JpaCallback<?> callback) {
+        return transactionTemplate.execute(new TransactionCallback<Object>() {
             public Object doInTransaction(TransactionStatus status) {
-                return jpaTemplate.execute(new JpaCallback() {
+                return jpaTemplate.execute(new JpaCallback<Object>() {
                     public Object doInJpa(EntityManager entityManager) throws PersistenceException {
                         return callback.doInJpa(entityManager);
                     }

Modified: camel/trunk/components/camel-jpa/src/main/java/org/apache/camel/component/jpa/QueryBuilder.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-jpa/src/main/java/org/apache/camel/component/jpa/QueryBuilder.java?rev=1165193&r1=1165192&r2=1165193&view=diff
==============================================================================
--- camel/trunk/components/camel-jpa/src/main/java/org/apache/camel/component/jpa/QueryBuilder.java (original)
+++ camel/trunk/components/camel-jpa/src/main/java/org/apache/camel/component/jpa/QueryBuilder.java Mon Sep  5 07:51:28 2011
@@ -86,7 +86,7 @@ public abstract class QueryBuilder imple
     /**
      * Creates a native SQL query with a provided resultClass
      */
-    public static QueryBuilder nativeQuery(final String nativeQuery, final Class resultClass) {
+    public static QueryBuilder nativeQuery(final String nativeQuery, final Class<?> resultClass) {
         return new QueryBuilder() {
             protected Query makeQueryObject(EntityManager entityManager) {
                 return entityManager.createNativeQuery(nativeQuery, resultClass);
@@ -116,7 +116,7 @@ public abstract class QueryBuilder imple
      * @param parameters the parameters to be configured on the query
      * @return this query builder
      */
-    public QueryBuilder parameters(final Collection parameters) {
+    public QueryBuilder parameters(final Collection<?> parameters) {
         checkNoParametersConfigured();
         parameterBuilder = new ParameterBuilder() {
             public void populateQuery(EntityManager entityManager, Query query) {

Modified: camel/trunk/components/camel-jpa/src/main/java/org/apache/camel/component/jpa/TransactionStrategy.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-jpa/src/main/java/org/apache/camel/component/jpa/TransactionStrategy.java?rev=1165193&r1=1165192&r2=1165193&view=diff
==============================================================================
--- camel/trunk/components/camel-jpa/src/main/java/org/apache/camel/component/jpa/TransactionStrategy.java (original)
+++ camel/trunk/components/camel-jpa/src/main/java/org/apache/camel/component/jpa/TransactionStrategy.java Mon Sep  5 07:51:28 2011
@@ -29,5 +29,5 @@ public interface TransactionStrategy {
      * @param callback the callback
      * @return the result
      */
-    Object execute(JpaCallback callback);
+    Object execute(JpaCallback<?> callback);
 }

Modified: camel/trunk/components/camel-jpa/src/main/java/org/apache/camel/processor/idempotent/jpa/JpaMessageIdRepository.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-jpa/src/main/java/org/apache/camel/processor/idempotent/jpa/JpaMessageIdRepository.java?rev=1165193&r1=1165192&r2=1165193&view=diff
==============================================================================
--- camel/trunk/components/camel-jpa/src/main/java/org/apache/camel/processor/idempotent/jpa/JpaMessageIdRepository.java (original)
+++ camel/trunk/components/camel-jpa/src/main/java/org/apache/camel/processor/idempotent/jpa/JpaMessageIdRepository.java Mon Sep  5 07:51:28 2011
@@ -71,12 +71,11 @@ public class JpaMessageIdRepository exte
     }
 
     @ManagedOperation(description = "Adds the key to the store")
-    @SuppressWarnings("unchecked")
     public boolean add(final String messageId) {
         // Run this in single transaction.
-        Boolean rc = (Boolean)transactionTemplate.execute(new TransactionCallback() {
-            public Object doInTransaction(TransactionStatus arg0) {
-                List list = jpaTemplate.find(QUERY_STRING, processorName, messageId);
+        Boolean rc = transactionTemplate.execute(new TransactionCallback<Boolean>() {
+            public Boolean doInTransaction(TransactionStatus arg0) {
+                List<?> list = jpaTemplate.find(QUERY_STRING, processorName, messageId);
                 if (list.isEmpty()) {
                     MessageProcessed processed = new MessageProcessed();
                     processed.setProcessorName(processorName);
@@ -94,12 +93,11 @@ public class JpaMessageIdRepository exte
     }
 
     @ManagedOperation(description = "Does the store contain the given key")
-    @SuppressWarnings("unchecked")
     public boolean contains(final String messageId) {
         // Run this in single transaction.
-        Boolean rc = (Boolean)transactionTemplate.execute(new TransactionCallback() {
-            public Object doInTransaction(TransactionStatus arg0) {
-                List list = jpaTemplate.find(QUERY_STRING, processorName, messageId);
+        Boolean rc = transactionTemplate.execute(new TransactionCallback<Boolean>() {
+            public Boolean doInTransaction(TransactionStatus arg0) {
+                List<?> list = jpaTemplate.find(QUERY_STRING, processorName, messageId);
                 if (list.isEmpty()) {
                     return Boolean.FALSE;
                 } else {
@@ -111,11 +109,10 @@ public class JpaMessageIdRepository exte
     }
 
     @ManagedOperation(description = "Remove the key from the store")
-    @SuppressWarnings("unchecked")
     public boolean remove(final String messageId) {
-        Boolean rc = (Boolean)transactionTemplate.execute(new TransactionCallback() {
-            public Object doInTransaction(TransactionStatus arg0) {
-                List list = jpaTemplate.find(QUERY_STRING, processorName, messageId);
+        Boolean rc = transactionTemplate.execute(new TransactionCallback<Boolean>() {
+            public Boolean doInTransaction(TransactionStatus arg0) {
+                List<?> list = jpaTemplate.find(QUERY_STRING, processorName, messageId);
                 if (list.isEmpty()) {
                     return Boolean.FALSE;
                 } else {

Modified: camel/trunk/components/camel-jpa/src/main/java/org/apache/camel/processor/idempotent/jpa/MessageProcessed.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-jpa/src/main/java/org/apache/camel/processor/idempotent/jpa/MessageProcessed.java?rev=1165193&r1=1165192&r2=1165193&view=diff
==============================================================================
--- camel/trunk/components/camel-jpa/src/main/java/org/apache/camel/processor/idempotent/jpa/MessageProcessed.java (original)
+++ camel/trunk/components/camel-jpa/src/main/java/org/apache/camel/processor/idempotent/jpa/MessageProcessed.java Mon Sep  5 07:51:28 2011
@@ -36,6 +36,8 @@ import javax.persistence.UniqueConstrain
     uniqueConstraints = @UniqueConstraint(columnNames = {"processorName", "messageId"})
 )
 public class MessageProcessed implements Serializable {
+    private static final long serialVersionUID = 5594244386689371118L;
+    
     protected Date createdAt;
     private Long id;
     private String messageId;

Modified: camel/trunk/components/camel-jpa/src/main/java/org/apache/camel/processor/interceptor/jpa/JpaTraceEventMessage.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-jpa/src/main/java/org/apache/camel/processor/interceptor/jpa/JpaTraceEventMessage.java?rev=1165193&r1=1165192&r2=1165193&view=diff
==============================================================================
--- camel/trunk/components/camel-jpa/src/main/java/org/apache/camel/processor/interceptor/jpa/JpaTraceEventMessage.java (original)
+++ camel/trunk/components/camel-jpa/src/main/java/org/apache/camel/processor/interceptor/jpa/JpaTraceEventMessage.java Mon Sep  5 07:51:28 2011
@@ -39,7 +39,8 @@ import org.apache.camel.processor.interc
     name = "CAMEL_MESSAGETRACED"
 )
 public class JpaTraceEventMessage implements TraceEventMessage, Serializable {
-
+    private static final long serialVersionUID = -3577516047575267548L;
+    
     protected Long id;
     protected Date timestamp;
     protected String fromEndpointUri;

Modified: camel/trunk/components/camel-jpa/src/test/java/org/apache/camel/component/jpa/AbstractJpaMethodTest.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-jpa/src/test/java/org/apache/camel/component/jpa/AbstractJpaMethodTest.java?rev=1165193&r1=1165192&r2=1165193&view=diff
==============================================================================
--- camel/trunk/components/camel-jpa/src/test/java/org/apache/camel/component/jpa/AbstractJpaMethodTest.java (original)
+++ camel/trunk/components/camel-jpa/src/test/java/org/apache/camel/component/jpa/AbstractJpaMethodTest.java Mon Sep  5 07:51:28 2011
@@ -78,7 +78,7 @@ public abstract class AbstractJpaMethodT
         assertEquals(customer.getAddress().getAddressLine2(), receivedCustomer.getAddress().getAddressLine2());
         assertNotNull(receivedCustomer.getAddress().getId());
         
-        List results = jpaTemplate.find("select o from " + Customer.class.getName() + " o");
+        List<?> results = jpaTemplate.find("select o from " + Customer.class.getName() + " o");
         assertEquals(1, results.size());
         Customer persistedCustomer = (Customer) results.get(0);
         assertEquals(receivedCustomer.getName(), persistedCustomer.getName());
@@ -99,7 +99,7 @@ public abstract class AbstractJpaMethodT
         exchange.getIn().setBody(customers);
         Exchange returnedExchange = template.send(endpoint, exchange);
         
-        List returnedCustomers = returnedExchange.getIn().getBody(List.class);
+        List<?> returnedCustomers = returnedExchange.getIn().getBody(List.class);
         assertEquals(2, returnedCustomers.size());
         
         assertEntitiesInDatabase(2, Customer.class.getName());
@@ -167,7 +167,7 @@ public abstract class AbstractJpaMethodT
         transactionStrategy = endpoint.createTransactionStrategy();
         jpaTemplate = endpoint.getTemplate();
         
-        transactionStrategy.execute(new JpaCallback() {
+        transactionStrategy.execute(new JpaCallback<Object>() {
             public Object doInJpa(EntityManager entityManager) throws PersistenceException {
                 entityManager.createQuery("delete from " + Customer.class.getName()).executeUpdate();
                 return null;
@@ -179,7 +179,7 @@ public abstract class AbstractJpaMethodT
     }
     
     protected void save(final Customer customer) {
-        transactionStrategy.execute(new JpaCallback() {
+        transactionStrategy.execute(new JpaCallback<Object>() {
             public Object doInJpa(EntityManager entityManager) throws PersistenceException {
                 entityManager.persist(customer);
                 entityManager.flush();
@@ -192,7 +192,7 @@ public abstract class AbstractJpaMethodT
     }
     
     protected void assertEntitiesInDatabase(int count, String entity) {
-        List results = jpaTemplate.find("select o from " + entity + " o");
+        List<?> results = jpaTemplate.find("select o from " + entity + " o");
         assertEquals(count, results.size());
     }
 

Modified: camel/trunk/components/camel-jpa/src/test/java/org/apache/camel/component/jpa/JpaEndpointTest.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-jpa/src/test/java/org/apache/camel/component/jpa/JpaEndpointTest.java?rev=1165193&r1=1165192&r2=1165193&view=diff
==============================================================================
--- camel/trunk/components/camel-jpa/src/test/java/org/apache/camel/component/jpa/JpaEndpointTest.java (original)
+++ camel/trunk/components/camel-jpa/src/test/java/org/apache/camel/component/jpa/JpaEndpointTest.java Mon Sep  5 07:51:28 2011
@@ -41,6 +41,10 @@ public class JpaEndpointTest extends Cam
         assertEquals("camel", jpa.getPersistenceUnit());
     }
 
+    /**
+     * 
+     * @deprecated 
+     */
     @Test
     public void testJpaEndpointCtrUrl() throws Exception {
         JpaEndpoint jpa = new JpaEndpoint("jpa://org.apache.camel.examples.SendEmail");
@@ -53,6 +57,10 @@ public class JpaEndpointTest extends Cam
         assertEquals("camel", jpa.getPersistenceUnit());
     }
 
+    /**
+     * 
+     * @deprecated
+     */
     @Test
     public void testJpaEndpointCtrUrlEMF() throws Exception {
         EntityManagerFactory fac = Persistence.createEntityManagerFactory("camel");
@@ -67,6 +75,10 @@ public class JpaEndpointTest extends Cam
         assertEquals("camel", jpa.getPersistenceUnit());
     }
 
+    /**
+     * 
+     * @deprecated
+     */
     @Test
     public void testJpaEndpointCtrUrlEMFandTM() throws Exception {
         EntityManagerFactory fac = Persistence.createEntityManagerFactory("camel");

Modified: camel/trunk/components/camel-jpa/src/test/java/org/apache/camel/component/jpa/JpaTest.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-jpa/src/test/java/org/apache/camel/component/jpa/JpaTest.java?rev=1165193&r1=1165192&r2=1165193&view=diff
==============================================================================
--- camel/trunk/components/camel-jpa/src/test/java/org/apache/camel/component/jpa/JpaTest.java (original)
+++ camel/trunk/components/camel-jpa/src/test/java/org/apache/camel/component/jpa/JpaTest.java Mon Sep  5 07:51:28 2011
@@ -60,7 +60,7 @@ public class JpaTest extends Assert {
 
     @Test
     public void testProducerInsertsIntoDatabaseThenConsumerFiresMessageExchange() throws Exception {
-        transactionStrategy.execute(new JpaCallback() {
+        transactionStrategy.execute(new JpaCallback<Object>() {
             public Object doInJpa(EntityManager entityManager) throws PersistenceException {
                 // lets delete any exiting records before the test
                 entityManager.createQuery("delete from " + entityName).executeUpdate();
@@ -68,7 +68,7 @@ public class JpaTest extends Assert {
             }
         });
 
-        List results = jpaTemplate.find(queryText);
+        List<?> results = jpaTemplate.find(queryText);
         assertEquals("Should have no results: " + results, 0, results.size());
 
         // lets produce some objects

Modified: camel/trunk/components/camel-jpa/src/test/java/org/apache/camel/component/jpa/JpaUseMergeTest.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-jpa/src/test/java/org/apache/camel/component/jpa/JpaUseMergeTest.java?rev=1165193&r1=1165192&r2=1165193&view=diff
==============================================================================
--- camel/trunk/components/camel-jpa/src/test/java/org/apache/camel/component/jpa/JpaUseMergeTest.java (original)
+++ camel/trunk/components/camel-jpa/src/test/java/org/apache/camel/component/jpa/JpaUseMergeTest.java Mon Sep  5 07:51:28 2011
@@ -42,7 +42,7 @@ public class JpaUseMergeTest extends Abs
         setUp("jpa://" + Customer.class.getName() + "?usePersist=false");
         
         final Customer customer = createDefaultCustomer();
-        transactionStrategy.execute(new JpaCallback() {
+        transactionStrategy.execute(new JpaCallback<Object>() {
             public Object doInJpa(EntityManager entityManager) throws PersistenceException {
                 entityManager.persist(customer);
                 entityManager.flush();
@@ -68,7 +68,7 @@ public class JpaUseMergeTest extends Abs
         assertEquals(customer.getAddress().getAddressLine2(), receivedCustomer.getAddress().getAddressLine2());
         assertNotNull(receivedCustomer.getAddress().getId());
         
-        List results = jpaTemplate.find("select o from " + Customer.class.getName() + " o");
+        List<?> results = jpaTemplate.find("select o from " + Customer.class.getName() + " o");
         assertEquals(1, results.size());
         Customer persistedCustomer = (Customer) results.get(0);
         assertEquals(receivedCustomer.getName(), persistedCustomer.getName());

Modified: camel/trunk/components/camel-jpa/src/test/java/org/apache/camel/component/jpa/JpaWithNamedQueryTest.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-jpa/src/test/java/org/apache/camel/component/jpa/JpaWithNamedQueryTest.java?rev=1165193&r1=1165192&r2=1165193&view=diff
==============================================================================
--- camel/trunk/components/camel-jpa/src/test/java/org/apache/camel/component/jpa/JpaWithNamedQueryTest.java (original)
+++ camel/trunk/components/camel-jpa/src/test/java/org/apache/camel/component/jpa/JpaWithNamedQueryTest.java Mon Sep  5 07:51:28 2011
@@ -61,7 +61,7 @@ public class JpaWithNamedQueryTest exten
 
     @Test
     public void testProducerInsertsIntoDatabaseThenConsumerFiresMessageExchange() throws Exception {
-        transactionStrategy.execute(new JpaCallback() {
+        transactionStrategy.execute(new JpaCallback<Object>() {
             public Object doInJpa(EntityManager entityManager) throws PersistenceException {
                 // lets delete any exiting records before the test
                 entityManager.createQuery("delete from " + entityName).executeUpdate();
@@ -74,7 +74,7 @@ public class JpaWithNamedQueryTest exten
             }
         });
 
-        List results = jpaTemplate.find(queryText);
+        List<?> results = jpaTemplate.find(queryText);
         assertEquals("Should have no results: " + results, 0, results.size());
 
         // lets produce some objects
@@ -109,16 +109,17 @@ public class JpaWithNamedQueryTest exten
         // we need to sleep as we will be invoked from inside the transaction!
         Thread.sleep(1000);
 
-        transactionStrategy.execute(new JpaCallback() {
-            @SuppressWarnings("unchecked")
+        transactionStrategy.execute(new JpaCallback<Object>() {
             public Object doInJpa(EntityManager entityManager) throws PersistenceException {
 
                 // now lets assert that there are still 2 entities left
-                List<MultiSteps> rows = entityManager.createQuery("select x from MultiSteps x").getResultList();
+                List<?> rows = entityManager.createQuery("select x from MultiSteps x").getResultList();
                 assertEquals("Number of entities: " + rows, 2, rows.size());
 
                 int counter = 1;
-                for (MultiSteps row : rows) {
+                for (Object rowObj : rows) {
+                    assertTrue("Rows are not instances of MultiSteps",  rowObj instanceof MultiSteps);
+                    final MultiSteps row = (MultiSteps) rowObj;
                     LOG.info("entity: " + counter++ + " = " + row);
 
                     if (row.getAddress().equals("foo@bar.com")) {

Modified: camel/trunk/components/camel-jpa/src/test/java/org/apache/camel/component/jpa/QueryBuilderTest.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-jpa/src/test/java/org/apache/camel/component/jpa/QueryBuilderTest.java?rev=1165193&r1=1165192&r2=1165193&view=diff
==============================================================================
--- camel/trunk/components/camel-jpa/src/test/java/org/apache/camel/component/jpa/QueryBuilderTest.java (original)
+++ camel/trunk/components/camel-jpa/src/test/java/org/apache/camel/component/jpa/QueryBuilderTest.java Mon Sep  5 07:51:28 2011
@@ -66,5 +66,4 @@ public class QueryBuilderTest extends Ca
         assertEquals("Query: select x from SendEmail x where x.id = :a Parameters: {a=1}", q.toString());
     }
 
-
 }

Modified: camel/trunk/components/camel-jpa/src/test/java/org/apache/camel/processor/interceptor/JpaTraceEventMessageTest.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-jpa/src/test/java/org/apache/camel/processor/interceptor/JpaTraceEventMessageTest.java?rev=1165193&r1=1165192&r2=1165193&view=diff
==============================================================================
--- camel/trunk/components/camel-jpa/src/test/java/org/apache/camel/processor/interceptor/JpaTraceEventMessageTest.java (original)
+++ camel/trunk/components/camel-jpa/src/test/java/org/apache/camel/processor/interceptor/JpaTraceEventMessageTest.java Mon Sep  5 07:51:28 2011
@@ -79,7 +79,7 @@ public class JpaTraceEventMessageTest ex
     private void assertEntityInDB() throws Exception {
         jpaTemplate = (JpaTemplate)applicationContext.getBean("jpaTemplate", JpaTemplate.class);
 
-        List list = jpaTemplate.find(SELECT_ALL_STRING);
+        List<?> list = jpaTemplate.find(SELECT_ALL_STRING);
         assertEquals(1, list.size());
         
         JpaTraceEventMessage db = (JpaTraceEventMessage) list.get(0);
@@ -89,7 +89,6 @@ public class JpaTraceEventMessageTest ex
         assertEquals("foo", db.getRouteId());
     }
 
-    @SuppressWarnings("unchecked")
     protected void cleanupRepository() {
         jpaTemplate = (JpaTemplate)applicationContext.getBean("jpaTemplate", JpaTemplate.class);
 
@@ -97,9 +96,9 @@ public class JpaTraceEventMessageTest ex
         transactionTemplate.setTransactionManager(new JpaTransactionManager(jpaTemplate.getEntityManagerFactory()));
         transactionTemplate.setPropagationBehavior(TransactionDefinition.PROPAGATION_REQUIRED);
 
-        transactionTemplate.execute(new TransactionCallback() {
+        transactionTemplate.execute(new TransactionCallback<Object>() {
             public Object doInTransaction(TransactionStatus arg0) {
-                List list = jpaTemplate.find(SELECT_ALL_STRING);
+                List<?> list = jpaTemplate.find(SELECT_ALL_STRING);
                 for (Object item : list) {
                     jpaTemplate.remove(item);
                 }

Modified: camel/trunk/components/camel-jpa/src/test/java/org/apache/camel/processor/jpa/FileConsumerJpaIdempotentTest.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-jpa/src/test/java/org/apache/camel/processor/jpa/FileConsumerJpaIdempotentTest.java?rev=1165193&r1=1165192&r2=1165193&view=diff
==============================================================================
--- camel/trunk/components/camel-jpa/src/test/java/org/apache/camel/processor/jpa/FileConsumerJpaIdempotentTest.java (original)
+++ camel/trunk/components/camel-jpa/src/test/java/org/apache/camel/processor/jpa/FileConsumerJpaIdempotentTest.java Mon Sep  5 07:51:28 2011
@@ -71,17 +71,16 @@ public class FileConsumerJpaIdempotentTe
         };
     }
 
-    @SuppressWarnings("unchecked")
     protected void cleanupRepository() {
-        jpaTemplate = (JpaTemplate)applicationContext.getBean("jpaTemplate", JpaTemplate.class);
+        jpaTemplate = applicationContext.getBean("jpaTemplate", JpaTemplate.class);
 
         TransactionTemplate transactionTemplate = new TransactionTemplate();
         transactionTemplate.setTransactionManager(new JpaTransactionManager(jpaTemplate.getEntityManagerFactory()));
         transactionTemplate.setPropagationBehavior(TransactionDefinition.PROPAGATION_REQUIRED);
 
-        transactionTemplate.execute(new TransactionCallback() {
+        transactionTemplate.execute(new TransactionCallback<Object>() {
             public Object doInTransaction(TransactionStatus arg0) {
-                List list = jpaTemplate.find(SELECT_ALL_STRING, PROCESSOR_NAME);
+                List<?> list = jpaTemplate.find(SELECT_ALL_STRING, PROCESSOR_NAME);
                 for (Object item : list) {
                     jpaTemplate.remove(item);
                 }

Modified: camel/trunk/components/camel-jpa/src/test/java/org/apache/camel/processor/jpa/JpaBatchConsumerTest.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-jpa/src/test/java/org/apache/camel/processor/jpa/JpaBatchConsumerTest.java?rev=1165193&r1=1165192&r2=1165193&view=diff
==============================================================================
--- camel/trunk/components/camel-jpa/src/test/java/org/apache/camel/processor/jpa/JpaBatchConsumerTest.java (original)
+++ camel/trunk/components/camel-jpa/src/test/java/org/apache/camel/processor/jpa/JpaBatchConsumerTest.java Mon Sep  5 07:51:28 2011
@@ -79,7 +79,6 @@ public class JpaBatchConsumerTest extend
         return SpringCamelContext.springCamelContext(applicationContext);
     }
 
-    @SuppressWarnings("unchecked")
     protected void cleanupRepository() {
         jpaTemplate = (JpaTemplate)applicationContext.getBean("jpaTemplate", JpaTemplate.class);
 
@@ -87,9 +86,9 @@ public class JpaBatchConsumerTest extend
         transactionTemplate.setTransactionManager(new JpaTransactionManager(jpaTemplate.getEntityManagerFactory()));
         transactionTemplate.setPropagationBehavior(TransactionDefinition.PROPAGATION_REQUIRED);
 
-        transactionTemplate.execute(new TransactionCallback() {
+        transactionTemplate.execute(new TransactionCallback<Object>() {
             public Object doInTransaction(TransactionStatus arg0) {
-                List list = jpaTemplate.find(SELECT_ALL_STRING);
+                List<?> list = jpaTemplate.find(SELECT_ALL_STRING);
                 for (Object item : list) {
                     jpaTemplate.remove(item);
                 }

Modified: camel/trunk/components/camel-jpa/src/test/java/org/apache/camel/processor/jpa/JpaFlushOnSendTest.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-jpa/src/test/java/org/apache/camel/processor/jpa/JpaFlushOnSendTest.java?rev=1165193&r1=1165192&r2=1165193&view=diff
==============================================================================
--- camel/trunk/components/camel-jpa/src/test/java/org/apache/camel/processor/jpa/JpaFlushOnSendTest.java (original)
+++ camel/trunk/components/camel-jpa/src/test/java/org/apache/camel/processor/jpa/JpaFlushOnSendTest.java Mon Sep  5 07:51:28 2011
@@ -72,15 +72,14 @@ public class JpaFlushOnSendTest extends 
     }
 
     private void assertEntityInDB() throws Exception {
-        jpaTemplate = (JpaTemplate)applicationContext.getBean("jpaTemplate", JpaTemplate.class);
+        jpaTemplate = applicationContext.getBean("jpaTemplate", JpaTemplate.class);
 
-        List list = jpaTemplate.find(SELECT_ALL_STRING);
+        List<?> list = jpaTemplate.find(SELECT_ALL_STRING);
         assertEquals(1, list.size());
 
         assertIsInstanceOf(SendEmail.class, list.get(0));
     }
 
-    @SuppressWarnings("unchecked")
     protected void cleanupRepository() {
         jpaTemplate = (JpaTemplate)applicationContext.getBean("jpaTemplate", JpaTemplate.class);
 
@@ -88,9 +87,9 @@ public class JpaFlushOnSendTest extends 
         transactionTemplate.setTransactionManager(new JpaTransactionManager(jpaTemplate.getEntityManagerFactory()));
         transactionTemplate.setPropagationBehavior(TransactionDefinition.PROPAGATION_REQUIRED);
 
-        transactionTemplate.execute(new TransactionCallback() {
+        transactionTemplate.execute(new TransactionCallback<Object>() {
             public Object doInTransaction(TransactionStatus arg0) {
-                List list = jpaTemplate.find(SELECT_ALL_STRING);
+                List<?> list = jpaTemplate.find(SELECT_ALL_STRING);
                 for (Object item : list) {
                     jpaTemplate.remove(item);
                 }

Modified: camel/trunk/components/camel-jpa/src/test/java/org/apache/camel/processor/jpa/JpaIdempotentConsumerTest.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-jpa/src/test/java/org/apache/camel/processor/jpa/JpaIdempotentConsumerTest.java?rev=1165193&r1=1165192&r2=1165193&view=diff
==============================================================================
--- camel/trunk/components/camel-jpa/src/test/java/org/apache/camel/processor/jpa/JpaIdempotentConsumerTest.java (original)
+++ camel/trunk/components/camel-jpa/src/test/java/org/apache/camel/processor/jpa/JpaIdempotentConsumerTest.java Mon Sep  5 07:51:28 2011
@@ -67,17 +67,16 @@ public class JpaIdempotentConsumerTest e
         return false;
     }
 
-    @SuppressWarnings("unchecked")
     protected void cleanupRepository() {
-        jpaTemplate = (JpaTemplate)applicationContext.getBean("jpaTemplate", JpaTemplate.class);
+        jpaTemplate = applicationContext.getBean("jpaTemplate", JpaTemplate.class);
 
         TransactionTemplate transactionTemplate = new TransactionTemplate();
         transactionTemplate.setTransactionManager(new JpaTransactionManager(jpaTemplate.getEntityManagerFactory()));
         transactionTemplate.setPropagationBehavior(TransactionDefinition.PROPAGATION_REQUIRED);
 
-        transactionTemplate.execute(new TransactionCallback() {
+        transactionTemplate.execute(new TransactionCallback<Object>() {
             public Object doInTransaction(TransactionStatus arg0) {
-                List list = jpaTemplate.find(SELECT_ALL_STRING, PROCESSOR_NAME);
+                List<?> list = jpaTemplate.find(SELECT_ALL_STRING, PROCESSOR_NAME);
                 for (Object item : list) {
                     jpaTemplate.remove(item);
                 }

Modified: camel/trunk/components/camel-jpa/src/test/java/org/apache/camel/processor/jpa/JpaProducerConcurrentTest.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-jpa/src/test/java/org/apache/camel/processor/jpa/JpaProducerConcurrentTest.java?rev=1165193&r1=1165192&r2=1165193&view=diff
==============================================================================
--- camel/trunk/components/camel-jpa/src/test/java/org/apache/camel/processor/jpa/JpaProducerConcurrentTest.java (original)
+++ camel/trunk/components/camel-jpa/src/test/java/org/apache/camel/processor/jpa/JpaProducerConcurrentTest.java Mon Sep  5 07:51:28 2011
@@ -64,10 +64,10 @@ public class JpaProducerConcurrentTest e
         getMockEndpoint("mock:result").assertNoDuplicates(body());
 
         ExecutorService executor = Executors.newFixedThreadPool(poolSize);
-        Map<Integer, Future> responses = new ConcurrentHashMap<Integer, Future>();
+        Map<Integer, Future<Object>> responses = new ConcurrentHashMap<Integer, Future<Object>>();
         for (int i = 0; i < files; i++) {
             final int index = i;
-            Future out = executor.submit(new Callable<Object>() {
+            Future<Object> out = executor.submit(new Callable<Object>() {
                 public Object call() throws Exception {
                     template.sendBody("direct:start", new SendEmail("user" + index + "@somewhere.org"));
                     return null;
@@ -81,7 +81,7 @@ public class JpaProducerConcurrentTest e
         assertEquals(files, responses.size());
 
         // get them so they are complete
-        for (Future future : responses.values()) {
+        for (Future<Object> future : responses.values()) {
             future.get();
         }
 
@@ -107,25 +107,24 @@ public class JpaProducerConcurrentTest e
     }
 
     private void assertEntityInDB(int number) throws Exception {
-        jpaTemplate = (JpaTemplate)applicationContext.getBean("jpaTemplate", JpaTemplate.class);
+        jpaTemplate = applicationContext.getBean("jpaTemplate", JpaTemplate.class);
 
-        List list = jpaTemplate.find(SELECT_ALL_STRING);
+        List<?> list = jpaTemplate.find(SELECT_ALL_STRING);
         assertEquals(number, list.size());
 
         assertIsInstanceOf(SendEmail.class, list.get(0));
     }
 
-    @SuppressWarnings("unchecked")
     protected void cleanupRepository() {
-        jpaTemplate = (JpaTemplate)applicationContext.getBean("jpaTemplate", JpaTemplate.class);
+        jpaTemplate = applicationContext.getBean("jpaTemplate", JpaTemplate.class);
 
         TransactionTemplate transactionTemplate = new TransactionTemplate();
         transactionTemplate.setTransactionManager(new JpaTransactionManager(jpaTemplate.getEntityManagerFactory()));
         transactionTemplate.setPropagationBehavior(TransactionDefinition.PROPAGATION_REQUIRED);
 
-        transactionTemplate.execute(new TransactionCallback() {
+        transactionTemplate.execute(new TransactionCallback<Object>() {
             public Object doInTransaction(TransactionStatus arg0) {
-                List list = jpaTemplate.find(SELECT_ALL_STRING);
+                List<?> list = jpaTemplate.find(SELECT_ALL_STRING);
                 for (Object item : list) {
                     jpaTemplate.remove(item);
                 }

Modified: camel/trunk/components/camel-jpa/src/test/java/org/apache/camel/processor/jpa/JpaProducerNoBodyTest.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-jpa/src/test/java/org/apache/camel/processor/jpa/JpaProducerNoBodyTest.java?rev=1165193&r1=1165192&r2=1165193&view=diff
==============================================================================
--- camel/trunk/components/camel-jpa/src/test/java/org/apache/camel/processor/jpa/JpaProducerNoBodyTest.java (original)
+++ camel/trunk/components/camel-jpa/src/test/java/org/apache/camel/processor/jpa/JpaProducerNoBodyTest.java Mon Sep  5 07:51:28 2011
@@ -72,17 +72,16 @@ public class JpaProducerNoBodyTest exten
         };
     }
 
-    @SuppressWarnings("unchecked")
     protected void cleanupRepository() {
-        jpaTemplate = (JpaTemplate)applicationContext.getBean("jpaTemplate", JpaTemplate.class);
+        jpaTemplate = applicationContext.getBean("jpaTemplate", JpaTemplate.class);
 
         TransactionTemplate transactionTemplate = new TransactionTemplate();
         transactionTemplate.setTransactionManager(new JpaTransactionManager(jpaTemplate.getEntityManagerFactory()));
         transactionTemplate.setPropagationBehavior(TransactionDefinition.PROPAGATION_REQUIRED);
 
-        transactionTemplate.execute(new TransactionCallback() {
+        transactionTemplate.execute(new TransactionCallback<Object>() {
             public Object doInTransaction(TransactionStatus arg0) {
-                List list = jpaTemplate.find(SELECT_ALL_STRING);
+                List<?> list = jpaTemplate.find(SELECT_ALL_STRING);
                 for (Object item : list) {
                     jpaTemplate.remove(item);
                 }

Modified: camel/trunk/components/camel-jpa/src/test/java/org/apache/camel/processor/jpa/JpaRouteConsumeLockEntityTest.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-jpa/src/test/java/org/apache/camel/processor/jpa/JpaRouteConsumeLockEntityTest.java?rev=1165193&r1=1165192&r2=1165193&view=diff
==============================================================================
--- camel/trunk/components/camel-jpa/src/test/java/org/apache/camel/processor/jpa/JpaRouteConsumeLockEntityTest.java (original)
+++ camel/trunk/components/camel-jpa/src/test/java/org/apache/camel/processor/jpa/JpaRouteConsumeLockEntityTest.java Mon Sep  5 07:51:28 2011
@@ -72,17 +72,16 @@ public class JpaRouteConsumeLockEntityTe
         };
     }
 
-    @SuppressWarnings("unchecked")
     protected void cleanupRepository() {
-        jpaTemplate = (JpaTemplate)applicationContext.getBean("jpaTemplate", JpaTemplate.class);
+        jpaTemplate = applicationContext.getBean("jpaTemplate", JpaTemplate.class);
 
         TransactionTemplate transactionTemplate = new TransactionTemplate();
         transactionTemplate.setTransactionManager(new JpaTransactionManager(jpaTemplate.getEntityManagerFactory()));
         transactionTemplate.setPropagationBehavior(TransactionDefinition.PROPAGATION_REQUIRED);
 
-        transactionTemplate.execute(new TransactionCallback() {
+        transactionTemplate.execute(new TransactionCallback<Object>() {
             public Object doInTransaction(TransactionStatus arg0) {
-                List list = jpaTemplate.find(SELECT_ALL_STRING);
+                List<?> list = jpaTemplate.find(SELECT_ALL_STRING);
                 for (Object item : list) {
                     jpaTemplate.remove(item);
                 }

Modified: camel/trunk/components/camel-jpa/src/test/java/org/apache/camel/processor/jpa/JpaRouteMaximumResultsTest.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-jpa/src/test/java/org/apache/camel/processor/jpa/JpaRouteMaximumResultsTest.java?rev=1165193&r1=1165192&r2=1165193&view=diff
==============================================================================
--- camel/trunk/components/camel-jpa/src/test/java/org/apache/camel/processor/jpa/JpaRouteMaximumResultsTest.java (original)
+++ camel/trunk/components/camel-jpa/src/test/java/org/apache/camel/processor/jpa/JpaRouteMaximumResultsTest.java Mon Sep  5 07:51:28 2011
@@ -79,25 +79,24 @@ public class JpaRouteMaximumResultsTest 
     }
 
     private void assertEntityInDB() throws Exception {
-        jpaTemplate = (JpaTemplate)applicationContext.getBean("jpaTemplate", JpaTemplate.class);
+        jpaTemplate = applicationContext.getBean("jpaTemplate", JpaTemplate.class);
 
-        List list = jpaTemplate.find(SELECT_ALL_STRING);
+        List<?> list = jpaTemplate.find(SELECT_ALL_STRING);
         assertEquals(3, list.size());
 
         assertIsInstanceOf(SendEmail.class, list.get(0));
     }
 
-    @SuppressWarnings("unchecked")
     protected void cleanupRepository() {
-        jpaTemplate = (JpaTemplate)applicationContext.getBean("jpaTemplate", JpaTemplate.class);
+        jpaTemplate = applicationContext.getBean("jpaTemplate", JpaTemplate.class);
 
         TransactionTemplate transactionTemplate = new TransactionTemplate();
         transactionTemplate.setTransactionManager(new JpaTransactionManager(jpaTemplate.getEntityManagerFactory()));
         transactionTemplate.setPropagationBehavior(TransactionDefinition.PROPAGATION_REQUIRED);
 
-        transactionTemplate.execute(new TransactionCallback() {
+        transactionTemplate.execute(new TransactionCallback<Object>() {
             public Object doInTransaction(TransactionStatus arg0) {
-                List list = jpaTemplate.find(SELECT_ALL_STRING);
+                List<?> list = jpaTemplate.find(SELECT_ALL_STRING);
                 for (Object item : list) {
                     jpaTemplate.remove(item);
                 }

Modified: camel/trunk/components/camel-jpa/src/test/java/org/apache/camel/processor/jpa/JpaRouteTest.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-jpa/src/test/java/org/apache/camel/processor/jpa/JpaRouteTest.java?rev=1165193&r1=1165192&r2=1165193&view=diff
==============================================================================
--- camel/trunk/components/camel-jpa/src/test/java/org/apache/camel/processor/jpa/JpaRouteTest.java (original)
+++ camel/trunk/components/camel-jpa/src/test/java/org/apache/camel/processor/jpa/JpaRouteTest.java Mon Sep  5 07:51:28 2011
@@ -78,25 +78,24 @@ public class JpaRouteTest extends CamelT
     }
 
     private void assertEntityInDB() throws Exception {
-        jpaTemplate = (JpaTemplate)applicationContext.getBean("jpaTemplate", JpaTemplate.class);
+        jpaTemplate = applicationContext.getBean("jpaTemplate", JpaTemplate.class);
 
-        List list = jpaTemplate.find(SELECT_ALL_STRING);
+        List<?> list = jpaTemplate.find(SELECT_ALL_STRING);
         assertEquals(1, list.size());
         
         assertIsInstanceOf(SendEmail.class, list.get(0));
     }
 
-    @SuppressWarnings("unchecked")
     protected void cleanupRepository() {
-        jpaTemplate = (JpaTemplate)applicationContext.getBean("jpaTemplate", JpaTemplate.class);
+        jpaTemplate = applicationContext.getBean("jpaTemplate", JpaTemplate.class);
 
         TransactionTemplate transactionTemplate = new TransactionTemplate();
         transactionTemplate.setTransactionManager(new JpaTransactionManager(jpaTemplate.getEntityManagerFactory()));
         transactionTemplate.setPropagationBehavior(TransactionDefinition.PROPAGATION_REQUIRED);
 
-        transactionTemplate.execute(new TransactionCallback() {
+        transactionTemplate.execute(new TransactionCallback<Object>() {
             public Object doInTransaction(TransactionStatus arg0) {
-                List list = jpaTemplate.find(SELECT_ALL_STRING);
+                List<?> list = jpaTemplate.find(SELECT_ALL_STRING);
                 for (Object item : list) {
                     jpaTemplate.remove(item);
                 }

Modified: camel/trunk/components/camel-jpa/src/test/java/org/apache/camel/processor/jpa/JpaRoutemaxMessagesPerPollTest.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-jpa/src/test/java/org/apache/camel/processor/jpa/JpaRoutemaxMessagesPerPollTest.java?rev=1165193&r1=1165192&r2=1165193&view=diff
==============================================================================
--- camel/trunk/components/camel-jpa/src/test/java/org/apache/camel/processor/jpa/JpaRoutemaxMessagesPerPollTest.java (original)
+++ camel/trunk/components/camel-jpa/src/test/java/org/apache/camel/processor/jpa/JpaRoutemaxMessagesPerPollTest.java Mon Sep  5 07:51:28 2011
@@ -76,25 +76,24 @@ public class JpaRoutemaxMessagesPerPollT
     }
 
     private void assertEntityInDB() throws Exception {
-        jpaTemplate = (JpaTemplate)applicationContext.getBean("jpaTemplate", JpaTemplate.class);
+        jpaTemplate = applicationContext.getBean("jpaTemplate", JpaTemplate.class);
 
-        List list = jpaTemplate.find(SELECT_ALL_STRING);
+        List<?> list = jpaTemplate.find(SELECT_ALL_STRING);
         assertEquals(3, list.size());
 
         assertIsInstanceOf(SendEmail.class, list.get(0));
     }
 
-    @SuppressWarnings("unchecked")
     protected void cleanupRepository() {
-        jpaTemplate = (JpaTemplate)applicationContext.getBean("jpaTemplate", JpaTemplate.class);
+        jpaTemplate = applicationContext.getBean("jpaTemplate", JpaTemplate.class);
 
         TransactionTemplate transactionTemplate = new TransactionTemplate();
         transactionTemplate.setTransactionManager(new JpaTransactionManager(jpaTemplate.getEntityManagerFactory()));
         transactionTemplate.setPropagationBehavior(TransactionDefinition.PROPAGATION_REQUIRED);
 
-        transactionTemplate.execute(new TransactionCallback() {
+        transactionTemplate.execute(new TransactionCallback<Object>() {
             public Object doInTransaction(TransactionStatus arg0) {
-                List list = jpaTemplate.find(SELECT_ALL_STRING);
+                List<?> list = jpaTemplate.find(SELECT_ALL_STRING);
                 for (Object item : list) {
                     jpaTemplate.remove(item);
                 }



Mime
View raw message