Package org.nxplanner.domain

Examples of org.nxplanner.domain.Person


    public void testStoryCustomerIdToObjectMappingBeforeSubmit() throws Exception {
        UserStoryEditorForm form = new UserStoryEditorForm();
        form.setOid("111");
        support.form = form;
        form.setCustomerId(1);
        Person person1 = new Person();
        person1.setId(1);
        Person person2 = new Person();
        person2.setId(2);
        UserStory story = new UserStory();
        story.setId(111);
        story.setCustomer(person1);
        expectObjectRepositoryAccess(UserStory.class);
        mockObjectRepositoryControl.expectAndReturn(mockObjectRepository.load(111), story);
View Full Code Here


    public void testStoryContinuation() throws Exception {
        task1.setCompleted(false);
        task2.setCompleted(false);
        task3.setCompleted(true);
        story.setName("name");
        story.setCustomer(new Person());
        story.setDescription("A description.");
        support.resources.setMessage("story.continued.to", "Continued as story:{0}");
        support.resources.setMessage("story.continued.from", "Continued from story:{0}");
        support.hibernateSession.saveIdProperty = "id";
        support.hibernateSession.saveIds = new Object[]{
View Full Code Here

    public void testMappings() throws Exception {
        Project project = newProject();
        Iteration iteration = newIteration(project);
        UserStory story = newUserStory(iteration);
        Person person = newPerson();
        story.setCustomer(person);
        session.flush();
        session.connection().commit();
        session.evict(story);
        UserStory savedStory = (UserStory) session.load(UserStory.class, new Integer(story.getId()));
View Full Code Here

            XPlannerLoginModule encryptor = new XPlannerLoginModule(new HashMap());
            Iterator userItr = users.iterator();
            while (userItr.hasNext()) {
                User user = (User)userItr.next();
                try {
                    Person person = getPerson(session, user);
                    if (person != null) {
                        initializePassword(person, log, user, encryptor);
                        initializeRoles(session, user, person);
                    } else {
                        log.warn("no xplanner user: " + user.getName());
View Full Code Here

    private Person getPerson(Session session, User user) throws HibernateException {
        List people = session.find("from person in class " +
                Person.class.getName() + " where person.userId = ?",
                user.getName(), Hibernate.STRING);
        Person person = null;
        Iterator peopleIterator = people.iterator();
        if (peopleIterator.hasNext()) {
            person = (Person)peopleIterator.next();
        }
        return person;
View Full Code Here

    }

    public void testTopPageInViewerRole() throws Exception {
        setUpProject(HIDDEN);
        Project project = setUpProject(NOT_HIDDEN);
        Person person = setUpPerson();
        setUpRole(person, project, "viewer");
        commit();

        tester.login(person.getUserId(), "test");

        tester.assertKeyPresent("projects.title");
        tester.assertTableEquals("objecttable", new String[][] {
            {
                tester.getMessage("projects.tableheading.name"),
View Full Code Here

    }

    public void testTopPageInEditorRole() throws Exception {
        setUpProject(HIDDEN);
        Project project = setUpProject(NOT_HIDDEN);
        Person person = setUpPerson();
        setUpRole(person, project, "editor");
        commit();

        tester.login(person.getUserId(), "test");

        tester.assertKeyPresent("projects.title");
        tester.assertTableEquals("objecttable", new String[][] {
            {
                tester.getMessage("projects.tableheading.name"),
View Full Code Here

    }

    public void testTopPageInAdminRole() throws Exception {
        setUpProject(HIDDEN);
        Project project = setUpProject(NOT_HIDDEN);
        Person person = setUpPerson();
        setUpRole(person, project, "admin");
        commit();

        tester.login(person.getUserId(), "test");

        tester.assertKeyPresent("projects.title");
        tester.assertTableEquals("objecttable", new String[][] {
            {
                tester.getMessage("projects.tableheading.name"),
View Full Code Here

    }

    public void testTopPageInSysAdminRole() throws Exception {
        Project hiddenProject = setUpProject(HIDDEN);
        Project project = setUpProject(NOT_HIDDEN);
        Person person = setUpPerson();
        setUpRole(person, null, "sysadmin");
        commit();

        tester.login(person.getUserId(), "test");

        tester.assertKeyPresent("projects.title");

        // Custom table assert - may be other projects here
        WebTable table = tester.getDialog().getWebTableBySummaryOrId("objecttable");
View Full Code Here

        return project;
    }

    private Person setUpPerson() throws Exception {
        String userId = generateUniqueName();
        Person person = new Person(userId);
        person.setName(userId);
        person.setInitials(userId);
        XPlannerLoginModule loginModule = new XPlannerLoginModule(Collections.EMPTY_MAP);
        person.setPassword(loginModule.encodePassword("test", null));
        tester.getSession().save(person);
        scheduleObjectDeletion(person);
        return person;
    }
View Full Code Here

TOP

Related Classes of org.nxplanner.domain.Person

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.