Examples of DefectRecomendation


Examples of com.vst.model.DefectRecomendation

    /**
     * @see com.vst.dao.DefectRecomendationDao#getDefectRecomendation(Integer defectRecomendationId)
     */
    public DefectRecomendation getDefectRecomendation(final Integer defectRecomendationId) {
        DefectRecomendation defectRecomendation = (DefectRecomendation) getObject(defectRecomendationId);
        return defectRecomendation;
    }
View Full Code Here

Examples of com.vst.model.DefectRecomendation

        defectRecomendationManager = null;
    }

    public void testGetDefectRecomendations() throws Exception {
        List results = new ArrayList();
        DefectRecomendation defectRecomendation = new DefectRecomendation();
        results.add(defectRecomendation);

        // set expected behavior on dao
        defectRecomendationDao.expects(once()).method("getDefectRecomendations")
            .will(returnValue(results));
View Full Code Here

Examples of com.vst.model.DefectRecomendation

    }

    public void testGetDefectRecomendation() throws Exception {
        // set expected behavior on dao
        defectRecomendationDao.expects(once()).method("getDefectRecomendation")
            .will(returnValue(new DefectRecomendation()));
        DefectRecomendation defectRecomendation = defectRecomendationManager.getDefectRecomendation(defectRecomendationId);
        assertTrue(defectRecomendation != null);
        defectRecomendationDao.verify();
    }
View Full Code Here

Examples of com.vst.model.DefectRecomendation

        assertTrue(defectRecomendation != null);
        defectRecomendationDao.verify();
    }

    public void testSaveDefectRecomendation() throws Exception {
        DefectRecomendation defectRecomendation = new DefectRecomendation();

        // set expected behavior on dao
        defectRecomendationDao.expects(once()).method("saveDefectRecomendation")
            .with(same(defectRecomendation)).isVoid();
View Full Code Here

Examples of com.vst.model.DefectRecomendation

        defectRecomendationManager.saveDefectRecomendation(defectRecomendation);
        defectRecomendationDao.verify();
    }

    public void testAddAndRemoveDefectRecomendation() throws Exception {
        DefectRecomendation defectRecomendation = new DefectRecomendation();

        // set required fields

        // set expected behavior on dao
        defectRecomendationDao.expects(once()).method("saveDefectRecomendation")
            .with(same(defectRecomendation)).isVoid();
        defectRecomendationManager.saveDefectRecomendation(defectRecomendation);
        defectRecomendationDao.verify();

        // reset expectations
        defectRecomendationDao.reset();

        defectRecomendationDao.expects(once()).method("removeDefectRecomendation").with(eq(new Long(defectRecomendationId)));
        defectRecomendationManager.removeDefectRecomendation(defectRecomendationId);
        defectRecomendationDao.verify();

        // reset expectations
        defectRecomendationDao.reset();
        // remove
        Exception ex = new ObjectRetrievalFailureException(DefectRecomendation.class, defectRecomendation.getDefectRecomendationId());
        defectRecomendationDao.expects(once()).method("removeDefectRecomendation").isVoid();
        defectRecomendationDao.expects(once()).method("getDefectRecomendation").will(throwException(ex));
        defectRecomendationManager.removeDefectRecomendation(defectRecomendationId);
        try {
            defectRecomendationManager.getDefectRecomendation(defectRecomendationId);
View Full Code Here

Examples of com.vst.model.DefectRecomendation

        return DefectRecomendation.class.isAssignableFrom(candidate);
    }

    public void validate(Object obj, Errors errors) {

        DefectRecomendation defectRecomendation = (DefectRecomendation) obj;

        //checking if the ibject type is correct
        if (defectRecomendation.getContent()==null || defectRecomendation.getContent().trim().equals("")) {
            errors.rejectValue("content", "defectRecomendation.noContent");
        }

        //checking if constructiontype is chosen
        if (defectRecomendation.getDefectCategory().getDefectCategoryId().equals(new Long(-1))) {
            errors.rejectValue("defectCategory", "defectRecomendation.noDefectCategory");
        }

        //checking if reason name is chosen
        if (defectRecomendation.getReasonName().getReasonNameId().equals(new Long(-1))) {
            errors.rejectValue("reasonName", "defectRecomendation.noReasonName");
        }

        if(!defectRecomendationManager.isUniqueDefectRecomendation(defectRecomendation)){
            errors.rejectValue("defectRecomendationId","defectRecomendation.notUnique");
View Full Code Here

Examples of com.vst.model.DefectRecomendation

        return DefectRecomendation.class.isAssignableFrom(candidate);
    }

    public void validate(Object obj, Errors errors) {

        DefectRecomendation defectRecomendation = (DefectRecomendation) obj;


        if (defectRecomendation.getDefectCategory().getDefectCategoryId().equals(new Long(-1))) {
            errors.rejectValue("defectCategory", "defectRecomendation.noDefectCategory");
        }
        if (defectRecomendation.getDefectCategory().getDefectCategoryId().equals(new Long(-1))) {
            errors.rejectValue("defectCategory", "defectRecomendation.noContent");
        }

        //checking if reason name is chosen
        if (defectRecomendation.getReasonName().getReasonNameId().equals(new Long(-1))) {
            errors.rejectValue("reasonName", "defectRecomendation.noReasonName");
        }

        if (!defectRecomendationManager.isUniqueDefectRecomendation(defectRecomendation)) {
            errors.rejectValue("defectRecomendationId", "defectRecomendation.notUnique");
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.