Skip to content

Commit

Permalink
s/DataflowAssert/PAssert/g
Browse files Browse the repository at this point in the history
  • Loading branch information
Raghu Angadi committed Apr 13, 2016
1 parent 914adb3 commit 8c26524
Showing 1 changed file with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
import com.google.cloud.dataflow.sdk.io.UnboundedSource;
import com.google.cloud.dataflow.sdk.io.UnboundedSource.UnboundedReader;
import com.google.cloud.dataflow.sdk.options.PipelineOptionsFactory;
import com.google.cloud.dataflow.sdk.testing.DataflowAssert;
import com.google.cloud.dataflow.sdk.testing.PAssert;
import com.google.cloud.dataflow.sdk.testing.RunnableOnService;
import com.google.cloud.dataflow.sdk.testing.TestPipeline;
import com.google.cloud.dataflow.sdk.transforms.Count;
Expand Down Expand Up @@ -198,20 +198,20 @@ public Void apply(Iterable<Long> values) {

public static void addCountingAsserts(PCollection<Long> input, long numElements) {
// Count == numElements
DataflowAssert
PAssert
.thatSingleton(input.apply("Count", Count.<Long>globally()))
.isEqualTo(numElements);
// Unique count == numElements
DataflowAssert
PAssert
.thatSingleton(input.apply(RemoveDuplicates.<Long>create())
.apply("UniqueCount", Count.<Long>globally()))
.isEqualTo(numElements);
// Min == 0
DataflowAssert
PAssert
.thatSingleton(input.apply("Min", Min.<Long>globally()))
.isEqualTo(0L);
// Max == numElements-1
DataflowAssert
PAssert
.thatSingleton(input.apply("Max", Max.<Long>globally()))
.isEqualTo(numElements - 1);
}
Expand Down Expand Up @@ -251,11 +251,11 @@ public void testUnboundedSourceWithExplicitPartitions() {
.apply(Values.<Long>create());

// assert that every element is a multiple of 5.
DataflowAssert
PAssert
.that(input)
.satisfies(new AssertMultipleOf(5));

DataflowAssert
PAssert
.thatSingleton(input.apply(Count.<Long>globally()))
.isEqualTo(numElements / 10L);

Expand Down Expand Up @@ -285,7 +285,7 @@ public void testUnboundedSourceTimestamps() {
.apply("TimestampDiff", ParDo.of(new ElementValueDiff()))
.apply("RemoveDuplicateTimestamps", RemoveDuplicates.<Long>create());
// This assert also confirms that diffs only has one unique value.
DataflowAssert.thatSingleton(diffs).isEqualTo(0L);
PAssert.thatSingleton(diffs).isEqualTo(0L);

p.run();
}
Expand Down

0 comments on commit 8c26524

Please sign in to comment.