svn commit: r935875 - in /camel/trunk: camel-core/src/main/java/org/apache/camel/processor/aggregate/ components/camel-hawtdb/src/test/java/org/apache/camel/component/hawtdb/ components/camel-jms/src/test/java/org/apache/camel/component/jms/tuning/ com...

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

svn commit: r935875 - in /camel/trunk: camel-core/src/main/java/org/apache/camel/processor/aggregate/ components/camel-hawtdb/src/test/java/org/apache/camel/component/hawtdb/ components/camel-jms/src/test/java/org/apache/camel/component/jms/tuning/ com...

davsclaus-2
Author: davsclaus
Date: Tue Apr 20 11:33:35 2010
New Revision: 935875

URL: http://svn.apache.org/viewvc?rev=935875&view=rev
Log:
Have unit tests class and method name be logged when using camel-test. Fixed tests on other boxes.

Modified:
    camel/trunk/camel-core/src/main/java/org/apache/camel/processor/aggregate/AggregateProcessor.java
    camel/trunk/components/camel-hawtdb/src/test/java/org/apache/camel/component/hawtdb/HawtDBAggregateLoadConcurrentTest.java
    camel/trunk/components/camel-jms/src/test/java/org/apache/camel/component/jms/tuning/PerformanceRouteTest.java
    camel/trunk/components/camel-test/src/main/java/org/apache/camel/test/CamelTestSupport.java
    camel/trunk/components/camel-test/src/main/java/org/apache/camel/test/junit4/CamelTestSupport.java
    camel/trunk/components/camel-test/src/main/java/org/apache/camel/test/junit4/TestSupport.java

Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/processor/aggregate/AggregateProcessor.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/processor/aggregate/AggregateProcessor.java?rev=935875&r1=935874&r2=935875&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/processor/aggregate/AggregateProcessor.java (original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/processor/aggregate/AggregateProcessor.java Tue Apr 20 11:33:35 2010
@@ -778,7 +778,7 @@ public class AggregateProcessor extends
 
         // start timeout service if its in use
         if (getCompletionTimeout() > 0 || getCompletionTimeoutExpression() != null) {
-            LOG.info("Using CompletionTimeout to trigger after " + getCompletionInterval() + " millis of inactivity.");
+            LOG.info("Using CompletionTimeout to trigger after " + getCompletionTimeout() + " millis of inactivity.");
             ScheduledExecutorService scheduler = camelContext.getExecutorServiceStrategy().newScheduledThreadPool(this, "AggregateTimeoutChecker", 1);
             // check for timed out aggregated messages once every second
             timeoutMap = new AggregationTimeoutMap(scheduler, 1000L);

Modified: camel/trunk/components/camel-hawtdb/src/test/java/org/apache/camel/component/hawtdb/HawtDBAggregateLoadConcurrentTest.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-hawtdb/src/test/java/org/apache/camel/component/hawtdb/HawtDBAggregateLoadConcurrentTest.java?rev=935875&r1=935874&r2=935875&view=diff
==============================================================================
--- camel/trunk/components/camel-hawtdb/src/test/java/org/apache/camel/component/hawtdb/HawtDBAggregateLoadConcurrentTest.java (original)
+++ camel/trunk/components/camel-hawtdb/src/test/java/org/apache/camel/component/hawtdb/HawtDBAggregateLoadConcurrentTest.java Tue Apr 20 11:33:35 2010
@@ -46,7 +46,7 @@ public class HawtDBAggregateLoadConcurre
     @Test
     public void testLoadTestHawtDBAggregate() throws Exception {
         MockEndpoint mock = getMockEndpoint("mock:result");
-        mock.expectedMinimumMessageCount(9);
+        mock.expectedMessageCount(10);
         mock.setResultWaitTime(30 * 1000);
 
         ExecutorService executor = Executors.newFixedThreadPool(10);
@@ -62,7 +62,7 @@ public class HawtDBAggregateLoadConcurre
                     if (LOG.isDebugEnabled()) {
                         LOG.debug("Sending " + value + " with id " + id);
                     }
-                    template.sendBodyAndHeader("seda:start?size=" + SIZE, value, "id", "" + id);
+                    template.sendBodyAndHeader("direct:start", value, "id", "" + id);
                     return null;
                 }
             });
@@ -80,7 +80,7 @@ public class HawtDBAggregateLoadConcurre
             public void configure() throws Exception {
                 HawtDBAggregationRepository repo = new HawtDBAggregationRepository("repo1", "target/data/hawtdb.dat");
 
-                from("seda:start?size=" + SIZE)
+                from("direct:start")
                     .to("log:input?groupSize=500")
                     .aggregate(header("id"), new MyAggregationStrategy())
                         .aggregationRepository(repo)

Modified: camel/trunk/components/camel-jms/src/test/java/org/apache/camel/component/jms/tuning/PerformanceRouteTest.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-jms/src/test/java/org/apache/camel/component/jms/tuning/PerformanceRouteTest.java?rev=935875&r1=935874&r2=935875&view=diff
==============================================================================
--- camel/trunk/components/camel-jms/src/test/java/org/apache/camel/component/jms/tuning/PerformanceRouteTest.java (original)
+++ camel/trunk/components/camel-jms/src/test/java/org/apache/camel/component/jms/tuning/PerformanceRouteTest.java Tue Apr 20 11:33:35 2010
@@ -45,8 +45,8 @@ public class PerformanceRouteTest extend
         getMockEndpoint("mock:audit").expectedMessageCount(size);
         getMockEndpoint("mock:audit").expectsNoDuplicates().body();
 
-        getMockEndpoint("mock:gold").expectedMessageCount((size / 2) - (size / 10));
-        getMockEndpoint("mock:silver").expectedMessageCount(size / 10);
+        getMockEndpoint("mock:gold").expectedMinimumMessageCount((size / 2) - (size / 10));
+        getMockEndpoint("mock:silver").expectedMinimumMessageCount(size / 10);
 
         for (int i = 0; i < size; i++) {
             String type;

Modified: camel/trunk/components/camel-test/src/main/java/org/apache/camel/test/CamelTestSupport.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-test/src/main/java/org/apache/camel/test/CamelTestSupport.java?rev=935875&r1=935874&r2=935875&view=diff
==============================================================================
--- camel/trunk/components/camel-test/src/main/java/org/apache/camel/test/CamelTestSupport.java (original)
+++ camel/trunk/components/camel-test/src/main/java/org/apache/camel/test/CamelTestSupport.java Tue Apr 20 11:33:35 2010
@@ -79,6 +79,11 @@ public abstract class CamelTestSupport e
 
     @Override
     protected void setUp() throws Exception {
+        log.info("********************************************************************************");
+        log.info("Testing: " + getName() + "(" + getClass().getName() + ")");
+        log.info("********************************************************************************");
+
+        log.debug("setUp test");
         if (!useJmx()) {
             disableJMX();
         } else {
@@ -112,6 +117,8 @@ public abstract class CamelTestSupport e
 
     @Override
     protected void tearDown() throws Exception {
+        log.info("Testing done: " + this);
+
         log.debug("tearDown test: " + getName());
         if (consumer != null) {
             consumer.stop();

Modified: camel/trunk/components/camel-test/src/main/java/org/apache/camel/test/junit4/CamelTestSupport.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-test/src/main/java/org/apache/camel/test/junit4/CamelTestSupport.java?rev=935875&r1=935874&r2=935875&view=diff
==============================================================================
--- camel/trunk/components/camel-test/src/main/java/org/apache/camel/test/junit4/CamelTestSupport.java (original)
+++ camel/trunk/components/camel-test/src/main/java/org/apache/camel/test/junit4/CamelTestSupport.java Tue Apr 20 11:33:35 2010
@@ -81,6 +81,11 @@ public abstract class CamelTestSupport e
 
     @Before
     public void setUp() throws Exception {
+        log.info("********************************************************************************");
+        log.info("Testing: " + getName() + "(" + getClass().getName() + ")");
+        log.info("********************************************************************************");
+
+        log.debug("setUp test");
         if (!useJmx()) {
             disableJMX();
         } else {
@@ -116,7 +121,9 @@ public abstract class CamelTestSupport e
 
     @After
     public void tearDown() throws Exception {
-        log.debug("tearDown test ");
+        log.info("Testing done: " + this);
+
+        log.debug("tearDown test");
         if (consumer != null) {
             consumer.stop();
         }

Modified: camel/trunk/components/camel-test/src/main/java/org/apache/camel/test/junit4/TestSupport.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-test/src/main/java/org/apache/camel/test/junit4/TestSupport.java?rev=935875&r1=935874&r2=935875&view=diff
==============================================================================
--- camel/trunk/components/camel-test/src/main/java/org/apache/camel/test/junit4/TestSupport.java (original)
+++ camel/trunk/components/camel-test/src/main/java/org/apache/camel/test/junit4/TestSupport.java Tue Apr 20 11:33:35 2010
@@ -21,6 +21,7 @@ import java.util.Collection;
 import java.util.List;
 import java.util.Locale;
 
+import junit.framework.TestCase;
 import org.apache.camel.CamelContext;
 import org.apache.camel.Channel;
 import org.apache.camel.Endpoint;
@@ -48,7 +49,7 @@ import org.junit.Assert;
  *
  * @version $Revision$
  */
-public abstract class TestSupport extends Assert {
+public abstract class TestSupport extends TestCase {
     private static final Log LOG = LogFactory.getLog(TestSupport.class);    
     protected transient Log log = LogFactory.getLog(getClass());