Package org.openengsb.domain.userprojects.model

Examples of org.openengsb.domain.userprojects.model.Assignment


    }

    @Override
    public void deleteAssignment(String userName, String project) {

        Assignment queryObj = new Assignment();
        queryObj.setUser(userName);
        queryObj.setProject(project);
        List<Assignment> assignments = queryForAssignments(queryObj);

        if (assignments.isEmpty()) {
            LOGGER.warn("Assignment {1}:{2} does not exist.", userName, project);
        }
View Full Code Here


    }

    @Override
    public void deleteAllAssignmentsForProject(String projectName) {
        Assignment queryObj = new Assignment();
        queryObj.setProject(projectName);
        List<Assignment> assignments = queryForAssignments(queryObj);

        deleteAssignmentsFromPersistence(assignments);
    }
View Full Code Here

        deleteAssignmentsFromPersistence(assignments);
    }

    @Override
    public void deleteAllAssignmentsForProject(Project project) {
        Assignment queryObj = new Assignment();
        queryObj.setProject(project.getName());
        List<Assignment> assignments = queryForAssignments(queryObj);

        deleteAssignmentsFromPersistence(assignments);
    }
View Full Code Here

        deleteAssignmentsFromPersistence(assignments);
    }

    @Override
    public void deleteAllAssignmentsForUser(String userName) {
        Assignment queryObj = new Assignment();
        queryObj.setUser(userName);
        List<Assignment> assignments = queryForAssignments(queryObj);

        deleteAssignmentsFromPersistence(assignments);
    }
View Full Code Here

        deleteAssignmentsFromPersistence(assignments);
    }

    @Override
    public void deleteAllAssignmentsForUser(User user) {
        Assignment queryObj = new Assignment();
        queryObj.setUser(user.getUsername());
        List<Assignment> assignments = queryForAssignments(queryObj);

        deleteAssignmentsFromPersistence(assignments);
    }
View Full Code Here

    public List<Assignment> findAssignments() {
        List<Assignment> assignments = Lists.newArrayList();
        for (BasicProject jiraProject : jiraClient.findProjects()) {
            for (com.atlassian.jira.rest.client.api.domain.User user : jiraClient.findUsers(Lists
                    .newArrayList(jiraProject))) {
                Assignment assignment = new Assignment();
                assignment.setUser(user.getName());
                assignment.setProject(jiraProject.getName());
                assignment.generateUuid();
                assignments.add(assignment);
            }
        }

        return assignments;
View Full Code Here

    private List<Assignment> createAssignments(List<Entry> assignmentEntries) throws NoSuchNodeException,
        MissingParentException {
        List<Assignment> assignments = Lists.newArrayList();
        for (Entry entry : assignmentEntries) {
            Assignment assignment = new Assignment();
            assignment.setProject(getLdapAttributeValue(ldapDao.lookup(DnFactory.assignmentProject(entry.getDn()))));
            assignment.setUser(getLdapAttributeValue(ldapDao.lookup(DnFactory.assignmentUser(entry.getDn()))));

            assignment.setPermissions(getNamesOfDirectChildren(ldapDao.getDirectChildren(DnFactory
                    .assignmentPermissions(entry.getDn()))));
            assignment.setRoles(getNamesOfDirectChildren(ldapDao.getDirectChildren(DnFactory.assignmentRoles(entry
                    .getDn()))));
            assignment.generateUuid();
            assignments.add(assignment);
        }
        return assignments;
    }
View Full Code Here

    }

    @Test
    @Ignore
    public void testFindAssignments() throws InterruptedException {
        Assignment assignment = createTestAssignment();
        List<Assignment> expected = Arrays.asList(assignment);
        ldapService.updateAssignments(expected);
        assertTrue(CollectionUtils.isEqualCollection(modelManager.findAssignments(), expected));
    }
View Full Code Here

public class UserProjectsLdapServiceImplTest extends BaseTest {

    @Test
    public void testUpdateAssignments_shouldCreateAssignment() throws LdapInvalidAttributeValueException,
        NoSuchNodeException, MissingParentException {
        Assignment assignment = createTestAssignment();
        ldapService.updateAssignments(Lists.newArrayList(assignment));
        assertThat(ldapDao.exists(DnFactory.assignment(assignment)), is(true));
        assertCorrectlyStored(assignment);
    }
View Full Code Here

    }

    @Test
    public void testUpdateAssignments_shouldUpdateAssignment() throws LdapInvalidAttributeValueException,
        NoSuchNodeException, MissingParentException {
        Assignment assignment = createTestAssignment();
        ldapService.updateAssignments(Lists.newArrayList(assignment));
        assignment.getPermissions().add("new");
        assignment.getRoles().add("new");
        ldapService.updateAssignments(Lists.newArrayList(assignment));
        assertCorrectlyStored(assignment);
    }
View Full Code Here

TOP

Related Classes of org.openengsb.domain.userprojects.model.Assignment

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.