Package org.jboss.dna.graph

Examples of org.jboss.dna.graph.Graph$WithUuids


        branchSourceName = mirrorSourceName;
        branchWorkspaceName = "Branch Workspace";
        addProjection("fedSpace", "Branch Projection", branchSourceName, branchWorkspaceName, "/Aircraft => /Aircraft");

        // Add some data to the mirror source ...
        Graph source = graphFor(mirrorSourceName, mirrorWorkspaceName);
        source.importXmlFrom(getClass().getClassLoader().getResource("cars.xml").toURI()).into("/");

        // Add some data to the mirror source ...
        Graph branch = graphFor(branchSourceName, branchWorkspaceName);
        branch.importXmlFrom(getClass().getClassLoader().getResource("aircraft.xml").toURI()).into("/");
    }
View Full Code Here


    }

    @Test
    public void shouldReturnRootNodeInMirrorProjection() {
        // Get the root node of the mirror projection using the actual graph ...
        Graph mirrorGraph = graphFor(mirrorSourceName, mirrorWorkspaceName);
        Node mirrorRoot = mirrorGraph.getNodeAt("/");
        Location mirrorRootLocation = mirrorRoot.getLocation();
        assertThat(mirrorRootLocation.hasIdProperties(), is(true));
        assertThat(mirrorRootLocation.getUuid(), is(notNullValue()));

        // Get the same node through the federation source ...
View Full Code Here

    }

    @Test
    public void shouldReturnRootNodeInBranchProjection() {
        // Get the top node of the branch projection using the actual graph ...
        Graph branchGraph = graphFor(branchSourceName, branchWorkspaceName);
        Node branchNode = branchGraph.getNodeAt("/Aircraft");
        Location branchNodeLocation = branchNode.getLocation();
        assertThat(branchNodeLocation.hasIdProperties(), is(true));
        assertThat(branchNodeLocation.getUuid(), is(notNullValue()));

        // Get the same node through the federation source ...
View Full Code Here

                return connectionFactory;
            }

            @SuppressWarnings( "synthetic-access" )
            public Subgraph getConfiguration( int depth ) {
                Graph result = Graph.create(configRepositorySource, context);
                result.useWorkspace("configSpace");
                return result.getSubgraphOfDepth(depth).at("/a/b/Test Repository");
            }
        };

        source = new FederatedRepositorySource();
        source.setName(repositoryName);
        sourceName = "federated source";
        source.setName(sourceName);
        source.initialize(repositoryContext);

        Graph configRepository = Graph.create(configRepositorySource, context);
        configRepository.createWorkspace().named("configSpace");
        Graph.Batch batch = configRepository.batch();
        batch.create("/a").and();
        batch.create("/a/b").and();
        batch.create("/a/b/Test Repository").with(DnaLexicon.DEFAULT_WORKSPACE_NAME, "fedSpace").and();
        batch.create("/a/b/Test Repository/dna:workspaces").and();
        batch.create("/a/b/Test Repository/dna:workspaces/fedSpace").and();
View Full Code Here

        // Create a graph and look up the root node. We do this to initialize the connection pool and
        // force the database to be setup at this point. By doing it now, we don't include this overhead
        // in our test timings.
        try {
            Graph graph = Graph.create(source, context);
            graph.getNodeAt("/");
        } catch (Throwable t) {
            Logger.getLogger(getClass()).debug("Unable to read the root node while setting up the \"" + source.getName()
                                               + "\" JPA source");
        }
View Full Code Here

TOP

Related Classes of org.jboss.dna.graph.Graph$WithUuids

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.