Package org.lab41.dendrite.metagraph.models

Examples of org.lab41.dendrite.metagraph.models.ProjectMetadata$Impl


        MetaGraphTx tx = metaGraph.newTransaction();

        UserMetadata userMetadata = tx.createUser("test");
        Assert.assertNotNull(userMetadata);

        ProjectMetadata projectMetadata = tx.createProject("test", userMetadata);
        Assert.assertNotNull(projectMetadata);

        GraphMetadata graphMetadata = projectMetadata.getCurrentGraph();
        Assert.assertNotNull(graphMetadata);

        tx.commit();

        DendriteGraph graph = metaGraph.getGraph(graphMetadata.getId());
View Full Code Here


    @Test(expected = IllegalArgumentException.class)
    public void testGettingInvalidVertexType() {
        MetaGraphTx tx = metaGraph.newTransaction();

        UserMetadata userMetadata = tx.createUser("test");
        ProjectMetadata projectMetadata = tx.createProject("test", userMetadata);
        tx.commit();

        tx = metaGraph.newTransaction();
        tx.getJob(projectMetadata.getId().toString());
        tx.rollback();
    }
View Full Code Here

    }

    @Test
    public void createProjectShouldMakeAProject() {
        UserMetadata userMetadata = tx.createUser("test");
        ProjectMetadata projectMetadata = tx.createProject("test", userMetadata);
        Assert.assertNotNull(projectMetadata);
        Assert.assertEquals(projectMetadata.getName(), "test");

        // Make sure the branch is linked to the project.
        BranchMetadata branchMetadata = projectMetadata.getCurrentBranch();
        Assert.assertNotNull(branchMetadata);
        Assert.assertEquals(branchMetadata.getName(), "master");
        Assert.assertEquals(branchMetadata.getProject(), projectMetadata);
        Assert.assertThat(projectMetadata.getBranches(), hasItem(branchMetadata));

        // Make sure the graph is linked to the project.
        GraphMetadata graphMetadata = branchMetadata.getGraph();
        Assert.assertNotNull(graphMetadata);
        Assert.assertEquals(graphMetadata.getProject(), projectMetadata);
        Assert.assertThat(projectMetadata.getGraphs(), hasItem(graphMetadata));

        // Make sure the graph links are empty.
        Assert.assertNull(graphMetadata.getParentGraph());
        Assert.assertEquals(graphMetadata.getChildGraphs().iterator().hasNext(), false);
    }
View Full Code Here

    }

    @Test
    public void createProjectShouldOptionallyNotMakeABranch() {
        UserMetadata userMetadata = tx.createUser("test");
        ProjectMetadata projectMetadata = tx.createProject("test", userMetadata, false);
        Assert.assertNotNull(projectMetadata);
        Assert.assertNull(projectMetadata.getCurrentBranch());
        Assert.assertNull(projectMetadata.getCurrentGraph());
    }
View Full Code Here

    public void setUp() {
        super.setUp();

        MetaGraphTx tx = metaGraph.newTransaction();
        UserMetadata userMetadata = tx.createUser("test");
        ProjectMetadata projectMetadata = tx.createProject("test", userMetadata);
        GraphMetadata graphMetadata = projectMetadata.getCurrentGraph();
        tx.commit();

        graph = metaGraph.getGraph(graphMetadata.getId());
    }
View Full Code Here

            this.doneTime = null;
        } else {
            this.doneTime = df.format(doneTime);
        }

        ProjectMetadata projectMetadata = jobMetadata.getProject();
        if (projectMetadata == null) {
            this.projectId = null;
        } else {
            this.projectId = projectMetadata.getId().toString();
        }

        JobMetadata parentJobMetadata = jobMetadata.getParentJob();
        if (parentJobMetadata == null) {
            this.parentJobId = null;
View Full Code Here

        Date creationTime = branchMetadata.getCreationTime();
        if (creationTime != null) {
            this.creationTime = df.format(creationTime);
        }

        ProjectMetadata projectMetadata = branchMetadata.getProject();
        if (projectMetadata != null) {
            this.projectId = branchMetadata.getProject().getId().toString();
        }

        GraphMetadata graphMetadata = branchMetadata.getGraph();
View Full Code Here

            this.creationTime = df.format(creationTime);
        }

        this.properties = graphMetadata.getProperties();

        ProjectMetadata projectMetadata = graphMetadata.getProject();
        if (projectMetadata != null) {
            this.projectId = projectMetadata.getId().toString();
        }

        GraphMetadata parentGraphMetadata = graphMetadata.getParentGraph();
        if (parentGraphMetadata != null) {
            this.parentGraphId = parentGraphMetadata.getId().toString();
View Full Code Here

    @ResponseBody
    public GetProjectResponse getProject(@PathVariable String projectId) throws NotFound {

        MetaGraphTx tx = metaGraphService.buildTransaction().readOnly().start();
        try {
            ProjectMetadata projectMetadata = tx.getProject(projectId);
            if (projectMetadata == null) {
                throw new NotFound(ProjectMetadata.class, projectId);
            }

            // FIXME: Temporary hack to force loading the graph until the UI can handle it occurring asynchronously.
            metaGraphService.getDendriteGraph(projectMetadata.getCurrentGraph().getId());

            return new GetProjectResponse(projectMetadata);
        } finally {
            tx.commit();
        }
View Full Code Here

            UserMetadata userMetadata = tx.getOrCreateUser(principal);
            if (userMetadata == null) {
                throw new NotFound(UserMetadata.class, principal.getName());
            }

            ProjectMetadata projectMetadata = tx.createProject(name, userMetadata, createGraph);

            headers.setLocation(builder.path("/projects/{projectId}").buildAndExpand(projectMetadata.getId()).toUri());

            getProjectResponse = new GetProjectResponse(projectMetadata);
        } catch (Throwable t) {
            tx.rollback();
            throw t;
View Full Code Here

TOP

Related Classes of org.lab41.dendrite.metagraph.models.ProjectMetadata$Impl

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.