You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by da...@apache.org on 2010/04/29 14:57:34 UTC
svn commit: r939301 - in
/camel/trunk/components/camel-hawtdb/src/test/java/org/apache/camel/component/hawtdb:
HawtDBAggregateConcurrentDifferentGroupsTest.java
HawtDBAggregateConcurrentSameGroupTest.java HawtDBAggregateLoadTest.java
Author: davsclaus
Date: Thu Apr 29 12:57:34 2010
New Revision: 939301
URL: http://svn.apache.org/viewvc?rev=939301&view=rev
Log:
Polished the test.
Modified:
camel/trunk/components/camel-hawtdb/src/test/java/org/apache/camel/component/hawtdb/HawtDBAggregateConcurrentDifferentGroupsTest.java
camel/trunk/components/camel-hawtdb/src/test/java/org/apache/camel/component/hawtdb/HawtDBAggregateConcurrentSameGroupTest.java
camel/trunk/components/camel-hawtdb/src/test/java/org/apache/camel/component/hawtdb/HawtDBAggregateLoadTest.java
Modified: camel/trunk/components/camel-hawtdb/src/test/java/org/apache/camel/component/hawtdb/HawtDBAggregateConcurrentDifferentGroupsTest.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-hawtdb/src/test/java/org/apache/camel/component/hawtdb/HawtDBAggregateConcurrentDifferentGroupsTest.java?rev=939301&r1=939300&r2=939301&view=diff
==============================================================================
--- camel/trunk/components/camel-hawtdb/src/test/java/org/apache/camel/component/hawtdb/HawtDBAggregateConcurrentDifferentGroupsTest.java (original)
+++ camel/trunk/components/camel-hawtdb/src/test/java/org/apache/camel/component/hawtdb/HawtDBAggregateConcurrentDifferentGroupsTest.java Thu Apr 29 12:57:34 2010
@@ -16,7 +16,6 @@
*/
package org.apache.camel.component.hawtdb;
-import java.io.File;
import java.util.concurrent.Callable;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
@@ -33,25 +32,12 @@ import org.junit.Test;
*/
public class HawtDBAggregateConcurrentDifferentGroupsTest extends CamelTestSupport {
- private HawtDBFile hawtDBFile;
-
@Override
public void setUp() throws Exception {
deleteDirectory("target/data");
- File file = new File("target/data/hawtdb.dat");
- hawtDBFile = new HawtDBFile();
- hawtDBFile.setFile(file);
- hawtDBFile.start();
-
super.setUp();
}
- @Override
- public void tearDown() throws Exception {
- hawtDBFile.stop();
- super.tearDown();
- }
-
@Test
public void testNoConcurrentProducers() throws Exception {
doSendMessages(2, 1);
@@ -93,9 +79,7 @@ public class HawtDBAggregateConcurrentDi
protected RouteBuilder createRouteBuilder() throws Exception {
return new RouteBuilder() {
public void configure() throws Exception {
- HawtDBAggregationRepository repo = new HawtDBAggregationRepository();
- repo.setHawtDBFile(hawtDBFile);
- repo.setRepositoryName("repo1");
+ HawtDBAggregationRepository repo = new HawtDBAggregationRepository("repo1", "target/data/hawtdb.dat");
from("direct:start")
.aggregate(header("id"), new MyAggregationStrategy())
Modified: camel/trunk/components/camel-hawtdb/src/test/java/org/apache/camel/component/hawtdb/HawtDBAggregateConcurrentSameGroupTest.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-hawtdb/src/test/java/org/apache/camel/component/hawtdb/HawtDBAggregateConcurrentSameGroupTest.java?rev=939301&r1=939300&r2=939301&view=diff
==============================================================================
--- camel/trunk/components/camel-hawtdb/src/test/java/org/apache/camel/component/hawtdb/HawtDBAggregateConcurrentSameGroupTest.java (original)
+++ camel/trunk/components/camel-hawtdb/src/test/java/org/apache/camel/component/hawtdb/HawtDBAggregateConcurrentSameGroupTest.java Thu Apr 29 12:57:34 2010
@@ -16,7 +16,6 @@
*/
package org.apache.camel.component.hawtdb;
-import java.io.File;
import java.util.concurrent.Callable;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
@@ -33,25 +32,12 @@ import org.junit.Test;
*/
public class HawtDBAggregateConcurrentSameGroupTest extends CamelTestSupport {
- private HawtDBFile hawtDBFile;
-
@Override
public void setUp() throws Exception {
deleteDirectory("target/data");
- File file = new File("target/data/hawtdb.dat");
- hawtDBFile = new HawtDBFile();
- hawtDBFile.setFile(file);
- hawtDBFile.start();
-
super.setUp();
}
- @Override
- public void tearDown() throws Exception {
- hawtDBFile.stop();
- super.tearDown();
- }
-
@Test
public void testNoConcurrentProducers() throws Exception {
doSendMessages(1, 1);
@@ -92,9 +78,7 @@ public class HawtDBAggregateConcurrentSa
protected RouteBuilder createRouteBuilder() throws Exception {
return new RouteBuilder() {
public void configure() throws Exception {
- HawtDBAggregationRepository repo = new HawtDBAggregationRepository();
- repo.setHawtDBFile(hawtDBFile);
- repo.setRepositoryName("repo1");
+ HawtDBAggregationRepository repo = new HawtDBAggregationRepository("repo1", "target/data/hawtdb.dat");
from("direct:start")
.aggregate(header("id"), new MyAggregationStrategy())
Modified: camel/trunk/components/camel-hawtdb/src/test/java/org/apache/camel/component/hawtdb/HawtDBAggregateLoadTest.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-hawtdb/src/test/java/org/apache/camel/component/hawtdb/HawtDBAggregateLoadTest.java?rev=939301&r1=939300&r2=939301&view=diff
==============================================================================
--- camel/trunk/components/camel-hawtdb/src/test/java/org/apache/camel/component/hawtdb/HawtDBAggregateLoadTest.java (original)
+++ camel/trunk/components/camel-hawtdb/src/test/java/org/apache/camel/component/hawtdb/HawtDBAggregateLoadTest.java Thu Apr 29 12:57:34 2010
@@ -31,11 +31,13 @@ public class HawtDBAggregateLoadTest ext
private static final Log LOG = LogFactory.getLog(HawtDBAggregateLoadTest.class);
private static final int SIZE = 500;
+ private HawtDBAggregationRepository repo;
@Before
@Override
public void setUp() throws Exception {
deleteDirectory("target/data");
+ repo = new HawtDBAggregationRepository("repo1", "target/data/hawtdb.dat");
super.setUp();
}
@@ -66,8 +68,6 @@ public class HawtDBAggregateLoadTest ext
return new RouteBuilder() {
@Override
public void configure() throws Exception {
- HawtDBAggregationRepository repo = new HawtDBAggregationRepository("repo1", "target/data/hawtdb.dat");
-
from("seda:start?size=" + SIZE)
.to("log:input?groupSize=500")
.aggregate(header("id"), new MyAggregationStrategy())