Package net.sf.pmr.agilePlanning.domain.release

Examples of net.sf.pmr.agilePlanning.domain.release.ReleaseImpl


    protected void setUp() throws Exception {
        super.setUp();
       
        validator = AgilePlanningObjectFactory.getReleaseValidator();
       
        release = new ReleaseImpl();
       
    }
View Full Code Here


       
        number = "1A";
        persistanceId = 3;
        persistanceVersion = 4;

        release = new ReleaseImpl();
       
        release.setDate(date);
        release.setProject(project);
        release.setNumber(number);
        release.setPersistanceId(persistanceId);
        release.setPersistanceVersion(persistanceVersion);
       
        releaseToDelete = new ReleaseImpl();
       
        releaseToDelete.setDate(date);
        releaseToDelete.setProject(project);
        releaseToDelete.setNumber(number);
        releaseToDelete.setPersistanceId(4);
View Full Code Here

        errors = AgilePlanningObjectFactory.getErrors();

        releaseService = new ReleaseServiceImpl(mockReleaseValidator, mockReleaseRepository, mockStoryRepository);
       
        releaseToAddOrUpdate = new ReleaseImpl();

        storyToAdd1PersistanceId = new Integer(3);
        storyToAdd2PersistanceId = new Integer(4);
        existingStoryPersistanceId = new Integer(5);

        // Story à ajouter
        storyToAdd1 = new StoryImpl();
        storyToAdd1.setShortDescription("1");
        storyToAdd1.setPersistanceId(storyToAdd1PersistanceId);
        storyToAdd2 = new StoryImpl();
        storyToAdd2.setShortDescription("2");
        storyToAdd2.setPersistanceId(storyToAdd2PersistanceId);
       
        // story existance dans la release
        existingStory = new StoryImpl();
        existingStory.setShortDescription("3");
        existingStory.setPersistanceId(existingStoryPersistanceId);
       
        // la release a déjà une story
        releaseToAddOrUpdate.setStories(new HashSet<Story>());
        releaseToAddOrUpdate.getStories().add(existingStory);
        releaseToAddOrUpdate.setPersistanceId(1);
        releaseToAddOrUpdate.setPersistanceVersion(3);
       
        storiesToAdd = new HashSet<Story>();
        storiesToAdd.add(storyToAdd1);
        storiesToAdd.add(storyToAdd2);
       
        releaseToDelete = new ReleaseImpl();
        releaseToDelete.setPersistanceVersion(1);
        releaseToDelete.setPersistanceVersion(5);

        MockCore.reset();
View Full Code Here

     * <li>Retours d'une structure d'erreur vide</li>
     * </ul>
     */
    public void testUpdate() {

        Release release = new ReleaseImpl();

        Project project = new ProjectImpl();
        Date date = new Date();
        String number = "2";
        int persistanceId = 1;
        long persistanceVersion = 3;
        release.setProject(project);

        // recherche
        mockReleaseRepository.expectFindByPersistanceId(persistanceId, release);

        // validation (sans erreurs)
        mockReleaseValidator.expectValidate(release, AgilePlanningObjectFactory.getErrors());

        // modification
        mockReleaseRepository.acceptAddOrUpdate(release);

        Errors errorsFromService = releaseService.update(number, date, persistanceId, persistanceVersion);

        // Vérifie les appels
        MockCore.verify();

        // aucune erreur n'est retournée
        assertFalse(errorsFromService.hasErrors());

        // vérifie la mise à jour
        assertEquals(release.getNumber(), number);
        assertSame(release.getProject(), project);
        assertEquals(release.getDate(), date);
        assertEquals(release.getPersistanceId(), persistanceId);
        assertEquals(release.getPersistanceVersion(), persistanceVersion);

    }
View Full Code Here

     * <li>retour d'une erreur dans la structure d'erreur</li>
     * </ul>
     */
    public void testUpdateWhenValidationFails() {

        Release release = new ReleaseImpl();

        Project project = new ProjectImpl();
        Date date = new Date();
        String number = "2";
        int persistanceId = 1;
        long persistanceVersion = 3;
        release.setProject(project);

        errors.reject("erreur");

        // recherche
        mockReleaseRepository.expectFindByPersistanceId(persistanceId, release);

        // validation
        mockReleaseValidator.expectValidate(release, errors);

        Errors errorsFromService = releaseService.update(number, date, persistanceId, persistanceVersion);

        // Vérifie les appels
        MockCore.verify();

        // une erreur est retournée.
        assertTrue(errorsFromService.hasErrors());

        // vérifie la mise à jour
        assertEquals(release.getNumber(), number);
        assertSame(release.getProject(), project);
        assertEquals(release.getDate(), date);
        assertEquals(release.getPersistanceId(), persistanceId);
        assertEquals(release.getPersistanceVersion(), persistanceVersion);

    }
View Full Code Here

     * </ul>
     */
    public void testFindByPersistanceIdWhenIterationIsFound() {

        int persistanceId = 1;
        Release release = new ReleaseImpl();

        mockReleaseRepository.expectFindByPersistanceId(persistanceId, release);

        Release releaseFromService = releaseService.findByPersistanceId(persistanceId);

View Full Code Here

     */
    public void testFindByProjectPersistanceIdWhenIterationsAreFound() {

        int projetPersistanceId = 1;
        Set<Release> set = new HashSet<Release>();
        Release release = new ReleaseImpl();
        set.add(release);

        mockReleaseRepository.expectFindByProjectPersistanceId(projetPersistanceId, set);

        Set setFromService = releaseService.findByProjectPersistanceId(projetPersistanceId);
View Full Code Here

       
        number = "1A";
        persistanceId = 3;
        persistanceVersion = 4;

        release = new ReleaseImpl();
       
        release.setDate(date);
        release.setProject(project);
        release.setNumber(number);
        release.setPersistanceId(persistanceId);
        release.setPersistanceVersion(persistanceVersion);
       
        releaseToDelete = new ReleaseImpl();
       
        releaseToDelete.setDate(date);
        releaseToDelete.setProject(project);
        releaseToDelete.setNumber(number);
        releaseToDelete.setPersistanceId(4);
View Full Code Here

        errors = AgilePlanningObjectFactory.getErrors();

        releaseService = new ReleaseServiceImpl(mockReleaseValidator, mockReleaseRepository, mockStoryRepository);
       
        releaseToAddOrUpdate = new ReleaseImpl();

        storyToAdd1PersistanceId = new Integer(3);
        storyToAdd2PersistanceId = new Integer(4);
        existingStoryPersistanceId = new Integer(5);

        // Story à ajouter
        storyToAdd1 = new StoryImpl();
        storyToAdd1.setShortDescription("1");
        storyToAdd1.setPersistanceId(storyToAdd1PersistanceId);
        storyToAdd2 = new StoryImpl();
        storyToAdd2.setShortDescription("2");
        storyToAdd2.setPersistanceId(storyToAdd2PersistanceId);
       
        // story existance dans la release
        existingStory = new StoryImpl();
        existingStory.setShortDescription("3");
        existingStory.setPersistanceId(existingStoryPersistanceId);
       
        // la release a déjà une story
        releaseToAddOrUpdate.setStories(new HashSet<Story>());
        releaseToAddOrUpdate.getStories().add(existingStory);
        releaseToAddOrUpdate.setPersistanceId(1);
        releaseToAddOrUpdate.setPersistanceVersion(3);
       
        storiesToAdd = new HashSet<Story>();
        storiesToAdd.add(storyToAdd1);
        storiesToAdd.add(storyToAdd2);
       
        releaseToDelete = new ReleaseImpl();
        releaseToDelete.setPersistanceVersion(1);
        releaseToDelete.setPersistanceVersion(5);
       
    }
View Full Code Here

     * <li>Retours d'une structure d'erreur vide</li>
     * </ul>
     */
    public void testUpdate() {

        Release release = new ReleaseImpl();

        Project project = new ProjectImpl();
        Date date = new Date();
        String number = "2";
        int persistanceId = 1;
        long persistanceVersion = 3;
        release.setProject(project);

        // recherche
        EasyMock.expect(mockReleaseRepository.findByPersistanceId(persistanceId)).andReturn(release);
       
        // validation (sans erreurs)
        EasyMock.expect(mockReleaseValidator.validate(release)).andReturn(AgilePlanningObjectFactory.getErrors());

        // modification
        mockReleaseRepository.addOrUpdate(release);

        mocksControl.replay();
       
        Errors errorsFromService = releaseService.update(number, date, persistanceId, persistanceVersion);

        // Vérifie les appels
        mocksControl.verify();

        // aucune erreur n'est retournée
        assertFalse(errorsFromService.hasErrors());

        // vérifie la mise à jour
        assertEquals(release.getNumber(), number);
        assertSame(release.getProject(), project);
        assertEquals(release.getDate(), date);
        assertEquals(release.getPersistanceId(), persistanceId);
        assertEquals(release.getPersistanceVersion(), persistanceVersion);

    }
View Full Code Here

TOP

Related Classes of net.sf.pmr.agilePlanning.domain.release.ReleaseImpl

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.