Package org.nxplanner.domain

Examples of org.nxplanner.domain.UserStory


    public void testNext_TwoStoriesWithDifferentPriority () throws Exception {
        story.setName("aaaa"); //first in alphabetical order
        story.setPriority(4); //second in priority order
        task = newTask(story);
        task.setName("aaa task");
        UserStory anotherStory = newUserStory(iteration);
        anotherStory.setName("zzzz"); //second in alphabetical order
        anotherStory.setPriority(1); //first in priority order
        Task anotherTask = newTask(anotherStory);
        anotherTask.setName("zzz task");
        source = new IterationDataSource(iteration, session);
        assertFieldValues(anotherStory, anotherTask);
        assertFieldValues(story, task);
View Full Code Here


        tasks = new ArrayList();
        tasks.add(task1);
        tasks.add(task2);
        tasks.add(task3);
        setUpThreadSession();
        story = new UserStory();
        story.setTasks(tasks);
        action = new EditStoryAction();
        setUpRepositories();
        action.setMetaRepository(mockMetaRepository);
    }
View Full Code Here

        form.setCustomerId(1);
        Person person1 = new Person();
        person1.setId(1);
        Person person2 = new Person();
        person2.setId(2);
        UserStory story = new UserStory();
        story.setId(111);
        expectObjectRepositoryAccess(UserStory.class);
        mockObjectRepositoryControl.expectAndReturn(mockObjectRepository.load(111), story);
        mockObjectRepository.update(story);
        mockSessionControl.expectAndReturn(mockSession.load(Person.class, new Integer(1)), person1);
        replay();

        support.executeAction(action);

        verify();
        assertSame(person1, story.getCustomer());
    }
View Full Code Here

        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);
View Full Code Here

            new Integer(6666),
            new Integer(7777)
        };
        support.setUpSubjectInRole("editor");

        UserStory continuedStory = action.continueStory(support.request, support.hibernateSession, story, 33);

        support.assertHistoricalEvent(1111, HistoricalEvent.CREATED, "continuation", XPlannerTestSupport.DEFAULT_PERSON_ID);
        support.assertHistoricalEvent(3333, HistoricalEvent.CREATED, "continuation", XPlannerTestSupport.DEFAULT_PERSON_ID);
        support.assertHistoricalEvent(5555, HistoricalEvent.CREATED, "continuation", XPlannerTestSupport.DEFAULT_PERSON_ID);
        assertEquals("wrong iteration ID", 33, continuedStory.getIterationId());
        assertEquals("wrong name", story.getName(), continuedStory.getName());
        assertEquals("wrong customer", story.getCustomer(), continuedStory.getCustomer());
        assertEquals("wrong priority", story.getPriority(), continuedStory.getPriority());
        assertTrue("wrong story desc.",
                story.getDescription().indexOf("Continued as story:" + continuedStory.getId()) != -1);
        assertTrue("wrong continuedStory desc.",
                continuedStory.getDescription().indexOf("Continued from story:" + story.getId()) != -1);
        assertEquals("wrong # of tasks", 2, support.hibernateSession.saveObjects.size() - 1);
        Iterator taskItr = support.hibernateSession.saveObjects.iterator();
        taskItr.next(); // skip story
        assertTaskProperties(task1, (Task)taskItr.next(), continuedStory);
        assertTaskProperties(task2, (Task)taskItr.next(), continuedStory);
View Full Code Here

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();
        session.connection().commit();
        session.evict(story);
        UserStory savedStory = (UserStory) session.load(UserStory.class, new Integer(story.getId()));
        assertEquals(person, savedStory.getCustomer());
    }
View Full Code Here

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

    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

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

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

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

TOP

Related Classes of org.nxplanner.domain.UserStory

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.