Examples of loginService()


Examples of org.apache.sling.jcr.api.SlingRepository.loginService()

                                bc.getBundle().getSymbolicName(), bc.getBundle().getBundleId());
                            throw new LoginException(); // TODO: correct ??
                        }

                        try {
                            session = repo.loginService(subServiceName, workspace);
                            holder.setRepositoryReference(bc, repositoryReference);
                            holder.setSession(session);
                        } finally {
                            // unget the repository if the service cannot
                            // login to it, otherwise the repository service
View Full Code Here

Examples of org.apache.sling.jcr.api.SlingRepository.loginService()

        context.addAttribute("privilege", privilege);

        SlingRepository repo = mock(SlingRepository.class);
        Session authenticatedSession = mock(Session.class);
        when(authenticatedSession.hasPermission(path, privilege)).thenReturn(true);
        when(repo.loginService(serviceName, null)).thenReturn(authenticatedSession);

        RepositoryTransportAuthenticationProvider repositoryTransportAuthenticationProvider = new RepositoryTransportAuthenticationProvider(serviceName);
        Session session = repositoryTransportAuthenticationProvider.authenticate(repo, context);
        assertNotNull(session);
    }
View Full Code Here

Examples of org.apache.sling.jcr.api.SlingRepository.loginService()

    @Test
    public void testProcessEventWithoutPrivileges() throws Exception {
        String serviceName = "serviceId";
        Session session = mock(Session.class);
        SlingRepository repository = mock(SlingRepository.class);
        when(repository.loginService(serviceName, null)).thenReturn(session);
        String path = "/some/path";
        String nuggetsPath = "/var/nuggets";
        PersistingJcrEventReplicationTrigger persistingJcrEventReplicationTrigger = new PersistingJcrEventReplicationTrigger(
                repository, path, serviceName, nuggetsPath);
        Event event = mock(Event.class);
View Full Code Here

Examples of org.apache.sling.jcr.api.SlingRepository.loginService()

        when(workspace.getObservationManager()).thenReturn(observationManager);
        when(session.getWorkspace()).thenReturn(workspace);
        when(session.hasPermission(nuggetsPath, Privilege.JCR_ADD_CHILD_NODES)).thenReturn(true);

        SlingRepository repository = mock(SlingRepository.class);
        when(repository.loginService(serviceName, null)).thenReturn(session);

        String path = "/some/path";
        PersistingJcrEventReplicationTrigger persistingJcrEventReplicationTrigger = new PersistingJcrEventReplicationTrigger(
                repository, path, serviceName, nuggetsPath);
        ReplicationRequestHandler handler = mock(ReplicationRequestHandler.class);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.