beam-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tg...@apache.org
Subject [2/2] beam git commit: Improve Pruning performed by the DirectRunnerApiSurfaceTest
Date Tue, 16 May 2017 17:24:55 GMT
Improve Pruning performed by the DirectRunnerApiSurfaceTest

Prune the parts of the Core SDK that must be exposed as part of the API
surface. The remainder should not be exposed accidentally.


Project: http://git-wip-us.apache.org/repos/asf/beam/repo
Commit: http://git-wip-us.apache.org/repos/asf/beam/commit/9d86bcd0
Tree: http://git-wip-us.apache.org/repos/asf/beam/tree/9d86bcd0
Diff: http://git-wip-us.apache.org/repos/asf/beam/diff/9d86bcd0

Branch: refs/heads/master
Commit: 9d86bcd0e199b34220feaa583d933c5e7b3215a8
Parents: 529f251
Author: Thomas Groh <tgroh@google.com>
Authored: Tue May 9 16:09:25 2017 -0700
Committer: Thomas Groh <tgroh@google.com>
Committed: Tue May 16 10:24:41 2017 -0700

----------------------------------------------------------------------
 .../runners/direct/DirectRunnerApiSurfaceTest.java | 17 +++++++++++++++--
 1 file changed, 15 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/beam/blob/9d86bcd0/runners/direct-java/src/test/java/org/apache/beam/runners/direct/DirectRunnerApiSurfaceTest.java
----------------------------------------------------------------------
diff --git a/runners/direct-java/src/test/java/org/apache/beam/runners/direct/DirectRunnerApiSurfaceTest.java
b/runners/direct-java/src/test/java/org/apache/beam/runners/direct/DirectRunnerApiSurfaceTest.java
index 9928cb0..631349f 100644
--- a/runners/direct-java/src/test/java/org/apache/beam/runners/direct/DirectRunnerApiSurfaceTest.java
+++ b/runners/direct-java/src/test/java/org/apache/beam/runners/direct/DirectRunnerApiSurfaceTest.java
@@ -23,7 +23,12 @@ import static org.junit.Assert.assertThat;
 
 import com.google.common.collect.ImmutableSet;
 import java.util.Set;
-import javax.annotation.Nullable;
+import org.apache.beam.sdk.Pipeline;
+import org.apache.beam.sdk.PipelineRunner;
+import org.apache.beam.sdk.metrics.MetricResults;
+import org.apache.beam.sdk.options.PipelineOptions;
+import org.apache.beam.sdk.options.PipelineOptionsRegistrar;
+import org.apache.beam.sdk.transforms.display.DisplayData;
 import org.apache.beam.sdk.util.ApiSurface;
 import org.junit.Test;
 import org.junit.runner.RunWith;
@@ -43,9 +48,17 @@ public class DirectRunnerApiSurfaceTest {
     final ClassLoader thisClassLoader = getClass().getClassLoader();
     ApiSurface apiSurface =
         ApiSurface.ofPackage(thisPackage, thisClassLoader)
+            // Do not include dependencies that are required based on the known exposures.
This
+            // could alternatively prune everything exposed by the public parts of the Core
SDK
+            .pruningClass(Pipeline.class)
+            .pruningClass(PipelineRunner.class)
+            .pruningClass(PipelineOptions.class)
+            .pruningClass(PipelineOptionsRegistrar.class)
+            .pruningClass(PipelineOptions.DirectRunner.class)
+            .pruningClass(DisplayData.Builder.class)
+            .pruningClass(MetricResults.class)
             .pruningPattern("org[.]apache[.]beam[.].*Test.*")
             .pruningPattern("org[.]apache[.]beam[.].*IT")
-            .pruningClass(Nullable.class)
             .pruningPattern("java[.]io.*")
             .pruningPattern("java[.]lang.*")
             .pruningPattern("java[.]util.*");


Mime
View raw message