Package org.jboss.dna.graph.observe

Examples of org.jboss.dna.graph.observe.MockObservable


    @Test
    public void shouldCleanUpLocksFromDeadSessions() throws Exception {
        // Use a different repository that supports anonymous logins to make this test cleaner
        Map<Option, String> options = new HashMap<Option, String>();
        options.put(JcrRepository.Option.ANONYMOUS_USER_ROLES, JcrSession.DNA_ADMIN_PERMISSION);
        JcrRepository repository = new JcrRepository(context, connectionFactory, sourceName, new MockObservable(), null,
                                                     descriptors, options);

        String lockedNodeName = "lockedNode";
        JcrSession locker = (JcrSession)repository.login();
View Full Code Here


            public RepositoryConnection createConnection( String sourceName ) throws RepositorySourceException {
                return source.getConnection();
            }
        };

        repository = new JcrRepository(context, connectionFactory, "unused", new MockObservable(), null, null, null);

        SecurityContext mockSecurityContext = new MockSecurityContext("testuser",
                                                                      Collections.singleton(JcrSession.DNA_WRITE_PERMISSION));
        session = (JcrSession)repository.login(new SecurityContextCredentials(mockSecurityContext));
    }
View Full Code Here

        stub(repository.createSystemGraph(context)).toAnswer(new Answer<Graph>() {
            public Graph answer( InvocationOnMock invocation ) throws Throwable {
                return graph;
            }
        });
        stub(this.repository.getRepositoryObservable()).toReturn(new MockObservable());

        // Stub out the repository, since we only need a few methods ...
        repoTypeManager = new RepositoryNodeTypeManager(repository, true);
        stub(repository.getRepositoryTypeManager()).toReturn(repoTypeManager);
View Full Code Here

            public RepositoryConnection createConnection( String sourceName ) throws RepositorySourceException {
                return source.getConnection();
            }
        };

        repository = new JcrRepository(context, connectionFactory, "unused", new MockObservable(), null, null, null);

        SecurityContext mockSecurityContext = new MockSecurityContext("testuser",
                                                                      Collections.singleton(JcrSession.DNA_WRITE_PERMISSION));
        session = (JcrSession)repository.login(new SecurityContextCredentials(mockSecurityContext));
    }
View Full Code Here

TOP

Related Classes of org.jboss.dna.graph.observe.MockObservable

Copyright © 2018 www.massapicom. 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.