Work that's part of RM-2431 and RM-2432.

Added to the classified-content-model - various properties as described in RM-2431 along with a constraint on Reclassification Action.
Addition to the ClassificationSchemeService of methods and types associated with Reclassification. (Upgrade, Downgrade, Declassify). See RM-2432.
Behaviour bean that will automatically set lastReclassificationAction and lastReclassifyBy in response to any change to currentClassificationLevel.
Also some util methods in RMCollections.
Fixed some spelling mistakes in classification-related properties.



git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/modules/recordsmanagement/HEAD@108878 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Neil McErlean
2015-07-23 16:13:43 +00:00
parent 38958f2a9a
commit 86a2d819ac
11 changed files with 354 additions and 6 deletions

View File

@@ -20,12 +20,17 @@
package org.alfresco.module.org_alfresco_module_rm.util;
import static java.util.Arrays.asList;
import static org.alfresco.module.org_alfresco_module_rm.util.RMCollectionUtils.diffKey;
import static org.junit.Assert.assertEquals;
import org.alfresco.module.org_alfresco_module_rm.util.RMCollectionUtils.Difference;
import org.junit.Test;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* Unit tests for {@link RMCollectionUtils}.
@@ -42,4 +47,32 @@ public class RMCollectionUtilsUnitTest
assertEquals(Collections.emptyList(), RMCollectionUtils.getDuplicateElements(asList("A", "B", "C")));
}
@Test public void compareMaps()
{
// Set up two maps to compare
final Map<Integer, Integer> mapA = new HashMap<>();
final Map<Integer, Integer> mapB = new HashMap<>();
// Fill one map with numbers and their squares...
for (int i : asList(1, 2, 3, 4, 5))
{
mapA.put(i, i*i);
}
// ... the other one has the same entries...
mapB.putAll(mapA);
// ... but with an addition, a deletion and a value change.
mapB.put(6, 36);
mapB.remove(1);
mapB.put(3, 100);
// Now ensure that various changes are correctly identified
assertEquals(Difference.REMOVED, diffKey(mapA, mapB, 1));
assertEquals(Difference.ADDED, diffKey(mapA, mapB, 6));
assertEquals(Difference.UNCHANGED, diffKey(mapA, mapB, 2));
assertEquals(Difference.UNCHANGED, diffKey(mapA, mapB, -1));
assertEquals(Difference.CHANGED, diffKey(mapA, mapB, 3));
}
}