activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tab...@apache.org
Subject svn commit: r1329240 - /activemq/trunk/activemq-core/src/test/java/org/apache/activemq/broker/scheduler/JobSchedulerTest.java
Date Mon, 23 Apr 2012 13:50:40 GMT
Author: tabish
Date: Mon Apr 23 13:50:40 2012
New Revision: 1329240

URL: http://svn.apache.org/viewvc?rev=1329240&view=rev
Log:
Make the test more deterministic to fix test errors on slower machines. 

Modified:
    activemq/trunk/activemq-core/src/test/java/org/apache/activemq/broker/scheduler/JobSchedulerTest.java

Modified: activemq/trunk/activemq-core/src/test/java/org/apache/activemq/broker/scheduler/JobSchedulerTest.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/broker/scheduler/JobSchedulerTest.java?rev=1329240&r1=1329239&r2=1329240&view=diff
==============================================================================
--- activemq/trunk/activemq-core/src/test/java/org/apache/activemq/broker/scheduler/JobSchedulerTest.java
(original)
+++ activemq/trunk/activemq-core/src/test/java/org/apache/activemq/broker/scheduler/JobSchedulerTest.java
Mon Apr 23 13:50:40 2012
@@ -18,11 +18,13 @@ package org.apache.activemq.broker.sched
 
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertTrue;
+
 import java.io.File;
 import java.util.Calendar;
 import java.util.List;
 import java.util.concurrent.CountDownLatch;
 import java.util.concurrent.TimeUnit;
+
 import org.apache.activemq.util.IOHelper;
 import org.apache.kahadb.util.ByteSequence;
 import org.junit.After;
@@ -129,17 +131,17 @@ public class JobSchedulerTest {
     public void testRemoveLong() throws Exception {
         final int COUNT = 10;
 
-        long time = 20000;
+        long time = 60000;
         for (int i = 0; i < COUNT; i++) {
             String str = new String("test" + i);
             scheduler.schedule("id" + i, new ByteSequence(str.getBytes()), "", time, 1000,
-1);
 
         }
-        int size = scheduler.getNextScheduleJobs().size();
+        int size = scheduler.getAllJobs().size();
         assertEquals(size, COUNT);
         long removeTime = scheduler.getNextScheduleTime();
         scheduler.remove(removeTime);
-        size = scheduler.getNextScheduleJobs().size();
+        size = scheduler.getAllJobs().size();
         assertEquals(0, size);
     }
 
@@ -150,16 +152,16 @@ public class JobSchedulerTest {
         long time = 20000;
         for (int i = 0; i < COUNT; i++) {
             String str = new String("test" + i);
-            scheduler.schedule("id" + i, new ByteSequence(str.getBytes()), "", time, 10,
-1);
+            scheduler.schedule("id" + i, new ByteSequence(str.getBytes()), "", time, 1000,
-1);
             if (i == COUNT / 2) {
-                scheduler.schedule(test, new ByteSequence(test.getBytes()), "", time, 10,
-1);
+                scheduler.schedule(test, new ByteSequence(test.getBytes()), "", time, 1000,
-1);
             }
         }
 
-        int size = scheduler.getNextScheduleJobs().size();
+        int size = scheduler.getAllJobs().size();
         assertEquals(size, COUNT + 1);
         scheduler.remove(test);
-        size = scheduler.getNextScheduleJobs().size();
+        size = scheduler.getAllJobs().size();
         assertEquals(size, COUNT);
     }
 



Mime
View raw message