mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
Added various action parameter contraint implementations.
These include type, aspect, property, mimetype, email templates and scripts. Constraint results unit tested. TODO - still need to go through all the actions and link each constraint to the appropraite properties. git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@18692 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -39,7 +39,7 @@ import org.alfresco.util.BaseSpringTest;
|
||||
*/
|
||||
public class ActionParameterConstraintTest extends BaseSpringTest
|
||||
{
|
||||
private static final String COMPARE_OP = "compare-operations";
|
||||
private static final String COMPARE_OP = "ac-compare-operations";
|
||||
|
||||
private ActionService actionService;
|
||||
|
||||
@@ -84,4 +84,29 @@ public class ActionParameterConstraintTest extends BaseSpringTest
|
||||
System.out.println(entry.getKey() + " - " + entry.getValue());
|
||||
}
|
||||
}
|
||||
|
||||
public void testConstraints()
|
||||
{
|
||||
testConstraint("ac-aspects");
|
||||
testConstraint("ac-types");
|
||||
testConstraint("ac-properties");
|
||||
testConstraint("ac-mimetypes");
|
||||
testConstraint("ac-email-templates");
|
||||
testConstraint("ac-scripts");
|
||||
}
|
||||
|
||||
private void testConstraint(String name)
|
||||
{
|
||||
ParameterConstraint constraint = actionService.getParameterConstraint(name);
|
||||
assertNotNull(constraint);
|
||||
assertEquals(name, constraint.getName());
|
||||
|
||||
Map<String, String> values = constraint.getAllowableValues();
|
||||
assertTrue(values.size()>0);
|
||||
System.out.println("== " + name + " ==\n");
|
||||
for (Map.Entry<String, String> entry : values.entrySet())
|
||||
{
|
||||
System.out.println(entry.getKey() + " - " + entry.getValue());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user