ALF-4348 - Fix up scheduled replication execution, and stub out the unit tests for this

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@22027 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Nick Burch
2010-08-26 16:17:37 +00:00
parent 61583adef0
commit baf2876ffc
3 changed files with 19 additions and 8 deletions

View File

@@ -22,19 +22,11 @@ import java.util.ArrayList;
import java.util.List;
import org.alfresco.repo.jscript.BaseScopableProcessorExtension;
import org.alfresco.repo.jscript.ScriptNode;
import org.alfresco.service.ServiceRegistry;
import org.alfresco.service.cmr.action.Action;
import org.alfresco.service.cmr.action.ActionTrackingService;
import org.alfresco.service.cmr.action.CancellableAction;
import org.alfresco.service.cmr.action.ExecutionDetails;
import org.alfresco.service.cmr.action.ExecutionSummary;
import org.alfresco.service.cmr.rendition.RenderingEngineDefinition;
import org.alfresco.service.cmr.rendition.RenditionDefinition;
import org.alfresco.service.cmr.rendition.RenditionService;
import org.alfresco.service.cmr.repository.ChildAssociationRef;
import org.alfresco.service.cmr.repository.NodeRef;
import org.alfresco.service.namespace.QName;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

View File

@@ -169,6 +169,14 @@ public class ReplicationActionExecutor extends ActionExecuterAbstractBase {
@Override
protected void executeImpl(Action action, NodeRef actionedUponNodeRef) {
// Specialise the action if needed, eg when loaded directly from
// the NodeRef without going via the replication service
if(action.getActionDefinitionName().equals(ReplicationDefinitionImpl.EXECUTOR_NAME))
{
action = new ReplicationDefinitionImpl(action);
}
// Off we go
final ReplicationDefinition replicationDef = (ReplicationDefinition)action;
if(replicationDef.getTargetName() == null ||
replicationDef.getTargetName().equals(""))

View File

@@ -1004,6 +1004,17 @@ public class ReplicationServiceIntegrationTest extends TestCase
replicationService.deleteReplicationDefinition(rd);
assertEquals(count, scheduledPersistedActionService.listSchedules().size());
txn.commit();
// Ask for it to run scheduled
// Should fire up and then fail due to missing definitions
// TODO
}
public void testCancellation() throws Exception
{
// TODO
}