[jboss-svn-commits] JBL Code SVN: r20221 - labs/jbossrules/trunk/drools-compiler/src/test/java/org/drools/integrationtests.
jboss-svn-commits at lists.jboss.org
jboss-svn-commits at lists.jboss.org
Thu May 29 15:51:40 EDT 2008
Author: mark.proctor at jboss.com
Date: 2008-05-29 15:51:40 -0400 (Thu, 29 May 2008)
New Revision: 20221
Modified:
labs/jbossrules/trunk/drools-compiler/src/test/java/org/drools/integrationtests/ProcessTimerTest.java
Log:
JBRULES-1625 Create Scheduler API with JDK implementation
-Basic refactoring for for TimerService, instead of Scheduler
Modified: labs/jbossrules/trunk/drools-compiler/src/test/java/org/drools/integrationtests/ProcessTimerTest.java
===================================================================
--- labs/jbossrules/trunk/drools-compiler/src/test/java/org/drools/integrationtests/ProcessTimerTest.java 2008-05-29 19:51:34 UTC (rev 20220)
+++ labs/jbossrules/trunk/drools-compiler/src/test/java/org/drools/integrationtests/ProcessTimerTest.java 2008-05-29 19:51:40 UTC (rev 20221)
@@ -37,7 +37,7 @@
" <nodes>\n" +
" <start id=\"1\" name=\"Start\" />\n" +
" <end id=\"2\" name=\"End\" />\n" +
- " <timer id=\"3\" name=\"Timer\" delay=\"2000\" period=\"1000\" />\n" +
+ " <timer id=\"3\" name=\"Timer\" delay=\"800\" period=\"200\" />\n" +
" <action id=\"4\" name=\"Action\" dialect=\"java\" >System.out.println(\"Triggered\");\n" +
"insert( new Message() );\n" +
"myList.add( new Message() );</action>\n" +
@@ -63,9 +63,19 @@
workingMemory.startProcess("org.drools.timer");
assertEquals(0, myList.size());
assertEquals(ProcessInstance.STATE_ACTIVE, processInstance.getState());
+
+ // test that the delay works
try {
- Thread.sleep(10000);
+ Thread.sleep(600);
} catch (InterruptedException e) {
+ // do nothing
+ }
+ assertEquals(0, myList.size());
+
+ // test that the period works
+ try {
+ Thread.sleep(1300);
+ } catch (InterruptedException e) {
// do nothing
}
assertEquals(5, myList.size());
More information about the jboss-svn-commits
mailing list