diff --git a/sdks/java/io/amazon-web-services/build.gradle b/sdks/java/io/amazon-web-services/build.gradle index 211b3b9a4a73..b9ed51fbbf77 100644 --- a/sdks/java/io/amazon-web-services/build.gradle +++ b/sdks/java/io/amazon-web-services/build.gradle @@ -52,7 +52,7 @@ dependencies { runtimeOnly "org.apache.httpcomponents:httpclient:4.5.12" testImplementation project(path: ":sdks:java:core", configuration: "shadowTest") testImplementation project(path: ":sdks:java:extensions:avro", configuration: "testRuntimeMigration") - testImplementation project(path: ":sdks:java:io:common", configuration: "testRuntimeMigration") + testImplementation project(path: ":sdks:java:io:common") testImplementation "io.findify:s3mock_2.12:0.2.6" testImplementation library.java.commons_lang3 testImplementation library.java.hamcrest diff --git a/sdks/java/io/amazon-web-services2/build.gradle b/sdks/java/io/amazon-web-services2/build.gradle index b681108dc618..b1b5e3abee69 100644 --- a/sdks/java/io/amazon-web-services2/build.gradle +++ b/sdks/java/io/amazon-web-services2/build.gradle @@ -78,7 +78,7 @@ dependencies { implementation library.java.commons_codec testImplementation project(path: ":sdks:java:core", configuration: "shadowTest") testImplementation project(path: ":sdks:java:extensions:avro", configuration: "testRuntimeMigration") - testImplementation project(path: ":sdks:java:io:common", configuration: "testRuntimeMigration") + testImplementation project(path: ":sdks:java:io:common") testImplementation "io.findify:s3mock_2.12:0.2.6" testImplementation 'org.elasticmq:elasticmq-rest-sqs_2.12:1.3.5' testImplementation library.java.mockito_core diff --git a/sdks/java/io/bigquery-io-perf-tests/build.gradle b/sdks/java/io/bigquery-io-perf-tests/build.gradle index 3fc1331d909b..0e251ae668fd 100644 --- a/sdks/java/io/bigquery-io-perf-tests/build.gradle +++ b/sdks/java/io/bigquery-io-perf-tests/build.gradle @@ -30,7 +30,7 @@ dependencies { testImplementation project(path: ":sdks:java:testing:test-utils", configuration: "testRuntimeMigration") testImplementation project(path: ":sdks:java:extensions:google-cloud-platform-core", configuration: "testRuntimeMigration") testImplementation project(path: ":sdks:java:testing:test-utils", configuration: "testRuntimeMigration") - testImplementation project(path: ":sdks:java:io:common", configuration: "testRuntimeMigration") + testImplementation project(path: ":sdks:java:io:common") testImplementation project(path: ":sdks:java:io:google-cloud-platform", configuration: "testRuntimeMigration") testImplementation project(":sdks:java:io:synthetic") testImplementation library.java.junit diff --git a/sdks/java/io/cassandra/build.gradle b/sdks/java/io/cassandra/build.gradle index 22208d6828c5..5256ac1f2148 100644 --- a/sdks/java/io/cassandra/build.gradle +++ b/sdks/java/io/cassandra/build.gradle @@ -45,7 +45,7 @@ dependencies { implementation library.java.slf4j_api implementation library.java.cassandra_driver_core implementation library.java.cassandra_driver_mapping - testImplementation project(path: ":sdks:java:io:common", configuration: "testRuntimeMigration") + testImplementation project(path: ":sdks:java:io:common") testImplementation library.java.junit testImplementation library.java.hamcrest testImplementation library.java.mockito_core diff --git a/sdks/java/io/cdap/build.gradle b/sdks/java/io/cdap/build.gradle index ae701448fd67..75991fc9d5ab 100644 --- a/sdks/java/io/cdap/build.gradle +++ b/sdks/java/io/cdap/build.gradle @@ -72,5 +72,5 @@ dependencies { testImplementation project(path: ":sdks:java:extensions:avro", configuration: "testRuntimeMigration") testImplementation project(path: ":sdks:java:testing:test-utils", configuration: "testRuntimeMigration") testImplementation project(path: ":runners:direct-java", configuration: "shadow") - testImplementation project(path: ":sdks:java:io:common", configuration: "testRuntimeMigration") + testImplementation project(path: ":sdks:java:io:common") } diff --git a/sdks/java/io/common/build.gradle b/sdks/java/io/common/build.gradle index 3b0ef6ffd810..566c7b89188a 100644 --- a/sdks/java/io/common/build.gradle +++ b/sdks/java/io/common/build.gradle @@ -20,15 +20,17 @@ plugins { id 'org.apache.beam.module' } applyJavaNature( exportJavadoc: false, automaticModuleName: 'org.apache.beam.sdk.io.common') description = "Apache Beam :: SDKs :: Java :: IO :: Common" -ext.summary = "Code used by all Beam IOs" +ext.summary = "Common test fixture used by Beam IOs" dependencies { - testImplementation library.java.vendored_guava_32_1_2_jre + implementation library.java.vendored_guava_32_1_2_jre + implementation library.java.joda_time + implementation library.java.postgres + implementation library.java.slf4j_api + implementation library.java.testcontainers_jdbc + implementation 'com.zaxxer:HikariCP-java6:2.3.13' + implementation project(path: ":sdks:java:core", configuration: "shadow") + testImplementation library.java.junit testImplementation library.java.hamcrest - testImplementation library.java.postgres - testImplementation library.java.testcontainers_mysql - testImplementation library.java.testcontainers_postgresql - testImplementation 'com.zaxxer:HikariCP-java6:2.3.13' - testImplementation project(path: ":sdks:java:core", configuration: "shadow") } diff --git a/sdks/java/io/common/src/test/java/org/apache/beam/sdk/io/common/DatabaseTestHelper.java b/sdks/java/io/common/src/main/java/org/apache/beam/sdk/io/common/DatabaseTestHelper.java similarity index 79% rename from sdks/java/io/common/src/test/java/org/apache/beam/sdk/io/common/DatabaseTestHelper.java rename to sdks/java/io/common/src/main/java/org/apache/beam/sdk/io/common/DatabaseTestHelper.java index 25ff7727cd4c..319e932265db 100644 --- a/sdks/java/io/common/src/test/java/org/apache/beam/sdk/io/common/DatabaseTestHelper.java +++ b/sdks/java/io/common/src/main/java/org/apache/beam/sdk/io/common/DatabaseTestHelper.java @@ -17,10 +17,12 @@ */ package org.apache.beam.sdk.io.common; -import static org.junit.Assert.assertEquals; +import static org.apache.beam.vendor.guava.v32_1_2_jre.com.google.common.base.Preconditions.checkNotNull; +import static org.apache.beam.vendor.guava.v32_1_2_jre.com.google.common.base.Preconditions.checkState; import com.zaxxer.hikari.HikariConfig; import com.zaxxer.hikari.HikariDataSource; +import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; import java.sql.Connection; import java.sql.ResultSet; import java.sql.SQLException; @@ -45,32 +47,28 @@ import org.testcontainers.containers.JdbcDatabaseContainer; /** This class contains helper methods to ease database usage in tests. */ +@SuppressFBWarnings( + value = {"OBL_UNSATISFIED_OBLIGATION", "OBL_UNSATISFIED_OBLIGATION_EXCEPTION_EDGE"}, + justification = "https://github.com/spotbugs/spotbugs/issues/493") public class DatabaseTestHelper { private static Map hikariSources = new HashMap<>(); - public static ResultSet performQuery(JdbcDatabaseContainer container, String sql) - throws SQLException { - DataSource ds = getDataSourceForContainer(container); - Statement statement = ds.getConnection().createStatement(); - statement.execute(sql); - ResultSet resultSet = statement.getResultSet(); - - resultSet.next(); - return resultSet; - } - public static DataSource getDataSourceForContainer(JdbcDatabaseContainer container) { - if (hikariSources.get(container.getJdbcUrl()) != null) { - return hikariSources.get(container.getJdbcUrl()); + String jdbcUrl = checkNotNull(container.getJdbcUrl()); + DataSource existingSource = hikariSources.get(jdbcUrl); + if (existingSource != null) { + return existingSource; } HikariConfig hikariConfig = new HikariConfig(); // Keeping a small connection pool to a testContainer to avoid overwhelming it. hikariConfig.setMaximumPoolSize(2); - hikariConfig.setJdbcUrl(container.getJdbcUrl()); + hikariConfig.setJdbcUrl(jdbcUrl); hikariConfig.setUsername(container.getUsername()); hikariConfig.setPassword(container.getPassword()); hikariConfig.setDriverClassName(container.getDriverClassName()); - return hikariSources.put(container.getJdbcUrl(), new HikariDataSource(hikariConfig)); + existingSource = new HikariDataSource(hikariConfig); + hikariSources.put(jdbcUrl, existingSource); + return existingSource; } public static PGSimpleDataSource getPostgresDataSource(PostgresIOTestPipelineOptions options) { @@ -102,19 +100,13 @@ public static void createTable( while (true) { // This is not implemented as try-with-resources because it appears that try-with-resources is // not correctly catching the PSQLException thrown by dataSource.getConnection() - Connection connection = null; - try { - connection = dataSource.getConnection(); - try (Statement statement = connection.createStatement()) { - statement.execute(String.format("create table %s (%s)", tableName, fieldsList)); - return; - } + try (Connection connection = dataSource.getConnection(); + Statement statement = connection.createStatement()) { + statement.execute(String.format("create table %s (%s)", tableName, fieldsList)); + return; + } catch (SQLException e) { exception = e; - } finally { - if (connection != null) { - connection.close(); - } } boolean hasNext; try { @@ -176,10 +168,9 @@ public static Optional getPostgresTableSize(DataSource dataSource, String public static void createTableWithStatement(DataSource dataSource, String stmt) throws SQLException { - try (Connection connection = dataSource.getConnection()) { - try (Statement statement = connection.createStatement()) { - statement.execute(stmt); - } + try (Connection connection = dataSource.getConnection(); + Statement statement = connection.createStatement()) { + statement.execute(stmt); } } @@ -194,14 +185,15 @@ public static ArrayList> getTestDataToWrite(long rowsToAdd) public static void assertRowCount(DataSource dataSource, String tableName, int expectedRowCount) throws SQLException { - try (Connection connection = dataSource.getConnection()) { - try (Statement statement = connection.createStatement()) { - try (ResultSet resultSet = statement.executeQuery("select count(*) from " + tableName)) { - resultSet.next(); - int count = resultSet.getInt(1); - assertEquals(expectedRowCount, count); - } - } + int count; + try (Connection connection = dataSource.getConnection(); + Statement statement = connection.createStatement(); + ResultSet resultSet = statement.executeQuery("select count(*) from " + tableName)) { + resultSet.next(); + count = resultSet.getInt(1); } + // check state outside the try close to enable auto-close resources + checkState( + expectedRowCount == count, "Expected count: %d, actual: %d", expectedRowCount, count); } } diff --git a/sdks/java/io/common/src/test/java/org/apache/beam/sdk/io/common/HashingFn.java b/sdks/java/io/common/src/main/java/org/apache/beam/sdk/io/common/HashingFn.java similarity index 98% rename from sdks/java/io/common/src/test/java/org/apache/beam/sdk/io/common/HashingFn.java rename to sdks/java/io/common/src/main/java/org/apache/beam/sdk/io/common/HashingFn.java index f69225eaac24..ac6ab2c10b7e 100644 --- a/sdks/java/io/common/src/test/java/org/apache/beam/sdk/io/common/HashingFn.java +++ b/sdks/java/io/common/src/main/java/org/apache/beam/sdk/io/common/HashingFn.java @@ -38,9 +38,9 @@ public class HashingFn extends CombineFn { /** Serializable Class to store the HashCode of input String. */ public static class Accum implements Serializable { - HashCode hashCode = null; + @Nullable HashCode hashCode; - public Accum(HashCode value) { + public Accum(@Nullable HashCode value) { this.hashCode = value; } diff --git a/sdks/java/io/common/src/test/java/org/apache/beam/sdk/io/common/IOITHelper.java b/sdks/java/io/common/src/main/java/org/apache/beam/sdk/io/common/IOITHelper.java similarity index 100% rename from sdks/java/io/common/src/test/java/org/apache/beam/sdk/io/common/IOITHelper.java rename to sdks/java/io/common/src/main/java/org/apache/beam/sdk/io/common/IOITHelper.java diff --git a/sdks/java/io/common/src/test/java/org/apache/beam/sdk/io/common/IOTestPipelineOptions.java b/sdks/java/io/common/src/main/java/org/apache/beam/sdk/io/common/IOTestPipelineOptions.java similarity index 100% rename from sdks/java/io/common/src/test/java/org/apache/beam/sdk/io/common/IOTestPipelineOptions.java rename to sdks/java/io/common/src/main/java/org/apache/beam/sdk/io/common/IOTestPipelineOptions.java diff --git a/sdks/java/io/common/src/test/java/org/apache/beam/sdk/io/common/NetworkTestHelper.java b/sdks/java/io/common/src/main/java/org/apache/beam/sdk/io/common/NetworkTestHelper.java similarity index 100% rename from sdks/java/io/common/src/test/java/org/apache/beam/sdk/io/common/NetworkTestHelper.java rename to sdks/java/io/common/src/main/java/org/apache/beam/sdk/io/common/NetworkTestHelper.java diff --git a/sdks/java/io/common/src/test/java/org/apache/beam/sdk/io/common/PostgresIOTestPipelineOptions.java b/sdks/java/io/common/src/main/java/org/apache/beam/sdk/io/common/PostgresIOTestPipelineOptions.java similarity index 100% rename from sdks/java/io/common/src/test/java/org/apache/beam/sdk/io/common/PostgresIOTestPipelineOptions.java rename to sdks/java/io/common/src/main/java/org/apache/beam/sdk/io/common/PostgresIOTestPipelineOptions.java diff --git a/sdks/java/io/common/src/test/java/org/apache/beam/sdk/io/common/SchemaAwareJavaBeans.java b/sdks/java/io/common/src/main/java/org/apache/beam/sdk/io/common/SchemaAwareJavaBeans.java similarity index 98% rename from sdks/java/io/common/src/test/java/org/apache/beam/sdk/io/common/SchemaAwareJavaBeans.java rename to sdks/java/io/common/src/main/java/org/apache/beam/sdk/io/common/SchemaAwareJavaBeans.java index 8b0cd18bff05..b97d4ab8c5f8 100644 --- a/sdks/java/io/common/src/test/java/org/apache/beam/sdk/io/common/SchemaAwareJavaBeans.java +++ b/sdks/java/io/common/src/main/java/org/apache/beam/sdk/io/common/SchemaAwareJavaBeans.java @@ -398,17 +398,17 @@ public abstract static class NullableAllPrimitiveDataTypes implements Serializab @AutoValue.Builder public abstract static class Builder { - public abstract Builder setABoolean(Boolean value); + public abstract Builder setABoolean(@Nullable Boolean value); - public abstract Builder setADouble(Double value); + public abstract Builder setADouble(@Nullable Double value); - public abstract Builder setAFloat(Float value); + public abstract Builder setAFloat(@Nullable Float value); - public abstract Builder setAnInteger(Integer value); + public abstract Builder setAnInteger(@Nullable Integer value); - public abstract Builder setALong(Long value); + public abstract Builder setALong(@Nullable Long value); - public abstract Builder setAString(String value); + public abstract Builder setAString(@Nullable String value); public abstract NullableAllPrimitiveDataTypes build(); } diff --git a/sdks/java/io/common/src/test/java/org/apache/beam/sdk/io/common/TestRow.java b/sdks/java/io/common/src/main/java/org/apache/beam/sdk/io/common/TestRow.java similarity index 83% rename from sdks/java/io/common/src/test/java/org/apache/beam/sdk/io/common/TestRow.java rename to sdks/java/io/common/src/main/java/org/apache/beam/sdk/io/common/TestRow.java index 94cea2a602b2..125fb70cc0bd 100644 --- a/sdks/java/io/common/src/test/java/org/apache/beam/sdk/io/common/TestRow.java +++ b/sdks/java/io/common/src/main/java/org/apache/beam/sdk/io/common/TestRow.java @@ -43,7 +43,7 @@ public int compareTo(TestRow other) { return id().compareTo(other.id()); } - /** Creates a {@link org.apache.beam.sdk.io.common.TestRow} from the seed value. */ + /** Creates a {@link TestRow} from the seed value. */ public static TestRow fromSeed(Integer seed) { return create(seed, getNameForSeed(seed)); } @@ -54,8 +54,8 @@ public static String getNameForSeed(Integer seed) { } /** - * Returns a range of {@link org.apache.beam.sdk.io.common.TestRow}s for seed values between - * rangeStart (inclusive) and rangeEnd (exclusive). + * Returns a range of {@link TestRow}s for seed values between rangeStart (inclusive) and rangeEnd + * (exclusive). */ public static Iterable getExpectedValues(int rangeStart, int rangeEnd) { List ret = new ArrayList<>(rangeEnd - rangeStart + 1); @@ -65,9 +65,7 @@ public static Iterable getExpectedValues(int rangeStart, int rangeEnd) return ret; } - /** - * Uses the input Long values as seeds to produce {@link org.apache.beam.sdk.io.common.TestRow}s. - */ + /** Uses the input Long values as seeds to produce {@link TestRow}s. */ public static class DeterministicallyConstructTestRowFn extends DoFn { @ProcessElement public void processElement(ProcessContext c) { @@ -75,7 +73,7 @@ public void processElement(ProcessContext c) { } } - /** Outputs just the name stored in the {@link org.apache.beam.sdk.io.common.TestRow}. */ + /** Outputs just the name stored in the {@link TestRow}. */ public static class SelectNameFn extends DoFn { @ProcessElement public void processElement(ProcessContext c) { @@ -95,9 +93,8 @@ public void processElement(ProcessContext c) { 5_000_000, "c44f8a5648cd9207c9c6f77395a998dc"); /** - * Returns the hash value that {@link org.apache.beam.sdk.io.common.HashingFn} will return when it - * is run on {@link org.apache.beam.sdk.io.common.TestRow}s produced by getExpectedValues(0, - * rowCount). + * Returns the hash value that {@link HashingFn} will return when it is run on {@link TestRow}s + * produced by getExpectedValues(0, rowCount). */ public static String getExpectedHashForRowCount(int rowCount) throws UnsupportedOperationException { diff --git a/sdks/java/io/common/src/main/java/org/apache/beam/sdk/io/common/package-info.java b/sdks/java/io/common/src/main/java/org/apache/beam/sdk/io/common/package-info.java new file mode 100644 index 000000000000..10f69425e0e1 --- /dev/null +++ b/sdks/java/io/common/src/main/java/org/apache/beam/sdk/io/common/package-info.java @@ -0,0 +1,19 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you 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. + */ +/** Common test fixture for Beam IOs. */ +package org.apache.beam.sdk.io.common; diff --git a/sdks/java/io/csv/build.gradle b/sdks/java/io/csv/build.gradle index 2be8f59d1f39..a7c8edadc86f 100644 --- a/sdks/java/io/csv/build.gradle +++ b/sdks/java/io/csv/build.gradle @@ -31,5 +31,5 @@ dependencies { testImplementation project(path: ":sdks:java:core", configuration: "shadowTest") testImplementation library.java.junit testRuntimeOnly project(path: ":runners:direct-java", configuration: "shadow") - testImplementation project(path: ":sdks:java:io:common", configuration: "testRuntimeMigration") + testImplementation project(path: ":sdks:java:io:common") } \ No newline at end of file diff --git a/sdks/java/io/debezium/build.gradle b/sdks/java/io/debezium/build.gradle index 7cbe7fc93c2b..f770a833df5e 100644 --- a/sdks/java/io/debezium/build.gradle +++ b/sdks/java/io/debezium/build.gradle @@ -39,7 +39,7 @@ dependencies { provided library.java.jackson_dataformat_csv permitUnusedDeclared library.java.jackson_dataformat_csv testImplementation project(path: ":sdks:java:core", configuration: "shadowTest") - testImplementation project(path: ":sdks:java:io:common", configuration: "testRuntimeMigration") + testImplementation project(path: ":sdks:java:io:common") // Test dependencies testImplementation library.java.junit diff --git a/sdks/java/io/elasticsearch/build.gradle b/sdks/java/io/elasticsearch/build.gradle index fd264e493fba..2ef1876a8b3d 100644 --- a/sdks/java/io/elasticsearch/build.gradle +++ b/sdks/java/io/elasticsearch/build.gradle @@ -36,5 +36,5 @@ dependencies { implementation "org.apache.httpcomponents:httpasyncclient:4.1.4" implementation "org.apache.httpcomponents:httpcore-nio:4.4.12" implementation "org.elasticsearch.client:elasticsearch-rest-client:7.17.22" - testImplementation project(path: ":sdks:java:io:common", configuration: "testRuntimeMigration") + testImplementation project(path: ":sdks:java:io:common") } diff --git a/sdks/java/io/file-based-io-tests/build.gradle b/sdks/java/io/file-based-io-tests/build.gradle index 14abdbfbae26..482fe7d9c094 100644 --- a/sdks/java/io/file-based-io-tests/build.gradle +++ b/sdks/java/io/file-based-io-tests/build.gradle @@ -27,7 +27,7 @@ ext.summary = "Integration tests for reading/writing using file-based sources/si dependencies { testImplementation project(path: ":sdks:java:core", configuration: "shadowTest") testImplementation project(path: ":sdks:java:extensions:avro", configuration: "testRuntimeMigration") - testImplementation project(path: ":sdks:java:io:common", configuration: "testRuntimeMigration") + testImplementation project(path: ":sdks:java:io:common") testImplementation project(path: ":sdks:java:io:xml", configuration: "testRuntimeMigration") testImplementation project(path: ":sdks:java:io:parquet", configuration: "testRuntimeMigration") testImplementation project(path: ":sdks:java:testing:test-utils", configuration: "testRuntimeMigration") diff --git a/sdks/java/io/file-schema-transform/build.gradle b/sdks/java/io/file-schema-transform/build.gradle index cdbef727e68d..31d4efa2f30e 100644 --- a/sdks/java/io/file-schema-transform/build.gradle +++ b/sdks/java/io/file-schema-transform/build.gradle @@ -53,7 +53,7 @@ dependencies { testImplementation library.java.junit testImplementation project(path: ":sdks:java:core", configuration: "shadow") - testImplementation project(path: ":sdks:java:io:common", configuration: "testRuntimeMigration") + testImplementation project(path: ":sdks:java:io:common") testImplementation project(path: ":sdks:java:io:parquet") testImplementation project(path: ":sdks:java:io:xml") testRuntimeOnly project(path: ":runners:direct-java", configuration: "shadow") diff --git a/sdks/java/io/google-ads/build.gradle b/sdks/java/io/google-ads/build.gradle index f3dbb19e04f4..ebd8f917be96 100644 --- a/sdks/java/io/google-ads/build.gradle +++ b/sdks/java/io/google-ads/build.gradle @@ -36,7 +36,7 @@ dependencies { implementation library.java.joda_time implementation library.java.vendored_guava_32_1_2_jre testImplementation project(path: ":sdks:java:core", configuration: "shadowTest") - testImplementation project(path: ":sdks:java:io:common", configuration: "testRuntimeMigration") + testImplementation project(path: ":sdks:java:io:common") testImplementation library.java.mockito_core testImplementation library.java.junit testRuntimeOnly project(path: ":runners:direct-java", configuration: "shadow") diff --git a/sdks/java/io/google-cloud-platform/build.gradle b/sdks/java/io/google-cloud-platform/build.gradle index 5554d9964ac3..42356817b57e 100644 --- a/sdks/java/io/google-cloud-platform/build.gradle +++ b/sdks/java/io/google-cloud-platform/build.gradle @@ -164,7 +164,7 @@ dependencies { testImplementation project(path: ":sdks:java:extensions:google-cloud-platform-core", configuration: "testRuntimeMigration") testImplementation project(path: ":sdks:java:extensions:protobuf", configuration: "testRuntimeMigration") testImplementation project(path: ":runners:direct-java", configuration: "shadow") - testImplementation project(path: ":sdks:java:io:common", configuration: "testRuntimeMigration") + testImplementation project(path: ":sdks:java:io:common") testImplementation project(path: ":sdks:java:testing:test-utils", configuration: "testRuntimeMigration") testImplementation library.java.mockito_core testImplementation library.java.powermock diff --git a/sdks/java/io/hadoop-format/build.gradle b/sdks/java/io/hadoop-format/build.gradle index c4def2c1de0e..0ad855249d7e 100644 --- a/sdks/java/io/hadoop-format/build.gradle +++ b/sdks/java/io/hadoop-format/build.gradle @@ -64,7 +64,7 @@ dependencies { provided library.java.hadoop_mapreduce_client_core testImplementation project(path: ":sdks:java:core", configuration: "shadowTest") testImplementation project(path: ":sdks:java:extensions:avro", configuration: "testRuntimeMigration") - testImplementation project(path: ":sdks:java:io:common", configuration: "testRuntimeMigration") + testImplementation project(path: ":sdks:java:io:common") testImplementation project(path: ":sdks:java:testing:test-utils", configuration: "testRuntimeMigration") testImplementation project(":sdks:java:io:jdbc") testImplementation "org.elasticsearch.plugin:transport-netty4-client:$elastic_search_version" diff --git a/sdks/java/io/hbase/build.gradle b/sdks/java/io/hbase/build.gradle index 2f63ab09b6ec..d85c0fc610bb 100644 --- a/sdks/java/io/hbase/build.gradle +++ b/sdks/java/io/hbase/build.gradle @@ -42,7 +42,7 @@ dependencies { implementation project(":sdks:java:io:hadoop-common") implementation library.java.slf4j_api provided "org.apache.hbase:hbase-shaded-client:$hbase_version" - testImplementation project(path: ":sdks:java:io:common", configuration: "testRuntimeMigration") + testImplementation project(path: ":sdks:java:io:common") testImplementation project(path: ":sdks:java:core", configuration: "shadowTest") testImplementation library.java.junit testImplementation library.java.hamcrest diff --git a/sdks/java/io/hcatalog/build.gradle b/sdks/java/io/hcatalog/build.gradle index e66c3cf56d8b..345e480e6cfe 100644 --- a/sdks/java/io/hcatalog/build.gradle +++ b/sdks/java/io/hcatalog/build.gradle @@ -67,7 +67,6 @@ dependencies { exclude group: "org.apache.hive", module: "hive-exec" exclude group: "com.google.protobuf", module: "protobuf-java" } - testImplementation project(":sdks:java:io:common").sourceSets.test.output testImplementation library.java.commons_io testImplementation library.java.junit testImplementation library.java.hamcrest diff --git a/sdks/java/io/influxdb/build.gradle b/sdks/java/io/influxdb/build.gradle index b9de6b099adb..56833d00f453 100644 --- a/sdks/java/io/influxdb/build.gradle +++ b/sdks/java/io/influxdb/build.gradle @@ -35,5 +35,5 @@ dependencies { testImplementation library.java.mockito_core testRuntimeOnly project(path: ":runners:direct-java", configuration: "shadow") testImplementation project(path: ":sdks:java:extensions:avro", configuration: "testRuntimeMigration") - testImplementation project(path: ":sdks:java:io:common", configuration: "testRuntimeMigration") + testImplementation project(path: ":sdks:java:io:common") } diff --git a/sdks/java/io/jdbc/build.gradle b/sdks/java/io/jdbc/build.gradle index add9f75cb157..615536d406c0 100644 --- a/sdks/java/io/jdbc/build.gradle +++ b/sdks/java/io/jdbc/build.gradle @@ -38,7 +38,7 @@ dependencies { testImplementation "org.apache.derby:derbynet:10.14.2.0" testImplementation project(path: ":sdks:java:core", configuration: "shadowTest") testImplementation project(path: ":sdks:java:extensions:avro", configuration: "testRuntimeMigration") - testImplementation project(path: ":sdks:java:io:common", configuration: "testRuntimeMigration") + testImplementation project(path: ":sdks:java:io:common") testImplementation project(path: ":sdks:java:testing:test-utils", configuration: "testRuntimeMigration") testImplementation library.java.junit testImplementation library.java.slf4j_api diff --git a/sdks/java/io/jms/build.gradle b/sdks/java/io/jms/build.gradle index 1ae1229b76c2..575bbb69632d 100644 --- a/sdks/java/io/jms/build.gradle +++ b/sdks/java/io/jms/build.gradle @@ -43,7 +43,7 @@ dependencies { testImplementation library.java.mockito_core testImplementation library.java.mockito_inline testImplementation library.java.qpid_jms_client - testImplementation project(path: ":sdks:java:io:common", configuration: "testRuntimeMigration") + testImplementation project(path: ":sdks:java:io:common") testImplementation project(path: ":sdks:java:testing:test-utils", configuration: "testRuntimeMigration") testRuntimeOnly library.java.slf4j_jdk14 testRuntimeOnly project(path: ":runners:direct-java", configuration: "shadow") diff --git a/sdks/java/io/json/build.gradle b/sdks/java/io/json/build.gradle index d64342eaaceb..f339afab4f0a 100644 --- a/sdks/java/io/json/build.gradle +++ b/sdks/java/io/json/build.gradle @@ -30,5 +30,5 @@ dependencies { testImplementation project(path: ":sdks:java:core", configuration: "shadowTest") testImplementation library.java.junit testRuntimeOnly project(path: ":runners:direct-java", configuration: "shadow") - testImplementation project(path: ":sdks:java:io:common", configuration: "testRuntimeMigration") + testImplementation project(path: ":sdks:java:io:common") } \ No newline at end of file diff --git a/sdks/java/io/kafka/build.gradle b/sdks/java/io/kafka/build.gradle index 3e095a2bacca..4fe2e0b3036c 100644 --- a/sdks/java/io/kafka/build.gradle +++ b/sdks/java/io/kafka/build.gradle @@ -93,7 +93,7 @@ dependencies { testImplementation project(":sdks:java:managed") testImplementation project(path: ":sdks:java:extensions:avro", configuration: "testRuntimeMigration") testImplementation project(path: ":sdks:java:extensions:protobuf", configuration: "testRuntimeMigration") - testImplementation project(path: ":sdks:java:io:common", configuration: "testRuntimeMigration") + testImplementation project(path: ":sdks:java:io:common") testImplementation project(path: ":sdks:java:testing:test-utils", configuration: "testRuntimeMigration") // For testing Cross-language transforms testImplementation library.java.avro diff --git a/sdks/java/io/kinesis/build.gradle b/sdks/java/io/kinesis/build.gradle index 98ab21164aaa..60058f4469ad 100644 --- a/sdks/java/io/kinesis/build.gradle +++ b/sdks/java/io/kinesis/build.gradle @@ -44,7 +44,7 @@ dependencies { implementation library.java.jackson_core implementation library.java.jackson_annotations implementation library.java.jackson_databind - testImplementation project(path: ":sdks:java:io:common", configuration: "testRuntimeMigration") + testImplementation project(path: ":sdks:java:io:common") testImplementation library.java.junit testImplementation library.java.mockito_core testImplementation library.java.guava_testlib diff --git a/sdks/java/io/kudu/build.gradle b/sdks/java/io/kudu/build.gradle index e1835a679f36..e6df32e35e78 100644 --- a/sdks/java/io/kudu/build.gradle +++ b/sdks/java/io/kudu/build.gradle @@ -49,7 +49,7 @@ dependencies { implementation "org.apache.kudu:kudu-client:$kudu_version" implementation library.java.slf4j_api testImplementation project(path: ":sdks:java:core", configuration: "shadowTest") - testImplementation project(path: ":sdks:java:io:common", configuration: "testRuntimeMigration") + testImplementation project(path: ":sdks:java:io:common") testImplementation library.java.junit testRuntimeOnly library.java.slf4j_jdk14 testRuntimeOnly project(path: ":runners:direct-java", configuration: "shadow") diff --git a/sdks/java/io/mongodb/build.gradle b/sdks/java/io/mongodb/build.gradle index 95722a69db29..89e571538f00 100644 --- a/sdks/java/io/mongodb/build.gradle +++ b/sdks/java/io/mongodb/build.gradle @@ -31,7 +31,7 @@ dependencies { implementation library.java.slf4j_api implementation library.java.vendored_guava_32_1_2_jre testImplementation library.java.junit - testImplementation project(path: ":sdks:java:io:common", configuration: "testRuntimeMigration") + testImplementation project(path: ":sdks:java:io:common") testImplementation project(path: ":sdks:java:testing:test-utils", configuration: "testRuntimeMigration") testImplementation "de.flapdoodle.embed:de.flapdoodle.embed.mongo:3.0.0" testImplementation "de.flapdoodle.embed:de.flapdoodle.embed.process:3.0.0" diff --git a/sdks/java/io/mqtt/build.gradle b/sdks/java/io/mqtt/build.gradle index e0514fb4312b..85d6c6c16f25 100644 --- a/sdks/java/io/mqtt/build.gradle +++ b/sdks/java/io/mqtt/build.gradle @@ -29,7 +29,7 @@ dependencies { implementation library.java.joda_time implementation "org.fusesource.mqtt-client:mqtt-client:1.15" implementation "org.fusesource.hawtbuf:hawtbuf:1.11" - testImplementation project(path: ":sdks:java:io:common", configuration: "testRuntimeMigration") + testImplementation project(path: ":sdks:java:io:common") testImplementation library.java.activemq_broker testImplementation library.java.activemq_mqtt testImplementation library.java.activemq_kahadb_store diff --git a/sdks/java/io/neo4j/build.gradle b/sdks/java/io/neo4j/build.gradle index e4bcfa157c6b..9d8226755538 100644 --- a/sdks/java/io/neo4j/build.gradle +++ b/sdks/java/io/neo4j/build.gradle @@ -31,7 +31,7 @@ dependencies { implementation library.java.vendored_guava_32_1_2_jre testImplementation library.java.junit testImplementation library.java.hamcrest - testImplementation project(path: ":sdks:java:io:common", configuration: "testRuntimeMigration") + testImplementation project(path: ":sdks:java:io:common") testImplementation project(path: ":sdks:java:testing:test-utils", configuration: "testRuntimeMigration") testImplementation "org.testcontainers:neo4j:1.16.2" testRuntimeOnly library.java.slf4j_jdk14 diff --git a/sdks/java/io/rabbitmq/build.gradle b/sdks/java/io/rabbitmq/build.gradle index beb08f36d60d..82ef33f1bed6 100644 --- a/sdks/java/io/rabbitmq/build.gradle +++ b/sdks/java/io/rabbitmq/build.gradle @@ -31,7 +31,7 @@ dependencies { implementation "com.rabbitmq:amqp-client:5.7.3" provided library.java.jackson_dataformat_xml permitUnusedDeclared library.java.jackson_dataformat_xml - testImplementation project(path: ":sdks:java:io:common", configuration: "testRuntimeMigration") + testImplementation project(path: ":sdks:java:io:common") testImplementation "org.apache.qpid:qpid-broker-core:$qpid_version" testImplementation "org.apache.qpid:qpid-broker-plugins-memory-store:$qpid_version" testImplementation "org.apache.qpid:qpid-broker-plugins-amqp-0-8-protocol:$qpid_version" diff --git a/sdks/java/io/redis/build.gradle b/sdks/java/io/redis/build.gradle index 6957eceec941..28c03d534cf5 100644 --- a/sdks/java/io/redis/build.gradle +++ b/sdks/java/io/redis/build.gradle @@ -26,7 +26,7 @@ dependencies { implementation library.java.vendored_guava_32_1_2_jre implementation project(path: ":sdks:java:core", configuration: "shadow") implementation "redis.clients:jedis:4.0.1" - testImplementation project(path: ":sdks:java:io:common", configuration: "testRuntimeMigration") + testImplementation project(path: ":sdks:java:io:common") testImplementation library.java.junit testImplementation "org.signal:embedded-redis:0.8.2" testRuntimeOnly library.java.slf4j_jdk14 diff --git a/sdks/java/io/rrio/build.gradle b/sdks/java/io/rrio/build.gradle index 9d51df4c1dc2..3159e2cff5f2 100644 --- a/sdks/java/io/rrio/build.gradle +++ b/sdks/java/io/rrio/build.gradle @@ -37,7 +37,7 @@ dependencies { implementation "redis.clients:jedis:$jedisVersion" testImplementation project(path: ":sdks:java:core", configuration: "shadowTest") - testImplementation project(path: ":sdks:java:io:common", configuration: "testRuntimeMigration") + testImplementation project(path: ":sdks:java:io:common") testImplementation project(path: ":beam-test-infra-mock-apis") // Vendored grpc library not fully compatible with proto autogenerated code testImplementation "io.grpc:grpc-netty-shaded:${grpcVersion}" diff --git a/sdks/java/io/singlestore/build.gradle b/sdks/java/io/singlestore/build.gradle index 796103c25c4d..922738dc3b4d 100644 --- a/sdks/java/io/singlestore/build.gradle +++ b/sdks/java/io/singlestore/build.gradle @@ -35,7 +35,7 @@ dependencies { implementation library.java.dbcp2 testImplementation library.java.junit - testImplementation project(path: ":sdks:java:io:common", configuration: "testRuntimeMigration") + testImplementation project(path: ":sdks:java:io:common") testImplementation library.java.dbcp2 testRuntimeOnly project(path: ":runners:direct-java", configuration: "shadow") testImplementation library.java.slf4j_api diff --git a/sdks/java/io/snowflake/build.gradle b/sdks/java/io/snowflake/build.gradle index 377b5c270410..6cb489bc511a 100644 --- a/sdks/java/io/snowflake/build.gradle +++ b/sdks/java/io/snowflake/build.gradle @@ -37,7 +37,7 @@ dependencies { implementation library.java.joda_time testImplementation project(path: ":sdks:java:core", configuration: "shadowTest") testImplementation project(path: ":sdks:java:extensions:avro", configuration: "testRuntimeMigration") - testImplementation project(path: ":sdks:java:io:common", configuration: "testRuntimeMigration") + testImplementation project(path: ":sdks:java:io:common") testImplementation project(path: ":sdks:java:testing:test-utils", configuration: "testRuntimeMigration") testImplementation 'com.google.cloud:google-cloud-storage:1.102.0' testImplementation library.java.avro diff --git a/sdks/java/io/solace/build.gradle b/sdks/java/io/solace/build.gradle index 8ee12f22ed03..f569a364abfe 100644 --- a/sdks/java/io/solace/build.gradle +++ b/sdks/java/io/solace/build.gradle @@ -46,7 +46,7 @@ dependencies { implementation library.java.threetenbp testImplementation library.java.junit - testImplementation project(path: ":sdks:java:io:common", configuration: "testRuntimeMigration") + testImplementation project(path: ":sdks:java:io:common") testImplementation project(path: ":sdks:java:testing:test-utils", configuration: "testRuntimeMigration") testRuntimeOnly library.java.slf4j_jdk14 testRuntimeOnly project(path: ":runners:direct-java", configuration: "shadow") diff --git a/sdks/java/io/sparkreceiver/2/build.gradle b/sdks/java/io/sparkreceiver/2/build.gradle index 8cfdb81d108d..7fb36b4c314d 100644 --- a/sdks/java/io/sparkreceiver/2/build.gradle +++ b/sdks/java/io/sparkreceiver/2/build.gradle @@ -52,7 +52,7 @@ dependencies { testImplementation library.java.testcontainers_rabbitmq testImplementation project(path: ":runners:direct-java", configuration: "shadow") testImplementation project(":sdks:java:io:synthetic") - testImplementation project(path: ":sdks:java:io:common", configuration: "testRuntimeMigration") + testImplementation project(path: ":sdks:java:io:common") testImplementation project(path: ":sdks:java:testing:test-utils", configuration: "testRuntimeMigration") testImplementation "com.rabbitmq:amqp-client:5.16.0" }