Examples of UserMetadata


Examples of org.lab41.dendrite.metagraph.models.UserMetadata

        Assert.assertEquals(metaGraph.getGraphs(true).size(), 1);

        // Create a graph.
        MetaGraphTx tx = metaGraph.newTransaction();

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

        // Now there should now be two graphs.
        Assert.assertEquals(metaGraph.getGraphs().size(), 1);
View Full Code Here

Examples of org.lab41.dendrite.metagraph.models.UserMetadata

    @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());
View Full Code Here

Examples of org.lab41.dendrite.metagraph.models.UserMetadata

        super.tearDown();
    }

    @Test(expected = IllegalArgumentException.class)
    public void createProjectShouldThrowWithEmptyName() {
        UserMetadata userMetadata = tx.createUser("test");
        tx.createProject("", userMetadata);
    }
View Full Code Here

Examples of org.lab41.dendrite.metagraph.models.UserMetadata

        tx.createProject("", userMetadata);
    }

    @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.
View Full Code Here

Examples of org.lab41.dendrite.metagraph.models.UserMetadata

        Assert.assertEquals(graphMetadata.getChildGraphs().iterator().hasNext(), false);
    }

    @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

Examples of org.lab41.dendrite.metagraph.models.UserMetadata

    @Before
    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

Examples of org.lab41.dendrite.metagraph.models.UserMetadata

        // This needs to be a read/write transaction as we might make a user.
        MetaGraphTx tx = metaGraphService.buildTransaction().start();
        GetProjectsResponse getProjectsResponse;

        try {
            UserMetadata userMetadata = tx.getOrCreateUser(principal);

            List<GetProjectResponse> projects = new ArrayList<>();
            for (ProjectMetadata projectMetadata : userMetadata.getProjects()) {
                projects.add(new GetProjectResponse(projectMetadata));
            }

            getProjectsResponse = new GetProjectsResponse(projects);
        } catch (Throwable t) {
View Full Code Here

Examples of org.lab41.dendrite.metagraph.models.UserMetadata

        MetaGraphTx tx = metaGraphService.newTransaction();
        GetProjectResponse getProjectResponse;
        HttpHeaders headers = new HttpHeaders();

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

            ProjectMetadata projectMetadata = tx.createProject(name, userMetadata, createGraph);
View Full Code Here

Examples of org.lab41.dendrite.metagraph.models.UserMetadata

            ProjectMetadata projectMetadata = tx.getProject(projectId);
            if (projectMetadata == null) {
                throw new NotFound(ProjectMetadata.class, projectId);
            }

            UserMetadata otherUserMetadata = tx.getUserByName(item.getName());
            if (otherUserMetadata == null) {
                throw new NotFound(UserMetadata.class);
            }

            projectMetadata.addUser(otherUserMetadata);
View Full Code Here

Examples of org.lab41.dendrite.metagraph.models.UserMetadata

        // This needs to be a read/write transaction as we might make a user.
        MetaGraphTx tx = metaGraphService.buildTransaction().start();
        List<GetGraphResponse> graphs = new ArrayList<>();

        try {
            UserMetadata userMetadata = tx.getOrCreateUser(principal);

            for (ProjectMetadata projectMetadata : userMetadata.getProjects()) {
                for (GraphMetadata graphMetadata : projectMetadata.getGraphs()) {
                    graphs.add(new GetGraphResponse(graphMetadata));
                }
            }
        } catch (Throwable t) {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.