Package org.jsurveylib.io

Examples of org.jsurveylib.io.XMLSurveyReader


        assertTrue(model.isLastPageAndComplete());
    }

    @Test
    public void toggleOnAnswerChanged() throws Exception {
        Survey model = new Survey(new XMLSurveyReader(new File("src\\test\\org\\jsurveylib\\model\\script\\skippagefiles\\toggleonanswerchanged.xml")));
       
        assertTrue(model.isNextPageAvailable());
        assertFalse(model.isPreviousPageAvailable());
        assertFalse(model.isLastPageAndComplete());
View Full Code Here


*/
public class OnAnswerChangedTest {

    @Test
    public void standard() throws Exception {
        Survey model = new Survey(new XMLSurveyReader(new File("src\\test\\org\\jsurveylib\\model\\script\\onanswerchangedfiles\\standard.xml")));
        Question x = model.getQuestionByID("X");
        assertTrue(x.isVisible());
        x.setAnswer("yes");
        assertFalse(x.isVisible());

View Full Code Here

        assertFalse(z.isValid());
    }

    @Test
    public void modifyingOthers() throws Exception {
        Survey model = new Survey(new XMLSurveyReader(new File("src\\test\\org\\jsurveylib\\model\\script\\onanswerchangedfiles\\modifyingothers.xml")));
        Question modifyee = model.getQuestionByID("modifyee");
        Question x = model.getQuestionByID("X");
        assertTrue(modifyee.isVisible());
        x.setAnswer("yes");
        assertFalse(modifyee.isVisible());
View Full Code Here

        assertFalse(modifyee.isValid());
    }

    @Test
    public void defaults() throws Exception {
        Survey model = new Survey(new XMLSurveyReader(new File("src\\test\\org\\jsurveylib\\model\\script\\onanswerchangedfiles\\defaults.xml")));
        Question modifyee = model.getQuestionByID("modifyee");
        assertTrue(modifyee.isVisible());
        assertTrue(modifyee.isEnabled());
        assertTrue(modifyee.isValid());
        assertEquals("1", model.getAnswer("scriptsRun"));
View Full Code Here

        assertEquals("1", model.getAnswer("scriptsRun"));
    }

    @Test
    public void loadXMLAnswers() throws Exception {
        Survey model = new Survey(new XMLSurveyReader(new File("src\\test\\org\\jsurveylib\\model\\script\\onanswerchangedfiles\\loadxmlanswers.xml")));
        model.loadXMLAnswers("src\\test\\org\\jsurveylib\\model\\script\\onanswerchangedfiles\\loadxmlanswersresult.xml");
        Question modifyee = model.getQuestionByID("modifyee");
        assertFalse(modifyee.isVisible());
        assertFalse(modifyee.isEnabled());
        assertFalse(modifyee.isValid());
View Full Code Here

*/
public class GoToPageTest {

    @Test
    public void goToPage() throws Exception {
        Survey survey = new Survey(new XMLSurveyReader(new File("src\\test\\org\\jsurveylib\\model\\script\\gotopagefiles\\gotopage.xml")));
        goToPageTest(survey);
    }
View Full Code Here

        goToPageTest(survey);
    }

    @Test
    public void goToPageReset() throws Exception {
        Survey survey = new Survey(new XMLSurveyReader(new File("src\\test\\org\\jsurveylib\\model\\script\\gotopagefiles\\gotopage.xml")));
        goToPageTest(survey);
        survey.reset();
        goToPageTest(survey);
    }
View Full Code Here

    private boolean enableStateChanged = false;

    @Test
    public void standard() throws Exception {
        Survey model = new Survey(new XMLSurveyReader(new File("src\\test\\org\\jsurveylib\\model\\script\\enablehandlerfiles\\standard.xml")));
        model.getQuestionByID("X").addEnableListener(this);


        assertFalse(enableStateChanged);
        model.getQuestionByID("Y").setAnswer("yes");
View Full Code Here

        assertTrue(model.getQuestionByID("X").isEnabled());
    }

    @Test
    public void startDisabled() throws Exception {
        Survey model = new Survey(new XMLSurveyReader(new File("src\\test\\org\\jsurveylib\\model\\script\\enablehandlerfiles\\startdisabled.xml")));
        assertFalse(model.getQuestionByID("X").isEnabled());
    }
View Full Code Here

        assertFalse(model.getQuestionByID("X").isEnabled());
    }

    @Test
    public void twoDependencies() throws Exception {
        Survey model = new Survey(new XMLSurveyReader(new File("src\\test\\org\\jsurveylib\\model\\script\\enablehandlerfiles\\twodependencies.xml")));
        model.getQuestionByID("Y").addEnableListener(this);

        assertFalse(model.getQuestionByID("Y").isEnabled());
        assertFalse(enableStateChanged);
        model.getQuestionByID("X").setAnswer("yes");
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.