// Mock up SEAM contexts
Map<String, Object> application = new HashMap<String, Object>();
Lifecycle.beginApplication( application );
Lifecycle.beginCall();
MockIdentity midentity = new MockIdentity();
RoleBasedPermissionResolver resolver = new RoleBasedPermissionResolver();
resolver.setEnableRoleBasedAuthorization( true );
midentity.addPermissionResolver( resolver );
Contexts.getSessionContext().set( "org.jboss.seam.security.identity",
midentity );
Contexts.getSessionContext().set( "org.drools.guvnor.client.rpc.RepositoryService",