Package org.nxplanner.domain

Examples of org.nxplanner.domain.Project


import org.nxplanner.domain.UserStory;

public class DatabaseMappingsTestScript extends org.nxplanner.acceptance.AbstractDatabaseTestScript{

    public void testMappings() throws Exception {
        Project project = newProject();
        Iteration iteration = newIteration(project);
        UserStory story = newUserStory(iteration);
        Person person = newPerson();
        story.setCustomer(person);
        session.flush();
View Full Code Here


        mockAbstractEditorFormControl.expectAndReturn(mockAbstractEditorForm.getId(), 0);
        mockAbstractEditorFormControl.expectAndReturn(mockAbstractEditorForm.getAction(),
                EditObjectAction.CREATE_ACTION);
        mockAbstractEditorForm.setAction(null);
        mockAbstractEditorForm.setId(OID);
        mockObjectRepository.insert(new Project());
        mockObjectRepositoryControl.setMatcher(new ArgumentsTypeMatcher());
        mockObjectRepositoryControl.setReturnValue(OID);
        support.request.setParameterValue("returnto", new String[]{"object.jsp"});
        replay();
View Full Code Here

        mockAbstractEditorFormControl.expectAndReturn(mockAbstractEditorForm.getId(), OID);
        mockAbstractEditorFormControl.expectAndReturn(mockAbstractEditorForm.getAction(),
                EditObjectAction.CREATE_ACTION);
        mockAbstractEditorForm.setAction(null);
        mockAbstractEditorForm.setId(OID);
        mockObjectRepository.insert(new Project());
        mockObjectRepositoryControl.setMatcher(new ArgumentsTypeMatcher());
        mockObjectRepositoryControl.setReturnValue(OID);
        support.setForward("view/projects", "projects.jsp");

        replay();
View Full Code Here

        tester.assertLinkPresentWithKey("projects.link.aggregate.timesheet");
    }

    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"),
                tester.getMessage("projects.tableheading.iteration")
            },
            { project.getName(), "" }
        });
        traverseLinkWithKeyAndReturn("navigation.me");
        traverseLinkWithKeyAndReturn("projects.link.people");
        traverseLinkWithKeyAndReturn("projects.link.aggregate.timesheet");
    }
View Full Code Here

        traverseLinkWithKeyAndReturn("projects.link.aggregate.timesheet");
    }

    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"),
                tester.getMessage("projects.tableheading.iteration"),
            },
            { project.getName(), ""},
        });
        traverseLinkWithKeyAndReturn("navigation.me");
        traverseLinkWithKeyAndReturn("projects.link.people");
        traverseLinkWithKeyAndReturn("projects.link.aggregate.timesheet");
    }
View Full Code Here

        traverseLinkWithKeyAndReturn("projects.link.aggregate.timesheet");
    }

    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"),
                tester.getMessage("projects.tableheading.iteration"),
                tester.getMessage("projects.tableheading.actions")
            },
            { project.getName(), "", "" },
        });
        tester.assertLinkPresentWithImage(EDIT_IMAGE);
        traverseLinkWithKeyAndReturn("navigation.me");
        traverseLinkWithKeyAndReturn("projects.link.people");
        traverseLinkWithKeyAndReturn("projects.link.aggregate.timesheet");
View Full Code Here

        traverseLinkWithKeyAndReturn("projects.link.people");
        traverseLinkWithKeyAndReturn("projects.link.aggregate.timesheet");
    }

    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");
        boolean foundProject = false;
        boolean foundHiddenProject = false;
        int nrow = table.getRowCount();
        for (int r = 0; r < nrow; r++) {
            if (table.getCellAsText(r, 0).trim().equals(project.getName())) {
                foundProject = true;
                assertEquals("N",table.getCellAsText(r, 2).trim());
                assertImageInCell(table, r, 3, EDIT_IMAGE);
                assertImageInCell(table, r, 3, DELETE_IMAGE);
            } else if (table.getCellAsText(r, 0).trim().equals(hiddenProject.getName())) {
View Full Code Here

        traverseLinkWithKeyAndReturn("projects.link.aggregate.timesheet");
    }

    public void testProjectEditAndReturn() throws Exception {
        tester.login();
        Project project = setUpProject(NOT_HIDDEN);
        commit();

        tester.gotoProjectsPage();
        tester.clickEditLinkInRowWithText(project.getName());
        tester.getDialog().setWorkingForm("projectEditorForm");
        tester.submit();
        tester.assertKeyPresent("projects.title");
    }
View Full Code Here

        session.flush();
        session.connection().commit();
    }

    private Project setUpProject(boolean isHidden) throws HibernateException {
        Project project = new Project();
        project.setName("@Test Project@");
        project.setHidden(isHidden);
        tester.getSession().save(project);
        project.setName("@Test Project " + project.getId() + "@");
        scheduleObjectDeletion(project);
        return project;
    }
View Full Code Here

        domainContext = new DomainContext();
        domainContext.populate(object);
        String projectIdParam = request.getParameter("projectId");
        if (domainContext.getProjectId() == 0 && StringUtils.isNotEmpty(projectIdParam) && !projectIdParam.equals("0")) {
            ObjectRepository objectRepository = getRepository(Project.class);
            Project project = (Project)objectRepository.load(Integer.parseInt((request.getParameter("projectId"))));
            domainContext.populate(project);
        }
        domainContext.save(request);
        return domainContext;
    }
View Full Code Here

TOP

Related Classes of org.nxplanner.domain.Project

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.