flink-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fhueske <...@git.apache.org>
Subject [GitHub] flink pull request: Flink 3750 fixed
Date Wed, 11 May 2016 11:54:21 GMT
Github user fhueske commented on a diff in the pull request:

    https://github.com/apache/flink/pull/1941#discussion_r62834121
  
    --- Diff: flink-batch-connectors/flink-jdbc/src/test/java/org/apache/flink/api/java/io/jdbc/JDBCTestBase.java
---
    @@ -0,0 +1,182 @@
    +/**
    + * Licensed to the Apache Software Foundation (ASF) under one
    + * or more contributor license agreements.  See the NOTICE file
    + * distributed with this work for additional information
    + * regarding copyright ownership.  The ASF licenses this file
    + * to you under the Apache License, Version 2.0 (the
    + * "License"); you may not use this file except in compliance
    + * with the License.  You may obtain a copy of the License at
    + * <p/>
    + * http://www.apache.org/licenses/LICENSE-2.0
    + * <p/>
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
    + */
    +package org.apache.flink.api.java.io.jdbc;
    +
    +import java.io.IOException;
    +import java.io.OutputStream;
    +import java.sql.Connection;
    +import java.sql.DriverManager;
    +import java.sql.SQLException;
    +import java.sql.Statement;
    +
    +import org.junit.After;
    +import org.junit.AfterClass;
    +import org.junit.Assert;
    +import org.junit.BeforeClass;
    +
    +/**
    + * Base test class for JDBC Input and Output formats
    + */
    +public class JDBCTestBase {
    +	
    +	public static final String DRIVER_CLASS = "org.apache.derby.jdbc.EmbeddedDriver";
    +	public static final String DB_URL = "jdbc:derby:memory:ebookshop";
    +	public static final String INPUT_TABLE = "books";
    +	public static final String OUTPUT_TABLE = "newbooks";
    +	public static final String SELECT_ALL_BOOKS = "select * from " + INPUT_TABLE;
    +	public static final String SELECT_ALL_NEWBOOKS = "select * from " + OUTPUT_TABLE;
    +	public static final String SELECT_EMPTY = "select * from books WHERE QTY < 0";
    +	public static final String INSERT_TEMPLATE = "insert into %s (id, title, author, price,
qty) values (?,?,?,?,?)";
    +	public static final String SELECT_ALL_BOOKS_SPLIT_BY_ID = JDBCTestBase.SELECT_ALL_BOOKS
+ " WHERE id BETWEEN ? AND ?";
    +	public static final String SELECT_ALL_BOOKS_SPLIT_BY_AUTHOR = JDBCTestBase.SELECT_ALL_BOOKS
+ " WHERE author = ?";
    +	
    +	protected JDBCInputFormat jdbcInputFormat;
    +	protected JDBCOutputFormat jdbcOutputFormat;
    +
    +	protected static Connection conn;
    +
    +	public static final Object[][] testData = {
    --- End diff --
    
    Add one or two records with `null` values to the test data.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message