use of org.apache.jackrabbit.core.cluster.SimpleEventListener.PrivilegeEvent in project jackrabbit by apache.
the class ClusterRecordTest method testPrivilegeRegistration.
/**
* Test producing and consuming a privilege registration.
* @throws Exception
*/
public void testPrivilegeRegistration() throws Exception {
PrivilegeDefinition pdf = new PrivilegeDefinitionImpl(NameFactoryImpl.getInstance().create("", "test"), false, null);
PrivilegeEvent event = new PrivilegeEvent(Collections.singletonList(pdf));
master.registeredPrivileges(event.getDefinitions());
SimpleEventListener listener = new SimpleEventListener();
slave.setListener((PrivilegeEventListener) listener);
slave.sync();
assertEquals(1, listener.getClusterEvents().size());
assertEquals(listener.getClusterEvents().get(0), event);
}
Aggregations