Examples of QuestionType


Examples of com.vst.model.QuestionType

        request = newGet("/editQuestionType.html");
        request.addParameter("questionTypeId", "1");

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

        QuestionType questionType = (QuestionType) mv.getModel().get(c.getCommandName());
        assertNotNull(questionType);
        request = newPost("/editQuestionType.html");
        super.objectToRequestParameters(questionType, request);

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

Examples of com.vst.model.QuestionType

            log.debug("entering 'handleRequest' method...");
        }
        if (request.getParameter("edited") != null) {
            request.setAttribute("addition", "?edited=1");
        }
        QuestionType questionType = new QuestionType();
        // populate object with request parameters
        BeanUtils.populate(questionType, request.getParameterMap());

        List questionTypes = questionTypeManager.getQuestionTypes(questionType);
View Full Code Here

Examples of com.vst.model.QuestionType

    protected Object formBackingObject(HttpServletRequest request)
            throws Exception {

        if (!isFormSubmission(request)) {
            String questionTypeId = request.getParameter("questionTypeId");
            QuestionType questionType = null;

            if (!StringUtils.isEmpty(questionTypeId)) {
                questionType = questionTypeManager.getQuestionType(questionTypeId);
                questionTypeManager.evict(questionType);
            } else {
                questionType = new QuestionType();
            }
            if (request.getParameter("edited") != null) {
                request.setAttribute("addition", "?edited=1");
                questionType.setEdited(true);
            }
            return questionType;
        }
        return super.formBackingObject(request);
    }
View Full Code Here

Examples of com.vst.model.QuestionType

            throws Exception {
        if (log.isDebugEnabled()) {
            log.debug("entering 'onSubmit' method...");
        }

        QuestionType questionType = (QuestionType) command;
        boolean isNew = (questionType.getQuestionTypeId() == null);
        Locale locale = request.getLocale();

        if (request.getParameter("delete") != null) {
            questionTypeManager.removeQuestionType(questionType.getQuestionTypeId().toString());

            saveMessage(request, getText("questionType.deleted", locale));
        } else {
            questionTypeManager.saveQuestionType(questionType);

            String key = (isNew) ? "questionType.added" : "questionType.updated";
            saveMessage(request, getText(key, locale));
            if (questionType.isEdited()) {
                return new ModelAndView("redirect:updating.html?id=" + questionType.getQuestionTypeId() + "&fieldId=" + request.getParameter("fieldId"));
            }
        }

        return new ModelAndView(getSuccessView());
    }
View Full Code Here

Examples of com.vst.model.QuestionType

    public void setQuestionTypeDao(QuestionTypeDao dao) {
        this.dao = dao;
    }

    public void testAddQuestionType() throws Exception {
        QuestionType questionType = new QuestionType();

        // set required fields

        dao.saveQuestionType(questionType);

        // verify a primary key was assigned
        assertNotNull(questionType.getQuestionTypeId());

        // verify set fields are same after save
    }
View Full Code Here

Examples of com.vst.model.QuestionType

        // verify set fields are same after save
    }

    public void testGetQuestionType() throws Exception {
        QuestionType questionType = dao.getQuestionType(questionTypeId);
        assertNotNull(questionType);
    }
View Full Code Here

Examples of com.vst.model.QuestionType

        QuestionType questionType = dao.getQuestionType(questionTypeId);
        assertNotNull(questionType);
    }

    public void testGetQuestionTypes() throws Exception {
        QuestionType questionType = new QuestionType();

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

Examples of com.vst.model.QuestionType

        List results = dao.getQuestionTypes(questionType);
        assertTrue(results.size() > 0);
    }

    public void testSaveQuestionType() throws Exception {
        QuestionType questionType = dao.getQuestionType(questionTypeId);

        // update required fields

        dao.saveQuestionType(questionType);
View Full Code Here

Examples of com.vst.model.QuestionType

        questionTypeManager = null;
    }

    public void testGetQuestionTypes() throws Exception {
        List results = new ArrayList();
        QuestionType questionType = new QuestionType();
        results.add(questionType);

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

Examples of com.vst.model.QuestionType

    }

    public void testGetQuestionType() throws Exception {
        // set expected behavior on dao
        questionTypeDao.expects(once()).method("getQuestionType")
            .will(returnValue(new QuestionType()));
        QuestionType questionType = questionTypeManager.getQuestionType(questionTypeId);
        assertTrue(questionType != null);
        questionTypeDao.verify();
    }
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.