Package org.jsurveylib.io

Examples of org.jsurveylib.io.XMLSurveyReader


        assertEquals("", errorMessage);
    }

    @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("");
View Full Code Here


        assertEquals("", errorMessage);
    }

    @Test
    public void checkOtherQuestion() throws Exception {
        Survey m = new Survey(new XMLSurveyReader(new File("src\\test\\org\\jsurveylib\\model\\script\\validationhandlerfiles\\checkotherquestion.xml")));
        Question password = m.getQuestionByID("password");
        Question confirm = m.getQuestionByID("confirm");

        assertTrue(confirm.isValid());
        password.setAnswer("secret");
View Full Code Here

        assertTrue(m.getCurrentPage().areRequirementsMet());
    }

    @Test
    public void errorMessageExpression() throws Exception {
        Survey m = new Survey(new XMLSurveyReader(new File("src\\test\\org\\jsurveylib\\model\\script\\validationhandlerfiles\\errormessageexpression.xml")));
        Question password = m.getQuestionByID("password");
        Question confirm = m.getQuestionByID("confirm");
        Question five = m.getQuestionByID("five");

        assertTrue(confirm.isValid());
View Full Code Here

    private boolean enChanged = false;
    private boolean valChanged = false;

    @Test
    public void standard() throws Exception {
        Survey m = new Survey(new XMLSurveyReader(new File("src\\test\\org\\jsurveylib\\model\\question\\typedropdownfiles\\standard.xml")));
        m.getQuestionByID("drop").addAnswerListener(this);
        DropdownQuestion drop = (DropdownQuestion) m.getQuestionByID("drop");
        Choice c0 = drop.getChoices().get(0);
        assertEquals("", c0.getId());
        assertEquals("blah", c0.getLabel());
View Full Code Here

        assertTrue(true);
    }

    @Test
    public void dupe() throws Exception {
        Survey m = new Survey(new XMLSurveyReader(new File("src\\test\\org\\jsurveylib\\model\\question\\typedropdownfiles\\dupe.xml")));
        DropdownQuestion orig = (DropdownQuestion) m.getQuestionByID("cb");
        orig.addAnswerListener(this);
        orig.addEnableListener(this);
        orig.addValidationListener(this);
        orig.addVisibilityListener(this);
View Full Code Here

    private boolean enChanged = false;
    private boolean valChanged = false;

    @Test
    public void defaults() throws Exception {
        Survey m = new Survey(new XMLSurveyReader(new File("src\\test\\org\\jsurveylib\\model\\question\\typefilechooserfiles\\defaults.xml")));
        m.getQuestionByID("chooser").addAnswerListener(this);
        FileChooserQuestion chooser = (FileChooserQuestion) m.getQuestionByID("chooser");

        assertEquals(0, chooser.getFileFilters().size());
        assertTrue(chooser.isAllFilesFilterEnabled());
View Full Code Here

        assertEquals("blah blah blah", chooser.getAnswer());
    }

    @Test
    public void openDialog() throws Exception {
        Survey m = new Survey(new XMLSurveyReader(new File("src\\test\\org\\jsurveylib\\model\\question\\typefilechooserfiles\\opendialog.xml")));
        m.getQuestionByID("chooser").addAnswerListener(this);
        FileChooserQuestion chooser = (FileChooserQuestion) m.getQuestionByID("chooser");
        assertTrue(chooser.isOpenDialog());
        assertFalse(chooser.isSaveDialog());
    }
View Full Code Here

        assertFalse(chooser.isSaveDialog());
    }

    @Test
    public void saveDialog() throws Exception {
        Survey m = new Survey(new XMLSurveyReader(new File("src\\test\\org\\jsurveylib\\model\\question\\typefilechooserfiles\\savedialog.xml")));
        m.getQuestionByID("chooser").addAnswerListener(this);
        FileChooserQuestion chooser = (FileChooserQuestion) m.getQuestionByID("chooser");
        assertFalse(chooser.isOpenDialog());
        assertTrue(chooser.isSaveDialog());
    }
View Full Code Here

        assertTrue(chooser.isSaveDialog());
    }

    @Test
    public void allfilesfilterdisabled() throws Exception {
        Survey m = new Survey(new XMLSurveyReader(new File("src\\test\\org\\jsurveylib\\model\\question\\typefilechooserfiles\\allfilesfilterdisabled.xml")));
        m.getQuestionByID("chooser").addAnswerListener(this);
        FileChooserQuestion chooser = (FileChooserQuestion) m.getQuestionByID("chooser");

        assertEquals(1, chooser.getFileFilters().size());
        assertFalse(chooser.isAllFilesFilterEnabled());
View Full Code Here

        assertEquals("blah blah blah", chooser.getAnswer());
    }

    @Test
    public void onefilefilefilter() throws Exception {
        Survey m = new Survey(new XMLSurveyReader(new File("src\\test\\org\\jsurveylib\\model\\question\\typefilechooserfiles\\onefilefilefilter.xml")));
        m.getQuestionByID("chooser").addAnswerListener(this);
        FileChooserQuestion chooser = (FileChooserQuestion) m.getQuestionByID("chooser");

        assertNull(chooser.getOpenTo());
        assertEquals(2, chooser.getFileFilters().size());
View Full Code Here

TOP

Related Classes of org.jsurveylib.io.XMLSurveyReader

Copyright © 2018 www.massapicom. 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.