use of com.adobe.acs.commons.fam.ActionManager in project acs-aem-commons by Adobe-Consulting-Services.
the class ActionManagerFactoryImpl method purgeCompletedTasks.
@Override
public void purgeCompletedTasks() {
for (Iterator<ActionManager> taskIterator = tasks.values().iterator(); taskIterator.hasNext(); ) {
ActionManager task = taskIterator.next();
if (task.isComplete() || taskRunner.getActiveCount() == 0) {
task.closeAllResolvers();
taskIterator.remove();
}
}
}
use of com.adobe.acs.commons.fam.ActionManager in project acs-aem-commons by Adobe-Consulting-Services.
the class BrokenLinksTest method getControlledProcessManager.
private ControlledProcessManager getControlledProcessManager() throws LoginException {
ActionManager am = getActionManager();
ActionManagerFactory amf = mock(ActionManagerFactoryImpl.class);
when(amf.createTaskManager(any(), any(), anyInt())).thenReturn(am);
ControlledProcessManager cpm = mock(ControlledProcessManager.class);
when(cpm.getActionManagerFactory()).thenReturn(amf);
when(cpm.getServiceResourceResolver()).thenReturn(getMockResolver());
return cpm;
}
use of com.adobe.acs.commons.fam.ActionManager in project acs-aem-commons by Adobe-Consulting-Services.
the class ActionManagerTest method deferredStatsCounterTest.
@Test
public void deferredStatsCounterTest() throws LoginException, Exception {
ResourceResolver rr = getMockResolver();
ActionManager manager = getActionManager();
assertEquals(0, manager.getAddedCount());
manager.deferredWithResolver(resolver -> {
});
assertEquals(1, manager.getAddedCount());
assertEquals(1, manager.getCompletedCount());
manager.deferredWithResolver(resolver -> {
});
assertEquals(2, manager.getAddedCount());
assertEquals(2, manager.getSuccessCount());
assertEquals(2, manager.getCompletedCount());
assertEquals(0, manager.getErrorCount());
assertEquals(0, manager.getRemainingCount());
assertTrue(manager.isComplete());
}
use of com.adobe.acs.commons.fam.ActionManager in project acs-aem-commons by Adobe-Consulting-Services.
the class ActionManagerTest method closeAllResolversTest.
@Test
public void closeAllResolversTest() throws LoginException, Exception {
ResourceResolver rr = getMockResolver();
ActionManager manager = getActionManager();
manager.deferredWithResolver(resolver -> {
});
manager.deferredWithResolver(resolver -> {
});
manager.deferredWithResolver(resolver -> {
});
manager.deferredWithResolver(resolver -> {
});
manager.closeAllResolvers();
verify(rr, atLeast(5)).close();
}
use of com.adobe.acs.commons.fam.ActionManager in project acs-aem-commons by Adobe-Consulting-Services.
the class PageRelocatorTest method getControlledProcessManager.
private ControlledProcessManager getControlledProcessManager() throws LoginException {
ActionManager am = getActionManager();
ActionManagerFactory amf = mock(ActionManagerFactoryImpl.class);
when(amf.createTaskManager(any(), any(), anyInt())).thenReturn(am);
ControlledProcessManager cpm = mock(ControlledProcessManager.class);
when(cpm.getActionManagerFactory()).thenReturn(amf);
when(cpm.getServiceResourceResolver()).thenReturn(getMockResolver());
return cpm;
}
Aggregations