Package org.nxplanner.forms

Examples of org.nxplanner.forms.UserStoryEditorForm


        setUpRepositories();
        action.setMetaRepository(mockMetaRepository);
    }

    public void testStoryCustomerIdToObjectMappingAfterSubmit() throws Exception {
        UserStoryEditorForm form = new UserStoryEditorForm();
        form.setOid("111");
        form.setAction(EditStoryAction.UPDATE_ACTION);
        support.form = form;
        form.setCustomerId(1);
        Person person1 = new Person();
        person1.setId(1);
        Person person2 = new Person();
        person2.setId(2);
        UserStory story = new UserStory();
View Full Code Here


        verify();
        assertSame(person1, story.getCustomer());
    }

    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);
//        mockObjectRepository.update(story);
//        mockSessionControl.expectAndReturn(mockSession.load(Person.class, new Integer(1)), person1);
//        mockSessionControl.expectAndReturn(mockSession.load(Person.class, new Integer(2)), person2);
        replay();

        support.executeAction(action);

        // dao - this test is probably wrong
        verify();
        assertEquals(1, form.getCustomerId());
    }
View Full Code Here

    public static final String MOVED = "moved";
    public static final String OPERATION_PARAM_KEY = "operation";

    public void beforeObjectCommit(Object object, Session session, ActionMapping actionMapping, ActionForm actionForm,
            HttpServletRequest request, HttpServletResponse reply) throws Exception {
        UserStoryEditorForm storyForm = (UserStoryEditorForm)actionForm;
        UserStory story = (UserStory)object;
        String operation = request.getParameter(OPERATION_PARAM_KEY);
        try {
            if (StringUtils.equals(operation, "continue")) {
                continueStory(request, session, story, storyForm.getTargetIterationId());
                HistorySupport.saveEvent(session, story, CONTINUED, null,
                        SecurityHelper.getRemoteUserId(request), new Date());
            } else if (StringUtils.equals(operation, "move")) {
                story.setIterationId(storyForm.getTargetIterationId());
                HistorySupport.saveEvent(session, story, MOVED, null,
                        SecurityHelper.getRemoteUserId(request), new Date());
            }
        } catch (Exception e) {
            throw new ServletException(e);
View Full Code Here

TOP

Related Classes of org.nxplanner.forms.UserStoryEditorForm

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.