mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
Replication Definition enable/disable/check support (Replication 69+70)
Ability to enable and disable replication definitions, which the executor checks, along with unit tests git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@21382 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -309,6 +309,7 @@ public class ReplicationServiceIntegrationTest extends BaseAlfrescoSpringTest
|
||||
assertEquals(ACTION_NAME, rdTT.getReplicationName());
|
||||
assertEquals("Test", rdTT.getDescription());
|
||||
assertEquals("TestTarget", rdTT.getTargetName());
|
||||
assertEquals(true, rdTT.isEnabled());
|
||||
assertEquals(0, rdTT.getPayload().size());
|
||||
|
||||
// Save and re-load without changes
|
||||
@@ -317,11 +318,13 @@ public class ReplicationServiceIntegrationTest extends BaseAlfrescoSpringTest
|
||||
assertEquals(ACTION_NAME, rdTT.getReplicationName());
|
||||
assertEquals("Test", rdTT.getDescription());
|
||||
assertEquals("TestTarget", rdTT.getTargetName());
|
||||
assertEquals(true, rdTT.isEnabled());
|
||||
assertEquals(0, rdTT.getPayload().size());
|
||||
|
||||
// Make some small changes
|
||||
rdTT.setDescription("Test Description");
|
||||
rdTT.getPayload().add(folder2a);
|
||||
rdTT.setEnabled(false);
|
||||
|
||||
// Check we see them on save/load
|
||||
replicationService.saveReplicationDefinition(rdTT);
|
||||
@@ -329,6 +332,7 @@ public class ReplicationServiceIntegrationTest extends BaseAlfrescoSpringTest
|
||||
assertEquals(ACTION_NAME, rdTT.getReplicationName());
|
||||
assertEquals("Test Description", rdTT.getDescription());
|
||||
assertEquals("TestTarget", rdTT.getTargetName());
|
||||
assertEquals(false, rdTT.isEnabled());
|
||||
assertEquals(1, rdTT.getPayload().size());
|
||||
assertEquals(folder2a, rdTT.getPayload().get(0));
|
||||
|
||||
@@ -345,6 +349,7 @@ public class ReplicationServiceIntegrationTest extends BaseAlfrescoSpringTest
|
||||
assertEquals(ACTION_NAME, rdTT.getReplicationName());
|
||||
assertEquals("Another One", rdTT.getDescription());
|
||||
assertEquals("TestTarget", rdTT.getTargetName());
|
||||
assertEquals(false, rdTT.isEnabled());
|
||||
assertEquals(2, rdTT.getPayload().size());
|
||||
assertEquals(folder1, rdTT.getPayload().get(0));
|
||||
assertEquals(folder2b, rdTT.getPayload().get(1));
|
||||
@@ -353,12 +358,14 @@ public class ReplicationServiceIntegrationTest extends BaseAlfrescoSpringTest
|
||||
rdTT.getPayload().clear();
|
||||
rdTT.getPayload().add(content1_1);
|
||||
assertEquals(1, rdTT.getPayload().size());
|
||||
rdTT.setEnabled(true);
|
||||
|
||||
replicationService.saveReplicationDefinition(rdTT);
|
||||
rdTT = replicationService.loadReplicationDefinition(ACTION_NAME);
|
||||
assertEquals(ACTION_NAME, rdTT.getReplicationName());
|
||||
assertEquals("Another One", rdTT.getDescription());
|
||||
assertEquals("TestTarget", rdTT.getTargetName());
|
||||
assertEquals(true, rdTT.isEnabled());
|
||||
assertEquals(1, rdTT.getPayload().size());
|
||||
assertEquals(content1_1, rdTT.getPayload().get(0));
|
||||
}
|
||||
@@ -393,6 +400,16 @@ public class ReplicationServiceIntegrationTest extends BaseAlfrescoSpringTest
|
||||
} catch(ReplicationServiceException e) {}
|
||||
|
||||
|
||||
// Now disabled, not allowed
|
||||
assertEquals(true, rd.isEnabled());
|
||||
rd.setEnabled(false);
|
||||
assertEquals(false, rd.isEnabled());
|
||||
try {
|
||||
actionService.executeAction(rd, replicationRoot);
|
||||
fail("Shouldn't be permitted when disabled");
|
||||
} catch(ReplicationServiceException e) {}
|
||||
|
||||
|
||||
// Invalid Transfer Target, not allowed
|
||||
rd = replicationService.createReplicationDefinition(ACTION_NAME, "Test");
|
||||
rd.setTargetName("I am an invalid target that isn't there");
|
||||
|
Reference in New Issue
Block a user