@Override public void run() { withSpecificTimestamp.toBefore("timestamp", instant); } });
@Override public void run() { oct.toBefore("timestamp", later); } });
@Override public void run() { fromOctober.toBefore("timestamp", earlier); } });
@Override public void run() { toOct.toBefore("timestamp", later); } });
@Override public void run() { oct.toBefore("timestamp", earlier); } });
@Override public void run() { afterSep.toBefore("timestamp", earlier); } });
@Override public RefinableView<E> toBefore(String name, Comparable value) { return asRefinableView().toBefore(name, value); }
@Override public void run() { beforeOct.toBefore("timestamp", later); } });
@Override public void run() { unbounded.toBefore("timestamp", sep12End).deleteAll(); } });
@Override public void run() { unbounded.toBefore("timestamp", sep12End).moveToTrash(); } });
@Override public void run() { unbounded.fromAfter("timestamp", nov11Start).toBefore("timestamp", nov12Start).moveToTrash(); } });
@Override public void run() { unbounded.fromAfter("timestamp", nov11Start).toBefore("timestamp", nov12Start).deleteAll(); } });
long end = new DateTime(2013, 11, 14, 0, 0, DateTimeZone.UTC).getMillis(); final RefinableView<StandardEvent> range = unbounded .from("timestamp", start).toBefore("timestamp", end);
@Test @SuppressWarnings("rawtypes") public void testReadySignalToBeforeConstraint() { Assume.assumeTrue(unbounded instanceof Signalable); final long instant = new DateTime(2013, 10, 1, 0, 0, DateTimeZone.UTC).getMillis(); final Signalable toBeforeSpecificTimestamp = (Signalable) unbounded.toBefore("timestamp", instant); Assert.assertFalse("Should not be ready initially", toBeforeSpecificTimestamp.isReady()); toBeforeSpecificTimestamp.signalReady(); Assert.assertTrue("Should be ready after signal", toBeforeSpecificTimestamp.isReady()); }
@Test public void testMixedConstraintViews() { assertViewUriEquivalent("id, color, and time constraints", "view:file:/tmp/test_name?color=,orange&id=exists()×tamp=[0,9)", test.with("color", "", "orange").with("id") .from("timestamp", 0L).toBefore("timestamp", 9L)); }
unbounded.fromAfter("timestamp", octInstant)); assertContentEquals(Sets.newHashSet(sepEvent), unbounded.toBefore("timestamp", octInstant)); long novStart = new DateTime(2013, 11, 1, 0, 0, DateTimeZone.UTC).getMillis(); assertContentEquals(Sets.<StandardEvent>newHashSet(octEvent), unbounded.from("timestamp", octStart).toBefore("timestamp", novStart));
@Test public void testBoundedRangeViews() { assertViewUriEquivalent("[a,b]", "view:file:/tmp/test_name?id=[a,b]", test.from("id", "a").to("id", "b")); assertViewUriEquivalent("[a,b)", "view:file:/tmp/test_name?id=[a,b)", test.from("id", "a").toBefore("id", "b")); assertViewUriEquivalent("(a,b]", "view:file:/tmp/test_name?id=(a,b]", test.fromAfter("id", "a").to("id", "b")); assertViewUriEquivalent("(a,b)", "view:file:/tmp/test_name?id=(a,b)", test.fromAfter("id", "a").toBefore("id", "b")); }
testDataset.from("timestamp", octInstant).toBefore("timestamp", novStart));
(Signalable) unbounded.toBefore("timestamp", instant); Assert.assertFalse("To before the instant should not be ready", beforeSpecificTimestamp.isReady());
@Test public void testUnboundedView() { // test events Assert.assertTrue("Should include any StandardEvent", unbounded.includes(event)); Assert.assertTrue("Should include even null events", unbounded.includes(null)); Assert.assertTrue("Should include older event", unbounded.includes(sepEvent)); Assert.assertTrue("Should include event", unbounded.includes(octEvent)); Assert.assertTrue("Should include newer event", unbounded.includes(novEvent)); // test range limiting Assert.assertNotNull("from should succeed", unbounded.from("timestamp", now)); Assert.assertNotNull("fromAfter should succeed", unbounded.fromAfter("timestamp", now)); Assert.assertNotNull("to should succeed", unbounded.to("timestamp", now)); Assert.assertNotNull("toBefore should succeed", unbounded.toBefore("timestamp", now)); Assert.assertNotNull("with should succeed", unbounded.with("timestamp", now)); }