Skip to content

Commit

Permalink
Rename Kudu test and override missing test method
Browse files Browse the repository at this point in the history
Static inner test classes that did not follow the BaseConnectorTest
naming convention were not being run. Rename tests to follow the naming
convention and then fix the test error that was previously hidden
  • Loading branch information
grantatspothero authored and ebyhr committed Mar 2, 2022
1 parent f844b11 commit 04d9fbe
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

import java.util.Optional;

import static io.trino.testing.sql.TestTable.randomTableSuffix;
import static org.testng.Assert.assertEquals;

public abstract class AbstractKuduWithStandardInferSchemaConnectorTest
Expand All @@ -33,4 +34,22 @@ public void testListingOfTableForDefaultSchema()
{
assertEquals(computeActual("SHOW TABLES FROM default").getRowCount(), 0);
}

@Test
@Override
public void testDropNonEmptySchema()
{
// Set column and table properties in CREATE TABLE statement
String schemaName = "test_drop_non_empty_schema_" + randomTableSuffix();

try {
assertUpdate("CREATE SCHEMA " + schemaName);
assertUpdate("CREATE TABLE " + schemaName + ".t(x int WITH (primary_key=true)) WITH (partition_by_hash_columns=ARRAY['x'], partition_by_hash_buckets=2)");
assertQueryFails("DROP SCHEMA " + schemaName, ".*Cannot drop non-empty schema '\\Q" + schemaName + "\\E'");
}
finally {
assertUpdate("DROP TABLE IF EXISTS " + schemaName + ".t");
assertUpdate("DROP SCHEMA IF EXISTS " + schemaName);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
*/
package io.trino.plugin.kudu;

public class KuduSmokeTests
public class KuduConnectorTests
{
private static final String KUDU_VERSION = "1.13.0";

Expand All @@ -37,7 +37,7 @@ protected String getKuduServerVersion()
}
}

public static class TestKuduSmokeTestWithStandardInferSchema
public static class TestKuduWithStandardInferSchemaConnectorTest
extends AbstractKuduWithStandardInferSchemaConnectorTest
{
@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ protected String getKuduServerVersion()
}
}

public static class TestKuduSmokeTestWithStandardInferSchema
public static class TestKuduWithStandardInferSchemaConnectorTest
extends AbstractKuduWithStandardInferSchemaConnectorTest
{
@Override
Expand Down

0 comments on commit 04d9fbe

Please sign in to comment.