Package org.jsurveylib.io

Examples of org.jsurveylib.io.XMLSurveyReader


     */
    private boolean dirty = true;


    public Survey(String xmlConfigFile) throws Exception {
        this(new XMLSurveyReader(new InputStreamReader(new FileInputStream(xmlConfigFile), "UTF-8")));
    }
View Full Code Here


    public Survey(String xmlConfigFile) throws Exception {
        this(new XMLSurveyReader(new InputStreamReader(new FileInputStream(xmlConfigFile), "UTF-8")));
    }

    public Survey(Reader xmlConfigReader) throws Exception {
        this(new XMLSurveyReader(xmlConfigReader));
    }
View Full Code Here

        assertTrue(true);       //apparently this is ok behavior.  Is that what we want?
    }

    @Test(expected = SAXException.class)
    public void invalidUsingXSD() throws Exception {
        new Survey(new XMLSurveyReader(new File("src\\test\\org\\jsurveylib\\surveyfiles\\invalidUsingXSD.xml")));
    }
View Full Code Here

        new Survey(new XMLSurveyReader(new File("src\\test\\org\\jsurveylib\\surveyfiles\\invalidUsingXSD.xml")));
    }

    @Test
    public void invalidNoXSD() throws Exception {
        new Survey(new XMLSurveyReader(new File("src\\test\\org\\jsurveylib\\surveyfiles\\invalidNoXSD.xml")));
        assertTrue(true);
    }
View Full Code Here

        assertTrue(true);
    }

    @Test
    public void validWithXSD() throws Exception {
        new Survey(new XMLSurveyReader(new File("src\\test\\org\\jsurveylib\\surveyfiles\\valid.xml")));
        assertTrue(true);
    }
View Full Code Here

        assertTrue(true);
    }

    @Test
    public void page() throws Exception {
        Survey survey = new Survey(new XMLSurveyReader(new File("src\\test\\org\\jsurveylib\\surveyfiles\\page.xml")));
        int pageCount = 0;
        for (Page page : survey.getPages()) {

            assertEquals(page, survey.getPages().get(pageCount));
            pageCount++;
View Full Code Here

        assertEquals("EXTRA", survey.getPages().get(2).getLabel());
    }

    @Test
    public void title() throws Exception {
        Survey survey = new Survey(new XMLSurveyReader(new File("src\\test\\org\\jsurveylib\\surveyfiles\\title.xml")));
        assertEquals("My Title", survey.getTitle());
        survey.setTitle("My New Title");
        assertEquals("My New Title", survey.getTitle());
    }
View Full Code Here

        assertEquals("My New Title", survey.getTitle());
    }

    @Test
    public void questionById() throws Exception {
        Survey survey = new Survey(new XMLSurveyReader(new File("src\\test\\org\\jsurveylib\\surveyfiles\\questionbyid.xml")));
        Question q = survey.getQuestionByID("X");
        assertEquals("X", q.getId());
        assertEquals("X:", q.getLabel().getText());

        q = survey.getQuestionByID("Y");
View Full Code Here

        assertNull(survey.getQuestionByID("Z"));
    }

    @Test
    public void onePageMovement() throws Exception {
        Survey survey = new Survey(new XMLSurveyReader(new File("src\\test\\org\\jsurveylib\\surveyfiles\\onepagemovement.xml")));
        survey.addPageListener(this);
        assertFalse(survey.isNextPageAvailable());
        assertFalse(survey.isPreviousPageAvailable());
        assertFalse(survey.isLastPageAndComplete());
View Full Code Here

        assertTrue(survey.isLastPageAndComplete());
    }

    @Test
    public void multiPageMovement() throws Exception {
        survey = new Survey(new XMLSurveyReader(new File("src\\test\\org\\jsurveylib\\surveyfiles\\multipagemovement.xml")));
        survey.addPageListener(this);
        assertFalse(survey.isNextPageAvailable());
        assertFalse(survey.isPreviousPageAvailable());
        assertFalse(survey.isLastPageAndComplete());
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.