ACE-403: As an administrator I want to be able to defer the start of cron based jobs

- Added debug information for testing that jobs run after specified delay.
   - Improved comments, and added test run times to comments.
   - Added CronTriggerBeanSystemTest to test suite.

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@63613 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Ahmed Owian
2014-03-04 17:23:54 +00:00
parent 9684596e82
commit a9923dccfa
3 changed files with 10 additions and 6 deletions

View File

@@ -437,5 +437,6 @@ public class Repository01TestSuite extends TestSuite
suite.addTest(new JUnit4TestAdapter(org.alfresco.util.test.junitrules.TemporaryNodesTest.class)); suite.addTest(new JUnit4TestAdapter(org.alfresco.util.test.junitrules.TemporaryNodesTest.class));
suite.addTest(new JUnit4TestAdapter(org.alfresco.util.test.junitrules.TemporarySitesTest.class)); suite.addTest(new JUnit4TestAdapter(org.alfresco.util.test.junitrules.TemporarySitesTest.class));
suite.addTest(new JUnit4TestAdapter(org.alfresco.util.CronTriggerBeanTest.class)); suite.addTest(new JUnit4TestAdapter(org.alfresco.util.CronTriggerBeanTest.class));
suite.addTest(new JUnit4TestAdapter(org.alfresco.util.CronTriggerBeanSystemTest.class));
} }
} }

View File

@@ -22,15 +22,17 @@ package org.alfresco.util;
import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue; import static org.junit.Assert.assertTrue;
import java.util.*; import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import org.junit.Before; import org.junit.Before;
import org.junit.Test; import org.junit.Test;
import org.springframework.context.support.ClassPathXmlApplicationContext; import org.springframework.context.support.ClassPathXmlApplicationContext;
/** /**
* This class tests that the CronTriggerBean correctly delays jobs when * This class tests the CronTriggerBean within the full Alfresco context.
* specified. * This test runs in about 45 seconds.
* *
* @author Ahmed Owian * @author Ahmed Owian
*/ */
@@ -41,8 +43,7 @@ public class CronTriggerBeanSystemTest
@Before @Before
public void setUp() throws Exception public void setUp() throws Exception
{ {
this.context = (ClassPathXmlApplicationContext) ApplicationContextHelper this.context = (ClassPathXmlApplicationContext) ApplicationContextHelper.getApplicationContext();
.getApplicationContext();
} }
/** /**

View File

@@ -41,6 +41,8 @@ import org.springframework.context.support.ClassPathXmlApplicationContext;
/** /**
* This class tests that the CronTriggerBean correctly delays jobs when specified. * This class tests that the CronTriggerBean correctly delays jobs when specified.
* This test runs in about 25 seconds.
*
* @author Ahmed Owian * @author Ahmed Owian
*/ */
public class CronTriggerBeanTest public class CronTriggerBeanTest