Skip to content

Commit

Permalink
Fix QueryTest
Browse files Browse the repository at this point in the history
Workaround for issue apache#22 + extra cleaning
  • Loading branch information
echauchot committed May 9, 2017
1 parent 3406101 commit b68fc71
Showing 1 changed file with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
import org.apache.beam.sdk.values.TimestampedValue;

import org.junit.Ignore;
import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.JUnit4;
Expand All @@ -33,23 +34,22 @@
* Test the various NEXMark queries yield results coherent with their models.
*/
@RunWith(JUnit4.class)
@Ignore
//TODO Ismael
public class QueryTest {
private static final NexmarkConfiguration CONFIG = NexmarkConfiguration.DEFAULT.clone();
@Rule
public TestPipeline p = TestPipeline.create();

static {
CONFIG.numEvents = 2000;
CONFIG.numEvents = 100;
}

/** Test {@code query} matches {@code model}. */
private static void queryMatchesModel(String name, NexmarkQuery query, NexmarkQueryModel model) {
Pipeline p = TestPipeline.create();
private void queryMatchesModel(String name, NexmarkQuery query, NexmarkQueryModel model) {
NexmarkUtils.setupPipeline(NexmarkUtils.CoderStrategy.HAND, p);
PCollection<TimestampedValue<KnownSize>> results =
p.apply(name + ".ReadBounded", NexmarkUtils.batchEventsSource(CONFIG)).apply(query);
//TODO Ismael this should not be called explicitly
// results.setIsBoundedInternal(IsBounded.BOUNDED);
results.setIsBoundedInternal(PCollection.IsBounded.BOUNDED);
PAssert.that(results).satisfies(model.assertionFor());
p.run().waitUntilFinish();
}
Expand Down

0 comments on commit b68fc71

Please sign in to comment.