[ 
https://issues.apache.org/jira/browse/BEAM-3138?focusedWorklogId=79583&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-79583
 ]

ASF GitHub Bot logged work on BEAM-3138:
----------------------------------------

                Author: ASF GitHub Bot
            Created on: 12/Mar/18 19:31
            Start Date: 12/Mar/18 19:31
    Worklog Time Spent: 10m 
      Work Description: kennknowles closed pull request #4740: 
[BEAM-3138][BEAM-3573] Eliminate some test-jar deps
URL: https://github.com/apache/beam/pull/4740
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/model/fn-execution/pom.xml b/model/fn-execution/pom.xml
index c568c4ff964..f6188e91636 100644
--- a/model/fn-execution/pom.xml
+++ b/model/fn-execution/pom.xml
@@ -31,16 +31,6 @@
   <description>Portable definitions for execution user-defined 
functions</description>
 
   <build>
-    <resources>
-      <resource>
-        <directory>src/test/resources</directory>
-        <filtering>true</filtering>
-      </resource>
-      <resource>
-        
<directory>${project.build.directory}/original_sources_to_package</directory>
-      </resource>
-    </resources>
-
     <plugins>
       <!-- Skip the checkstyle plugin on generated code -->
       <plugin>
diff --git 
a/model/fn-execution/src/test/resources/org/apache/beam/model/fnexecution/v1/standard_coders.yaml
 
b/model/fn-execution/src/main/resources/org/apache/beam/model/fnexecution/v1/standard_coders.yaml
similarity index 100%
rename from 
model/fn-execution/src/test/resources/org/apache/beam/model/fnexecution/v1/standard_coders.yaml
rename to 
model/fn-execution/src/main/resources/org/apache/beam/model/fnexecution/v1/standard_coders.yaml
diff --git a/model/job-management/pom.xml b/model/job-management/pom.xml
index 4b723f3dae9..162d0aaf4a1 100644
--- a/model/job-management/pom.xml
+++ b/model/job-management/pom.xml
@@ -31,16 +31,6 @@
   <description>Portable definitions for submitting pipelines.</description>
 
   <build>
-    <resources>
-      <resource>
-        <directory>src/main/resources</directory>
-        <filtering>true</filtering>
-      </resource>
-      <resource>
-        
<directory>${project.build.directory}/original_sources_to_package</directory>
-      </resource>
-    </resources>
-
     <plugins>
       <!-- Skip the checkstyle plugin on generated code -->
       <plugin>
diff --git a/model/pipeline/pom.xml b/model/pipeline/pom.xml
index 73fea08c898..d7cbee7918d 100644
--- a/model/pipeline/pom.xml
+++ b/model/pipeline/pom.xml
@@ -31,16 +31,6 @@
   <description>Portable definitions for building pipelines</description>
 
   <build>
-    <resources>
-      <resource>
-        <directory>src/main/resources</directory>
-        <filtering>true</filtering>
-      </resource>
-      <resource>
-        
<directory>${project.build.directory}/original_sources_to_package</directory>
-      </resource>
-    </resources>
-
     <plugins>
       <!-- Skip the checkstyle plugin on generated code -->
       <plugin>
diff --git a/pom.xml b/pom.xml
index 42ac08a3cff..9573a07767f 100644
--- a/pom.xml
+++ b/pom.xml
@@ -494,13 +494,6 @@
         <version>${project.version}</version>
       </dependency>
 
-      <dependency>
-        <groupId>org.apache.beam</groupId>
-        <artifactId>beam-model-fn-execution</artifactId>
-        <version>${project.version}</version>
-        <type>test-jar</type>
-      </dependency>
-
       <dependency>
         <groupId>org.apache.beam</groupId>
         <artifactId>beam-sdks-java-core</artifactId>
@@ -562,13 +555,6 @@
         <version>${project.version}</version>
       </dependency>
 
-      <dependency>
-        <groupId>org.apache.beam</groupId>
-        <artifactId>beam-sdks-java-fn-execution</artifactId>
-        <version>${project.version}</version>
-        <type>test-jar</type>
-      </dependency>
-
       <dependency>
         <groupId>org.apache.beam</groupId>
         <artifactId>beam-sdks-java-harness</artifactId>
@@ -749,6 +735,7 @@
         <version>${project.version}</version>
       </dependency>
 
+      <!-- For runners to inherit from abstract StateInternalsTest -->
       <dependency>
         <groupId>org.apache.beam</groupId>
         <artifactId>beam-runners-core-java</artifactId>
@@ -1409,6 +1396,20 @@
         <version>${commons.csv.version}</version>
       </dependency>
 
+      <!-- We ship testlibs that depend on Guava testlib -->
+      <dependency>
+        <groupId>com.google.guava</groupId>
+        <artifactId>guava-testlib</artifactId>
+        <version>${guava.version}</version>
+      </dependency>
+
+      <dependency>
+        <groupId>junit</groupId>
+        <artifactId>junit</artifactId>
+        <version>${junit.version}</version>
+        <scope>provided</scope>
+      </dependency>
+
       <!-- Testing -->
 
       <dependency>
@@ -1456,8 +1457,6 @@
       </dependency>
 
       <dependency>
-        <!-- Note: when relocating guava, ensure guava-testlib is not also 
relocated by
-             excluding com.google.common.**.testing.* -->
         <groupId>com.google.guava</groupId>
         <artifactId>guava-testlib</artifactId>
         <version>${guava.version}</version>
@@ -1955,10 +1954,6 @@
                 <relocations>
                   <relocation>
                     <pattern>com.google.common</pattern>
-                    <excludes>
-                      <!-- com.google.common is too generic, need to exclude 
guava-testlib -->
-                      <exclude>com.google.common.**.testing.*</exclude>
-                    </excludes>
                     <!--suppress MavenModelInspection -->
                     <shadedPattern>
                       
org.apache.${renderedArtifactId}.repackaged.com.google.common
diff --git a/runners/apex/build.gradle b/runners/apex/build.gradle
index bb97e36a357..800e5947c5e 100644
--- a/runners/apex/build.gradle
+++ b/runners/apex/build.gradle
@@ -43,7 +43,7 @@ dependencies {
   shadow library.java.findbugs_jsr305
   shadow library.java.apex_engine
   testCompile project(path: ":sdks:java:core", configuration: "shadowTest")
-  testCompile project(":model:fn-execution").sourceSets.test.output
+  // ApexStateInternalsTest extends abstract StateInternalsTest
   testCompile project(":runners:core-java").sourceSets.test.output
   testCompile library.java.hamcrest_core
   testCompile library.java.junit
diff --git a/runners/apex/pom.xml b/runners/apex/pom.xml
index e5ecaaf0499..5faf95f8853 100644
--- a/runners/apex/pom.xml
+++ b/runners/apex/pom.xml
@@ -185,10 +185,10 @@
     <dependency>
       <groupId>org.apache.beam</groupId>
       <artifactId>beam-model-fn-execution</artifactId>
-      <type>test-jar</type>
       <scope>test</scope>
     </dependency>
 
+    <!-- ApexStateInternalsTest extends abstract StateInternalsTest -->
     <dependency>
       <groupId>org.apache.beam</groupId>
       <artifactId>beam-runners-core-java</artifactId>
diff --git a/runners/direct-java/build.gradle b/runners/direct-java/build.gradle
index 4aaa6ef9260..21152bdc55d 100644
--- a/runners/direct-java/build.gradle
+++ b/runners/direct-java/build.gradle
@@ -51,7 +51,6 @@ dependencies {
   shadow library.java.junit
   shadowTest project(path: ":sdks:java:core", configuration: "shadowTest")
   shadowTest project(path: ":runners:core-java", configuration: "shadowTest")
-  shadowTest project(":model:fn-execution").sourceSets.test.output
   shadowTest library.java.guava_testlib
   shadowTest library.java.slf4j_jdk14
   shadowTest library.java.mockito_core
diff --git a/runners/direct-java/pom.xml b/runners/direct-java/pom.xml
index 0ce23fdd0dc..4f3da73f0e0 100644
--- a/runners/direct-java/pom.xml
+++ b/runners/direct-java/pom.xml
@@ -328,7 +328,6 @@
     <dependency>
       <groupId>org.apache.beam</groupId>
       <artifactId>beam-model-fn-execution</artifactId>
-      <type>test-jar</type>
       <scope>test</scope>
     </dependency>
   </dependencies>
diff --git a/runners/flink/build.gradle b/runners/flink/build.gradle
index 133821ff59c..d6673ae246d 100644
--- a/runners/flink/build.gradle
+++ b/runners/flink/build.gradle
@@ -65,7 +65,7 @@ dependencies {
   shadow "org.apache.flink:flink-runtime_2.11:$flink_version"
   shadow "org.apache.flink:flink-streaming-java_2.11:$flink_version"
   shadowTest project(path: ":sdks:java:core", configuration: "shadowTest")
-  shadowTest project(":model:fn-execution").sourceSets.test.output
+  // FlinkStateInternalsTest extends abstract StateInternalsTest
   shadowTest project(":runners:core-java").sourceSets.test.output
   shadowTest library.java.commons_lang3
   shadowTest library.java.hamcrest_core
diff --git a/runners/flink/pom.xml b/runners/flink/pom.xml
index 83408270bbd..610bc9d200d 100644
--- a/runners/flink/pom.xml
+++ b/runners/flink/pom.xml
@@ -384,10 +384,10 @@
     <dependency>
       <groupId>org.apache.beam</groupId>
       <artifactId>beam-model-fn-execution</artifactId>
-      <type>test-jar</type>
       <scope>test</scope>
     </dependency>
 
+    <!-- FlinkStateInternalsTest extends abstract StateInternalsTest -->
     <dependency>
       <groupId>org.apache.beam</groupId>
       <artifactId>beam-runners-core-java</artifactId>
diff --git a/runners/google-cloud-dataflow-java/build.gradle 
b/runners/google-cloud-dataflow-java/build.gradle
index b8b0cf296e0..b75b97d9208 100644
--- a/runners/google-cloud-dataflow-java/build.gradle
+++ b/runners/google-cloud-dataflow-java/build.gradle
@@ -75,7 +75,6 @@ dependencies {
   testCompile 
project(":sdks:java:io:google-cloud-platform").sourceSets.test.output
   testCompile project(path: ":sdks:java:core", configuration: "shadowTest")
   testCompile 
project(":sdks:java:extensions:google-cloud-platform-core").sourceSets.test.output
-  testCompile project(":model:fn-execution").sourceSets.test.output
   testCompile library.java.guava_testlib
   testCompile library.java.slf4j_jdk14
   testCompile library.java.mockito_core
diff --git a/runners/google-cloud-dataflow-java/pom.xml 
b/runners/google-cloud-dataflow-java/pom.xml
index 951e47b772a..8640fbc0315 100644
--- a/runners/google-cloud-dataflow-java/pom.xml
+++ b/runners/google-cloud-dataflow-java/pom.xml
@@ -525,7 +525,6 @@
     <dependency>
       <groupId>org.apache.beam</groupId>
       <artifactId>beam-model-fn-execution</artifactId>
-      <type>test-jar</type>
       <scope>test</scope>
     </dependency>
   </dependencies>
diff --git a/runners/java-fn-execution/build.gradle 
b/runners/java-fn-execution/build.gradle
index b1aa9e8c0ca..55a7ea41a38 100644
--- a/runners/java-fn-execution/build.gradle
+++ b/runners/java-fn-execution/build.gradle
@@ -39,7 +39,6 @@ dependencies {
   shadow library.java.grpc_stub
   shadow library.java.grpc_netty
   shadow library.java.slf4j_api
-  testCompile project(":sdks:java:fn-execution").sourceSets.test.output
   testCompile project(":sdks:java:harness")
   testCompile project(path: ":runners:core-construction-java", configuration: 
"shadow")
   testCompile library.java.junit
diff --git a/runners/java-fn-execution/pom.xml 
b/runners/java-fn-execution/pom.xml
index 5096b299719..c34ffe41e25 100644
--- a/runners/java-fn-execution/pom.xml
+++ b/runners/java-fn-execution/pom.xml
@@ -113,13 +113,6 @@
       <scope>test</scope>
     </dependency>
 
-    <dependency>
-      <groupId>org.apache.beam</groupId>
-      <artifactId>beam-sdks-java-fn-execution</artifactId>
-      <type>test-jar</type>
-      <scope>test</scope>
-    </dependency>
-
     <dependency>
       <groupId>org.mockito</groupId>
       <artifactId>mockito-core</artifactId>
diff --git 
a/runners/java-fn-execution/src/test/java/org/apache/beam/runners/fnexecution/logging/GrpcLoggingServiceTest.java
 
b/runners/java-fn-execution/src/test/java/org/apache/beam/runners/fnexecution/logging/GrpcLoggingServiceTest.java
index f885df1b2e3..b49d6093a40 100644
--- 
a/runners/java-fn-execution/src/test/java/org/apache/beam/runners/fnexecution/logging/GrpcLoggingServiceTest.java
+++ 
b/runners/java-fn-execution/src/test/java/org/apache/beam/runners/fnexecution/logging/GrpcLoggingServiceTest.java
@@ -33,13 +33,13 @@
 import java.util.concurrent.Executors;
 import java.util.concurrent.Future;
 import java.util.concurrent.LinkedBlockingQueue;
+import java.util.function.Consumer;
 import org.apache.beam.model.fnexecution.v1.BeamFnApi;
 import org.apache.beam.model.fnexecution.v1.BeamFnApi.LogControl;
 import org.apache.beam.model.fnexecution.v1.BeamFnApi.LogEntry;
 import org.apache.beam.model.fnexecution.v1.BeamFnLoggingGrpc;
 import org.apache.beam.runners.fnexecution.GrpcFnServer;
 import org.apache.beam.runners.fnexecution.InProcessServerFactory;
-import org.apache.beam.sdk.fn.test.Consumer;
 import org.apache.beam.sdk.fn.test.TestStreams;
 import org.junit.Test;
 import org.junit.runner.RunWith;
diff --git a/runners/spark/build.gradle b/runners/spark/build.gradle
index e1d2c0abdd2..2bc444f36b8 100644
--- a/runners/spark/build.gradle
+++ b/runners/spark/build.gradle
@@ -75,7 +75,7 @@ dependencies {
   provided "com.esotericsoftware.kryo:kryo:2.21"
   testCompile project(path: ":sdks:java:io:kafka", configuration: "shadow")
   testCompile project(path: ":sdks:java:core", configuration: "shadowTest")
-  testCompile project(":model:fn-execution").sourceSets.test.output
+  // SparkStateInternalsTest extends abstract StateInternalsTest
   testCompile project(":runners:core-java").sourceSets.test.output
   testCompile library.java.avro
   testCompile library.java.kafka_clients
diff --git a/runners/spark/pom.xml b/runners/spark/pom.xml
index 5eb57b07607..4e5e791a7a1 100644
--- a/runners/spark/pom.xml
+++ b/runners/spark/pom.xml
@@ -367,10 +367,10 @@
     <dependency>
       <groupId>org.apache.beam</groupId>
       <artifactId>beam-model-fn-execution</artifactId>
-      <type>test-jar</type>
       <scope>test</scope>
     </dependency>
 
+    <!-- SparkStateInternalsTest extends abstract StateInternalsTest -->
     <dependency>
       <groupId>org.apache.beam</groupId>
       <artifactId>beam-runners-core-java</artifactId>
diff --git a/sdks/java/core/build.gradle b/sdks/java/core/build.gradle
index 6f09f6ee85b..bddc95c43cd 100644
--- a/sdks/java/core/build.gradle
+++ b/sdks/java/core/build.gradle
@@ -53,6 +53,7 @@ dependencies {
   compile library.java.byte_buddy
   compile library.java.commons_compress
   compile library.java.commons_lang3
+  compile library.java.guava_testlib
   compileOnly library.java.findbugs_annotations
   shadow library.java.jackson_core
   shadow library.java.jackson_annotations
@@ -65,12 +66,11 @@ dependencies {
   shadow library.java.hamcrest_library
   shadow library.java.junit
   shadow "org.tukaani:xz:1.5"
-  shadowTest project(":model:fn-execution").sourceSets.test.output
-  shadowTest library.java.guava_testlib
   shadowTest library.java.jackson_dataformat_yaml
   shadowTest library.java.slf4j_jdk14
   shadowTest library.java.mockito_core
   shadowTest "com.esotericsoftware.kryo:kryo:2.21"
+  shadowTest project(path: ":model:fn-execution", configuration: "shadow")
 }
 
 // Shade dependencies.
diff --git a/sdks/java/core/pom.xml b/sdks/java/core/pom.xml
index 53cdf5654ed..3b2be6400e0 100644
--- a/sdks/java/core/pom.xml
+++ b/sdks/java/core/pom.xml
@@ -64,6 +64,7 @@
                 <artifactSet>
                   <includes>
                     <include>com.google.guava:guava</include>
+                    <include>com.google.guava:guava-testlib</include>
                     <include>com.google.protobuf:protobuf-java</include>
                     <include>com.google.protobuf:protobuf-java-util</include>
                     <include>net.bytebuddy:byte-buddy</include>
@@ -83,10 +84,6 @@
                 <relocations>
                   <relocation>
                     <pattern>com.google.common</pattern>
-                    <excludes>
-                      <!-- com.google.common is too generic, need to exclude 
guava-testlib -->
-                      <exclude>com.google.common.**.testing.*</exclude>
-                    </excludes>
                     <!--suppress MavenModelInspection -->
                     <shadedPattern>
                       org.apache.beam.sdk.repackaged.com.google.common
@@ -201,11 +198,8 @@
     </dependency>
 
     <dependency>
-      <!-- Note: when relocating guava, ensure guava-testlib is not also 
relocated by
-           excluding com.google.common.**.testing.* -->
       <groupId>com.google.guava</groupId>
       <artifactId>guava-testlib</artifactId>
-      <scope>test</scope>
     </dependency>
 
     <dependency>
@@ -300,19 +294,7 @@
     <dependency>
       <groupId>org.apache.beam</groupId>
       <artifactId>beam-model-fn-execution</artifactId>
-      <type>test-jar</type>
       <scope>test</scope>
-      <exclusions>
-        <!-- We only rely on the standard_coders.yaml -->
-        <exclusion>
-          <groupId>org.apache.beam</groupId>
-          <artifactId>beam-model-pipeline</artifactId>
-        </exclusion>
-        <exclusion>
-          <groupId>org.apache.beam</groupId>
-          <artifactId>beam-model-construction</artifactId>
-        </exclusion>
-      </exclusions>
     </dependency>
 
     <dependency>
diff --git 
a/sdks/java/core/src/test/java/org/apache/beam/sdk/io/fs/ResourceIdTester.java 
b/sdks/java/core/src/main/java/org/apache/beam/sdk/io/fs/ResourceIdTester.java
similarity index 100%
rename from 
sdks/java/core/src/test/java/org/apache/beam/sdk/io/fs/ResourceIdTester.java
rename to 
sdks/java/core/src/main/java/org/apache/beam/sdk/io/fs/ResourceIdTester.java
diff --git 
a/sdks/java/core/src/main/java/org/apache/beam/sdk/util/ApiSurface.java 
b/sdks/java/core/src/main/java/org/apache/beam/sdk/util/ApiSurface.java
index a49069450f4..848d218ceae 100644
--- a/sdks/java/core/src/main/java/org/apache/beam/sdk/util/ApiSurface.java
+++ b/sdks/java/core/src/main/java/org/apache/beam/sdk/util/ApiSurface.java
@@ -774,18 +774,4 @@ private boolean exposed(int modifiers) {
 
   ////////////////////////////////////////////////////////////////////////////
 
-  /**
-   * All classes transitively reachable via only public method signatures of 
the SDK.
-   *
-   * <p>Note that our idea of "public" does not include various internal-only 
APIs.
-   */
-  public static ApiSurface getSdkApiSurface(final ClassLoader classLoader) 
throws IOException {
-    return ApiSurface.ofPackage("org.apache.beam", classLoader)
-        .pruningPattern("org[.]apache[.]beam[.].*Test")
-        // Exposes Guava, but not intended for users
-        .pruningClassName("org.apache.beam.sdk.util.common.ReflectHelpers")
-         // test only
-        
.pruningClassName("org.apache.beam.sdk.testing.InterceptingUrlClassLoader")
-        .pruningPrefix("java");
-  }
 }
diff --git 
a/sdks/java/core/src/test/java/org/apache/beam/SdkCoreApiSurfaceTest.java 
b/sdks/java/core/src/test/java/org/apache/beam/SdkCoreApiSurfaceTest.java
index 080f34aa5e6..8c8d7442a64 100644
--- a/sdks/java/core/src/test/java/org/apache/beam/SdkCoreApiSurfaceTest.java
+++ b/sdks/java/core/src/test/java/org/apache/beam/SdkCoreApiSurfaceTest.java
@@ -21,6 +21,7 @@
 import static org.hamcrest.MatcherAssert.assertThat;
 
 import com.google.common.collect.ImmutableSet;
+import java.io.IOException;
 import java.util.Set;
 import org.apache.beam.sdk.util.ApiSurface;
 import org.junit.Test;
@@ -31,6 +32,23 @@
 @RunWith(JUnit4.class)
 public class SdkCoreApiSurfaceTest {
 
+  /**
+   * All classes transitively reachable via only public method signatures of 
the SDK.
+   *
+   * <p>Note that our idea of "public" does not include various internal-only 
APIs.
+   */
+  public static ApiSurface getSdkApiSurface(final ClassLoader classLoader) 
throws IOException {
+    return ApiSurface.ofPackage("org.apache.beam", classLoader)
+        .pruningPattern("org[.]apache[.]beam[.].*Test")
+        // Exposes Guava, but not intended for users
+        .pruningClassName("org.apache.beam.sdk.util.common.ReflectHelpers")
+        // test only
+        
.pruningClassName("org.apache.beam.sdk.testing.InterceptingUrlClassLoader")
+        // test only
+        .pruningPrefix("org.apache.beam.model.")
+        .pruningPrefix("java");
+  }
+
   @Test
   public void testSdkApiSurface() throws Exception {
 
@@ -50,6 +68,6 @@ public void testSdkApiSurface() throws Exception {
             "org.junit");
 
     assertThat(
-        ApiSurface.getSdkApiSurface(getClass().getClassLoader()), 
containsOnlyPackages(allowed));
+        getSdkApiSurface(getClass().getClassLoader()), 
containsOnlyPackages(allowed));
   }
 }
diff --git a/sdks/java/fn-execution/pom.xml b/sdks/java/fn-execution/pom.xml
index 6c91ca2c204..94238799d5f 100644
--- a/sdks/java/fn-execution/pom.xml
+++ b/sdks/java/fn-execution/pom.xml
@@ -105,13 +105,14 @@
       <scope>provided</scope>
     </dependency>
 
-    <!-- Test dependencies -->
+    <!-- We ship test utilities but the user needs to provide JUnit -->
     <dependency>
       <groupId>junit</groupId>
       <artifactId>junit</artifactId>
-      <scope>test</scope>
+      <scope>provided</scope>
     </dependency>
-    
+
+    <!-- Test dependencies -->
     <dependency>
       <groupId>org.hamcrest</groupId>
       <artifactId>hamcrest-core</artifactId>
diff --git 
a/sdks/java/fn-execution/src/test/java/org/apache/beam/sdk/fn/test/TestExecutors.java
 
b/sdks/java/fn-execution/src/main/java/org/apache/beam/sdk/fn/test/TestExecutors.java
similarity index 98%
rename from 
sdks/java/fn-execution/src/test/java/org/apache/beam/sdk/fn/test/TestExecutors.java
rename to 
sdks/java/fn-execution/src/main/java/org/apache/beam/sdk/fn/test/TestExecutors.java
index 780d9cce78f..01d64bd4f31 100644
--- 
a/sdks/java/fn-execution/src/test/java/org/apache/beam/sdk/fn/test/TestExecutors.java
+++ 
b/sdks/java/fn-execution/src/main/java/org/apache/beam/sdk/fn/test/TestExecutors.java
@@ -21,6 +21,7 @@
 import com.google.common.util.concurrent.ForwardingExecutorService;
 import java.util.concurrent.ExecutorService;
 import java.util.concurrent.TimeUnit;
+import java.util.function.Supplier;
 import org.junit.rules.TestRule;
 import org.junit.runner.Description;
 import org.junit.runners.model.Statement;
diff --git 
a/sdks/java/fn-execution/src/test/java/org/apache/beam/sdk/fn/test/TestStreams.java
 
b/sdks/java/fn-execution/src/main/java/org/apache/beam/sdk/fn/test/TestStreams.java
similarity index 98%
rename from 
sdks/java/fn-execution/src/test/java/org/apache/beam/sdk/fn/test/TestStreams.java
rename to 
sdks/java/fn-execution/src/main/java/org/apache/beam/sdk/fn/test/TestStreams.java
index 4fdbc066cb2..73fcafc7fc1 100644
--- 
a/sdks/java/fn-execution/src/test/java/org/apache/beam/sdk/fn/test/TestStreams.java
+++ 
b/sdks/java/fn-execution/src/main/java/org/apache/beam/sdk/fn/test/TestStreams.java
@@ -20,6 +20,8 @@
 
 import io.grpc.stub.CallStreamObserver;
 import io.grpc.stub.StreamObserver;
+import java.util.function.Consumer;
+import java.util.function.Supplier;
 
 /** Utility methods which enable testing of {@link StreamObserver}s. */
 public class TestStreams {
diff --git 
a/sdks/java/fn-execution/src/test/java/org/apache/beam/sdk/fn/test/Supplier.java
 
b/sdks/java/fn-execution/src/main/java/org/apache/beam/sdk/fn/test/package-info.java
similarity index 87%
rename from 
sdks/java/fn-execution/src/test/java/org/apache/beam/sdk/fn/test/Supplier.java
rename to 
sdks/java/fn-execution/src/main/java/org/apache/beam/sdk/fn/test/package-info.java
index b0bae2e2a87..40b663fe0da 100644
--- 
a/sdks/java/fn-execution/src/test/java/org/apache/beam/sdk/fn/test/Supplier.java
+++ 
b/sdks/java/fn-execution/src/main/java/org/apache/beam/sdk/fn/test/package-info.java
@@ -16,11 +16,5 @@
  * limitations under the License.
  */
 
+/** Utilities for testing use of this package. */
 package org.apache.beam.sdk.fn.test;
-
-/**
- * A fork of the Java 8 Supplier interface, to enable migrations.
- */
-public interface Supplier<T> {
-  T get();
-}
diff --git 
a/sdks/java/fn-execution/src/test/java/org/apache/beam/sdk/fn/data/BeamFnDataBufferingOutboundObserverTest.java
 
b/sdks/java/fn-execution/src/test/java/org/apache/beam/sdk/fn/data/BeamFnDataBufferingOutboundObserverTest.java
index 04d92c4726d..94685de066c 100644
--- 
a/sdks/java/fn-execution/src/test/java/org/apache/beam/sdk/fn/data/BeamFnDataBufferingOutboundObserverTest.java
+++ 
b/sdks/java/fn-execution/src/test/java/org/apache/beam/sdk/fn/data/BeamFnDataBufferingOutboundObserverTest.java
@@ -29,13 +29,13 @@
 import java.util.ArrayList;
 import java.util.Collection;
 import java.util.concurrent.atomic.AtomicBoolean;
+import java.util.function.Consumer;
 import org.apache.beam.model.fnexecution.v1.BeamFnApi;
 import org.apache.beam.model.fnexecution.v1.BeamFnApi.Elements;
 import org.apache.beam.model.fnexecution.v1.BeamFnApi.Target;
 import org.apache.beam.sdk.coders.ByteArrayCoder;
 import org.apache.beam.sdk.coders.Coder;
 import org.apache.beam.sdk.coders.LengthPrefixCoder;
-import org.apache.beam.sdk.fn.test.Consumer;
 import org.apache.beam.sdk.fn.test.TestStreams;
 import org.apache.beam.sdk.util.WindowedValue;
 import org.junit.Test;
diff --git 
a/sdks/java/fn-execution/src/test/java/org/apache/beam/sdk/fn/test/Consumer.java
 
b/sdks/java/fn-execution/src/test/java/org/apache/beam/sdk/fn/test/Consumer.java
deleted file mode 100644
index 184a6e297a1..00000000000
--- 
a/sdks/java/fn-execution/src/test/java/org/apache/beam/sdk/fn/test/Consumer.java
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
- * 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.
- */
-
-package org.apache.beam.sdk.fn.test;
-
-/**
- * A fork of the Java 8 consumer interface. This exists to enable migration 
for existing consumers.
- */
-public interface Consumer<T> {
-  void accept(T item);
-}
diff --git a/sdks/java/harness/build.gradle b/sdks/java/harness/build.gradle
index afe2ffa691e..dad72041b96 100644
--- a/sdks/java/harness/build.gradle
+++ b/sdks/java/harness/build.gradle
@@ -50,8 +50,6 @@ dependencies {
   compile library.java.joda_time
   compile library.java.slf4j_api
   provided library.java.error_prone_annotations
-  testCompile project(path: ":sdks:java:core", configuration: "shadowTest")
-  testCompile project(":sdks:java:fn-execution").sourceSets.test.output
   testCompile library.java.hamcrest_core
   testCompile library.java.junit
   testCompile library.java.mockito_core
diff --git a/sdks/java/harness/pom.xml b/sdks/java/harness/pom.xml
index c98e7d91757..e1f010a7098 100644
--- a/sdks/java/harness/pom.xml
+++ b/sdks/java/harness/pom.xml
@@ -175,13 +175,6 @@
     </dependency>
 
     <!-- test dependencies -->
-    <dependency>
-      <groupId>org.apache.beam</groupId>
-      <artifactId>beam-sdks-java-fn-execution</artifactId>
-      <type>test-jar</type>
-      <scope>test</scope>
-    </dependency>
-
     <dependency>
       <groupId>org.apache.beam</groupId>
       <artifactId>beam-runners-core-java</artifactId>
diff --git a/sdks/java/io/amazon-web-services/build.gradle 
b/sdks/java/io/amazon-web-services/build.gradle
index 40731ae55e2..779cd932f0c 100644
--- a/sdks/java/io/amazon-web-services/build.gradle
+++ b/sdks/java/io/amazon-web-services/build.gradle
@@ -35,7 +35,6 @@ dependencies {
   shadow library.java.slf4j_api
   runtime "org.apache.httpcomponents:httpclient:4.5.2"
   shadowTest library.java.guava_testlib
-  shadowTest project(path: ":sdks:java:core", configuration: "shadowTest")
   shadowTest library.java.hamcrest_core
   shadowTest library.java.mockito_core
   shadowTest library.java.junit


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Issue Time Tracking
-------------------

    Worklog Id:     (was: 79583)
    Time Spent: 50m  (was: 40m)

> Stop depending on Test JARs
> ---------------------------
>
>                 Key: BEAM-3138
>                 URL: https://issues.apache.org/jira/browse/BEAM-3138
>             Project: Beam
>          Issue Type: Bug
>          Components: io-java-gcp, runner-core, sdk-java-core, sdk-java-harness
>            Reporter: Thomas Groh
>            Assignee: Kenneth Knowles
>            Priority: Minor
>          Time Spent: 50m
>  Remaining Estimate: 0h
>
> Testing components can be in a testing or otherwise signaled package, but 
> shouldn't really be depended on by depending on a test jar in the test scope.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to