Search in sources :

Example 1 with PrivilegeEvent

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);
}
Also used : PrivilegeDefinitionImpl(org.apache.jackrabbit.spi.commons.privilege.PrivilegeDefinitionImpl) PrivilegeDefinition(org.apache.jackrabbit.spi.PrivilegeDefinition) PrivilegeEvent(org.apache.jackrabbit.core.cluster.SimpleEventListener.PrivilegeEvent)

Aggregations

PrivilegeEvent (org.apache.jackrabbit.core.cluster.SimpleEventListener.PrivilegeEvent)1 PrivilegeDefinition (org.apache.jackrabbit.spi.PrivilegeDefinition)1 PrivilegeDefinitionImpl (org.apache.jackrabbit.spi.commons.privilege.PrivilegeDefinitionImpl)1