Package org.jboss.dna.graph

Examples of org.jboss.dna.graph.Subgraph


        // File expectedFile = new File("src/test/resources/");
        // if ( expectedFile.exists() ) {
        // expectedGraph.importXmlFrom(expectedFile).into("/");   
       
        Subgraph subgraph = graph.getSubgraphOfDepth(10).at("/");
        assertThat(subgraph, is(notNullValue()));
        //String value = subgraph.toString();
        //System.out.println(value);
       
        SubgraphNode rootNode = subgraph.getNode(".");
        assertThat(rootNode.getChildren().size(), is(1));
       
        SubgraphNode statementsNode = rootNode.getNode(path("ddl:statements"));
        assertNotNull(statementsNode);
        assertThat(statementsNode.getChildren().size(), is(1));
View Full Code Here


        assertThat(content, is(notNullValue()));
        sequencer.sequence(content, output, context);
       
        output.close();

        Subgraph subgraph = graph.getSubgraphOfDepth(10).at("/");
        assertThat(subgraph, is(notNullValue()));
        //String value = subgraph.toString();
        //System.out.println(value);
       
        SubgraphNode rootNode = subgraph.getNode(".");
        assertThat(rootNode.getChildren().size(), is(1));
       
        SubgraphNode statementsNode = rootNode.getNode(path("ddl:statements"));
        assertNotNull(statementsNode);
        assertThat(statementsNode.getChildren().size(), is(1));
View Full Code Here

        assertThat(content, is(notNullValue()));
        sequencer.sequence(content, output, context);
       
        output.close();

        Subgraph subgraph = graph.getSubgraphOfDepth(10).at("/");
        assertThat(subgraph, is(notNullValue()));
        //String value = subgraph.toString();
        //System.out.println(value);
       
        SubgraphNode rootNode = subgraph.getNode(".");
        assertThat(rootNode.getChildren().size(), is(1));
       
        SubgraphNode statementsNode = rootNode.getNode(path("ddl:statements"));
        assertNotNull(statementsNode);
        assertThat(statementsNode.getChildren().size(), is(3));
View Full Code Here

        assertThat(content, is(notNullValue()));
        sequencer.sequence(content, output, context);
       
        output.close();

        Subgraph subgraph = graph.getSubgraphOfDepth(10).at("/");
        assertThat(subgraph, is(notNullValue()));
        //String value = subgraph.toString();
        //System.out.println(value);
       
        SubgraphNode rootNode = subgraph.getNode(".");
        assertThat(rootNode.getChildren().size(), is(1));
       
        SubgraphNode statementsNode = rootNode.getNode(path("ddl:statements"));
        assertNotNull(statementsNode);
        assertThat(statementsNode.getChildren().size(), is(20));
View Full Code Here

        assertThat(content, is(notNullValue()));
        sequencer.sequence(content, output, context);
       
        output.close();

        Subgraph subgraph = graph.getSubgraphOfDepth(10).at("/");
        assertThat(subgraph, is(notNullValue()));
        //String value = subgraph.toString();
        //System.out.println(value);
       
        SubgraphNode rootNode = subgraph.getNode(".");
        assertThat(rootNode.getChildren().size(), is(1));
       
        SubgraphNode statementsNode = rootNode.getNode(path("ddl:statements"));
        assertNotNull(statementsNode);
        assertThat(statementsNode.getChildren().size(), is(64));
View Full Code Here

        assertThat(content, is(notNullValue()));
        sequencer.sequence(content, output, context);
       
        output.close();

        Subgraph subgraph = graph.getSubgraphOfDepth(10).at("/");
        assertThat(subgraph, is(notNullValue()));
        //String value = subgraph.toString();
        //System.out.println(value);
       
        SubgraphNode rootNode = subgraph.getNode(".");
        assertThat(rootNode.getChildren().size(), is(1));
       
        SubgraphNode statementsNode = rootNode.getNode(path("ddl:statements"));
        assertNotNull(statementsNode);
        assertThat(statementsNode.getChildren().size(), is(50));
View Full Code Here

                     .and()
                     .save();

        // Verify that the graph has been updated correctly ...
        DnaConfiguration.ConfigurationDefinition content = configuration.getConfigurationDefinition();
        Subgraph subgraph = content.graph().getSubgraphOfDepth(3).at("/");
        assertThat(subgraph.getNode("/dna:sources"), is(notNullValue()));
        assertThat(subgraph.getNode("/dna:sources/name"), is(notNullValue()));
        assertThat(subgraph.getNode("/dna:sources/name"), hasProperty(DnaLexicon.RETRY_LIMIT, 100));
        assertThat(subgraph.getNode("/dna:sources/name"), hasProperty("defaultCachePolicy", cachePolicy));
        assertThat(subgraph.getNode("/dna:sources/name"), hasProperty("defaultWorkspaceName", "default workspace name"));
        assertThat(subgraph.getNode("/dna:sources/name"), hasProperty("rootNodeUuid", rootUuid));
    }
View Full Code Here

        engine = configuration.build();
        engine.start();

        // Verify that the graph has been updated correctly ...
        Graph config = engine.getGraph(JcrConfiguration.DEFAULT_CONFIGURATION_SOURCE_NAME);
        Subgraph subgraph = config.getSubgraphOfDepth(6).at("/");
        assertThat(subgraph.getNode("/dna:sources"), is(notNullValue()));
        assertThat(subgraph.getNode("/dna:sources/Source2"), is(notNullValue()));
        assertThat(subgraph.getNode("/dna:sources/Source2"), hasProperty(DnaLexicon.CLASSNAME,
                                                                         InMemoryRepositorySource.class.getName()));
        assertThat(subgraph.getNode("/dna:repositories"), is(notNullValue()));
        assertThat(subgraph.getNode("/dna:repositories/JCR Repository"), is(notNullValue()));
        assertThat(subgraph.getNode("/dna:repositories/JCR Repository"), hasProperty(DnaLexicon.SOURCE_NAME, "Source2"));
        assertThat(subgraph.getNode("/dna:repositories/JCR Repository/dna:options"), is(notNullValue()));
        assertThat(subgraph.getNode("/dna:repositories/JCR Repository/dna:options/JAAS_LOGIN_CONFIG_NAME"),
                   hasProperty(DnaLexicon.VALUE, "test"));

        JcrRepository repository = engine.getRepository("JCR Repository");

        Map<Option, String> options = new HashMap<Option, String>();
View Full Code Here

        assertThat(configuration.getProblems().isEmpty(), is(true));

        // Verify that the graph has been updated correctly ...
        DnaConfiguration.ConfigurationDefinition content = configuration.getConfigurationDefinition();
        Subgraph subgraph = content.graph().getSubgraphOfDepth(6).at("/");

        assertThat(subgraph.getNode("/dna:sources"), is(notNullValue()));
        assertThat(subgraph.getNode("/dna:sources/Cars"), is(notNullValue()));
        assertThat(subgraph.getNode("/dna:sources/Cars"), hasProperty(DnaLexicon.RETRY_LIMIT, "3"));
        assertThat(subgraph.getNode("/dna:sources/Cars"), hasProperty(DnaLexicon.CLASSNAME,
                                                                      InMemoryRepositorySource.class.getName()));
        assertThat(subgraph.getNode("/dna:sources/Aircraft"), is(notNullValue()));
        assertThat(subgraph.getNode("/dna:sources/Aircraft"), hasProperty("defaultWorkspaceName", "default"));
        assertThat(subgraph.getNode("/dna:sources/Aircraft"), hasProperty(DnaLexicon.CLASSNAME,
                                                                          InMemoryRepositorySource.class.getName()));
        assertThat(subgraph.getNode("/dna:sources/Cache"), is(notNullValue()));
        assertThat(subgraph.getNode("/dna:sources/Cache"), hasProperty(DnaLexicon.CLASSNAME,
                                                                       InMemoryRepositorySource.class.getName()));

        assertThat(subgraph.getNode("/dna:mimeTypeDetectors").getChildren(), hasChild(segment("Detector")));
        assertThat(subgraph.getNode("/dna:mimeTypeDetectors/Detector"), is(notNullValue()));
        assertThat(subgraph.getNode("/dna:mimeTypeDetectors/Detector"),
                   hasProperty(DnaLexicon.DESCRIPTION, "Standard extension-based MIME type detector"));
        assertThat(subgraph.getNode("/dna:mimeTypeDetectors/Detector"),
                   hasProperty(DnaLexicon.CLASSNAME, ExtensionBasedMimeTypeDetector.class.getName()));

        assertThat(subgraph.getNode("/dna:repositories").getChildren(), hasChild(segment("Car Repository")));
        assertThat(subgraph.getNode("/dna:repositories/Car Repository"), is(notNullValue()));
        assertThat(subgraph.getNode("/dna:repositories/Car Repository"), hasProperty(DnaLexicon.SOURCE_NAME, "Cars"));
        assertThat(subgraph.getNode("/dna:repositories/Car Repository").getChildren(), hasChild(segment("dna:options")));
        assertThat(subgraph.getNode("/dna:repositories/Car Repository/dna:options"), is(notNullValue()));
        assertThat(subgraph.getNode("/dna:repositories/Car Repository/dna:options").getChildren(),
                   hasChild(segment("jaasLoginConfigName")));
        assertThat(subgraph.getNode("/dna:repositories/Car Repository/dna:options/jaasLoginConfigName"), is(notNullValue()));
        assertThat(subgraph.getNode("/dna:repositories/Car Repository/dna:options/jaasLoginConfigName"),
                   hasProperty(DnaLexicon.VALUE, "dna-jcr"));

        // Initialize IDTrust and a policy file (which defines the "dna-jcr" login config name)
        String configFile = "security/jaas.conf.xml";
        IDTrustConfiguration idtrustConfig = new IDTrustConfiguration();
View Full Code Here

                                .getNamespaceRegistry()
                                .isRegisteredNamespaceUri("http://www.jboss.org/dna/test/1.0"), is(true));

        // Verify that the graph has been updated correctly ...
        DnaConfiguration.ConfigurationDefinition content = configuration.getConfigurationDefinition();
        Subgraph subgraph = content.graph().getSubgraphOfDepth(6).at("/");

        assertThat(subgraph.getNode("/dna:repositories").getChildren(), hasChild(segment("Car Repository")));
        assertThat(subgraph.getNode("/dna:repositories/Car Repository"), is(notNullValue()));
        assertThat(subgraph.getNode("/dna:repositories/Car Repository"), hasProperty(DnaLexicon.SOURCE_NAME, "Cars"));
        assertThat(subgraph.getNode("/dna:repositories/Car Repository").getChildren(), hasChild(segment("dna:options")));
        assertThat(subgraph.getNode("/dna:repositories/Car Repository/jcr:nodeTypes"), is(notNullValue()));
        // for (Location child : subgraph.getNode("/dna:repositories/Car Repository/dna:nodeTypes").getChildren()) {
        // System.out.println(child.getPath().getLastSegment().getString(context().getNamespaceRegistry()));
        // }
        assertThat(subgraph.getNode("/dna:repositories/Car Repository/jcr:nodeTypes").getChildren(),
                   hasChildren(segment("dnatest:noSameNameSibs"),
                               segment("dnatest:referenceableUnstructured"),
                               segment("dnatest:nodeWithMandatoryProperty"),
                               segment("dnatest:nodeWithMandatoryChild"),
                               segment("dnatest:unorderableUnstructured")));
        assertThat(subgraph.getNode("/dna:repositories/Car Repository/dna:namespaces"), is(notNullValue()));

        // Check that the namespace in the CND file was persisted correctly ...
        assertThat(subgraph.getNode("/dna:repositories/Car Repository/dna:namespaces").getChildren(),
                   hasChild(segment("dnatest")));
        assertThat(subgraph.getNode("/dna:repositories/Car Repository/dna:namespaces/dnatest"),
                   hasProperty(DnaLexicon.NAMESPACE_URI, "http://www.jboss.org/dna/test/1.0"));

        // Initialize IDTrust and a policy file (which defines the "dna-jcr" login config name)
        String configFile = "security/jaas.conf.xml";
        IDTrustConfiguration idtrustConfig = new IDTrustConfiguration();
View Full Code Here

TOP

Related Classes of org.jboss.dna.graph.Subgraph

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.