Package net.sf.pmr.agilePlanning.domain.story

Examples of net.sf.pmr.agilePlanning.domain.story.BusinessValue


    /**
     * Test quand la BusinessValue est trouv�e.
     */
    public final void testFindByIdWhenBusinessValueIsFound() {
       
        BusinessValue businessValue = businessValueMapper.findById(1);
       
        assertNotNull(businessValue);
        assertEquals(1, businessValue.getId());
        assertEquals("HIGH", businessValue.getDescription());
       
    }
View Full Code Here


     * Test quand la BusinessValue n'est pas trouv�e.
     * La m�thode doit retourner null.
     */
    public final void testFindByIdWhenBusinessValueIsNotFound() {
       
        BusinessValue businessValue = businessValueMapper.findById(999);
       
        assertNull(businessValue);
       
    }
View Full Code Here

        story.setDaysEstimated(daysEstimated);
        story.setPersistanceId(persistanceId);
        story.setPersistanceVersion(persistanceVersion);

        // find the riskLevel and business value
        BusinessValue businessValue = businessValueRepository.findById(businessValueId);
        story.setBusinessValue(businessValue);

        RiskLevel riskLevel = riskLevelRepository.findById(riskLevelId);
        story.setRiskLevel(riskLevel);
View Full Code Here

        story.setShortDescription(shortDescription);
        story.setDescription(description);
        story.setDaysEstimated(daysEstimated);

        // find the riskLevel and business value
        BusinessValue businessValue = businessValueRepository.findById(businessValueId);
        story.setBusinessValue(businessValue);

        RiskLevel riskLevel = riskLevelRepository.findById(riskLevelId);
        story.setRiskLevel(riskLevel);
View Full Code Here

        // Comment tester la construction � l'aide de la factory ??
        // et la construction de l'objet
       
        Story story = new StoryImpl();
       
        BusinessValue businessValue = new BusinessValueImpl();
        businessValue.setId(1);
       
        RiskLevel riskLevel = new RiskLevelImpl();
        riskLevel.setId(2);

        story.setPersistanceId(1);
View Full Code Here

        // Comment tester la construction à l'aide de la factory ??
        // et la construction de l'objet
       
        Story story = new StoryImpl();
       
        BusinessValue businessValue = new BusinessValueImpl();
        businessValue.setId(1);
       
        RiskLevel riskLevel = new RiskLevelImpl();
        riskLevel.setId(2);

        story.setPersistanceId(1);
View Full Code Here

       
        MockCore.startBlock();
       
        // recherche des business value et risk level
        BusinessValue businessValueOfTheStory = new BusinessValueImpl();
        businessValueOfTheStory.setId(1);
        mockBusinessValueRepository.expectFindById(1, businessValueOfTheStory);

        RiskLevel riskLevelOfTheStory = new RiskLevelImpl();
        riskLevelOfTheStory.setId(2);
        mockRiskLevelRepository.expectFindById(2, riskLevelOfTheStory);      
        MockCore.endBlock();
       
        storyToUpdate.setBusinessValue(businessValueOfTheStory);
        storyToUpdate.setRiskLevel(riskLevelOfTheStory);
       

        // validation
        mockStoryValidator.expectValidate(new Ignore(), errors);

        // enregistrement de la story dans la repository
        mockStoryRepository.expectAddOrUpdate(storyToUpdate);

        // appel de la m�thode de mise � jour
        Errors errorsFromService = storyService.update(shortDescription, description, daysestimated, businessValueOfTheStory.getId(), riskLevelOfTheStory.getId(),persistanceId, persistanceVersion);

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

        // aucune erreur n'est retourn�e (car pas de validation)
View Full Code Here

        String description = "doo";
        double daysestimated = 2;
        int persistanceId = 1;
        int persistanceVersion = 5;

        BusinessValue businessValueOfTheStory = new BusinessValueImpl();
        businessValueOfTheStory.setId(1);

        RiskLevel riskLevelOfTheStory = new RiskLevelImpl();
        riskLevelOfTheStory.setId(2);

     
        // recherche de la story
        Story story =  null;
        mockStoryRepository.expectFindByPersistanceId(1, story);
       
        // Appel au service
        Errors errorsFromService = storyService.update(shortDescription, description, daysestimated, businessValueOfTheStory.getId(), riskLevelOfTheStory.getId(),persistanceId, persistanceVersion);
       
        // contrôle de l'erreur retournée
        assertTrue(errorsFromService.hasGlobalErrors());
        // message en Français
        assertEquals("Cette story n'existe pas en base de données", errorsFromService.getGlobalError(Locale.FRENCH));
View Full Code Here

       
        // recherche de la story dans la repository
        mockStoryRepository.expectFindByPersistanceId(persistanceId, storyToUpdate);       
       
        // recherche des business value et risk level
        BusinessValue businessValueOfTheStory = new BusinessValueImpl();
        businessValueOfTheStory.setId(1);
        mockBusinessValueRepository.expectFindById(1, businessValueOfTheStory);

        RiskLevel riskLevelOfTheStory = new RiskLevelImpl();
        riskLevelOfTheStory.setId(2);
        mockRiskLevelRepository.expectFindById(2, riskLevelOfTheStory);      
        MockCore.endBlock();


        // validation
        errors.reject("code");
        mockStoryValidator.expectValidate(new Ignore(), errors);

        // appel de la m�thode de mise � jour
        Errors errorsFromService = storyService.update(shortDescription, description, estimate, businessValueOfTheStory.getId(), riskLevelOfTheStory.getId(), persistanceId, persistanceVersion);

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

        // aucune erreur n'est retourn�e (car pas de validation)
View Full Code Here

        story.setDaysEstimated(daysEstimated);
        story.setPersistanceId(persistanceId);
        story.setPersistanceVersion(persistanceVersion);

        // find the riskLevel and business value
        BusinessValue businessValue = businessValueRepository.findById(businessValueId);
        story.setBusinessValue(businessValue);

        RiskLevel riskLevel = riskLevelRepository.findById(riskLevelId);
        story.setRiskLevel(riskLevel);
View Full Code Here

TOP

Related Classes of net.sf.pmr.agilePlanning.domain.story.BusinessValue

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.