Examples of BusinessValue


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

        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

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

        // 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

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

     */
    public void testAddStoryObject() {
       
        Story story = new StoryImpl();
       
        BusinessValue businessValue = new BusinessValueImpl();
        businessValue.setId(1);
        businessValue.setDescription("Hight");
       
        RiskLevel riskLevel = new RiskLevelImpl();
        riskLevel.setId(2);
        riskLevel.setDescription("Low");

View Full Code Here

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

        // TODO comment tester unitairement la construction de l'objet à l'aide de la factory ???

       
        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

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

     */
    public void testAddStoryObjectWhenValidationFails() {
       
        Story story = new StoryImpl();
       
        BusinessValue businessValue = new BusinessValueImpl();
        businessValue.setId(1);
        businessValue.setDescription("Hight");
       
        RiskLevel riskLevel = new RiskLevelImpl();
        riskLevel.setId(2);
        riskLevel.setDescription("Low");

View Full Code Here

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

        EasyMock.expect(mockStoryRepository.findByPersistanceId(persistanceId)).andReturn(storyToUpdate);
       
        //MockCore.startBlock();
       
        // recherche des business value et risk level
        BusinessValue businessValueOfTheStory = new BusinessValueImpl();
        businessValueOfTheStory.setId(1);
        EasyMock.expect(mockBusinessValueRepository.findById(1)).andReturn(businessValueOfTheStory);

        RiskLevel riskLevelOfTheStory = new RiskLevelImpl();
        riskLevelOfTheStory.setId(2);
        EasyMock.expect(mockRiskLevelRepository.findById(2)).andReturn(riskLevelOfTheStory);

        //MockCore.endBlock();
       
        storyToUpdate.setBusinessValue(businessValueOfTheStory);
        storyToUpdate.setRiskLevel(riskLevelOfTheStory);

        // validation
        EasyMock.expect(mockStoryValidator.validate(EasyMock.isA(Story.class))).andReturn(errors);
       
        // enregistrement de la story dans la repository
        mockStoryRepository.addOrUpdate(storyToUpdate);
       
        // set mock in replay mode
        mocksControl.replay();

        // 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
        mocksControl.verify();

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

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

        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;
       
        EasyMock.expect(mockStoryRepository.findByPersistanceId(1)).andReturn(story);
       
        // set mock in replay mode
        mocksControl.replay();
       
        // 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

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

       
        // recherche de la story dans la repository
        EasyMock.expect(mockStoryRepository.findByPersistanceId(persistanceId)).andReturn(storyToUpdate);
       
        // recherche des business value et risk level
        BusinessValue businessValueOfTheStory = new BusinessValueImpl();
        businessValueOfTheStory.setId(1);
        EasyMock.expect(mockBusinessValueRepository.findById(1)).andReturn(businessValueOfTheStory);

        RiskLevel riskLevelOfTheStory = new RiskLevelImpl();
        riskLevelOfTheStory.setId(2);
        EasyMock.expect(mockRiskLevelRepository.findById(2)).andReturn(riskLevelOfTheStory);
       
        //MockCore.endBlock();

        // validation
        errors.reject("code");
        EasyMock.expect(mockStoryValidator.validate(EasyMock.isA(Story.class))).andReturn(errors);

        // set mock in replay mode
        mocksControl.replay();
       
        // 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
        mocksControl.verify();

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

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

     * <li>la description</li>
     * </ul>
     */
    public void testIsEqualsAndHashcodeWithDifferentDescriptions() {     
       
      BusinessValue businessValue1 = new BusinessValueImpl();
      businessValue1.setId(1);
      businessValue1.setDescription("description");
     
      BusinessValue businessValue2 = new BusinessValueImpl();
      businessValue2.setId(1);
      businessValue2.setDescription("scooby doo");
     
      assertFalse(businessValue1.equals(businessValue2));
      assertFalse(businessValue1.hashCode() == businessValue2.hashCode());
     
    }
View Full Code Here

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

     * <li>la description</li>
     * </ul>
     */
    public void testIsEqualsAndHashcodeWithSameDescriptions() {     
       
      BusinessValue businessValue1 = new BusinessValueImpl();
      businessValue1.setId(1);
      businessValue1.setDescription("description");
     
      BusinessValue businessValue2 = new BusinessValueImpl();
      businessValue2.setId(2);
      businessValue2.setDescription("description");
     
      assertTrue(businessValue1.equals(businessValue2));
      assertTrue(businessValue1.hashCode() == businessValue2.hashCode());
     
    }
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.