package ch.vorburger.mariadb4j.mariadb4jmavenplugintest.basic;

import org.junit.Test;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.Statement;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;

@SuppressWarnings({"SqlDialectInspection", "SqlNoDataSourceInspection"})
public class BasicUsageIT {

    @Test(timeout = 5000)
    public void openDatabase() throws Exception {
        int port = Integer.parseInt(System.getProperty("mariadb4j.port"));
        assertTrue("expect positive port value: " + port, port > 0);
        String jdbcUrl = "jdbc:mysql://localhost:" + port + "/foo";
        try (Connection conn = DriverManager.getConnection(jdbcUrl)) {
            try (Statement stmt = conn.createStatement();
                ResultSet rs = stmt.executeQuery("SHOW TABLES LIKE 'bar'")) {
                List<String> tables = new ArrayList<>();
                while (rs.next()) {
                    tables.add(rs.getString(1));
                }
                assertEquals("table names", Collections.singletonList("bar"), tables);
            }
        }
    }
}
@@ -1,8 +1,659 @@
+/*%0A * #%25L%0A * MariaDB4j%0A * %25%25%0A * Copyright (C) 2012 - 2017 Michael Vorburger%0A * %25%25%0A * Licensed under the Apache License, Version 2.0 (the %22License%22);%0A * you may not use this file except in compliance with the License.%0A * You may obtain a copy of the License at%0A * %0A *      http://www.apache.org/licenses/LICENSE-2.0%0A * %0A * Unless required by applicable law or agreed to in writing, software%0A * distributed under the License is distributed on an %22AS IS%22 BASIS,%0A * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.%0A * See the License for the specific language governing permissions and%0A * limitations under the License.%0A * #L%25%0A */%0A
 package 
@@ -1891,8 +1891,9 @@
 %0A    %7D%0A%7D
+%0A

add missing license header to BasicUsageIT