Examples of DriverScript


Examples of com.asakusafw.windgate.core.DriverScript

     * Inconsistent JDBC support.
     */
    @Test(expected = IllegalStateException.class)
    public void invalid_support_class() {
        Mock mock = new Mock(String.class, "testing", InvalidSupport.class, "TESTING", "VALUE");
        DriverScript script = mock.getDriverScript();
        assertThat(script.getResourceName(), is(Constants.JDBC_RESOURCE_NAME));
        script.getConfiguration();
    }
View Full Code Here

Examples of com.asakusafw.windgate.core.DriverScript

     * simple case.
     */
    @Test
    public void simple() {
        Mock desc = new Mock("example", StringSupport.class);
        DriverScript script = desc.getDriverScript();
        assertThat(script.getResourceName(), is(Constants.LOCAL_FILE_RESOURCE_NAME));
        assertThat(script.getConfiguration().get(FileProcess.FILE.key()), is("example"));
        assertThat(script.getConfiguration().get(StreamProcess.STREAM_SUPPORT.key()), is(StringSupport.class.getName()));
    }
View Full Code Here

Examples of com.asakusafw.windgate.core.DriverScript

     * Simple case.
     */
    @Test
    public void simple() {
        Mock mock = new Mock(String.class, "testing", StringSupport.class, "TESTING", null, "VALUE");
        DriverScript script = mock.getDriverScript();
        assertThat(script.getResourceName(), is(Constants.JDBC_RESOURCE_NAME));
        Map<String, String> conf = script.getConfiguration();
        assertThat(conf.size(), is(3));
        assertThat(conf.get(JdbcProcess.TABLE.key()), is("TESTING"));
        assertThat(conf.get(JdbcProcess.COLUMNS.key()), equalToIgnoringWhiteSpace("VALUE"));
        assertThat(conf.get(JdbcProcess.JDBC_SUPPORT.key()), is(StringSupport.class.getName()));
        assertThat(conf.get(JdbcProcess.CONDITION.key()), is(nullValue()));
View Full Code Here

Examples of com.asakusafw.windgate.core.DriverScript

     */
    @Test
    public void multiple_columns() {
        Mock mock = new Mock(String.class, "testing", StringSupport.class, "TESTING", null,
                "A", "B", "C");
        DriverScript script = mock.getDriverScript();
        assertThat(script.getResourceName(), is(Constants.JDBC_RESOURCE_NAME));
        Map<String, String> conf = script.getConfiguration();
        assertThat(conf.size(), is(3));
        assertThat(conf.get(JdbcProcess.TABLE.key()), is("TESTING"));
        assertThat(conf.get(JdbcProcess.COLUMNS.key()), equalToIgnoringWhiteSpace("A, B, C"));
        assertThat(conf.get(JdbcProcess.JDBC_SUPPORT.key()), is(StringSupport.class.getName()));
        assertThat(conf.get(JdbcProcess.CONDITION.key()), is(nullValue()));
View Full Code Here

Examples of com.asakusafw.windgate.core.DriverScript

     * With condition.
     */
    @Test
    public void condition() {
        Mock mock = new Mock(String.class, "testing", StringSupport.class, "TESTING", "VALUE > 0", "VALUE");
        DriverScript script = mock.getDriverScript();
        assertThat(script.getResourceName(), is(Constants.JDBC_RESOURCE_NAME));
        Map<String, String> conf = script.getConfiguration();
        assertThat(conf.size(), is(4));
        assertThat(conf.get(JdbcProcess.TABLE.key()), is("TESTING"));
        assertThat(conf.get(JdbcProcess.COLUMNS.key()), equalToIgnoringWhiteSpace("VALUE"));
        assertThat(conf.get(JdbcProcess.JDBC_SUPPORT.key()), is(StringSupport.class.getName()));
        assertThat(conf.get(JdbcProcess.CONDITION.key()), equalToIgnoringWhiteSpace("VALUE > 0"));
View Full Code Here

Examples of com.asakusafw.windgate.core.DriverScript

     * Table not specified.
     */
    @Test(expected = IllegalStateException.class)
    public void no_tables() {
        Mock mock = new Mock(String.class, "testing", StringSupport.class, null, null, "VALUE");
        DriverScript script = mock.getDriverScript();
        assertThat(script.getResourceName(), is(Constants.JDBC_RESOURCE_NAME));
        script.getConfiguration();
    }
View Full Code Here

Examples of com.asakusafw.windgate.core.DriverScript

     * Table is empty.
     */
    @Test(expected = IllegalStateException.class)
    public void empty_table() {
        Mock mock = new Mock(String.class, "testing", StringSupport.class, "", null, "VALUE");
        DriverScript script = mock.getDriverScript();
        assertThat(script.getResourceName(), is(Constants.JDBC_RESOURCE_NAME));
        script.getConfiguration();
    }
View Full Code Here

Examples of com.asakusafw.windgate.core.DriverScript

     * Columns not specified.
     */
    @Test(expected = IllegalStateException.class)
    public void no_columns() {
        Mock mock = new Mock(String.class, "testing", StringSupport.class, "TESTING", null, (String[]) null);
        DriverScript script = mock.getDriverScript();
        assertThat(script.getResourceName(), is(Constants.JDBC_RESOURCE_NAME));
        script.getConfiguration();
    }
View Full Code Here

Examples of com.asakusafw.windgate.core.DriverScript

     * Columns are empty.
     */
    @Test(expected = IllegalStateException.class)
    public void empty_columns() {
        Mock mock = new Mock(String.class, "testing", StringSupport.class, "TESTING", null);
        DriverScript script = mock.getDriverScript();
        assertThat(script.getResourceName(), is(Constants.JDBC_RESOURCE_NAME));
        script.getConfiguration();
    }
View Full Code Here

Examples of com.asakusafw.windgate.core.DriverScript

     * Contains empty column.
     */
    @Test(expected = IllegalStateException.class)
    public void has_empty_column() {
        Mock mock = new Mock(String.class, "testing", StringSupport.class, "TESTING", null, "");
        DriverScript script = mock.getDriverScript();
        assertThat(script.getResourceName(), is(Constants.JDBC_RESOURCE_NAME));
        script.getConfiguration();
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.