File configDir = new File(publication.getDirectory(), "config" + File.separator + "ac"
+ File.separator + "passwd");
assertTrue(configDir.exists());
Policy policy = getPolicyManager().getPolicy(getAccreditableManager(), url);
WorkflowResolver resolver = null;
try {
resolver = (WorkflowResolver) getManager().lookup(WorkflowResolver.ROLE);
String[] emptyRoles = {};
Situation situation = new CMSSituation(emptyRoles, "test", "127.0.0.1");
WorkflowInstance instance = resolver.getWorkflowInstance(document);
instance.getHistory().initialize(situation);
for (int situationIndex = 0; situationIndex < situations.length; situationIndex++) {
assertNotNull(instance);
System.out.println("Current state: " + instance.getCurrentState());
Identity identity = new Identity();
User user = getAccreditableManager().getUserManager().getUser(
situations[situationIndex].getUser());
identity.addIdentifiable(user);
Role[] roles = policy.getRoles(identity);
System.out.print("Roles:");
for (int roleIndex = 0; roleIndex < roles.length; roleIndex++) {
System.out.print(" " + roles[roleIndex]);
}