Package org.jsurveylib

Examples of org.jsurveylib.Survey


        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());
        assertEquals("", chooser.getAnswer());
        assertFalse(stateChanged);
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());
        assertEquals("txt", chooser.getFileFilters().get(0).getExtension());
        assertEquals("gif", chooser.getFileFilters().get(1).getExtension());
View Full Code Here

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

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

        assertEquals(2, chooser.getFileFilters().size());
        assertEquals("txt,doc", chooser.getFileFilters().get(0).getExtension());
        assertEquals("gif,jpg,png", chooser.getFileFilters().get(1).getExtension());
        assertTrue(chooser.isAllFilesFilterEnabled());
View Full Code Here

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

    @Test
    public void defaultValue() throws Exception {
        Survey m = new Survey(new XMLSurveyReader(new File("src\\test\\org\\jsurveylib\\model\\question\\typefilechooserfiles\\defaultvalue.xml")));
        assertEquals("C:\\UDRPGenerator\\blind-xpath-injection.pdf", m.getQuestionByID("chooser").getAnswer());
    }
View Full Code Here

        assertEquals("C:\\UDRPGenerator\\blind-xpath-injection.pdf", m.getQuestionByID("chooser").getAnswer());
    }

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

        assertFalse(stateChanged);
    }

    @Test
    public void openTo() throws Exception {
        Survey m = new Survey(new XMLSurveyReader(new File("src\\test\\org\\jsurveylib\\model\\question\\typefilechooserfiles\\opento.xml")));
        FileChooserQuestion chooser = (FileChooserQuestion) m.getQuestionByID("cb");
        assertEquals("C:\\jsurveylib-0.6", chooser.getOpenTo());
    }
View Full Code Here

        assertEquals("C:\\jsurveylib-0.6", chooser.getOpenTo());
    }

    @Test
    public void openToTemplate() throws Exception {
        Survey m = new Survey(new XMLSurveyReader(new File("src\\test\\org\\jsurveylib\\model\\question\\typefilechooserfiles\\opentotemplate.xml")));
        FileChooserQuestion chooser = (FileChooserQuestion) m.getQuestionByID("cb");
        assertEquals("C:\\jsurveylib-0.6", chooser.getOpenTo());
    }
View Full Code Here

    private int stateChangeCount = 0;

    @Test
    public void listener() throws Exception {
        Survey m = new Survey(new XMLSurveyReader(new File("src\\test\\org\\jsurveylib\\model\\question\\questionfiles\\listener.xml")));
        Question q1 = m.getCurrentPage().getQuestions().get(0);
        q1.addAnswerListener(this);
        assertEquals(0, stateChangeCount);
        q1.setAnswer("yes");
        assertEquals(1, stateChangeCount);
    }
View Full Code Here

TOP

Related Classes of org.jsurveylib.Survey

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.