Package org.jboss.dna.graph.observe

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


            }
        };

        // Set up the repository ...
        descriptors = new HashMap<String, String>();
        repository = new JcrRepository(context, connectionFactory, sourceName, new MockObservable(), null, descriptors, null);

        // Set up the graph that goes directly to the source ...
        sourceGraph = Graph.create(source, context);

        // Set up the graph that goes directly to the system source ...
View Full Code Here


        assertThat(JcrRepository.WORKSPACES_SHARE_SYSTEM_BRANCH, is(true));
    }

    @Test
    public void shouldAllowNullDescriptors() throws Exception {
        new JcrRepository(context, connectionFactory, sourceName, new MockObservable(), null, null, null);
    }
View Full Code Here

        new JcrRepository(context, connectionFactory, sourceName, new MockObservable(), null, null, null);
    }

    @Test( expected = IllegalArgumentException.class )
    public void shouldNotAllowNullExecutionContext() throws Exception {
        new JcrRepository(null, connectionFactory, sourceName, new MockObservable(), null, descriptors, null);
    }
View Full Code Here

        new JcrRepository(null, connectionFactory, sourceName, new MockObservable(), null, descriptors, null);
    }

    @Test( expected = IllegalArgumentException.class )
    public void shouldNotAllowNullConnectionFactories() throws Exception {
        new JcrRepository(context, null, sourceName, new MockObservable(), null, descriptors, null);
    }
View Full Code Here

        new JcrRepository(context, connectionFactory, sourceName, null, null, null, null);
    }

    @Test( expected = IllegalArgumentException.class )
    public void shouldNotAllowNullSourceName() throws Exception {
        new JcrRepository(context, connectionFactory, null, new MockObservable(), null, descriptors, null);
    }
View Full Code Here

        testDescriptorValues(repository);
    }

    @Test
    public void shouldProvideBuiltInDescriptorsWhenNotSuppliedDescriptors() throws Exception {
        Repository repository = new JcrRepository(context, connectionFactory, sourceName, new MockObservable(), null,
                                                  descriptors, null);
        testDescriptorKeys(repository);
        testDescriptorValues(repository);
    }
View Full Code Here

        assertThat(this.repository.getRepositoryObservable(), is(notNullValue()));
    }

    @Test
    public void shouldHaveDefaultOptionsWhenNotOverridden() throws Exception {
        JcrRepository repository = new JcrRepository(context, connectionFactory, sourceName, new MockObservable(), null,
                                                     descriptors, null);
        assertThat(repository.getOptions().get(JcrRepository.Option.PROJECT_NODE_TYPES),
                   is(JcrRepository.DefaultOption.PROJECT_NODE_TYPES));
    }
View Full Code Here

    @Test
    public void shouldProvideUserSuppliedDescriptors() throws Exception {
        Map<String, String> descriptors = new HashMap<String, String>();
        descriptors.put("property", "value");
        Repository repository = new JcrRepository(context, connectionFactory, sourceName, new MockObservable(), null,
                                                  descriptors, null);
        testDescriptorKeys(repository);
        testDescriptorValues(repository);
        assertThat(repository.getDescriptor("property"), is("value"));
    }
View Full Code Here

    @Test
    public void shouldAllowLoginWithNoCredentialsIfAnonAccessEnabled() throws Exception {
        Map<JcrRepository.Option, String> options = new HashMap<JcrRepository.Option, String>();
        options.put(JcrRepository.Option.ANONYMOUS_USER_ROLES, JcrSession.DNA_READ_PERMISSION);
        JcrRepository repository = new JcrRepository(context, connectionFactory, sourceName, new MockObservable(), null,
                                                     descriptors, options);

        session = (JcrSession)repository.login();

        assertThat(session, is(notNullValue()));
View Full Code Here

    @Test
    public void shouldAllowManySessionLoginsAndLogouts() 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);

        Session session;

        for (int i = 0; i < 10000; i++) {
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.