From 4bbcb7403fc650e3b14673eee408b0fc23f7fbe4 Mon Sep 17 00:00:00 2001 From: Ashhar Hasan Date: Fri, 9 Jul 2021 20:02:05 +0530 Subject: [PATCH] Migrate to skipTestUnless --- .../trino/plugin/jdbc/BaseJdbcConnectorTest.java | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/plugin/trino-base-jdbc/src/test/java/io/trino/plugin/jdbc/BaseJdbcConnectorTest.java b/plugin/trino-base-jdbc/src/test/java/io/trino/plugin/jdbc/BaseJdbcConnectorTest.java index 5939fc3f15ac..1ffc0fa9b4a2 100644 --- a/plugin/trino-base-jdbc/src/test/java/io/trino/plugin/jdbc/BaseJdbcConnectorTest.java +++ b/plugin/trino-base-jdbc/src/test/java/io/trino/plugin/jdbc/BaseJdbcConnectorTest.java @@ -78,6 +78,7 @@ import static io.trino.testing.TestingConnectorBehavior.SUPPORTS_LIMIT_PUSHDOWN; import static io.trino.testing.TestingConnectorBehavior.SUPPORTS_PREDICATE_PUSHDOWN_WITH_VARCHAR_EQUALITY; import static io.trino.testing.TestingConnectorBehavior.SUPPORTS_PREDICATE_PUSHDOWN_WITH_VARCHAR_INEQUALITY; +import static io.trino.testing.TestingConnectorBehavior.SUPPORTS_ROW_LEVEL_DELETE; import static io.trino.testing.TestingConnectorBehavior.SUPPORTS_TOPN_PUSHDOWN; import static io.trino.testing.TestingConnectorBehavior.SUPPORTS_TOPN_PUSHDOWN_WITH_VARCHAR; import static io.trino.testing.assertions.Assert.assertEventually; @@ -1169,7 +1170,7 @@ protected TestView createSleepingView(Duration minimalSleepDuration) @Test public void testDeleteWithBigintEqualityPredicate() { - skipTestUnlessSupportsDeletes(); + skipTestUnless(hasBehavior(SUPPORTS_CREATE_TABLE) && hasBehavior(SUPPORTS_ROW_LEVEL_DELETE)); String tableName = "test_delete_" + randomTableSuffix(); assertUpdate("CREATE TABLE " + tableName + " AS SELECT * FROM region", 5); assertUpdate("DELETE FROM " + tableName + " WHERE regionkey = 1", 1); @@ -1186,7 +1187,7 @@ public void testDeleteWithBigintEqualityPredicate() @Test public void testDeleteWithVarcharEqualityPredicate() { - skipTestUnlessSupportsDeletes(); + skipTestUnless(hasBehavior(SUPPORTS_CREATE_TABLE) && hasBehavior(SUPPORTS_ROW_LEVEL_DELETE)); try (TestTable table = new TestTable(getQueryRunner()::execute, "test_delete", "(col varchar(1))", ImmutableList.of("'a'", "'A'", "null"))) { if (!hasBehavior(SUPPORTS_PREDICATE_PUSHDOWN_WITH_VARCHAR_EQUALITY)) { assertQueryFails("DELETE FROM " + table.getName() + " WHERE col = 'A'", "Unsupported delete"); @@ -1201,7 +1202,7 @@ public void testDeleteWithVarcharEqualityPredicate() @Test public void testDeleteWithVarcharInequalityPredicate() { - skipTestUnlessSupportsDeletes(); + skipTestUnless(hasBehavior(SUPPORTS_CREATE_TABLE) && hasBehavior(SUPPORTS_ROW_LEVEL_DELETE)); try (TestTable table = new TestTable(getQueryRunner()::execute, "test_delete", "(col varchar(1))", ImmutableList.of("'a'", "'A'", "null"))) { if (!hasBehavior(SUPPORTS_PREDICATE_PUSHDOWN_WITH_VARCHAR_INEQUALITY)) { assertQueryFails("DELETE FROM " + table.getName() + " WHERE col != 'A'", "Unsupported delete"); @@ -1216,7 +1217,7 @@ public void testDeleteWithVarcharInequalityPredicate() @Test public void testDeleteWithVarcharGreaterAndLowerPredicate() { - skipTestUnlessSupportsDeletes(); + skipTestUnless(hasBehavior(SUPPORTS_CREATE_TABLE) && hasBehavior(SUPPORTS_ROW_LEVEL_DELETE)); try (TestTable table = new TestTable(getQueryRunner()::execute, "test_delete", "(col varchar(1))", ImmutableList.of("'0'", "'a'", "'A'", "'b'", "null"))) { if (!hasBehavior(SUPPORTS_PREDICATE_PUSHDOWN_WITH_VARCHAR_INEQUALITY)) { assertQueryFails("DELETE FROM " + table.getName() + " WHERE col < 'A'", "Unsupported delete"); @@ -1234,7 +1235,7 @@ public void testDeleteWithVarcharGreaterAndLowerPredicate() @Override public void testDeleteWithComplexPredicate() { - skipTestUnlessSupportsDeletes(); + skipTestUnless(hasBehavior(SUPPORTS_CREATE_TABLE) && hasBehavior(SUPPORTS_ROW_LEVEL_DELETE)); assertThatThrownBy(super::testDeleteWithComplexPredicate) .hasStackTraceContaining("TrinoException: Unsupported delete"); } @@ -1242,7 +1243,7 @@ public void testDeleteWithComplexPredicate() @Override public void testDeleteWithSubquery() { - skipTestUnlessSupportsDeletes(); + skipTestUnless(hasBehavior(SUPPORTS_CREATE_TABLE) && hasBehavior(SUPPORTS_ROW_LEVEL_DELETE)); assertThatThrownBy(super::testDeleteWithSubquery) .hasStackTraceContaining("TrinoException: Unsupported delete"); } @@ -1250,7 +1251,7 @@ public void testDeleteWithSubquery() @Override public void testDeleteWithSemiJoin() { - skipTestUnlessSupportsDeletes(); + skipTestUnless(hasBehavior(SUPPORTS_CREATE_TABLE) && hasBehavior(SUPPORTS_ROW_LEVEL_DELETE)); assertThatThrownBy(super::testDeleteWithSemiJoin) .hasStackTraceContaining("TrinoException: Unsupported delete"); }