Package org.jsurveylib.model.question

Examples of org.jsurveylib.model.question.Question.addValidationListener()


    public void addUnnecessaryListener() throws Exception {
        Survey model = new Survey(new XMLSurveyReader(new File("src\\test\\org\\jsurveylib\\model\\script\\scripthandlerfiles\\standard.xml")));
        Question q = model.getQuestionByID("X");
        q.addEnableListener(this);
        q.addAnswerListener(this);
        q.addValidationListener(this);
        q.addVisibilityListener(this);
        assertFalse(vis);
        assertFalse(ena);
        assertFalse(ans);
        assertFalse(val);
View Full Code Here


    @Test
    public void orderOfMessages() throws Exception {
        Survey m = new Survey(new XMLSurveyReader(new File("src\\test\\org\\jsurveylib\\model\\script\\validationhandlerfiles\\orderofmessages.xml")));
        Question q = m.getQuestionByID("blah");
        q.addValidationListener(this);
        assertFalse(q.isValid());

        assertNull(newStatus);
        assertNull(errorMessage);
View Full Code Here

    @Test
    public void configValidation() throws Exception {
        Survey m = new Survey(new XMLSurveyReader(new File("src\\test\\org\\jsurveylib\\model\\script\\validationhandlerfiles\\configvalidation.xml")));
        Question q = m.getQuestionByID("textArea");
        q.addValidationListener(this);
        assertFalse(q.isValid());

        q.setAnswer("");
        assertFalse(q.isValid());
        assertEquals("Say \"please\" and \"thank you\"", q.getCurrentValidationMessage());
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.