From 42c54a648ce43261a05baa08deee48c1bd605819 Mon Sep 17 00:00:00 2001 From: David Phillips Date: Tue, 24 Sep 2024 14:57:34 -0700 Subject: [PATCH] Rename product test table result --- .../io/trino/tests/product/TpchTableResults.java | 2 +- .../io/trino/tests/product/cassandra/TestSelect.java | 4 ++-- .../tests/product/hive/TestHiveBucketedTables.java | 6 +++--- .../product/jdbc/TestExternalAuthorizerOAuth2.java | 6 +++--- .../TestExternalAuthorizerOAuth2RefreshToken.java | 12 ++++++------ .../java/io/trino/tests/product/jdbc/TestJdbc.java | 8 ++++---- .../jdbc/TestKerberosConstrainedDelegationJdbc.java | 2 +- .../trino/tests/product/jdbc/TestLdapTrinoJdbc.java | 10 +++++----- .../{presto-nation.result => trino-nation.result} | 0 9 files changed, 25 insertions(+), 25 deletions(-) rename testing/trino-product-tests/src/main/resources/table-results/{presto-nation.result => trino-nation.result} (100%) diff --git a/testing/trino-product-tests/src/main/java/io/trino/tests/product/TpchTableResults.java b/testing/trino-product-tests/src/main/java/io/trino/tests/product/TpchTableResults.java index 3771191e6732..81a6767619dd 100644 --- a/testing/trino-product-tests/src/main/java/io/trino/tests/product/TpchTableResults.java +++ b/testing/trino-product-tests/src/main/java/io/trino/tests/product/TpchTableResults.java @@ -19,7 +19,7 @@ public final class TpchTableResults { - public static final SqlResultDescriptor PRESTO_NATION_RESULT = sqlResultDescriptorForResource("table-results/presto-nation.result"); + public static final SqlResultDescriptor TRINO_NATION_RESULT = sqlResultDescriptorForResource("table-results/trino-nation.result"); private TpchTableResults() { diff --git a/testing/trino-product-tests/src/main/java/io/trino/tests/product/cassandra/TestSelect.java b/testing/trino-product-tests/src/main/java/io/trino/tests/product/cassandra/TestSelect.java index 93c4ccffd0b8..057e920c486a 100644 --- a/testing/trino-product-tests/src/main/java/io/trino/tests/product/cassandra/TestSelect.java +++ b/testing/trino-product-tests/src/main/java/io/trino/tests/product/cassandra/TestSelect.java @@ -35,7 +35,7 @@ import static io.trino.tempto.fulfillment.table.TableRequirements.immutableTable; import static io.trino.tests.product.TestGroups.CASSANDRA; import static io.trino.tests.product.TestGroups.PROFILE_SPECIFIC_TESTS; -import static io.trino.tests.product.TpchTableResults.PRESTO_NATION_RESULT; +import static io.trino.tests.product.TpchTableResults.TRINO_NATION_RESULT; import static io.trino.tests.product.cassandra.CassandraTpchTableDefinitions.CASSANDRA_NATION; import static io.trino.tests.product.cassandra.CassandraTpchTableDefinitions.CASSANDRA_SUPPLIER; import static io.trino.tests.product.cassandra.DataTypesTableDefinition.CASSANDRA_ALL_TYPES; @@ -87,7 +87,7 @@ public void testSelectNation() QueryResult queryResult = onTrino() .executeQuery(sql); - assertThat(queryResult).matches(PRESTO_NATION_RESULT); + assertThat(queryResult).matches(TRINO_NATION_RESULT); } @Test(groups = {CASSANDRA, PROFILE_SPECIFIC_TESTS}) diff --git a/testing/trino-product-tests/src/main/java/io/trino/tests/product/hive/TestHiveBucketedTables.java b/testing/trino-product-tests/src/main/java/io/trino/tests/product/hive/TestHiveBucketedTables.java index 1a7680ae983d..2b530b60f12c 100644 --- a/testing/trino-product-tests/src/main/java/io/trino/tests/product/hive/TestHiveBucketedTables.java +++ b/testing/trino-product-tests/src/main/java/io/trino/tests/product/hive/TestHiveBucketedTables.java @@ -43,7 +43,7 @@ import static io.trino.tempto.query.QueryExecutor.param; import static io.trino.testing.TestingNames.randomNameSuffix; import static io.trino.tests.product.TestGroups.LARGE_QUERY; -import static io.trino.tests.product.TpchTableResults.PRESTO_NATION_RESULT; +import static io.trino.tests.product.TpchTableResults.TRINO_NATION_RESULT; import static io.trino.tests.product.hive.BucketingType.BUCKETED_DEFAULT; import static io.trino.tests.product.hive.BucketingType.BUCKETED_V1; import static io.trino.tests.product.hive.BucketingType.BUCKETED_V2; @@ -112,7 +112,7 @@ public void testSelectStar() String tableName = mutableTableInstanceOf(BUCKETED_NATION).getNameInDatabase(); populateHiveTable(tableName, NATION.getName()); - assertThat(onTrino().executeQuery("SELECT * FROM " + tableName)).matches(PRESTO_NATION_RESULT); + assertThat(onTrino().executeQuery("SELECT * FROM " + tableName)).matches(TRINO_NATION_RESULT); } @Test(groups = LARGE_QUERY) @@ -286,7 +286,7 @@ public void testCreateBucketedTableAsSelect() // nations has 25 rows and NDV=5 for n_regionkey, setting bucket_count=10 will surely create empty buckets onTrino().executeQuery(format("CREATE TABLE %s WITH (bucket_count = 10, bucketed_by = ARRAY['n_regionkey']) AS SELECT * FROM %s", tableName, NATION.getName())); - assertThat(onTrino().executeQuery(format("SELECT * FROM %s", tableName))).matches(PRESTO_NATION_RESULT); + assertThat(onTrino().executeQuery(format("SELECT * FROM %s", tableName))).matches(TRINO_NATION_RESULT); assertThat(onTrino().executeQuery(format("SELECT count(*) FROM %s WHERE n_regionkey=0", tableName))).containsExactlyInOrder(row(5)); } diff --git a/testing/trino-product-tests/src/main/java/io/trino/tests/product/jdbc/TestExternalAuthorizerOAuth2.java b/testing/trino-product-tests/src/main/java/io/trino/tests/product/jdbc/TestExternalAuthorizerOAuth2.java index f44062a12260..9f8df89c30d7 100644 --- a/testing/trino-product-tests/src/main/java/io/trino/tests/product/jdbc/TestExternalAuthorizerOAuth2.java +++ b/testing/trino-product-tests/src/main/java/io/trino/tests/product/jdbc/TestExternalAuthorizerOAuth2.java @@ -97,7 +97,7 @@ public void shouldAuthenticateAndExecuteQuery() try (Connection connection = DriverManager.getConnection(jdbcUrl); PreparedStatement statement = connection.prepareStatement("SELECT * FROM tpch.tiny.nation"); ResultSet results = statement.executeQuery()) { - assertThat(forResultSet(results)).matches(TpchTableResults.PRESTO_NATION_RESULT); + assertThat(forResultSet(results)).matches(TpchTableResults.TRINO_NATION_RESULT); } } @@ -109,13 +109,13 @@ public void shouldAuthenticateAfterTokenExpires() try (Connection connection = DriverManager.getConnection(jdbcUrl); PreparedStatement statement = connection.prepareStatement("SELECT * FROM tpch.tiny.nation"); ResultSet results = statement.executeQuery()) { - assertThat(forResultSet(results)).matches(TpchTableResults.PRESTO_NATION_RESULT); + assertThat(forResultSet(results)).matches(TpchTableResults.TRINO_NATION_RESULT); //Wait until the token expires. See: HydraIdentityProvider.TTL_ACCESS_TOKEN_IN_SECONDS SECONDS.sleep(10); try (PreparedStatement repeatedStatement = connection.prepareStatement("SELECT * FROM tpch.tiny.nation"); ResultSet repeatedResults = repeatedStatement.executeQuery()) { - assertThat(forResultSet(repeatedResults)).matches(TpchTableResults.PRESTO_NATION_RESULT); + assertThat(forResultSet(repeatedResults)).matches(TpchTableResults.TRINO_NATION_RESULT); } } } diff --git a/testing/trino-product-tests/src/main/java/io/trino/tests/product/jdbc/TestExternalAuthorizerOAuth2RefreshToken.java b/testing/trino-product-tests/src/main/java/io/trino/tests/product/jdbc/TestExternalAuthorizerOAuth2RefreshToken.java index ad2fbcff197a..8ddcbbe06634 100644 --- a/testing/trino-product-tests/src/main/java/io/trino/tests/product/jdbc/TestExternalAuthorizerOAuth2RefreshToken.java +++ b/testing/trino-product-tests/src/main/java/io/trino/tests/product/jdbc/TestExternalAuthorizerOAuth2RefreshToken.java @@ -102,7 +102,7 @@ public void shouldRefreshTokenAfterTokenExpire() try (Connection connection = DriverManager.getConnection(jdbcUrl); PreparedStatement statement = connection.prepareStatement("SELECT * FROM tpch.tiny.nation"); ResultSet results = statement.executeQuery()) { - assertThat(forResultSet(results)).matches(TpchTableResults.PRESTO_NATION_RESULT); + assertThat(forResultSet(results)).matches(TpchTableResults.TRINO_NATION_RESULT); assertThat(redirectHandler.getRedirectCount()).isEqualTo(1); @@ -111,7 +111,7 @@ public void shouldRefreshTokenAfterTokenExpire() try (PreparedStatement repeatedStatement = connection.prepareStatement("SELECT * FROM tpch.tiny.nation"); ResultSet repeatedResults = repeatedStatement.executeQuery()) { - assertThat(forResultSet(repeatedResults)).matches(TpchTableResults.PRESTO_NATION_RESULT); + assertThat(forResultSet(repeatedResults)).matches(TpchTableResults.TRINO_NATION_RESULT); } assertThat(redirectHandler.getRedirectCount()).isEqualTo(1); @@ -128,7 +128,7 @@ public void shouldAuthenticateAfterRefreshTokenExpires() try (Connection connection = DriverManager.getConnection(jdbcUrl); PreparedStatement statement = connection.prepareStatement("SELECT * FROM tpch.tiny.nation"); ResultSet results = statement.executeQuery()) { - assertThat(forResultSet(results)).matches(TpchTableResults.PRESTO_NATION_RESULT); + assertThat(forResultSet(results)).matches(TpchTableResults.TRINO_NATION_RESULT); assertThat(redirectHandler.getRedirectCount()).isEqualTo(1); @@ -136,7 +136,7 @@ public void shouldAuthenticateAfterRefreshTokenExpires() SECONDS.sleep(20); try (PreparedStatement repeatedStatement = connection.prepareStatement("SELECT * FROM tpch.tiny.nation"); ResultSet repeatedResults = repeatedStatement.executeQuery()) { - assertThat(forResultSet(repeatedResults)).matches(TpchTableResults.PRESTO_NATION_RESULT); + assertThat(forResultSet(repeatedResults)).matches(TpchTableResults.TRINO_NATION_RESULT); } assertThat(redirectHandler.getRedirectCount()).isEqualTo(2); @@ -153,7 +153,7 @@ public void shouldAuthenticateAfterIssuedTokenExpires() try (Connection connection = DriverManager.getConnection(jdbcUrl); PreparedStatement statement = connection.prepareStatement("SELECT * FROM tpch.tiny.nation"); ResultSet results = statement.executeQuery()) { - assertThat(forResultSet(results)).matches(TpchTableResults.PRESTO_NATION_RESULT); + assertThat(forResultSet(results)).matches(TpchTableResults.TRINO_NATION_RESULT); assertThat(redirectHandler.getRedirectCount()).isEqualTo(1); @@ -162,7 +162,7 @@ public void shouldAuthenticateAfterIssuedTokenExpires() try (PreparedStatement repeatedStatement = connection.prepareStatement("SELECT * FROM tpch.tiny.nation"); ResultSet repeatedResults = repeatedStatement.executeQuery()) { - assertThat(forResultSet(repeatedResults)).matches(TpchTableResults.PRESTO_NATION_RESULT); + assertThat(forResultSet(repeatedResults)).matches(TpchTableResults.TRINO_NATION_RESULT); } assertThat(redirectHandler.getRedirectCount()).isEqualTo(2); diff --git a/testing/trino-product-tests/src/main/java/io/trino/tests/product/jdbc/TestJdbc.java b/testing/trino-product-tests/src/main/java/io/trino/tests/product/jdbc/TestJdbc.java index 6035c5e836c2..44cd5b6158a6 100644 --- a/testing/trino-product-tests/src/main/java/io/trino/tests/product/jdbc/TestJdbc.java +++ b/testing/trino-product-tests/src/main/java/io/trino/tests/product/jdbc/TestJdbc.java @@ -38,7 +38,7 @@ import static io.trino.tempto.fulfillment.table.hive.tpch.TpchTableDefinitions.NATION; import static io.trino.tempto.internal.convention.SqlResultDescriptor.sqlResultDescriptorForResource; import static io.trino.tests.product.TestGroups.JDBC; -import static io.trino.tests.product.TpchTableResults.PRESTO_NATION_RESULT; +import static io.trino.tests.product.TpchTableResults.TRINO_NATION_RESULT; import static io.trino.tests.product.utils.JdbcDriverUtils.getSessionProperty; import static io.trino.tests.product.utils.JdbcDriverUtils.resetSessionProperty; import static io.trino.tests.product.utils.JdbcDriverUtils.setSessionProperty; @@ -68,7 +68,7 @@ public void shouldExecuteQuery() { try (Statement statement = connection().createStatement()) { QueryResult result = queryResult(statement, "select * from hive.default.nation"); - assertThat(result).matches(PRESTO_NATION_RESULT); + assertThat(result).matches(TRINO_NATION_RESULT); } } @@ -85,7 +85,7 @@ public void shouldInsertSelectQuery() .isEqualTo(25); } - assertThat(onTrino().executeQuery("SELECT * FROM " + tableNameInDatabase)).matches(PRESTO_NATION_RESULT); + assertThat(onTrino().executeQuery("SELECT * FROM " + tableNameInDatabase)).matches(TRINO_NATION_RESULT); } @Test(groups = JDBC) @@ -97,7 +97,7 @@ public void shouldExecuteQueryWithSelectedCatalogAndSchema() connection().setSchema("default"); try (Statement statement = connection().createStatement()) { QueryResult result = queryResult(statement, "select * from nation"); - assertThat(result).matches(PRESTO_NATION_RESULT); + assertThat(result).matches(TRINO_NATION_RESULT); } } diff --git a/testing/trino-product-tests/src/main/java/io/trino/tests/product/jdbc/TestKerberosConstrainedDelegationJdbc.java b/testing/trino-product-tests/src/main/java/io/trino/tests/product/jdbc/TestKerberosConstrainedDelegationJdbc.java index 834e53485b7f..a78da2df46b0 100644 --- a/testing/trino-product-tests/src/main/java/io/trino/tests/product/jdbc/TestKerberosConstrainedDelegationJdbc.java +++ b/testing/trino-product-tests/src/main/java/io/trino/tests/product/jdbc/TestKerberosConstrainedDelegationJdbc.java @@ -80,7 +80,7 @@ public void testSelectConstrainedDelegationKerberos() try (Connection connection = DriverManager.getConnection(jdbcUrl, driverProperties); PreparedStatement statement = connection.prepareStatement("SELECT * FROM tpch.tiny.nation"); ResultSet results = statement.executeQuery()) { - assertThat(forResultSet(results)).matches(TpchTableResults.PRESTO_NATION_RESULT); + assertThat(forResultSet(results)).matches(TpchTableResults.TRINO_NATION_RESULT); } finally { credential.dispose(); diff --git a/testing/trino-product-tests/src/main/java/io/trino/tests/product/jdbc/TestLdapTrinoJdbc.java b/testing/trino-product-tests/src/main/java/io/trino/tests/product/jdbc/TestLdapTrinoJdbc.java index 27dc54b088e2..e2c1968daa3a 100644 --- a/testing/trino-product-tests/src/main/java/io/trino/tests/product/jdbc/TestLdapTrinoJdbc.java +++ b/testing/trino-product-tests/src/main/java/io/trino/tests/product/jdbc/TestLdapTrinoJdbc.java @@ -32,7 +32,7 @@ import static io.trino.tests.product.TestGroups.LDAP_MULTIPLE_BINDS; import static io.trino.tests.product.TestGroups.PROFILE_SPECIFIC_TESTS; import static io.trino.tests.product.TestGroups.TRINO_JDBC; -import static io.trino.tests.product.TpchTableResults.PRESTO_NATION_RESULT; +import static io.trino.tests.product.TpchTableResults.TRINO_NATION_RESULT; import static java.lang.String.format; import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThatThrownBy; @@ -59,7 +59,7 @@ protected String getLdapUrlFormat() public void shouldRunQueryWithLdap() throws SQLException { - assertThat(executeLdapQuery(NATION_SELECT_ALL_QUERY, ldapUserName, ldapUserPassword)).matches(PRESTO_NATION_RESULT); + assertThat(executeLdapQuery(NATION_SELECT_ALL_QUERY, ldapUserName, ldapUserPassword)).matches(TRINO_NATION_RESULT); } @Requires(ImmutableNationTable.class) @@ -68,7 +68,7 @@ public void shouldRunQueryWithAlternativeBind() throws SQLException { String name = USER_IN_AMERICA.getAttributes().get("cn"); - assertThat(executeLdapQuery(NATION_SELECT_ALL_QUERY, name, ldapUserPassword)).matches(PRESTO_NATION_RESULT); + assertThat(executeLdapQuery(NATION_SELECT_ALL_QUERY, name, ldapUserPassword)).matches(TRINO_NATION_RESULT); } @Test(groups = {LDAP, TRINO_JDBC, PROFILE_SPECIFIC_TESTS}, timeOut = TIMEOUT) @@ -153,7 +153,7 @@ public void shouldFailForUserWithColon() public void shouldRunQueryWithFileAuthenticator() throws SQLException { - assertThat(executeLdapQuery(NATION_SELECT_ALL_QUERY, ldapUserName, fileUserPassword)).matches(PRESTO_NATION_RESULT); + assertThat(executeLdapQuery(NATION_SELECT_ALL_QUERY, ldapUserName, fileUserPassword)).matches(TRINO_NATION_RESULT); } @Requires(ImmutableNationTable.class) @@ -161,7 +161,7 @@ public void shouldRunQueryWithFileAuthenticator() public void shouldRunQueryForAnotherUserWithOnlyFileAuthenticator() throws SQLException { - assertThat(executeLdapQuery(NATION_SELECT_ALL_QUERY, "OnlyFileUser", onlyFileUserPassword)).matches(PRESTO_NATION_RESULT); + assertThat(executeLdapQuery(NATION_SELECT_ALL_QUERY, "OnlyFileUser", onlyFileUserPassword)).matches(TRINO_NATION_RESULT); } private void expectQueryToFailForUserNotInGroup(String user) diff --git a/testing/trino-product-tests/src/main/resources/table-results/presto-nation.result b/testing/trino-product-tests/src/main/resources/table-results/trino-nation.result similarity index 100% rename from testing/trino-product-tests/src/main/resources/table-results/presto-nation.result rename to testing/trino-product-tests/src/main/resources/table-results/trino-nation.result