Examples of UserStory


Examples of org.nxplanner.domain.UserStory

public class TestUserStoryDecorator extends TestCase {
    UserStoryDecorator decorator;

    public void testGetPercentCompleted() throws Exception {
        UserStory story1 = newStory(10, 10, 0, true);
        UserStory story2 = newStory(10, 9, 0, true);
        UserStory story3 = newStory(5, 5, 0, true);
        UserStory story4 = newStory(2, 0, 2, false);
        UserStory story5 = newStory(0, 0, 0, false);
        decorator = new UserStoryDecorator();
        double pct1 = getPercentCompleted(story1);
        double pct2 = getPercentCompleted(story2);
        double pct3 = getPercentCompleted(story3);
        double pct4 = getPercentCompleted(story4);
View Full Code Here

Examples of org.nxplanner.domain.UserStory

    private UserStory newStory(final double estimatedHours,
                               final double actualHours,
                               final double remainingHours,
                               final boolean completed) {
        return new UserStory() {
            public double getEstimatedHours() { return estimatedHours; }
            public double getActualHours() { return actualHours; }
            public double getRemainingHours() { return remainingHours; }
            public boolean isCompleted() { return completed; }
        };
View Full Code Here

Examples of org.nxplanner.domain.UserStory

import org.nxplanner.domain.UserStory;


public class UserStoryDecorator extends TableDecorator {
    public double getPercentCompleted() {
        UserStory story = getUserStory();
        return HoursDecorator.getPercentCompletedScore(story.getEstimatedHours(),
                                                       story.getActualHours(),
                                                       story.getRemainingHours(),
                                                       story.isCompleted());
    }
View Full Code Here

Examples of org.nxplanner.domain.UserStory

                                                       story.getRemainingHours(),
                                                       story.isCompleted());
    }

    public double getRemainingHours() {
        UserStory story = getUserStory();
        return HoursDecorator.getRemainingHoursScore(story.getActualHours(), story.getRemainingHours(), story.isCompleted());
    }
View Full Code Here

Examples of org.nxplanner.domain.UserStory

        iteration.setName(ITERATION_PREFIX + iteration.getId());
        return iteration;
    }

    public UserStory newUserStory(Iteration iteration) {
        UserStory story = new UserStory();
        story.setId(nextId++);
        story.setName(STORY_PREFIX + iteration.getId());
        iteration.getUserStories().add(story);
        return story;
    }
View Full Code Here

Examples of org.nxplanner.domain.UserStory

                mockAuthorizer.hasPermissionPersonId);
    }

    public void testUserAuthorizedWithObjectAttributeString() throws Exception {
        mockAuthorizer.hasPermission2Return = Boolean.TRUE;
        Object mockObject = new UserStory();
        support.pageContext.setAttribute("x", mockObject);
        tag.setObject("x");
        tag.setProjectId(11);
        tag.setPermission("set");
View Full Code Here

Examples of org.nxplanner.domain.UserStory

        assertEquals("wrong param to authorizer", mockObject, mockAuthorizer.hasPermission2DomainObject);
    }

    public void testUserAuthorizedWhenObjectIsFromDefaultAttribute() throws Exception {
        mockAuthorizer.hasPermission2Return = Boolean.TRUE;
        Object mockObject = new UserStory();
        support.pageContext.setAttribute("project", mockObject);
        tag.setProjectId(11);
        tag.setPermission("set");

        int result = tag.doStartTag();
View Full Code Here

Examples of org.nxplanner.domain.UserStory

    }

    public void testUserAuthorizedWhenProjectIdFromRequestParam() throws Exception {
        support.request.setParameterValue("projectId", new String[]{"33"});
        mockAuthorizer.hasPermission2Return = Boolean.TRUE;
        UserStory mockStory = new UserStory();
        tag.setObject(mockStory);
        tag.setPermission("set");

        int result = tag.doStartTag();
View Full Code Here

Examples of org.nxplanner.domain.UserStory

public class TestStoryModel extends TestCase {
    StoryModel model;

    public void testGetName() throws Exception {
        UserStory story = new UserStory();
        story.setName("story");
        Iteration iteration = new Iteration();
        iteration.setName("iteration");
        IterationModel model = new IterationModel(iteration){
            protected Project getProject() {
                Project project = new Project();
View Full Code Here

Examples of org.nxplanner.domain.UserStory

    }

    public void testPopulateTask() throws Exception {
        Project project = newProject();
        Iteration iteration = newIteration(project);
        UserStory story = newUserStory(iteration);
        Task task = newTask(story);
        commitCloseAndOpenSession();
        DomainContext context = new DomainContext();
        context.populate(task);
        assertEquals(project.getId(), context.getProjectId());
        assertEquals(project.getName(), context.getProjectName());
        assertEquals(iteration.getId(), context.getIterationId());
        assertEquals(iteration.getName(), context.getIterationName());
        assertEquals(story.getId(), context.getStoryId());
        assertEquals(story.getName(), context.getStoryName());
        assertSame(task, context.getTargetObject());
    }
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.