Package org.jsurveylib.io

Examples of org.jsurveylib.io.XMLSurveyReader


        assertEquals(10, rows);
    }

    @Test
    public void dupe() throws Exception {
        Survey m = new Survey(new XMLSurveyReader(new File("src\\test\\org\\jsurveylib\\model\\question\\typetextareafiles\\dupe.xml")));
        TextAreaQuestion orig = (TextAreaQuestion) 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\\typetextfieldfiles\\defaults.xml")));
        m.getQuestionByID("field").addAnswerListener(this);
        FreeTextQuestion field = (FreeTextQuestion) m.getQuestionByID("field");
        assertFalse(field.isAnswered());
        assertFalse(stateChanged);
        field.setAnswer("");    //no change
View Full Code Here

        assertTrue(field.isAnswered());
    }

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

    private boolean ans = false;
    private boolean val = false;

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

        assertFalse(val);
    }

    @Test
    public void scope() throws Exception {
        Survey model = new Survey(new XMLSurveyReader(new File("src\\test\\org\\jsurveylib\\model\\script\\scripthandlerfiles\\scope.xml")));
        Question impolite = model.getQuestionByID("impolite");
        impolite.setAnswer("please");
        assertFalse(impolite.isValid());
        assertEquals("You've said 'please' 1 time(s). Stop it!", impolite.getCurrentValidationMessage());
View Full Code Here

        assertEquals("You've said 'please' 2 time(s). Stop it!", impolite.getCurrentValidationMessage());
    }

    @Test
    public void initHasAccessToQuestions() throws Exception {
        Survey model = new Survey(new XMLSurveyReader(new File("src\\test\\org\\jsurveylib\\model\\script\\scripthandlerfiles\\inithasaccesstoquestions.xml")));
        Question q = model.getQuestionByID("Y");
        assertFalse(q.isEnabled());
        assertEquals("no", q.getAnswer());
    }
View Full Code Here

    private int lastPageInserted;
    private int lastRowInserted;

    @Test
    public void answerof() throws Exception {
        Survey model = new Survey(new XMLSurveyReader(new File("src\\test\\org\\jsurveylib\\model\\script\\answeroffiles\\answerof.xml")));
        answerOfTest(model);
    }
View Full Code Here

        answerOfTest(model);
    }

    @Test
    public void answerOfReset() throws Exception {
        Survey model = new Survey(new XMLSurveyReader(new File("src\\test\\org\\jsurveylib\\model\\script\\answeroffiles\\answerof.xml")));
        model.reset();
        answerOfTest(model);
    }
View Full Code Here

    private int lastPageInserted;
    private int lastRowInserted;

    @Test
    public void visible() throws Exception {
        Survey model = new Survey(new XMLSurveyReader(new File("src\\test\\org\\jsurveylib\\model\\script\\populatetemplatefiles\\visible.xml")));
        visibleTest(model);
    }
View Full Code Here

        visibleTest(model);
    }

    @Test
    public void visibleReset() throws Exception {
        Survey model = new Survey(new XMLSurveyReader(new File("src\\test\\org\\jsurveylib\\model\\script\\populatetemplatefiles\\visible.xml")));
        visibleTest(model);
        model.reset();
        visibleTest(model);
    }
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.