1 4 package com.openedit.modules; 5 6 import com.openedit.BaseTestCase; 7 import com.openedit.modules.scheduler.Action; 8 import com.openedit.modules.scheduler.SchedulerModule; 9 import com.openedit.modules.scheduler.TestModule; 10 11 14 public class SchedulerModuleTest extends BaseTestCase 15 { 16 17 public SchedulerModuleTest( String arg0 ) 18 { 19 super( arg0 ); 20 String base = System.getProperty("basedir"); 21 if ( base == null) 22 { 23 System.setProperty("basedir","resources/test"); 24 } 25 } 26 27 public void testScheduler() throws Exception 28 { 29 SchedulerModule scheduler = (SchedulerModule) getModule( "Scheduler" ); 30 assertNotNull( scheduler ); 31 scheduler.startTask( new Action("/testmod.html", 0,1000) ); 32 33 TestModule testModule = ( TestModule ) getModule( "TestModule" ); 34 assertNotNull( testModule ); 35 Thread.sleep( 1400 ); 36 assertTrue( testModule.getCount() > 0 ); 37 } 38 41 protected void tearDown() throws Exception { 42 super.tearDown(); 44 45 SchedulerModule scheduler = (SchedulerModule) getModule( "Scheduler" ); 46 scheduler.shutdown(); 47 } 48 } 49 | Popular Tags |