mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
Scheduled action executor - Unit tests for most execution cases, persistance still TODO (ALF-4346)
git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@21846 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -1265,11 +1265,13 @@ public class ActionServiceImplTest extends BaseAlfrescoSpringTest
|
||||
public static final String NAME = "sleep-action";
|
||||
public static final String GO_BANG = "GoBang";
|
||||
private int sleepMs;
|
||||
|
||||
private Thread executingThread;
|
||||
|
||||
private int timesExecuted = 0;
|
||||
private void incrementTimesExecutedCount() {timesExecuted++;}
|
||||
public int getTimesExecuted() {return timesExecuted;}
|
||||
private Thread executingThread;
|
||||
public void resetTimesExecuted() {timesExecuted=0;}
|
||||
|
||||
private ActionTrackingService actionTrackingService;
|
||||
|
||||
@@ -1341,11 +1343,12 @@ public class ActionServiceImplTest extends BaseAlfrescoSpringTest
|
||||
throw new RuntimeException("Bang!");
|
||||
}
|
||||
|
||||
CancellableSleepAction ca = (CancellableSleepAction)action;
|
||||
boolean cancelled = actionTrackingService.isCancellationRequested(ca);
|
||||
if(cancelled)
|
||||
if(action instanceof CancellableSleepAction)
|
||||
{
|
||||
throw new ActionCancelledException(ca);
|
||||
CancellableSleepAction ca = (CancellableSleepAction)action;
|
||||
boolean cancelled = actionTrackingService.isCancellationRequested(ca);
|
||||
if(cancelled)
|
||||
throw new ActionCancelledException(ca);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user