Examples of DangerCategory


Examples of com.vst.model.DangerCategory

        request = newGet("/editDangerCategory.html");
        request.addParameter("dangerCategoryId", "1");

        mv = c.handleRequest(request, new MockHttpServletResponse());

        DangerCategory dangerCategory = (DangerCategory) mv.getModel().get(c.getCommandName());
        assertNotNull(dangerCategory);
        request = newPost("/editDangerCategory.html");
        super.objectToRequestParameters(dangerCategory, request);

        // update the form's fields and add it back to the request
View Full Code Here

Examples of com.vst.model.DangerCategory

        // generating the unique number of construction
        constructionExample.setExampleName("конструкция 0");
        System.out.println(objectConstruction.getTypeId().intValue());
        Integer number = constructionExampleManager.getExampleNumberByConstructionObjectId(new Integer(objectConstruction.getTypeId()));
        constructionExample.setExampleRelativeNumber(number);
        DangerCategory dc = new DangerCategory();
        // 0 -default danger category means N/A
        dc.setDangerCategoryId(new Integer(0));
        constructionExample.setDangerCategory(dc);
        constructionExample.setObjectId(new Integer(buildObjectId));
        constructionExample.setBuildObjectId(new Integer(buildObjectId));
        constructionExample.setObjectConstructionId(objectConstruction.getTypeId());
        constructionExample.setConstructionType(objectConstruction.getConstructionType());
View Full Code Here

Examples of com.vst.model.DangerCategory

    public void makeNotNull(BuildingObject buildingObject) {
        dao.evict(buildingObject);
        if (buildingObject.getDangerCategory() == null) {

            buildingObject.setDangerCategory(new DangerCategory());
        }
    }
View Full Code Here

Examples of com.vst.model.DangerCategory

        DangerCategory dangerCategory = dao.getDangerCategory(dangerCategoryId);
        assertNotNull(dangerCategory);
    }

    public void testGetDangerCategorys() throws Exception {
        DangerCategory dangerCategory = new DangerCategory();

        List results = dao.getDangerCategorys(dangerCategory);
        assertTrue(results.size() > 0);
    }
View Full Code Here

Examples of com.vst.model.DangerCategory

        List results = dao.getDangerCategorys(dangerCategory);
        assertTrue(results.size() > 0);
    }

    public void testSaveDangerCategory() throws Exception {
        DangerCategory dangerCategory = dao.getDangerCategory(dangerCategoryId);

        // update required fields

        dao.saveDangerCategory(dangerCategory);
View Full Code Here

Examples of com.vst.model.DangerCategory

          ce.setExampleName((String) cols[2]);
          ce.setDangerCategory((DangerCategory) cols[3]);
          ce.setNoDeffects((Boolean) cols[4]);

          if (ce.getRecommendedDangerCategory() == null){
          DangerCategory dc = new DangerCategory();
          dc.setDangerCategoryId(-1);
          dc.setCategoryName("В");
          ce.setRecommendedDangerCategory(dc);
        }
          ce.setExampleDefects(null);
          ce.setDefectCount(new Integer(0));
          ce.setExampleDefects(new ArrayList<ConstructionDefect>());
View Full Code Here

Examples of com.vst.model.DangerCategory

        dangerCategoryManager = null;
    }

    public void testGetDangerCategorys() throws Exception {
        List results = new ArrayList();
        DangerCategory dangerCategory = new DangerCategory();
        results.add(dangerCategory);

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

Examples of com.vst.model.DangerCategory

    }

    public void testGetDangerCategory() throws Exception {
        // set expected behavior on dao
        dangerCategoryDao.expects(once()).method("getDangerCategory")
            .will(returnValue(new DangerCategory()));
        DangerCategory dangerCategory = dangerCategoryManager.getDangerCategory(dangerCategoryId);
        assertTrue(dangerCategory != null);
        dangerCategoryDao.verify();
    }
View Full Code Here

Examples of com.vst.model.DangerCategory

        assertTrue(dangerCategory != null);
        dangerCategoryDao.verify();
    }

    public void testSaveDangerCategory() throws Exception {
        DangerCategory dangerCategory = new DangerCategory();

        // set expected behavior on dao
        dangerCategoryDao.expects(once()).method("saveDangerCategory")
            .with(same(dangerCategory)).isVoid();
View Full Code Here

Examples of com.vst.model.DangerCategory

        dangerCategoryManager.saveDangerCategory(dangerCategory);
        dangerCategoryDao.verify();
    }

    public void testAddAndRemoveDangerCategory() throws Exception {
        DangerCategory dangerCategory = new DangerCategory();

        // set required fields

        // set expected behavior on dao
        dangerCategoryDao.expects(once()).method("saveDangerCategory")
            .with(same(dangerCategory)).isVoid();
        dangerCategoryManager.saveDangerCategory(dangerCategory);
        dangerCategoryDao.verify();

        // reset expectations
        dangerCategoryDao.reset();

        dangerCategoryDao.expects(once()).method("removeDangerCategory").with(eq(new Long(dangerCategoryId)));
        dangerCategoryManager.removeDangerCategory(dangerCategoryId);
        dangerCategoryDao.verify();

        // reset expectations
        dangerCategoryDao.reset();
        // remove
        Exception ex = new ObjectRetrievalFailureException(DangerCategory.class, dangerCategory.getDangerCategoryId());
        dangerCategoryDao.expects(once()).method("removeDangerCategory").isVoid();
        dangerCategoryDao.expects(once()).method("getDangerCategory").will(throwException(ex));
        dangerCategoryManager.removeDangerCategory(dangerCategoryId);
        try {
            dangerCategoryManager.getDangerCategory(dangerCategoryId);
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.