Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/*
* Licensed 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
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* 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 io.trino.plugin.jdbc;

import io.trino.testing.BaseConnectorTest;

public abstract class BaseJdbcConnectorTest
extends BaseConnectorTest
{
// TODO move common tests from connector-specific classes here
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
package io.trino.plugin.jdbc;

import com.google.common.collect.ImmutableMap;
import io.trino.testing.BaseConnectorTest;
import io.trino.testing.QueryRunner;
import io.trino.testing.sql.JdbcSqlExecutor;
import io.trino.testing.sql.TestTable;
Expand All @@ -27,7 +26,7 @@
import static io.trino.plugin.jdbc.H2QueryRunner.createH2QueryRunner;

public class TestJdbcConnectorTest
extends BaseConnectorTest
extends BaseJdbcConnectorTest
{
private Map<String, String> properties;

Expand Down
7 changes: 7 additions & 0 deletions plugin/trino-clickhouse/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,13 @@
</dependency>

<!-- for testing -->
<dependency>
<groupId>io.trino</groupId>
<artifactId>trino-base-jdbc</artifactId>
<type>test-jar</type>
<scope>test</scope>
</dependency>

<dependency>
<groupId>io.trino</groupId>
<artifactId>trino-main</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,10 @@
package io.trino.plugin.clickhouse;

import com.google.common.collect.ImmutableMap;
import io.trino.testing.BaseConnectorTest;
import io.trino.plugin.jdbc.BaseJdbcConnectorTest;
import io.trino.testing.MaterializedResult;
import io.trino.testing.QueryRunner;
import io.trino.testing.sql.TestTable;
import io.trino.tpch.TpchTable;
import org.testng.SkipException;
import org.testng.annotations.Test;

Expand All @@ -31,7 +30,7 @@
import static org.assertj.core.api.Assertions.assertThat;

public class TestClickHouseConnectorTest
extends BaseConnectorTest
extends BaseJdbcConnectorTest
{
private TestingClickHouseServer clickhouseServer;

Expand All @@ -40,10 +39,14 @@ protected QueryRunner createQueryRunner()
throws Exception
{
this.clickhouseServer = closeAfterClass(new TestingClickHouseServer());
return createClickHouseQueryRunner(clickhouseServer, ImmutableMap.of(), ImmutableMap.<String, String>builder()
.put("clickhouse.map-string-as-varchar", "true")
.put("allow-drop-table", "true")
.build(), TpchTable.getTables());
return createClickHouseQueryRunner(
clickhouseServer,
ImmutableMap.of(),
ImmutableMap.<String, String>builder()
.put("clickhouse.map-string-as-varchar", "true")
.put("allow-drop-table", "true")
.build(),
REQUIRED_TPCH_TABLES);
}

@Override
Expand Down
7 changes: 7 additions & 0 deletions plugin/trino-memsql/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,13 @@
</dependency>

<!-- for testing -->
<dependency>
<groupId>io.trino</groupId>
<artifactId>trino-base-jdbc</artifactId>
<type>test-jar</type>
<scope>test</scope>
</dependency>

<dependency>
<groupId>io.trino</groupId>
<artifactId>trino-main</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,13 @@
package io.trino.plugin.memsql;

import com.google.common.collect.ImmutableMap;
import io.trino.plugin.jdbc.BaseJdbcConnectorTest;
import io.trino.sql.planner.plan.AggregationNode;
import io.trino.sql.planner.plan.FilterNode;
import io.trino.testing.BaseConnectorTest;
import io.trino.testing.MaterializedResult;
import io.trino.testing.MaterializedRow;
import io.trino.testing.QueryRunner;
import io.trino.testing.sql.TestTable;
import io.trino.tpch.TpchTable;
import org.intellij.lang.annotations.Language;
import org.testng.SkipException;
import org.testng.annotations.AfterClass;
Expand All @@ -43,7 +42,7 @@
import static org.testng.Assert.assertTrue;

public class TestMemSqlConnectorTest
extends BaseConnectorTest
extends BaseJdbcConnectorTest
{
protected TestingMemSqlServer memSqlServer;

Expand All @@ -52,7 +51,7 @@ protected QueryRunner createQueryRunner()
throws Exception
{
memSqlServer = new TestingMemSqlServer();
return createMemSqlQueryRunner(memSqlServer, ImmutableMap.of(), TpchTable.getTables());
return createMemSqlQueryRunner(memSqlServer, ImmutableMap.of(), REQUIRED_TPCH_TABLES);
}

@AfterClass(alwaysRun = true)
Expand Down
7 changes: 7 additions & 0 deletions plugin/trino-mysql/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,13 @@
</dependency>

<!-- for testing -->
<dependency>
<groupId>io.trino</groupId>
<artifactId>trino-base-jdbc</artifactId>
<type>test-jar</type>
<scope>test</scope>
</dependency>

<dependency>
<groupId>io.trino</groupId>
<artifactId>trino-main</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@

import com.google.common.collect.ImmutableList;
import io.trino.Session;
import io.trino.plugin.jdbc.BaseJdbcConnectorTest;
import io.trino.sql.planner.plan.AggregationNode;
import io.trino.sql.planner.plan.ExchangeNode;
import io.trino.sql.planner.plan.FilterNode;
import io.trino.sql.planner.plan.MarkDistinctNode;
import io.trino.sql.planner.plan.ProjectNode;
import io.trino.testing.BaseConnectorTest;
import io.trino.testing.MaterializedResult;
import io.trino.testing.MaterializedRow;
import io.trino.testing.sql.SqlExecutor;
Expand All @@ -43,7 +43,7 @@
import static org.testng.Assert.assertTrue;

public abstract class BaseMySqlConnectorTest
extends BaseConnectorTest
extends BaseJdbcConnectorTest
{
@Override
protected boolean supportsDelete()
Expand Down
7 changes: 7 additions & 0 deletions plugin/trino-oracle/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,13 @@
</dependency>

<!-- for testing -->
<dependency>
<groupId>io.trino</groupId>
<artifactId>trino-base-jdbc</artifactId>
<type>test-jar</type>
<scope>test</scope>
</dependency>

<dependency>
<groupId>io.trino</groupId>
<artifactId>trino-main</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@
import com.google.common.collect.ImmutableList;
import io.trino.Session;
import io.trino.execution.QueryInfo;
import io.trino.plugin.jdbc.BaseJdbcConnectorTest;
import io.trino.sql.planner.plan.AggregationNode;
import io.trino.sql.planner.plan.FilterNode;
import io.trino.sql.planner.plan.ProjectNode;
import io.trino.testing.BaseConnectorTest;
import io.trino.testing.MaterializedResult;
import io.trino.testing.ResultWithQueryId;
import io.trino.testing.sql.SqlExecutor;
Expand All @@ -39,7 +39,7 @@
import static org.testng.Assert.assertTrue;

public abstract class BaseOracleConnectorTest
extends BaseConnectorTest
extends BaseJdbcConnectorTest
{
@Override
protected boolean supportsDelete()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
import io.airlift.testing.Closeables;
import io.trino.testing.QueryRunner;
import io.trino.testing.sql.SqlExecutor;
import io.trino.tpch.TpchTable;
import org.testng.annotations.AfterClass;
import org.testng.annotations.Test;

Expand Down Expand Up @@ -53,7 +52,7 @@ protected QueryRunner createQueryRunner()
.put("oracle.connection-pool.enabled", "false")
.put("oracle.remarks-reporting.enabled", "false")
.build(),
TpchTable.getTables());
REQUIRED_TPCH_TABLES);
}

@AfterClass(alwaysRun = true)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
import io.airlift.testing.Closeables;
import io.trino.testing.QueryRunner;
import io.trino.testing.sql.SqlExecutor;
import io.trino.tpch.TpchTable;
import org.testng.annotations.AfterClass;
import org.testng.annotations.Test;

Expand Down Expand Up @@ -49,7 +48,7 @@ protected QueryRunner createQueryRunner()
.put("oracle.connection-pool.enabled", "true")
.put("oracle.remarks-reporting.enabled", "false")
.build(),
TpchTable.getTables());
REQUIRED_TPCH_TABLES);
}

@AfterClass(alwaysRun = true)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
import io.airlift.testing.Closeables;
import io.trino.testing.QueryRunner;
import io.trino.testing.sql.SqlExecutor;
import io.trino.tpch.TpchTable;
import org.testng.annotations.AfterClass;

import java.io.IOException;
Expand Down Expand Up @@ -46,7 +45,7 @@ protected QueryRunner createQueryRunner()
.put("oracle.connection-pool.enabled", "true")
.put("oracle.remarks-reporting.enabled", "true")
.build(),
TpchTable.getTables());
REQUIRED_TPCH_TABLES);
}

@AfterClass(alwaysRun = true)
Expand Down
7 changes: 7 additions & 0 deletions plugin/trino-postgresql/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,13 @@
</dependency>

<!-- for testing -->
<dependency>
<groupId>io.trino</groupId>
<artifactId>trino-base-jdbc</artifactId>
<type>test-jar</type>
<scope>test</scope>
</dependency>

<dependency>
<groupId>io.trino</groupId>
<artifactId>trino-jmx</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@

import com.google.common.collect.ImmutableList;
import io.trino.Session;
import io.trino.plugin.jdbc.BaseJdbcConnectorTest;
import io.trino.sql.planner.plan.AggregationNode;
import io.trino.sql.planner.plan.ExchangeNode;
import io.trino.sql.planner.plan.FilterNode;
import io.trino.sql.planner.plan.MarkDistinctNode;
import io.trino.sql.planner.plan.ProjectNode;
import io.trino.testing.BaseConnectorTest;
import io.trino.testing.QueryRunner;
import io.trino.testing.sql.JdbcSqlExecutor;
import io.trino.testing.sql.TestTable;
Expand Down Expand Up @@ -48,7 +48,7 @@
import static org.testng.Assert.assertTrue;

public class TestPostgreSqlConnectorTest
extends BaseConnectorTest
extends BaseJdbcConnectorTest
{
protected TestingPostgreSqlServer postgreSqlServer;

Expand Down
7 changes: 7 additions & 0 deletions plugin/trino-sqlserver/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,13 @@
</dependency>

<!-- for testing -->
<dependency>
<groupId>io.trino</groupId>
<artifactId>trino-base-jdbc</artifactId>
<type>test-jar</type>
<scope>test</scope>
</dependency>

<dependency>
<groupId>io.trino</groupId>
<artifactId>trino-main</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,14 @@

import com.google.common.collect.ImmutableMap;
import io.trino.Session;
import io.trino.plugin.jdbc.BaseJdbcConnectorTest;
import io.trino.sql.planner.plan.AggregationNode;
import io.trino.sql.planner.plan.ExchangeNode;
import io.trino.sql.planner.plan.FilterNode;
import io.trino.sql.planner.plan.MarkDistinctNode;
import io.trino.sql.planner.plan.ProjectNode;
import io.trino.testing.BaseConnectorTest;
import io.trino.testing.QueryRunner;
import io.trino.testing.sql.TestTable;
import io.trino.tpch.TpchTable;
import org.testng.annotations.DataProvider;
import org.testng.annotations.Test;

Expand All @@ -43,7 +42,7 @@
import static org.testng.Assert.assertTrue;

public class TestSqlServerConnectorTest
extends BaseConnectorTest
extends BaseJdbcConnectorTest
{
protected TestingSqlServer sqlServer;

Expand All @@ -53,7 +52,7 @@ protected QueryRunner createQueryRunner()
{
sqlServer = closeAfterClass(new TestingSqlServer());
sqlServer.start();
return createSqlServerQueryRunner(sqlServer, ImmutableMap.of(), ImmutableMap.of(), TpchTable.getTables());
return createSqlServerQueryRunner(sqlServer, ImmutableMap.of(), ImmutableMap.of(), REQUIRED_TPCH_TABLES);
}

@Override
Expand Down