camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cmuel...@apache.org
Subject svn commit: r1073186 [1/2] - in /camel/trunk: apache-camel/ apache-camel/src/main/descriptors/ components/ components/camel-jdbc-aggregator/ components/camel-jdbc-aggregator/src/main/java/org/apache/camel/component/jdbc/aggregationrepository/ component...
Date Mon, 21 Feb 2011 23:27:41 GMT
Author: cmueller
Date: Mon Feb 21 23:27:38 2011
New Revision: 1073186

URL: http://svn.apache.org/viewvc?rev=1073186&view=rev
Log:
CAMEL-3649: Move the camel-jdbc-aggregator into camel-sql

Added:
    camel/trunk/components/camel-sql/src/main/java/org/apache/camel/processor/aggregate/
    camel/trunk/components/camel-sql/src/main/java/org/apache/camel/processor/aggregate/jdbc/
    camel/trunk/components/camel-sql/src/main/java/org/apache/camel/processor/aggregate/jdbc/ClassLoadingAwareObjectInputStream.java
      - copied, changed from r1073182, camel/trunk/components/camel-jdbc-aggregator/src/main/java/org/apache/camel/component/jdbc/aggregationrepository/ClassLoadingAwareObjectInputStream.java
    camel/trunk/components/camel-sql/src/main/java/org/apache/camel/processor/aggregate/jdbc/JdbcAggregationRepository.java
      - copied, changed from r1073182, camel/trunk/components/camel-jdbc-aggregator/src/main/java/org/apache/camel/component/jdbc/aggregationrepository/JdbcAggregationRepository.java
    camel/trunk/components/camel-sql/src/main/java/org/apache/camel/processor/aggregate/jdbc/JdbcCamelCodec.java
      - copied, changed from r1073182, camel/trunk/components/camel-jdbc-aggregator/src/main/java/org/apache/camel/component/jdbc/aggregationrepository/JdbcCamelCodec.java
    camel/trunk/components/camel-sql/src/test/java/org/apache/camel/processor/aggregate/
    camel/trunk/components/camel-sql/src/test/java/org/apache/camel/processor/aggregate/jdbc/
    camel/trunk/components/camel-sql/src/test/java/org/apache/camel/processor/aggregate/jdbc/AbstractJdbcAggregationTestSupport.java
      - copied, changed from r1073182, camel/trunk/components/camel-jdbc-aggregator/src/test/java/org/apache/camel/component/jdbc/aggregationrepository/JdbcAggregateTest.java
    camel/trunk/components/camel-sql/src/test/java/org/apache/camel/processor/aggregate/jdbc/JdbcAggregateCompletionIntervalTest.java
    camel/trunk/components/camel-sql/src/test/java/org/apache/camel/processor/aggregate/jdbc/JdbcAggregateConcurrentDifferentGroupsTest.java
    camel/trunk/components/camel-sql/src/test/java/org/apache/camel/processor/aggregate/jdbc/JdbcAggregateConcurrentSameGroupTest.java
    camel/trunk/components/camel-sql/src/test/java/org/apache/camel/processor/aggregate/jdbc/JdbcAggregateDiscardOnTimeoutTest.java
      - copied, changed from r1073182, camel/trunk/components/camel-jdbc-aggregator/src/test/java/org/apache/camel/component/jdbc/aggregationrepository/JdbcAggregateDiscardOnTimeoutTest.java
    camel/trunk/components/camel-sql/src/test/java/org/apache/camel/processor/aggregate/jdbc/JdbcAggregateLoadAndRecoverTest.java
      - copied, changed from r1073182, camel/trunk/components/camel-jdbc-aggregator/src/test/java/org/apache/camel/component/jdbc/aggregationrepository/JdbcAggregateLoadAndRecoverTest.java
    camel/trunk/components/camel-sql/src/test/java/org/apache/camel/processor/aggregate/jdbc/JdbcAggregateLoadConcurrentTest.java
      - copied, changed from r1073182, camel/trunk/components/camel-jdbc-aggregator/src/test/java/org/apache/camel/component/jdbc/aggregationrepository/JdbcAggregateLoadConcurrentTest.java
    camel/trunk/components/camel-sql/src/test/java/org/apache/camel/processor/aggregate/jdbc/JdbcAggregateLoadTest.java
      - copied, changed from r1073182, camel/trunk/components/camel-jdbc-aggregator/src/test/java/org/apache/camel/component/jdbc/aggregationrepository/JdbcAggregateLoadTest.java
    camel/trunk/components/camel-sql/src/test/java/org/apache/camel/processor/aggregate/jdbc/JdbcAggregateNotLostRemovedWhenConfirmedTest.java
      - copied, changed from r1073182, camel/trunk/components/camel-jdbc-aggregator/src/test/java/org/apache/camel/component/jdbc/aggregationrepository/JdbcAggregateNotLostRemovedWhenConfirmedTest.java
    camel/trunk/components/camel-sql/src/test/java/org/apache/camel/processor/aggregate/jdbc/JdbcAggregateNotLostTest.java
      - copied, changed from r1073182, camel/trunk/components/camel-jdbc-aggregator/src/test/java/org/apache/camel/component/jdbc/aggregationrepository/JdbcAggregateNotLostTest.java
    camel/trunk/components/camel-sql/src/test/java/org/apache/camel/processor/aggregate/jdbc/JdbcAggregateRecoverDeadLetterChannelFailedTest.java
      - copied, changed from r1073182, camel/trunk/components/camel-jdbc-aggregator/src/test/java/org/apache/camel/component/jdbc/aggregationrepository/JdbcAggregateRecoverDeadLetterChannelFailedTest.java
    camel/trunk/components/camel-sql/src/test/java/org/apache/camel/processor/aggregate/jdbc/JdbcAggregateRecoverDeadLetterChannelTest.java
      - copied, changed from r1073182, camel/trunk/components/camel-jdbc-aggregator/src/test/java/org/apache/camel/component/jdbc/aggregationrepository/JdbcAggregateRecoverDeadLetterChannelTest.java
    camel/trunk/components/camel-sql/src/test/java/org/apache/camel/processor/aggregate/jdbc/JdbcAggregateRecoverTest.java
      - copied, changed from r1073182, camel/trunk/components/camel-jdbc-aggregator/src/test/java/org/apache/camel/component/jdbc/aggregationrepository/JdbcAggregateRecoverTest.java
    camel/trunk/components/camel-sql/src/test/java/org/apache/camel/processor/aggregate/jdbc/JdbcAggregateRecoverWithRedeliveryPolicyTest.java
      - copied, changed from r1073182, camel/trunk/components/camel-jdbc-aggregator/src/test/java/org/apache/camel/component/jdbc/aggregationrepository/JdbcAggregateRecoverWithRedeliveryPolicyTest.java
    camel/trunk/components/camel-sql/src/test/java/org/apache/camel/processor/aggregate/jdbc/JdbcAggregateRecoverWithSedaTest.java
      - copied, changed from r1073182, camel/trunk/components/camel-jdbc-aggregator/src/test/java/org/apache/camel/component/jdbc/aggregationrepository/JdbcAggregateRecoverWithSedaTest.java
    camel/trunk/components/camel-sql/src/test/java/org/apache/camel/processor/aggregate/jdbc/JdbcAggregateTest.java
      - copied, changed from r1073182, camel/trunk/components/camel-jdbc-aggregator/src/test/java/org/apache/camel/component/jdbc/aggregationrepository/JdbcAggregateTest.java
    camel/trunk/components/camel-sql/src/test/java/org/apache/camel/processor/aggregate/jdbc/JdbcAggregationRepositoryAlotDataTest.java
      - copied, changed from r1073182, camel/trunk/components/camel-jdbc-aggregator/src/test/java/org/apache/camel/component/jdbc/aggregationrepository/JdbcAggregationRepositoryAlotDataTest.java
    camel/trunk/components/camel-sql/src/test/java/org/apache/camel/processor/aggregate/jdbc/JdbcAggregationRepositoryMultipleRepoTest.java
      - copied, changed from r1073182, camel/trunk/components/camel-jdbc-aggregator/src/test/java/org/apache/camel/component/jdbc/aggregationrepository/JdbcAggregationRepositoryMultipleRepoTest.java
    camel/trunk/components/camel-sql/src/test/java/org/apache/camel/processor/aggregate/jdbc/JdbcAggregationRepositoryRecoverExistingTest.java
      - copied, changed from r1073182, camel/trunk/components/camel-jdbc-aggregator/src/test/java/org/apache/camel/component/jdbc/aggregationrepository/JdbcAggregationRepositoryRecoverExistingTest.java
    camel/trunk/components/camel-sql/src/test/java/org/apache/camel/processor/aggregate/jdbc/JdbcAggregationRepositoryTest.java
      - copied, changed from r1073182, camel/trunk/components/camel-jdbc-aggregator/src/test/java/org/apache/camel/component/jdbc/aggregationrepository/JdbcAggregationRepositoryTest.java
    camel/trunk/components/camel-sql/src/test/java/org/apache/camel/processor/aggregate/jdbc/JdbcExchangeSerializationTest.java
      - copied, changed from r1073182, camel/trunk/components/camel-jdbc-aggregator/src/test/java/org/apache/camel/component/jdbc/aggregationrepository/JdbcExchangeSerializationTest.java
    camel/trunk/components/camel-sql/src/test/java/org/apache/camel/processor/aggregate/jdbc/JdbcGetNotFoundTest.java
      - copied, changed from r1073182, camel/trunk/components/camel-jdbc-aggregator/src/test/java/org/apache/camel/component/jdbc/aggregationrepository/JdbcGetNotFoundTest.java
    camel/trunk/components/camel-sql/src/test/java/org/apache/camel/processor/aggregate/jdbc/JdbcGrowIssueTest.java
      - copied, changed from r1073182, camel/trunk/components/camel-jdbc-aggregator/src/test/java/org/apache/camel/component/jdbc/aggregationrepository/JdbcGrowIssueTest.java
    camel/trunk/components/camel-sql/src/test/java/org/apache/camel/processor/aggregate/jdbc/JdbcSpringAggregateRecoverWithRedeliveryPolicyTest.java
      - copied, changed from r1073182, camel/trunk/components/camel-jdbc-aggregator/src/test/java/org/apache/camel/component/jdbc/aggregationrepository/JdbcSpringAggregateRecoverWithRedeliveryPolicyTest.java
    camel/trunk/components/camel-sql/src/test/java/org/apache/camel/processor/aggregate/jdbc/JdbcSpringAggregateTest.java
      - copied, changed from r1073182, camel/trunk/components/camel-jdbc-aggregator/src/test/java/org/apache/camel/component/jdbc/aggregationrepository/JdbcSpringAggregateTest.java
    camel/trunk/components/camel-sql/src/test/resources/jndi.properties
      - copied, changed from r1073182, camel/trunk/components/camel-jdbc-aggregator/src/test/resources/jndi.properties
    camel/trunk/components/camel-sql/src/test/resources/org/apache/camel/processor/aggregate/
    camel/trunk/components/camel-sql/src/test/resources/org/apache/camel/processor/aggregate/jdbc/
    camel/trunk/components/camel-sql/src/test/resources/org/apache/camel/processor/aggregate/jdbc/JdbcSpringAggregateRecoverWithRedeliveryPolicyTest.xml
      - copied, changed from r1073182, camel/trunk/components/camel-jdbc-aggregator/src/test/resources/org/apache/camel/component/jdbc/aggregationrepository/JdbcSpringAggregateRecoverWithRedeliveryPolicyTest.xml
    camel/trunk/components/camel-sql/src/test/resources/org/apache/camel/processor/aggregate/jdbc/JdbcSpringAggregateTest.xml
      - copied, changed from r1073182, camel/trunk/components/camel-jdbc-aggregator/src/test/resources/org/apache/camel/component/jdbc/aggregationrepository/JdbcSpringAggregateTest.xml
    camel/trunk/components/camel-sql/src/test/resources/org/apache/camel/processor/aggregate/jdbc/JdbcSpringDataSource.xml
      - copied, changed from r1073182, camel/trunk/components/camel-jdbc-aggregator/src/test/resources/org/apache/camel/component/jdbc/aggregationrepository/JdbcSpringDataSource.xml
    camel/trunk/components/camel-sql/src/test/resources/sql/
    camel/trunk/components/camel-sql/src/test/resources/sql/init.sql
      - copied, changed from r1073182, camel/trunk/components/camel-jdbc-aggregator/src/test/resources/sql/init.sql
    camel/trunk/components/camel-sql/src/test/resources/sql/init2.sql
      - copied, changed from r1073182, camel/trunk/components/camel-jdbc-aggregator/src/test/resources/sql/init2.sql
Removed:
    camel/trunk/components/camel-jdbc-aggregator/pom.xml
    camel/trunk/components/camel-jdbc-aggregator/src/main/java/org/apache/camel/component/jdbc/aggregationrepository/ClassLoadingAwareObjectInputStream.java
    camel/trunk/components/camel-jdbc-aggregator/src/main/java/org/apache/camel/component/jdbc/aggregationrepository/JdbcAggregationRepository.java
    camel/trunk/components/camel-jdbc-aggregator/src/main/java/org/apache/camel/component/jdbc/aggregationrepository/JdbcCamelCodec.java
    camel/trunk/components/camel-jdbc-aggregator/src/main/resources/META-INF/LICENSE.txt
    camel/trunk/components/camel-jdbc-aggregator/src/main/resources/META-INF/NOTICE.txt
    camel/trunk/components/camel-jdbc-aggregator/src/test/java/org/apache/camel/component/jdbc/aggregationrepository/JdbcAggregateCompletionIntervalTest.java
    camel/trunk/components/camel-jdbc-aggregator/src/test/java/org/apache/camel/component/jdbc/aggregationrepository/JdbcAggregateConcurrentDifferentGroupsTest.java
    camel/trunk/components/camel-jdbc-aggregator/src/test/java/org/apache/camel/component/jdbc/aggregationrepository/JdbcAggregateConcurrentSameGroupTest.java
    camel/trunk/components/camel-jdbc-aggregator/src/test/java/org/apache/camel/component/jdbc/aggregationrepository/JdbcAggregateDiscardOnTimeoutTest.java
    camel/trunk/components/camel-jdbc-aggregator/src/test/java/org/apache/camel/component/jdbc/aggregationrepository/JdbcAggregateLoadAndRecoverTest.java
    camel/trunk/components/camel-jdbc-aggregator/src/test/java/org/apache/camel/component/jdbc/aggregationrepository/JdbcAggregateLoadConcurrentTest.java
    camel/trunk/components/camel-jdbc-aggregator/src/test/java/org/apache/camel/component/jdbc/aggregationrepository/JdbcAggregateLoadTest.java
    camel/trunk/components/camel-jdbc-aggregator/src/test/java/org/apache/camel/component/jdbc/aggregationrepository/JdbcAggregateNotLostRemovedWhenConfirmedTest.java
    camel/trunk/components/camel-jdbc-aggregator/src/test/java/org/apache/camel/component/jdbc/aggregationrepository/JdbcAggregateNotLostTest.java
    camel/trunk/components/camel-jdbc-aggregator/src/test/java/org/apache/camel/component/jdbc/aggregationrepository/JdbcAggregateRecoverDeadLetterChannelFailedTest.java
    camel/trunk/components/camel-jdbc-aggregator/src/test/java/org/apache/camel/component/jdbc/aggregationrepository/JdbcAggregateRecoverDeadLetterChannelTest.java
    camel/trunk/components/camel-jdbc-aggregator/src/test/java/org/apache/camel/component/jdbc/aggregationrepository/JdbcAggregateRecoverTest.java
    camel/trunk/components/camel-jdbc-aggregator/src/test/java/org/apache/camel/component/jdbc/aggregationrepository/JdbcAggregateRecoverWithRedeliveryPolicyTest.java
    camel/trunk/components/camel-jdbc-aggregator/src/test/java/org/apache/camel/component/jdbc/aggregationrepository/JdbcAggregateRecoverWithSedaTest.java
    camel/trunk/components/camel-jdbc-aggregator/src/test/java/org/apache/camel/component/jdbc/aggregationrepository/JdbcAggregateTest.java
    camel/trunk/components/camel-jdbc-aggregator/src/test/java/org/apache/camel/component/jdbc/aggregationrepository/JdbcAggregationRepositoryAlotDataTest.java
    camel/trunk/components/camel-jdbc-aggregator/src/test/java/org/apache/camel/component/jdbc/aggregationrepository/JdbcAggregationRepositoryMultipleRepoTest.java
    camel/trunk/components/camel-jdbc-aggregator/src/test/java/org/apache/camel/component/jdbc/aggregationrepository/JdbcAggregationRepositoryRecoverExistingTest.java
    camel/trunk/components/camel-jdbc-aggregator/src/test/java/org/apache/camel/component/jdbc/aggregationrepository/JdbcAggregationRepositoryTest.java
    camel/trunk/components/camel-jdbc-aggregator/src/test/java/org/apache/camel/component/jdbc/aggregationrepository/JdbcExchangeSerializationTest.java
    camel/trunk/components/camel-jdbc-aggregator/src/test/java/org/apache/camel/component/jdbc/aggregationrepository/JdbcGetNotFoundTest.java
    camel/trunk/components/camel-jdbc-aggregator/src/test/java/org/apache/camel/component/jdbc/aggregationrepository/JdbcGrowIssueTest.java
    camel/trunk/components/camel-jdbc-aggregator/src/test/java/org/apache/camel/component/jdbc/aggregationrepository/JdbcSpringAggregateRecoverWithRedeliveryPolicyTest.java
    camel/trunk/components/camel-jdbc-aggregator/src/test/java/org/apache/camel/component/jdbc/aggregationrepository/JdbcSpringAggregateTest.java
    camel/trunk/components/camel-jdbc-aggregator/src/test/resources/jndi.properties
    camel/trunk/components/camel-jdbc-aggregator/src/test/resources/log4j.properties
    camel/trunk/components/camel-jdbc-aggregator/src/test/resources/org/apache/camel/component/jdbc/aggregationrepository/JdbcSpringAggregateRecoverWithRedeliveryPolicyTest.xml
    camel/trunk/components/camel-jdbc-aggregator/src/test/resources/org/apache/camel/component/jdbc/aggregationrepository/JdbcSpringAggregateTest.xml
    camel/trunk/components/camel-jdbc-aggregator/src/test/resources/org/apache/camel/component/jdbc/aggregationrepository/JdbcSpringDataSource.xml
    camel/trunk/components/camel-jdbc-aggregator/src/test/resources/sql/init.sql
    camel/trunk/components/camel-jdbc-aggregator/src/test/resources/sql/init2.sql
Modified:
    camel/trunk/apache-camel/pom.xml
    camel/trunk/apache-camel/src/main/descriptors/common-bin.xml
    camel/trunk/components/camel-sql/pom.xml
    camel/trunk/components/pom.xml
    camel/trunk/parent/pom.xml
    camel/trunk/platforms/karaf/features/src/main/resources/features.xml

Modified: camel/trunk/apache-camel/pom.xml
URL: http://svn.apache.org/viewvc/camel/trunk/apache-camel/pom.xml?rev=1073186&r1=1073185&r2=1073186&view=diff
==============================================================================
--- camel/trunk/apache-camel/pom.xml (original)
+++ camel/trunk/apache-camel/pom.xml Mon Feb 21 23:27:38 2011
@@ -193,10 +193,6 @@
     </dependency>
     <dependency>
       <groupId>org.apache.camel</groupId>
-      <artifactId>camel-jdbc-aggregator</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.apache.camel</groupId>
       <artifactId>camel-jetty</artifactId>
     </dependency>
     <dependency>

Modified: camel/trunk/apache-camel/src/main/descriptors/common-bin.xml
URL: http://svn.apache.org/viewvc/camel/trunk/apache-camel/src/main/descriptors/common-bin.xml?rev=1073186&r1=1073185&r2=1073186&view=diff
==============================================================================
--- camel/trunk/apache-camel/src/main/descriptors/common-bin.xml (original)
+++ camel/trunk/apache-camel/src/main/descriptors/common-bin.xml Mon Feb 21 23:27:38 2011
@@ -71,7 +71,6 @@
         <include>org.apache.camel:camel-jaxb</include>
         <include>org.apache.camel:camel-jcr</include>
         <include>org.apache.camel:camel-jdbc</include>
-        <include>org.apache.camel:camel-jdbc-aggregator</include>
         <include>org.apache.camel:camel-jetty</include>
         <include>org.apache.camel:camel-jibx</include>
         <include>org.apache.camel:camel-jing</include>

Modified: camel/trunk/components/camel-sql/pom.xml
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-sql/pom.xml?rev=1073186&r1=1073185&r2=1073186&view=diff
==============================================================================
--- camel/trunk/components/camel-sql/pom.xml (original)
+++ camel/trunk/components/camel-sql/pom.xml Mon Feb 21 23:27:38 2011
@@ -32,10 +32,12 @@
 	<properties>
 		<camel.osgi.export.pkg>
 			org.apache.camel.component.sql.*;${camel.osgi.version},
+			org.apache.camel.processor.aggregate.jdbc.*;${camel.osgi.version},
 			org.apache.camel.processor.idempotent.jdbc.*;${camel.osgi.version}
 		</camel.osgi.export.pkg>
 		<camel.osgi.import.pkg>
 			!org.apache.camel.component.sql.*,
+			!org.apache.camel.processor.aggregate.jdbc.*,
 			!org.apache.camel.processor.idempotent.jdbc.*,
 			*
 		</camel.osgi.import.pkg>
@@ -68,7 +70,6 @@
 			<optional>true</optional>
 			<scope>test</scope>
 		</dependency>
-
 		<dependency>
 			<groupId>junit</groupId>
 			<artifactId>junit</artifactId>
@@ -89,5 +90,22 @@
 	      <artifactId>hsqldb</artifactId>
 	      <scope>test</scope>
 	    </dependency>
+        <dependency>
+            <groupId>com.h2database</groupId>
+            <artifactId>h2</artifactId>
+            <scope>test</scope>
+        </dependency>
 	</dependencies>
-</project>
+	
+    <build>
+        <plugins>
+            <!-- use per test fork mode to avoid side effects -->
+            <plugin>
+              <artifactId>maven-surefire-plugin</artifactId>
+              <configuration>
+                <forkMode>pertest</forkMode>
+              </configuration>
+            </plugin>
+      </plugins>
+    </build>
+</project>
\ No newline at end of file

Copied: camel/trunk/components/camel-sql/src/main/java/org/apache/camel/processor/aggregate/jdbc/ClassLoadingAwareObjectInputStream.java (from r1073182, camel/trunk/components/camel-jdbc-aggregator/src/main/java/org/apache/camel/component/jdbc/aggregationrepository/ClassLoadingAwareObjectInputStream.java)
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-sql/src/main/java/org/apache/camel/processor/aggregate/jdbc/ClassLoadingAwareObjectInputStream.java?p2=camel/trunk/components/camel-sql/src/main/java/org/apache/camel/processor/aggregate/jdbc/ClassLoadingAwareObjectInputStream.java&p1=camel/trunk/components/camel-jdbc-aggregator/src/main/java/org/apache/camel/component/jdbc/aggregationrepository/ClassLoadingAwareObjectInputStream.java&r1=1073182&r2=1073186&rev=1073186&view=diff
==============================================================================
--- camel/trunk/components/camel-jdbc-aggregator/src/main/java/org/apache/camel/component/jdbc/aggregationrepository/ClassLoadingAwareObjectInputStream.java (original)
+++ camel/trunk/components/camel-sql/src/main/java/org/apache/camel/processor/aggregate/jdbc/ClassLoadingAwareObjectInputStream.java Mon Feb 21 23:27:38 2011
@@ -14,7 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.camel.component.jdbc.aggregationrepository;
+package org.apache.camel.processor.aggregate.jdbc;
 
 import java.io.IOException;
 import java.io.InputStream;

Copied: camel/trunk/components/camel-sql/src/main/java/org/apache/camel/processor/aggregate/jdbc/JdbcAggregationRepository.java (from r1073182, camel/trunk/components/camel-jdbc-aggregator/src/main/java/org/apache/camel/component/jdbc/aggregationrepository/JdbcAggregationRepository.java)
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-sql/src/main/java/org/apache/camel/processor/aggregate/jdbc/JdbcAggregationRepository.java?p2=camel/trunk/components/camel-sql/src/main/java/org/apache/camel/processor/aggregate/jdbc/JdbcAggregationRepository.java&p1=camel/trunk/components/camel-jdbc-aggregator/src/main/java/org/apache/camel/component/jdbc/aggregationrepository/JdbcAggregationRepository.java&r1=1073182&r2=1073186&rev=1073186&view=diff
==============================================================================
--- camel/trunk/components/camel-jdbc-aggregator/src/main/java/org/apache/camel/component/jdbc/aggregationrepository/JdbcAggregationRepository.java (original)
+++ camel/trunk/components/camel-sql/src/main/java/org/apache/camel/processor/aggregate/jdbc/JdbcAggregationRepository.java Mon Feb 21 23:27:38 2011
@@ -14,7 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.camel.component.jdbc.aggregationrepository;
+package org.apache.camel.processor.aggregate.jdbc;
 
 import java.io.IOException;
 import java.sql.PreparedStatement;

Copied: camel/trunk/components/camel-sql/src/main/java/org/apache/camel/processor/aggregate/jdbc/JdbcCamelCodec.java (from r1073182, camel/trunk/components/camel-jdbc-aggregator/src/main/java/org/apache/camel/component/jdbc/aggregationrepository/JdbcCamelCodec.java)
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-sql/src/main/java/org/apache/camel/processor/aggregate/jdbc/JdbcCamelCodec.java?p2=camel/trunk/components/camel-sql/src/main/java/org/apache/camel/processor/aggregate/jdbc/JdbcCamelCodec.java&p1=camel/trunk/components/camel-jdbc-aggregator/src/main/java/org/apache/camel/component/jdbc/aggregationrepository/JdbcCamelCodec.java&r1=1073182&r2=1073186&rev=1073186&view=diff
==============================================================================
--- camel/trunk/components/camel-jdbc-aggregator/src/main/java/org/apache/camel/component/jdbc/aggregationrepository/JdbcCamelCodec.java (original)
+++ camel/trunk/components/camel-sql/src/main/java/org/apache/camel/processor/aggregate/jdbc/JdbcCamelCodec.java Mon Feb 21 23:27:38 2011
@@ -14,7 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.camel.component.jdbc.aggregationrepository;
+package org.apache.camel.processor.aggregate.jdbc;
 
 import java.io.ByteArrayInputStream;
 import java.io.ByteArrayOutputStream;

Copied: camel/trunk/components/camel-sql/src/test/java/org/apache/camel/processor/aggregate/jdbc/AbstractJdbcAggregationTestSupport.java (from r1073182, camel/trunk/components/camel-jdbc-aggregator/src/test/java/org/apache/camel/component/jdbc/aggregationrepository/JdbcAggregateTest.java)
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-sql/src/test/java/org/apache/camel/processor/aggregate/jdbc/AbstractJdbcAggregationTestSupport.java?p2=camel/trunk/components/camel-sql/src/test/java/org/apache/camel/processor/aggregate/jdbc/AbstractJdbcAggregationTestSupport.java&p1=camel/trunk/components/camel-jdbc-aggregator/src/test/java/org/apache/camel/component/jdbc/aggregationrepository/JdbcAggregateTest.java&r1=1073182&r2=1073186&rev=1073186&view=diff
==============================================================================
--- camel/trunk/components/camel-jdbc-aggregator/src/test/java/org/apache/camel/component/jdbc/aggregationrepository/JdbcAggregateTest.java (original)
+++ camel/trunk/components/camel-sql/src/test/java/org/apache/camel/processor/aggregate/jdbc/AbstractJdbcAggregationTestSupport.java Mon Feb 21 23:27:38 2011
@@ -14,62 +14,54 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.camel.component.jdbc.aggregationrepository;
-
-import java.util.concurrent.TimeUnit;
+package org.apache.camel.processor.aggregate.jdbc;
 
 import org.apache.camel.Exchange;
 import org.apache.camel.builder.RouteBuilder;
-import org.apache.camel.component.mock.MockEndpoint;
 import org.apache.camel.processor.aggregate.AggregationStrategy;
 import org.apache.camel.test.junit4.CamelTestSupport;
-import org.junit.Test;
+import org.junit.Before;
 import org.springframework.context.ApplicationContext;
 import org.springframework.context.support.ClassPathXmlApplicationContext;
 
-public class JdbcAggregateTest extends CamelTestSupport {
+public abstract class AbstractJdbcAggregationTestSupport extends CamelTestSupport {
 
     JdbcAggregationRepository repo;
 
+    @Before
     @Override
     public void setUp() throws Exception {
-        ApplicationContext applicationContext = new ClassPathXmlApplicationContext("org/apache/camel/component/jdbc/aggregationrepository/JdbcSpringDataSource.xml");
+        ApplicationContext applicationContext = new ClassPathXmlApplicationContext("org/apache/camel/processor/aggregate/jdbc/JdbcSpringDataSource.xml");
         repo = applicationContext.getBean("repo1", JdbcAggregationRepository.class);
-
+        
+        configureJdbcAggregationRepository();
+        
         super.setUp();
     }
 
-    @Test
-    public void testJdbcAggregate() throws Exception {
-        MockEndpoint mock = getMockEndpoint("mock:aggregated");
-        mock.expectedBodiesReceived("ABCDE");
-
-        template.sendBodyAndHeader("direct:start", "A", "id", 123);
-        template.sendBodyAndHeader("direct:start", "B", "id", 123);
-        template.sendBodyAndHeader("direct:start", "C", "id", 123);
-        template.sendBodyAndHeader("direct:start", "D", "id", 123);
-        template.sendBodyAndHeader("direct:start", "E", "id", 123);
-
-        assertMockEndpointsSatisfied(30, TimeUnit.SECONDS);
-
-        // from endpoint should be preserved
-        assertEquals("direct://start", mock.getReceivedExchanges().get(0).getFromEndpoint().getEndpointUri());
+    void configureJdbcAggregationRepository() {
     }
 
     @Override
     protected RouteBuilder createRouteBuilder() throws Exception {
         return new RouteBuilder() {
             @Override
+            // START SNIPPET: e1
             public void configure() throws Exception {
                 // here is the Camel route where we aggregate
                 from("direct:start")
                         .aggregate(header("id"), new MyAggregationStrategy())
-                                // use our created jdbc repo as aggregation repository
-                        .completionSize(5).aggregationRepository(repo)
+                                // complete every 5th seconds
+                        .completionInterval(getCompletionInterval()).aggregationRepository(repo)
                         .to("mock:aggregated");
             }
+            // END SNIPPET: e1
         };
     }
+    
+    long getCompletionInterval() {
+        return 5000;
+    }
 
     public static class MyAggregationStrategy implements AggregationStrategy {
 

Added: camel/trunk/components/camel-sql/src/test/java/org/apache/camel/processor/aggregate/jdbc/JdbcAggregateCompletionIntervalTest.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-sql/src/test/java/org/apache/camel/processor/aggregate/jdbc/JdbcAggregateCompletionIntervalTest.java?rev=1073186&view=auto
==============================================================================
--- camel/trunk/components/camel-sql/src/test/java/org/apache/camel/processor/aggregate/jdbc/JdbcAggregateCompletionIntervalTest.java (added)
+++ camel/trunk/components/camel-sql/src/test/java/org/apache/camel/processor/aggregate/jdbc/JdbcAggregateCompletionIntervalTest.java Mon Feb 21 23:27:38 2011
@@ -0,0 +1,47 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.processor.aggregate.jdbc;
+
+import org.apache.camel.component.mock.MockEndpoint;
+import org.junit.Test;
+
+public class JdbcAggregateCompletionIntervalTest extends AbstractJdbcAggregationTestSupport {
+
+    @Test
+    public void testJdbcAggregateCompletionInterval() throws Exception {
+        MockEndpoint mock = getMockEndpoint("mock:aggregated");
+        mock.setResultWaitTime(30 * 1000L);
+        mock.expectedBodiesReceived("ABCD", "E");
+
+        // wait a bit so we complete on the next poll
+        Thread.sleep(2000);
+
+        template.sendBodyAndHeader("direct:start", "A", "id", 123);
+        template.sendBodyAndHeader("direct:start", "B", "id", 123);
+        template.sendBodyAndHeader("direct:start", "C", "id", 123);
+        template.sendBodyAndHeader("direct:start", "D", "id", 123);
+
+        Thread.sleep(6000);
+
+        template.sendBodyAndHeader("direct:start", "E", "id", 123);
+
+        assertMockEndpointsSatisfied();
+
+        // from endpoint should be preserved
+        assertEquals("direct://start", mock.getReceivedExchanges().get(0).getFromEndpoint().getEndpointUri());
+    }
+}
\ No newline at end of file

Added: camel/trunk/components/camel-sql/src/test/java/org/apache/camel/processor/aggregate/jdbc/JdbcAggregateConcurrentDifferentGroupsTest.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-sql/src/test/java/org/apache/camel/processor/aggregate/jdbc/JdbcAggregateConcurrentDifferentGroupsTest.java?rev=1073186&view=auto
==============================================================================
--- camel/trunk/components/camel-sql/src/test/java/org/apache/camel/processor/aggregate/jdbc/JdbcAggregateConcurrentDifferentGroupsTest.java (added)
+++ camel/trunk/components/camel-sql/src/test/java/org/apache/camel/processor/aggregate/jdbc/JdbcAggregateConcurrentDifferentGroupsTest.java Mon Feb 21 23:27:38 2011
@@ -0,0 +1,69 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.processor.aggregate.jdbc;
+
+import java.util.concurrent.Callable;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.Executors;
+
+import org.apache.camel.component.mock.MockEndpoint;
+import org.junit.Test;
+
+public class JdbcAggregateConcurrentDifferentGroupsTest extends AbstractJdbcAggregationTestSupport {
+
+    @Test
+    public void testNoConcurrentProducers() throws Exception {
+        doSendMessages(2, 1);
+    }
+
+    @Test
+    public void testConcurrentProducers() throws Exception {
+        doSendMessages(10, 5);
+    }
+
+    @Test
+    public void testMoreConcurrentProducers() throws Exception {
+        doSendMessages(50, 10);
+    }
+
+    private void doSendMessages(int files, int poolSize) throws Exception {
+        MockEndpoint mock = getMockEndpoint("mock:aggregated");
+        mock.expectedMessageCount(2);
+        mock.setResultWaitTime(30 * 1000L);
+
+        ExecutorService executor = Executors.newFixedThreadPool(poolSize);
+        for (int i = 0; i < files; i++) {
+            final int index = i;
+            executor.submit(new Callable<Object>() {
+                public Object call() throws Exception {
+                    String id = index % 2 == 0 ? "A" : "B";
+                    template.sendBodyAndHeader("direct:start", index, "id", id);
+                    // simulate a little delay
+                    Thread.sleep(3);
+                    return null;
+                }
+            });
+        }
+
+        assertMockEndpointsSatisfied();
+    }
+    
+    @Override
+    long getCompletionInterval() {
+        return 1000;
+    }
+}
\ No newline at end of file

Added: camel/trunk/components/camel-sql/src/test/java/org/apache/camel/processor/aggregate/jdbc/JdbcAggregateConcurrentSameGroupTest.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-sql/src/test/java/org/apache/camel/processor/aggregate/jdbc/JdbcAggregateConcurrentSameGroupTest.java?rev=1073186&view=auto
==============================================================================
--- camel/trunk/components/camel-sql/src/test/java/org/apache/camel/processor/aggregate/jdbc/JdbcAggregateConcurrentSameGroupTest.java (added)
+++ camel/trunk/components/camel-sql/src/test/java/org/apache/camel/processor/aggregate/jdbc/JdbcAggregateConcurrentSameGroupTest.java Mon Feb 21 23:27:38 2011
@@ -0,0 +1,68 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.processor.aggregate.jdbc;
+
+import java.util.concurrent.Callable;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.Executors;
+
+import org.apache.camel.component.mock.MockEndpoint;
+import org.junit.Test;
+
+public class JdbcAggregateConcurrentSameGroupTest extends AbstractJdbcAggregationTestSupport {
+
+    @Test
+    public void testNoConcurrentProducers() throws Exception {
+        doSendMessages(1, 1);
+    }
+
+    @Test
+    public void testConcurrentProducers() throws Exception {
+        doSendMessages(10, 5);
+    }
+
+    @Test
+    public void testMoreConcurrentProducers() throws Exception {
+        doSendMessages(50, 10);
+    }
+
+    private void doSendMessages(int files, int poolSize) throws Exception {
+        MockEndpoint mock = getMockEndpoint("mock:aggregated");
+        mock.setResultWaitTime(30 * 1000L);
+        mock.expectedMessageCount(1);
+
+        ExecutorService executor = Executors.newFixedThreadPool(poolSize);
+        for (int i = 0; i < files; i++) {
+            final int index = i;
+            executor.submit(new Callable<Object>() {
+                public Object call() throws Exception {
+                    template.sendBodyAndHeader("direct:start", index, "id", 123);
+                    // simulate a little delay
+                    Thread.sleep(3);
+                    return null;
+                }
+            });
+        }
+
+        assertMockEndpointsSatisfied();
+    }
+
+    @Override
+    long getCompletionInterval() {
+        return 1000;
+    }
+}
\ No newline at end of file

Copied: camel/trunk/components/camel-sql/src/test/java/org/apache/camel/processor/aggregate/jdbc/JdbcAggregateDiscardOnTimeoutTest.java (from r1073182, camel/trunk/components/camel-jdbc-aggregator/src/test/java/org/apache/camel/component/jdbc/aggregationrepository/JdbcAggregateDiscardOnTimeoutTest.java)
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-sql/src/test/java/org/apache/camel/processor/aggregate/jdbc/JdbcAggregateDiscardOnTimeoutTest.java?p2=camel/trunk/components/camel-sql/src/test/java/org/apache/camel/processor/aggregate/jdbc/JdbcAggregateDiscardOnTimeoutTest.java&p1=camel/trunk/components/camel-jdbc-aggregator/src/test/java/org/apache/camel/component/jdbc/aggregationrepository/JdbcAggregateDiscardOnTimeoutTest.java&r1=1073182&r2=1073186&rev=1073186&view=diff
==============================================================================
--- camel/trunk/components/camel-jdbc-aggregator/src/test/java/org/apache/camel/component/jdbc/aggregationrepository/JdbcAggregateDiscardOnTimeoutTest.java (original)
+++ camel/trunk/components/camel-sql/src/test/java/org/apache/camel/processor/aggregate/jdbc/JdbcAggregateDiscardOnTimeoutTest.java Mon Feb 21 23:27:38 2011
@@ -14,35 +14,20 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.camel.component.jdbc.aggregationrepository;
+package org.apache.camel.processor.aggregate.jdbc;
 
 import java.util.concurrent.TimeUnit;
-import java.util.concurrent.atomic.AtomicInteger;
-import javax.sql.DataSource;
 
-import org.apache.camel.Exchange;
 import org.apache.camel.builder.RouteBuilder;
 import org.apache.camel.component.mock.MockEndpoint;
-import org.apache.camel.processor.aggregate.AggregationStrategy;
-import org.apache.camel.test.junit4.CamelTestSupport;
-import org.junit.Before;
 import org.junit.Test;
-import org.springframework.context.ApplicationContext;
-import org.springframework.context.support.ClassPathXmlApplicationContext;
 
-public class JdbcAggregateDiscardOnTimeoutTest extends CamelTestSupport {
+public class JdbcAggregateDiscardOnTimeoutTest extends AbstractJdbcAggregationTestSupport {
 
-    private static AtomicInteger counter = new AtomicInteger(0);
-    private JdbcAggregationRepository repo;
-
-    @Before
     @Override
-    public void setUp() throws Exception {
-        ApplicationContext applicationContext = new ClassPathXmlApplicationContext("org/apache/camel/component/jdbc/aggregationrepository/JdbcSpringDataSource.xml");
-        repo = applicationContext.getBean("repo1", JdbcAggregationRepository.class);
+    void configureJdbcAggregationRepository() {
         repo.setUseRecovery(true);
         repo.setRecoveryInterval(500, TimeUnit.MILLISECONDS);
-        super.setUp();
     }
 
     @Test
@@ -86,18 +71,4 @@ public class JdbcAggregateDiscardOnTimeo
             }
         };
     }
-
-    public static class MyAggregationStrategy implements AggregationStrategy {
-
-        public Exchange aggregate(Exchange oldExchange, Exchange newExchange) {
-            if (oldExchange == null) {
-                return newExchange;
-            }
-            String body1 = oldExchange.getIn().getBody(String.class);
-            String body2 = newExchange.getIn().getBody(String.class);
-
-            oldExchange.getIn().setBody(body1 + body2);
-            return oldExchange;
-        }
-    }
 }
\ No newline at end of file

Copied: camel/trunk/components/camel-sql/src/test/java/org/apache/camel/processor/aggregate/jdbc/JdbcAggregateLoadAndRecoverTest.java (from r1073182, camel/trunk/components/camel-jdbc-aggregator/src/test/java/org/apache/camel/component/jdbc/aggregationrepository/JdbcAggregateLoadAndRecoverTest.java)
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-sql/src/test/java/org/apache/camel/processor/aggregate/jdbc/JdbcAggregateLoadAndRecoverTest.java?p2=camel/trunk/components/camel-sql/src/test/java/org/apache/camel/processor/aggregate/jdbc/JdbcAggregateLoadAndRecoverTest.java&p1=camel/trunk/components/camel-jdbc-aggregator/src/test/java/org/apache/camel/component/jdbc/aggregationrepository/JdbcAggregateLoadAndRecoverTest.java&r1=1073182&r2=1073186&rev=1073186&view=diff
==============================================================================
--- camel/trunk/components/camel-jdbc-aggregator/src/test/java/org/apache/camel/component/jdbc/aggregationrepository/JdbcAggregateLoadAndRecoverTest.java (original)
+++ camel/trunk/components/camel-sql/src/test/java/org/apache/camel/processor/aggregate/jdbc/JdbcAggregateLoadAndRecoverTest.java Mon Feb 21 23:27:38 2011
@@ -14,7 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.camel.component.jdbc.aggregationrepository;
+package org.apache.camel.processor.aggregate.jdbc;
 
 import java.util.HashMap;
 import java.util.Map;
@@ -24,31 +24,16 @@ import org.apache.camel.Exchange;
 import org.apache.camel.Processor;
 import org.apache.camel.builder.RouteBuilder;
 import org.apache.camel.component.mock.MockEndpoint;
-import org.apache.camel.processor.aggregate.AggregationStrategy;
-import org.apache.camel.test.junit4.CamelTestSupport;
-import org.junit.Before;
 import org.junit.Test;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
-import org.springframework.context.ApplicationContext;
-import org.springframework.context.support.ClassPathXmlApplicationContext;
 
-public class JdbcAggregateLoadAndRecoverTest extends CamelTestSupport {
+public class JdbcAggregateLoadAndRecoverTest extends AbstractJdbcAggregationTestSupport {
 
     private static final Logger LOG = LoggerFactory.getLogger(JdbcAggregateLoadAndRecoverTest.class);
     private static final int SIZE = 200;
     private static AtomicInteger counter = new AtomicInteger();
 
-    private JdbcAggregationRepository repo;
-
-    @Before
-    @Override
-    public void setUp() throws Exception {
-        ApplicationContext applicationContext = new ClassPathXmlApplicationContext("org/apache/camel/component/jdbc/aggregationrepository/JdbcSpringDataSource.xml");
-        repo = applicationContext.getBean("repo1", JdbcAggregationRepository.class);
-        super.setUp();
-    }
-
     @Test
     public void testLoadAndRecoverJdbcAggregate() throws Exception {
         MockEndpoint mock = getMockEndpoint("mock:result");
@@ -113,21 +98,4 @@ public class JdbcAggregateLoadAndRecover
             }
         };
     }
-
-    public static class MyAggregationStrategy implements AggregationStrategy {
-
-        public Exchange aggregate(Exchange oldExchange, Exchange newExchange) {
-            if (oldExchange == null) {
-                return newExchange;
-            }
-
-            Integer body1 = oldExchange.getIn().getBody(Integer.class);
-            Integer body2 = newExchange.getIn().getBody(Integer.class);
-            int sum = body1 + body2;
-
-            oldExchange.getIn().setBody(sum);
-            return oldExchange;
-        }
-    }
-
-}
+}
\ No newline at end of file

Copied: camel/trunk/components/camel-sql/src/test/java/org/apache/camel/processor/aggregate/jdbc/JdbcAggregateLoadConcurrentTest.java (from r1073182, camel/trunk/components/camel-jdbc-aggregator/src/test/java/org/apache/camel/component/jdbc/aggregationrepository/JdbcAggregateLoadConcurrentTest.java)
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-sql/src/test/java/org/apache/camel/processor/aggregate/jdbc/JdbcAggregateLoadConcurrentTest.java?p2=camel/trunk/components/camel-sql/src/test/java/org/apache/camel/processor/aggregate/jdbc/JdbcAggregateLoadConcurrentTest.java&p1=camel/trunk/components/camel-jdbc-aggregator/src/test/java/org/apache/camel/component/jdbc/aggregationrepository/JdbcAggregateLoadConcurrentTest.java&r1=1073182&r2=1073186&rev=1073186&view=diff
==============================================================================
--- camel/trunk/components/camel-jdbc-aggregator/src/test/java/org/apache/camel/component/jdbc/aggregationrepository/JdbcAggregateLoadConcurrentTest.java (original)
+++ camel/trunk/components/camel-sql/src/test/java/org/apache/camel/processor/aggregate/jdbc/JdbcAggregateLoadConcurrentTest.java Mon Feb 21 23:27:38 2011
@@ -14,40 +14,24 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.camel.component.jdbc.aggregationrepository;
+package org.apache.camel.processor.aggregate.jdbc;
 
 import java.util.concurrent.Callable;
 import java.util.concurrent.ExecutorService;
 import java.util.concurrent.Executors;
 
-import org.apache.camel.Exchange;
 import org.apache.camel.builder.RouteBuilder;
 import org.apache.camel.component.mock.MockEndpoint;
-import org.apache.camel.processor.aggregate.AggregationStrategy;
-import org.apache.camel.test.junit4.CamelTestSupport;
-import org.junit.Before;
 import org.junit.Test;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
-import org.springframework.context.ApplicationContext;
-import org.springframework.context.support.ClassPathXmlApplicationContext;
 
-public class JdbcAggregateLoadConcurrentTest extends CamelTestSupport {
+public class JdbcAggregateLoadConcurrentTest extends AbstractJdbcAggregationTestSupport {
 
     private static final Logger LOG = LoggerFactory.getLogger(JdbcAggregateLoadConcurrentTest.class);
     private static final char[] KEYS = new char[]{'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J'};
     private static final int SIZE = 500;
 
-    private JdbcAggregationRepository repo;
-
-    @Before
-    @Override
-    public void setUp() throws Exception {
-        ApplicationContext applicationContext = new ClassPathXmlApplicationContext("org/apache/camel/component/jdbc/aggregationrepository/JdbcSpringDataSource.xml");
-        repo = applicationContext.getBean("repo1", JdbcAggregationRepository.class);
-        super.setUp();
-    }
-
     @Test
     public void testLoadTestJdbcAggregate() throws Exception {
         MockEndpoint mock = getMockEndpoint("mock:result");
@@ -96,20 +80,4 @@ public class JdbcAggregateLoadConcurrent
             }
         };
     }
-
-    public static class MyAggregationStrategy implements AggregationStrategy {
-
-        public Exchange aggregate(Exchange oldExchange, Exchange newExchange) {
-            if (oldExchange == null) {
-                return newExchange;
-            }
-
-            Integer body1 = oldExchange.getIn().getBody(Integer.class);
-            Integer body2 = newExchange.getIn().getBody(Integer.class);
-            int sum = body1 + body2;
-
-            oldExchange.getIn().setBody(sum);
-            return oldExchange;
-        }
-    }
-}
+}
\ No newline at end of file

Copied: camel/trunk/components/camel-sql/src/test/java/org/apache/camel/processor/aggregate/jdbc/JdbcAggregateLoadTest.java (from r1073182, camel/trunk/components/camel-jdbc-aggregator/src/test/java/org/apache/camel/component/jdbc/aggregationrepository/JdbcAggregateLoadTest.java)
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-sql/src/test/java/org/apache/camel/processor/aggregate/jdbc/JdbcAggregateLoadTest.java?p2=camel/trunk/components/camel-sql/src/test/java/org/apache/camel/processor/aggregate/jdbc/JdbcAggregateLoadTest.java&p1=camel/trunk/components/camel-jdbc-aggregator/src/test/java/org/apache/camel/component/jdbc/aggregationrepository/JdbcAggregateLoadTest.java&r1=1073182&r2=1073186&rev=1073186&view=diff
==============================================================================
--- camel/trunk/components/camel-jdbc-aggregator/src/test/java/org/apache/camel/component/jdbc/aggregationrepository/JdbcAggregateLoadTest.java (original)
+++ camel/trunk/components/camel-sql/src/test/java/org/apache/camel/processor/aggregate/jdbc/JdbcAggregateLoadTest.java Mon Feb 21 23:27:38 2011
@@ -14,33 +14,18 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.camel.component.jdbc.aggregationrepository;
+package org.apache.camel.processor.aggregate.jdbc;
 
-import org.apache.camel.Exchange;
 import org.apache.camel.builder.RouteBuilder;
 import org.apache.camel.component.mock.MockEndpoint;
-import org.apache.camel.processor.aggregate.AggregationStrategy;
-import org.apache.camel.test.junit4.CamelTestSupport;
-import org.junit.Before;
 import org.junit.Test;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
-import org.springframework.context.ApplicationContext;
-import org.springframework.context.support.ClassPathXmlApplicationContext;
 
-public class JdbcAggregateLoadTest extends CamelTestSupport {
+public class JdbcAggregateLoadTest extends AbstractJdbcAggregationTestSupport {
 
     private static final Logger LOG = LoggerFactory.getLogger(JdbcAggregateLoadTest.class);
     private static final int SIZE = 500;
-    private JdbcAggregationRepository repo;
-
-    @Before
-    @Override
-    public void setUp() throws Exception {
-        ApplicationContext applicationContext = new ClassPathXmlApplicationContext("org/apache/camel/component/jdbc/aggregationrepository/JdbcSpringDataSource.xml");
-        repo = applicationContext.getBean("repo1", JdbcAggregationRepository.class);
-        super.setUp();
-    }
 
     @Test
     public void testLoadTestJdbcAggregate() throws Exception {
@@ -80,21 +65,4 @@ public class JdbcAggregateLoadTest exten
             }
         };
     }
-
-    public static class MyAggregationStrategy implements AggregationStrategy {
-
-        public Exchange aggregate(Exchange oldExchange, Exchange newExchange) {
-            if (oldExchange == null) {
-                return newExchange;
-            }
-
-            Integer body1 = oldExchange.getIn().getBody(Integer.class);
-            Integer body2 = newExchange.getIn().getBody(Integer.class);
-            int sum = body1 + body2;
-
-            oldExchange.getIn().setBody(sum);
-            return oldExchange;
-        }
-    }
-
-}
+}
\ No newline at end of file

Copied: camel/trunk/components/camel-sql/src/test/java/org/apache/camel/processor/aggregate/jdbc/JdbcAggregateNotLostRemovedWhenConfirmedTest.java (from r1073182, camel/trunk/components/camel-jdbc-aggregator/src/test/java/org/apache/camel/component/jdbc/aggregationrepository/JdbcAggregateNotLostRemovedWhenConfirmedTest.java)
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-sql/src/test/java/org/apache/camel/processor/aggregate/jdbc/JdbcAggregateNotLostRemovedWhenConfirmedTest.java?p2=camel/trunk/components/camel-sql/src/test/java/org/apache/camel/processor/aggregate/jdbc/JdbcAggregateNotLostRemovedWhenConfirmedTest.java&p1=camel/trunk/components/camel-jdbc-aggregator/src/test/java/org/apache/camel/component/jdbc/aggregationrepository/JdbcAggregateNotLostRemovedWhenConfirmedTest.java&r1=1073182&r2=1073186&rev=1073186&view=diff
==============================================================================
--- camel/trunk/components/camel-jdbc-aggregator/src/test/java/org/apache/camel/component/jdbc/aggregationrepository/JdbcAggregateNotLostRemovedWhenConfirmedTest.java (original)
+++ camel/trunk/components/camel-sql/src/test/java/org/apache/camel/processor/aggregate/jdbc/JdbcAggregateNotLostRemovedWhenConfirmedTest.java Mon Feb 21 23:27:38 2011
@@ -14,28 +14,15 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.camel.component.jdbc.aggregationrepository;
+package org.apache.camel.processor.aggregate.jdbc;
 
 import java.util.concurrent.TimeUnit;
 
 import org.apache.camel.Exchange;
 import org.apache.camel.builder.RouteBuilder;
-import org.apache.camel.processor.aggregate.AggregationStrategy;
-import org.apache.camel.test.junit4.CamelTestSupport;
 import org.junit.Test;
-import org.springframework.context.ApplicationContext;
-import org.springframework.context.support.ClassPathXmlApplicationContext;
 
-public class JdbcAggregateNotLostRemovedWhenConfirmedTest extends CamelTestSupport {
-
-    private JdbcAggregationRepository repo;
-
-    @Override
-    public void setUp() throws Exception {
-        ApplicationContext applicationContext = new ClassPathXmlApplicationContext("org/apache/camel/component/jdbc/aggregationrepository/JdbcSpringDataSource.xml");
-        repo = applicationContext.getBean("repo1", JdbcAggregationRepository.class);
-        super.setUp();
-    }
+public class JdbcAggregateNotLostRemovedWhenConfirmedTest extends AbstractJdbcAggregationTestSupport {
 
     @Test
     public void testJdbcAggregateNotLostRemovedWhenConfirmed() throws Exception {
@@ -74,18 +61,4 @@ public class JdbcAggregateNotLostRemoved
             }
         };
     }
-
-    public static class MyAggregationStrategy implements AggregationStrategy {
-
-        public Exchange aggregate(Exchange oldExchange, Exchange newExchange) {
-            if (oldExchange == null) {
-                return newExchange;
-            }
-            String body1 = oldExchange.getIn().getBody(String.class);
-            String body2 = newExchange.getIn().getBody(String.class);
-
-            oldExchange.getIn().setBody(body1 + body2);
-            return oldExchange;
-        }
-    }
 }
\ No newline at end of file

Copied: camel/trunk/components/camel-sql/src/test/java/org/apache/camel/processor/aggregate/jdbc/JdbcAggregateNotLostTest.java (from r1073182, camel/trunk/components/camel-jdbc-aggregator/src/test/java/org/apache/camel/component/jdbc/aggregationrepository/JdbcAggregateNotLostTest.java)
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-sql/src/test/java/org/apache/camel/processor/aggregate/jdbc/JdbcAggregateNotLostTest.java?p2=camel/trunk/components/camel-sql/src/test/java/org/apache/camel/processor/aggregate/jdbc/JdbcAggregateNotLostTest.java&p1=camel/trunk/components/camel-jdbc-aggregator/src/test/java/org/apache/camel/component/jdbc/aggregationrepository/JdbcAggregateNotLostTest.java&r1=1073182&r2=1073186&rev=1073186&view=diff
==============================================================================
--- camel/trunk/components/camel-jdbc-aggregator/src/test/java/org/apache/camel/component/jdbc/aggregationrepository/JdbcAggregateNotLostTest.java (original)
+++ camel/trunk/components/camel-sql/src/test/java/org/apache/camel/processor/aggregate/jdbc/JdbcAggregateNotLostTest.java Mon Feb 21 23:27:38 2011
@@ -14,31 +14,15 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.camel.component.jdbc.aggregationrepository;
+package org.apache.camel.processor.aggregate.jdbc;
 
 import java.util.concurrent.TimeUnit;
 
 import org.apache.camel.Exchange;
 import org.apache.camel.builder.RouteBuilder;
-import org.apache.camel.processor.aggregate.AggregationStrategy;
-import org.apache.camel.test.junit4.CamelTestSupport;
-
-import org.junit.Before;
 import org.junit.Test;
-import org.springframework.context.ApplicationContext;
-import org.springframework.context.support.ClassPathXmlApplicationContext;
-
-public class JdbcAggregateNotLostTest extends CamelTestSupport {
-
-    private JdbcAggregationRepository repo;
 
-    @Before
-    @Override
-    public void setUp() throws Exception {
-        ApplicationContext applicationContext = new ClassPathXmlApplicationContext("org/apache/camel/component/jdbc/aggregationrepository/JdbcSpringDataSource.xml");
-        repo = applicationContext.getBean("repo1", JdbcAggregationRepository.class);
-        super.setUp();
-    }
+public class JdbcAggregateNotLostTest extends AbstractJdbcAggregationTestSupport {
 
     @Test
     public void testJdbcAggregateNotLost() throws Exception {
@@ -88,18 +72,4 @@ public class JdbcAggregateNotLostTest ex
             }
         };
     }
-
-    public static class MyAggregationStrategy implements AggregationStrategy {
-
-        public Exchange aggregate(Exchange oldExchange, Exchange newExchange) {
-            if (oldExchange == null) {
-                return newExchange;
-            }
-            String body1 = oldExchange.getIn().getBody(String.class);
-            String body2 = newExchange.getIn().getBody(String.class);
-
-            oldExchange.getIn().setBody(body1 + body2);
-            return oldExchange;
-        }
-    }
 }
\ No newline at end of file

Copied: camel/trunk/components/camel-sql/src/test/java/org/apache/camel/processor/aggregate/jdbc/JdbcAggregateRecoverDeadLetterChannelFailedTest.java (from r1073182, camel/trunk/components/camel-jdbc-aggregator/src/test/java/org/apache/camel/component/jdbc/aggregationrepository/JdbcAggregateRecoverDeadLetterChannelFailedTest.java)
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-sql/src/test/java/org/apache/camel/processor/aggregate/jdbc/JdbcAggregateRecoverDeadLetterChannelFailedTest.java?p2=camel/trunk/components/camel-sql/src/test/java/org/apache/camel/processor/aggregate/jdbc/JdbcAggregateRecoverDeadLetterChannelFailedTest.java&p1=camel/trunk/components/camel-jdbc-aggregator/src/test/java/org/apache/camel/component/jdbc/aggregationrepository/JdbcAggregateRecoverDeadLetterChannelFailedTest.java&r1=1073182&r2=1073186&rev=1073186&view=diff
==============================================================================
--- camel/trunk/components/camel-jdbc-aggregator/src/test/java/org/apache/camel/component/jdbc/aggregationrepository/JdbcAggregateRecoverDeadLetterChannelFailedTest.java (original)
+++ camel/trunk/components/camel-sql/src/test/java/org/apache/camel/processor/aggregate/jdbc/JdbcAggregateRecoverDeadLetterChannelFailedTest.java Mon Feb 21 23:27:38 2011
@@ -14,36 +14,25 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.camel.component.jdbc.aggregationrepository;
+package org.apache.camel.processor.aggregate.jdbc;
 
 import java.util.concurrent.TimeUnit;
 
 import org.apache.camel.Exchange;
 import org.apache.camel.builder.RouteBuilder;
-import org.apache.camel.processor.aggregate.AggregationStrategy;
-import org.apache.camel.test.junit4.CamelTestSupport;
 import org.junit.Test;
-import org.springframework.context.ApplicationContext;
-import org.springframework.context.support.ClassPathXmlApplicationContext;
 
-public class JdbcAggregateRecoverDeadLetterChannelFailedTest extends CamelTestSupport {
+public class JdbcAggregateRecoverDeadLetterChannelFailedTest extends AbstractJdbcAggregationTestSupport {
 
-    private JdbcAggregationRepository repo;
-
-    @Override
-    public void setUp() throws Exception {
-        ApplicationContext applicationContext = new ClassPathXmlApplicationContext("org/apache/camel/component/jdbc/aggregationrepository/JdbcSpringDataSource.xml");
-        repo = applicationContext.getBean("repo1", JdbcAggregationRepository.class);
+    void configureJdbcAggregationRepository() {
         // enable recovery
         repo.setUseRecovery(true);
-        // exhaust after at most 2 attempts
+        // exhaust after at most 3 attempts
         repo.setMaximumRedeliveries(3);
         // and move to this dead letter channel
         repo.setDeadLetterUri("direct:dead");
         // check faster
         repo.setRecoveryInterval(1000, TimeUnit.MILLISECONDS);
-
-        super.setUp();
     }
 
     @Test
@@ -90,18 +79,4 @@ public class JdbcAggregateRecoverDeadLet
             }
         };
     }
-
-    public static class MyAggregationStrategy implements AggregationStrategy {
-
-        public Exchange aggregate(Exchange oldExchange, Exchange newExchange) {
-            if (oldExchange == null) {
-                return newExchange;
-            }
-            String body1 = oldExchange.getIn().getBody(String.class);
-            String body2 = newExchange.getIn().getBody(String.class);
-
-            oldExchange.getIn().setBody(body1 + body2);
-            return oldExchange;
-        }
-    }
 }
\ No newline at end of file

Copied: camel/trunk/components/camel-sql/src/test/java/org/apache/camel/processor/aggregate/jdbc/JdbcAggregateRecoverDeadLetterChannelTest.java (from r1073182, camel/trunk/components/camel-jdbc-aggregator/src/test/java/org/apache/camel/component/jdbc/aggregationrepository/JdbcAggregateRecoverDeadLetterChannelTest.java)
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-sql/src/test/java/org/apache/camel/processor/aggregate/jdbc/JdbcAggregateRecoverDeadLetterChannelTest.java?p2=camel/trunk/components/camel-sql/src/test/java/org/apache/camel/processor/aggregate/jdbc/JdbcAggregateRecoverDeadLetterChannelTest.java&p1=camel/trunk/components/camel-jdbc-aggregator/src/test/java/org/apache/camel/component/jdbc/aggregationrepository/JdbcAggregateRecoverDeadLetterChannelTest.java&r1=1073182&r2=1073186&rev=1073186&view=diff
==============================================================================
--- camel/trunk/components/camel-jdbc-aggregator/src/test/java/org/apache/camel/component/jdbc/aggregationrepository/JdbcAggregateRecoverDeadLetterChannelTest.java (original)
+++ camel/trunk/components/camel-sql/src/test/java/org/apache/camel/processor/aggregate/jdbc/JdbcAggregateRecoverDeadLetterChannelTest.java Mon Feb 21 23:27:38 2011
@@ -14,26 +14,17 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.camel.component.jdbc.aggregationrepository;
+package org.apache.camel.processor.aggregate.jdbc;
 
 import java.util.concurrent.TimeUnit;
 
 import org.apache.camel.Exchange;
 import org.apache.camel.builder.RouteBuilder;
-import org.apache.camel.processor.aggregate.AggregationStrategy;
-import org.apache.camel.test.junit4.CamelTestSupport;
 import org.junit.Test;
-import org.springframework.context.ApplicationContext;
-import org.springframework.context.support.ClassPathXmlApplicationContext;
 
-public class JdbcAggregateRecoverDeadLetterChannelTest extends CamelTestSupport {
+public class JdbcAggregateRecoverDeadLetterChannelTest extends AbstractJdbcAggregationTestSupport {
 
-    private JdbcAggregationRepository repo;
-
-    @Override
-    public void setUp() throws Exception {
-        ApplicationContext applicationContext = new ClassPathXmlApplicationContext("org/apache/camel/component/jdbc/aggregationrepository/JdbcSpringDataSource.xml");
-        repo = applicationContext.getBean("repo1", JdbcAggregationRepository.class);
+    void configureJdbcAggregationRepository() {
         // enable recovery
         repo.setUseRecovery(true);
         // exhaust after at most 3 attempts
@@ -42,8 +33,6 @@ public class JdbcAggregateRecoverDeadLet
         repo.setDeadLetterUri("mock:dead");
         // check faster
         repo.setRecoveryInterval(500, TimeUnit.MILLISECONDS);
-
-        super.setUp();
     }
 
     @Test
@@ -80,18 +69,4 @@ public class JdbcAggregateRecoverDeadLet
             }
         };
     }
-
-    public static class MyAggregationStrategy implements AggregationStrategy {
-
-        public Exchange aggregate(Exchange oldExchange, Exchange newExchange) {
-            if (oldExchange == null) {
-                return newExchange;
-            }
-            String body1 = oldExchange.getIn().getBody(String.class);
-            String body2 = newExchange.getIn().getBody(String.class);
-
-            oldExchange.getIn().setBody(body1 + body2);
-            return oldExchange;
-        }
-    }
 }
\ No newline at end of file

Copied: camel/trunk/components/camel-sql/src/test/java/org/apache/camel/processor/aggregate/jdbc/JdbcAggregateRecoverTest.java (from r1073182, camel/trunk/components/camel-jdbc-aggregator/src/test/java/org/apache/camel/component/jdbc/aggregationrepository/JdbcAggregateRecoverTest.java)
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-sql/src/test/java/org/apache/camel/processor/aggregate/jdbc/JdbcAggregateRecoverTest.java?p2=camel/trunk/components/camel-sql/src/test/java/org/apache/camel/processor/aggregate/jdbc/JdbcAggregateRecoverTest.java&p1=camel/trunk/components/camel-jdbc-aggregator/src/test/java/org/apache/camel/component/jdbc/aggregationrepository/JdbcAggregateRecoverTest.java&r1=1073182&r2=1073186&rev=1073186&view=diff
==============================================================================
--- camel/trunk/components/camel-jdbc-aggregator/src/test/java/org/apache/camel/component/jdbc/aggregationrepository/JdbcAggregateRecoverTest.java (original)
+++ camel/trunk/components/camel-sql/src/test/java/org/apache/camel/processor/aggregate/jdbc/JdbcAggregateRecoverTest.java Mon Feb 21 23:27:38 2011
@@ -14,7 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.camel.component.jdbc.aggregationrepository;
+package org.apache.camel.processor.aggregate.jdbc;
 
 import java.util.concurrent.TimeUnit;
 import java.util.concurrent.atomic.AtomicInteger;
@@ -22,26 +22,17 @@ import java.util.concurrent.atomic.Atomi
 import org.apache.camel.Exchange;
 import org.apache.camel.Processor;
 import org.apache.camel.builder.RouteBuilder;
-import org.apache.camel.processor.aggregate.AggregationStrategy;
-import org.apache.camel.test.junit4.CamelTestSupport;
 import org.junit.Test;
-import org.springframework.context.ApplicationContext;
-import org.springframework.context.support.ClassPathXmlApplicationContext;
 
-public class JdbcAggregateRecoverTest extends CamelTestSupport {
+public class JdbcAggregateRecoverTest extends AbstractJdbcAggregationTestSupport {
 
     private static AtomicInteger counter = new AtomicInteger(0);
-    private JdbcAggregationRepository repo;
-
-    @Override
-    public void setUp() throws Exception {
-        ApplicationContext applicationContext = new ClassPathXmlApplicationContext("org/apache/camel/component/jdbc/aggregationrepository/JdbcSpringDataSource.xml");
-        repo = applicationContext.getBean("repo1", JdbcAggregationRepository.class);
+    
+    void configureJdbcAggregationRepository() {
         // enable recovery
         repo.setUseRecovery(true);
         // check faster
         repo.setRecoveryInterval(500, TimeUnit.MILLISECONDS);
-        super.setUp();
     }
 
     @Test
@@ -88,18 +79,4 @@ public class JdbcAggregateRecoverTest ex
             }
         };
     }
-
-    public static class MyAggregationStrategy implements AggregationStrategy {
-
-        public Exchange aggregate(Exchange oldExchange, Exchange newExchange) {
-            if (oldExchange == null) {
-                return newExchange;
-            }
-            String body1 = oldExchange.getIn().getBody(String.class);
-            String body2 = newExchange.getIn().getBody(String.class);
-
-            oldExchange.getIn().setBody(body1 + body2);
-            return oldExchange;
-        }
-    }
 }
\ No newline at end of file

Copied: camel/trunk/components/camel-sql/src/test/java/org/apache/camel/processor/aggregate/jdbc/JdbcAggregateRecoverWithRedeliveryPolicyTest.java (from r1073182, camel/trunk/components/camel-jdbc-aggregator/src/test/java/org/apache/camel/component/jdbc/aggregationrepository/JdbcAggregateRecoverWithRedeliveryPolicyTest.java)
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-sql/src/test/java/org/apache/camel/processor/aggregate/jdbc/JdbcAggregateRecoverWithRedeliveryPolicyTest.java?p2=camel/trunk/components/camel-sql/src/test/java/org/apache/camel/processor/aggregate/jdbc/JdbcAggregateRecoverWithRedeliveryPolicyTest.java&p1=camel/trunk/components/camel-jdbc-aggregator/src/test/java/org/apache/camel/component/jdbc/aggregationrepository/JdbcAggregateRecoverWithRedeliveryPolicyTest.java&r1=1073182&r2=1073186&rev=1073186&view=diff
==============================================================================
--- camel/trunk/components/camel-jdbc-aggregator/src/test/java/org/apache/camel/component/jdbc/aggregationrepository/JdbcAggregateRecoverWithRedeliveryPolicyTest.java (original)
+++ camel/trunk/components/camel-sql/src/test/java/org/apache/camel/processor/aggregate/jdbc/JdbcAggregateRecoverWithRedeliveryPolicyTest.java Mon Feb 21 23:27:38 2011
@@ -14,7 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.camel.component.jdbc.aggregationrepository;
+package org.apache.camel.processor.aggregate.jdbc;
 
 import java.util.concurrent.TimeUnit;
 import java.util.concurrent.atomic.AtomicInteger;
@@ -22,27 +22,17 @@ import java.util.concurrent.atomic.Atomi
 import org.apache.camel.Exchange;
 import org.apache.camel.Processor;
 import org.apache.camel.builder.RouteBuilder;
-import org.apache.camel.processor.aggregate.AggregationStrategy;
-import org.apache.camel.test.junit4.CamelTestSupport;
 import org.junit.Test;
-import org.springframework.context.ApplicationContext;
-import org.springframework.context.support.ClassPathXmlApplicationContext;
 
-public class JdbcAggregateRecoverWithRedeliveryPolicyTest extends CamelTestSupport {
+public class JdbcAggregateRecoverWithRedeliveryPolicyTest extends AbstractJdbcAggregationTestSupport {
 
     private static AtomicInteger counter = new AtomicInteger(0);
-    private JdbcAggregationRepository repo;
-
-    @Override
-    public void setUp() throws Exception {
-        ApplicationContext applicationContext = new ClassPathXmlApplicationContext("org/apache/camel/component/jdbc/aggregationrepository/JdbcSpringDataSource.xml");
-        repo = applicationContext.getBean("repo1", JdbcAggregationRepository.class);
+    
+    void configureJdbcAggregationRepository() {
         // enable recovery
         repo.setUseRecovery(true);
         // check faster
-        repo.setRecoveryInterval(500, TimeUnit.MILLISECONDS);
-
-        super.setUp();
+        repo.setRecoveryInterval(500, TimeUnit.MILLISECONDS); 
     }
 
     @Test
@@ -92,18 +82,4 @@ public class JdbcAggregateRecoverWithRed
             }
         };
     }
-
-    public static class MyAggregationStrategy implements AggregationStrategy {
-
-        public Exchange aggregate(Exchange oldExchange, Exchange newExchange) {
-            if (oldExchange == null) {
-                return newExchange;
-            }
-            String body1 = oldExchange.getIn().getBody(String.class);
-            String body2 = newExchange.getIn().getBody(String.class);
-
-            oldExchange.getIn().setBody(body1 + body2);
-            return oldExchange;
-        }
-    }
 }
\ No newline at end of file

Copied: camel/trunk/components/camel-sql/src/test/java/org/apache/camel/processor/aggregate/jdbc/JdbcAggregateRecoverWithSedaTest.java (from r1073182, camel/trunk/components/camel-jdbc-aggregator/src/test/java/org/apache/camel/component/jdbc/aggregationrepository/JdbcAggregateRecoverWithSedaTest.java)
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-sql/src/test/java/org/apache/camel/processor/aggregate/jdbc/JdbcAggregateRecoverWithSedaTest.java?p2=camel/trunk/components/camel-sql/src/test/java/org/apache/camel/processor/aggregate/jdbc/JdbcAggregateRecoverWithSedaTest.java&p1=camel/trunk/components/camel-jdbc-aggregator/src/test/java/org/apache/camel/component/jdbc/aggregationrepository/JdbcAggregateRecoverWithSedaTest.java&r1=1073182&r2=1073186&rev=1073186&view=diff
==============================================================================
--- camel/trunk/components/camel-jdbc-aggregator/src/test/java/org/apache/camel/component/jdbc/aggregationrepository/JdbcAggregateRecoverWithSedaTest.java (original)
+++ camel/trunk/components/camel-sql/src/test/java/org/apache/camel/processor/aggregate/jdbc/JdbcAggregateRecoverWithSedaTest.java Mon Feb 21 23:27:38 2011
@@ -14,7 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.camel.component.jdbc.aggregationrepository;
+package org.apache.camel.processor.aggregate.jdbc;
 
 import java.util.concurrent.TimeUnit;
 import java.util.concurrent.atomic.AtomicInteger;
@@ -22,27 +22,17 @@ import java.util.concurrent.atomic.Atomi
 import org.apache.camel.Exchange;
 import org.apache.camel.Processor;
 import org.apache.camel.builder.RouteBuilder;
-import org.apache.camel.processor.aggregate.AggregationStrategy;
-import org.apache.camel.test.junit4.CamelTestSupport;
 import org.junit.Test;
-import org.springframework.context.ApplicationContext;
-import org.springframework.context.support.ClassPathXmlApplicationContext;
 
-public class JdbcAggregateRecoverWithSedaTest extends CamelTestSupport {
+public class JdbcAggregateRecoverWithSedaTest extends AbstractJdbcAggregationTestSupport {
 
     private static AtomicInteger counter = new AtomicInteger(0);
-    private JdbcAggregationRepository repo;
 
-    @Override
-    public void setUp() throws Exception {
-        ApplicationContext applicationContext = new ClassPathXmlApplicationContext("org/apache/camel/component/jdbc/aggregationrepository/JdbcSpringDataSource.xml");
-        repo = applicationContext.getBean("repo1", JdbcAggregationRepository.class);
+    void configureJdbcAggregationRepository() {
         // enable recovery
         repo.setUseRecovery(true);
         // check faster
         repo.setRecoveryInterval(500, TimeUnit.MILLISECONDS);
-
-        super.setUp();
     }
 
     @Test
@@ -94,18 +84,4 @@ public class JdbcAggregateRecoverWithSed
             }
         };
     }
-
-    public static class MyAggregationStrategy implements AggregationStrategy {
-
-        public Exchange aggregate(Exchange oldExchange, Exchange newExchange) {
-            if (oldExchange == null) {
-                return newExchange;
-            }
-            String body1 = oldExchange.getIn().getBody(String.class);
-            String body2 = newExchange.getIn().getBody(String.class);
-
-            oldExchange.getIn().setBody(body1 + body2);
-            return oldExchange;
-        }
-    }
 }
\ No newline at end of file

Copied: camel/trunk/components/camel-sql/src/test/java/org/apache/camel/processor/aggregate/jdbc/JdbcAggregateTest.java (from r1073182, camel/trunk/components/camel-jdbc-aggregator/src/test/java/org/apache/camel/component/jdbc/aggregationrepository/JdbcAggregateTest.java)
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-sql/src/test/java/org/apache/camel/processor/aggregate/jdbc/JdbcAggregateTest.java?p2=camel/trunk/components/camel-sql/src/test/java/org/apache/camel/processor/aggregate/jdbc/JdbcAggregateTest.java&p1=camel/trunk/components/camel-jdbc-aggregator/src/test/java/org/apache/camel/component/jdbc/aggregationrepository/JdbcAggregateTest.java&r1=1073182&r2=1073186&rev=1073186&view=diff
==============================================================================
--- camel/trunk/components/camel-jdbc-aggregator/src/test/java/org/apache/camel/component/jdbc/aggregationrepository/JdbcAggregateTest.java (original)
+++ camel/trunk/components/camel-sql/src/test/java/org/apache/camel/processor/aggregate/jdbc/JdbcAggregateTest.java Mon Feb 21 23:27:38 2011
@@ -14,30 +14,15 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.camel.component.jdbc.aggregationrepository;
+package org.apache.camel.processor.aggregate.jdbc;
 
 import java.util.concurrent.TimeUnit;
 
-import org.apache.camel.Exchange;
 import org.apache.camel.builder.RouteBuilder;
 import org.apache.camel.component.mock.MockEndpoint;
-import org.apache.camel.processor.aggregate.AggregationStrategy;
-import org.apache.camel.test.junit4.CamelTestSupport;
 import org.junit.Test;
-import org.springframework.context.ApplicationContext;
-import org.springframework.context.support.ClassPathXmlApplicationContext;
 
-public class JdbcAggregateTest extends CamelTestSupport {
-
-    JdbcAggregationRepository repo;
-
-    @Override
-    public void setUp() throws Exception {
-        ApplicationContext applicationContext = new ClassPathXmlApplicationContext("org/apache/camel/component/jdbc/aggregationrepository/JdbcSpringDataSource.xml");
-        repo = applicationContext.getBean("repo1", JdbcAggregationRepository.class);
-
-        super.setUp();
-    }
+public class JdbcAggregateTest extends AbstractJdbcAggregationTestSupport {
 
     @Test
     public void testJdbcAggregate() throws Exception {
@@ -70,18 +55,4 @@ public class JdbcAggregateTest extends C
             }
         };
     }
-
-    public static class MyAggregationStrategy implements AggregationStrategy {
-
-        public Exchange aggregate(Exchange oldExchange, Exchange newExchange) {
-            if (oldExchange == null) {
-                return newExchange;
-            }
-            String body1 = oldExchange.getIn().getBody(String.class);
-            String body2 = newExchange.getIn().getBody(String.class);
-
-            oldExchange.getIn().setBody(body1 + body2);
-            return oldExchange;
-        }
-    }
 }
\ No newline at end of file

Copied: camel/trunk/components/camel-sql/src/test/java/org/apache/camel/processor/aggregate/jdbc/JdbcAggregationRepositoryAlotDataTest.java (from r1073182, camel/trunk/components/camel-jdbc-aggregator/src/test/java/org/apache/camel/component/jdbc/aggregationrepository/JdbcAggregationRepositoryAlotDataTest.java)
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-sql/src/test/java/org/apache/camel/processor/aggregate/jdbc/JdbcAggregationRepositoryAlotDataTest.java?p2=camel/trunk/components/camel-sql/src/test/java/org/apache/camel/processor/aggregate/jdbc/JdbcAggregationRepositoryAlotDataTest.java&p1=camel/trunk/components/camel-jdbc-aggregator/src/test/java/org/apache/camel/component/jdbc/aggregationrepository/JdbcAggregationRepositoryAlotDataTest.java&r1=1073182&r2=1073186&rev=1073186&view=diff
==============================================================================
--- camel/trunk/components/camel-jdbc-aggregator/src/test/java/org/apache/camel/component/jdbc/aggregationrepository/JdbcAggregationRepositoryAlotDataTest.java (original)
+++ camel/trunk/components/camel-sql/src/test/java/org/apache/camel/processor/aggregate/jdbc/JdbcAggregationRepositoryAlotDataTest.java Mon Feb 21 23:27:38 2011
@@ -14,30 +14,16 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.camel.component.jdbc.aggregationrepository;
+package org.apache.camel.processor.aggregate.jdbc;
 
 import org.apache.camel.Exchange;
 import org.apache.camel.impl.DefaultExchange;
-import org.apache.camel.test.junit4.CamelTestSupport;
 import org.junit.Test;
-import org.springframework.context.ApplicationContext;
-import org.springframework.context.support.ClassPathXmlApplicationContext;
 
-public class JdbcAggregationRepositoryAlotDataTest extends CamelTestSupport {
-
-    ApplicationContext applicationContext;
-
-    @Override
-    public void setUp() throws Exception {
-        applicationContext = new ClassPathXmlApplicationContext("org/apache/camel/component/jdbc/aggregationrepository/JdbcSpringDataSource.xml");
-
-        super.setUp();
-    }
+public class JdbcAggregationRepositoryAlotDataTest extends AbstractJdbcAggregationTestSupport {
 
     @Test
     public void testWithAlotOfDataSameKey() {
-        JdbcAggregationRepository repo = applicationContext.getBean("repo1", JdbcAggregationRepository.class);
-
         for (int i = 0; i < 100; i++) {
             Exchange exchange1 = new DefaultExchange(context);
             exchange1.getIn().setBody("counter:" + i);
@@ -51,9 +37,6 @@ public class JdbcAggregationRepositoryAl
 
     @Test
     public void testWithAlotOfDataTwoKeys() {
-        JdbcAggregationRepository repo = applicationContext.getBean("repo1", JdbcAggregationRepository.class);
-
-
         for (int i = 0; i < 100; i++) {
             Exchange exchange1 = new DefaultExchange(context);
             exchange1.getIn().setBody("counter:" + i);
@@ -71,9 +54,6 @@ public class JdbcAggregationRepositoryAl
 
     @Test
     public void testWithAlotOfDataWithDifferentKeys() {
-        JdbcAggregationRepository repo = applicationContext.getBean("repo1", JdbcAggregationRepository.class);
-
-
         for (int i = 0; i < 100; i++) {
             Exchange exchange1 = new DefaultExchange(context);
             exchange1.getIn().setBody("counter:" + i);
@@ -87,4 +67,4 @@ public class JdbcAggregationRepositoryAl
             assertEquals("counter:" + i, actual.getIn().getBody());
         }
     }
-}
+}
\ No newline at end of file

Copied: camel/trunk/components/camel-sql/src/test/java/org/apache/camel/processor/aggregate/jdbc/JdbcAggregationRepositoryMultipleRepoTest.java (from r1073182, camel/trunk/components/camel-jdbc-aggregator/src/test/java/org/apache/camel/component/jdbc/aggregationrepository/JdbcAggregationRepositoryMultipleRepoTest.java)
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-sql/src/test/java/org/apache/camel/processor/aggregate/jdbc/JdbcAggregationRepositoryMultipleRepoTest.java?p2=camel/trunk/components/camel-sql/src/test/java/org/apache/camel/processor/aggregate/jdbc/JdbcAggregationRepositoryMultipleRepoTest.java&p1=camel/trunk/components/camel-jdbc-aggregator/src/test/java/org/apache/camel/component/jdbc/aggregationrepository/JdbcAggregationRepositoryMultipleRepoTest.java&r1=1073182&r2=1073186&rev=1073186&view=diff
==============================================================================
--- camel/trunk/components/camel-jdbc-aggregator/src/test/java/org/apache/camel/component/jdbc/aggregationrepository/JdbcAggregationRepositoryMultipleRepoTest.java (original)
+++ camel/trunk/components/camel-sql/src/test/java/org/apache/camel/processor/aggregate/jdbc/JdbcAggregationRepositoryMultipleRepoTest.java Mon Feb 21 23:27:38 2011
@@ -14,7 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.camel.component.jdbc.aggregationrepository;
+package org.apache.camel.processor.aggregate.jdbc;
 
 import org.apache.camel.Exchange;
 import org.apache.camel.impl.DefaultExchange;
@@ -29,7 +29,7 @@ public class JdbcAggregationRepositoryMu
 
     @Override
     public void setUp() throws Exception {
-        applicationContext = new ClassPathXmlApplicationContext("org/apache/camel/component/jdbc/aggregationrepository/JdbcSpringDataSource.xml");
+        applicationContext = new ClassPathXmlApplicationContext("org/apache/camel/processor/aggregate/jdbc/JdbcSpringDataSource.xml");
 
         super.setUp();
     }
@@ -103,5 +103,4 @@ public class JdbcAggregationRepositoryMu
         actual = repo2.get(context, "foo");
         assertEquals("Bye World", actual.getIn().getBody());
     }
-
 }
\ No newline at end of file

Copied: camel/trunk/components/camel-sql/src/test/java/org/apache/camel/processor/aggregate/jdbc/JdbcAggregationRepositoryRecoverExistingTest.java (from r1073182, camel/trunk/components/camel-jdbc-aggregator/src/test/java/org/apache/camel/component/jdbc/aggregationrepository/JdbcAggregationRepositoryRecoverExistingTest.java)
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-sql/src/test/java/org/apache/camel/processor/aggregate/jdbc/JdbcAggregationRepositoryRecoverExistingTest.java?p2=camel/trunk/components/camel-sql/src/test/java/org/apache/camel/processor/aggregate/jdbc/JdbcAggregationRepositoryRecoverExistingTest.java&p1=camel/trunk/components/camel-jdbc-aggregator/src/test/java/org/apache/camel/component/jdbc/aggregationrepository/JdbcAggregationRepositoryRecoverExistingTest.java&r1=1073182&r2=1073186&rev=1073186&view=diff
==============================================================================
--- camel/trunk/components/camel-jdbc-aggregator/src/test/java/org/apache/camel/component/jdbc/aggregationrepository/JdbcAggregationRepositoryRecoverExistingTest.java (original)
+++ camel/trunk/components/camel-sql/src/test/java/org/apache/camel/processor/aggregate/jdbc/JdbcAggregationRepositoryRecoverExistingTest.java Mon Feb 21 23:27:38 2011
@@ -14,31 +14,32 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.camel.component.jdbc.aggregationrepository;
+package org.apache.camel.processor.aggregate.jdbc;
 
 import org.apache.camel.Exchange;
+import org.apache.camel.builder.RouteBuilder;
 import org.apache.camel.impl.DefaultExchange;
-import org.apache.camel.test.junit4.CamelTestSupport;
 import org.junit.Test;
-import org.springframework.context.ApplicationContext;
-import org.springframework.context.support.ClassPathXmlApplicationContext;
 
-public class JdbcAggregationRepositoryRecoverExistingTest extends CamelTestSupport {
-
-    ApplicationContext applicationContext;
+public class JdbcAggregationRepositoryRecoverExistingTest extends AbstractJdbcAggregationTestSupport {
 
     @Override
-    public void setUp() throws Exception {
-        applicationContext = new ClassPathXmlApplicationContext("org/apache/camel/component/jdbc/aggregationrepository/JdbcSpringDataSource.xml");
-
-        super.setUp();
+    void configureJdbcAggregationRepository() {
+        repo.setReturnOldExchange(true);
+        repo.setUseRecovery(true);
+    }
+    
+    @Override
+    protected RouteBuilder createRouteBuilder() throws Exception {
+        return new RouteBuilder() {
+            public void configure() {
+                // no routes added by default
+            }
+        };
     }
 
     @Test
     public void testExisting() throws Exception {
-        JdbcAggregationRepository repo = applicationContext.getBean("repo1", JdbcAggregationRepository.class);
-        repo.setReturnOldExchange(true);
-        repo.setUseRecovery(true);
         repo.start();
 
         // Store it..
@@ -71,5 +72,4 @@ public class JdbcAggregationRepositoryRe
 
         repo.stop();
     }
-
 }
\ No newline at end of file



Mime
View raw message