@Override public void run() { fromOctober.fromAfter("timestamp", earlier); } });
@Override public void run() { oct.fromAfter("timestamp", earlier); } });
@Override public void run() { withSpecificTimestamp.fromAfter("timestamp", instant); } });
@Override public void run() { oct.fromAfter("timestamp", later); } });
@Override public void run() { toOct.fromAfter("timestamp", later); } });
@Override public RefinableView<E> fromAfter(String name, Comparable value) { return asRefinableView().fromAfter(name, value); }
@Override public void run() { afterSep.fromAfter("timestamp", earlier); } });
@Override public void run() { beforeOct.fromAfter("timestamp", later); } });
@Override public void run() { unbounded.fromAfter("timestamp", nov11Start).toBefore("timestamp", nov12Start).moveToTrash(); } });
@Override public void run() { unbounded.fromAfter("timestamp", nov11Start).toBefore("timestamp", nov12Start).deleteAll(); } });
unbounded.fromAfter("timestamp", octInstant)); assertContentEquals(Sets.newHashSet(sepEvent), unbounded.toBefore("timestamp", octInstant));
@Test(expected = IllegalArgumentException.class) public void testInvalidLimitedWriter() { final View<TestEntity> range = ds .fromAfter(NAMES[0], "1").to(NAMES[0], "5") .fromAfter(NAMES[1], "1").to(NAMES[1], "5"); range.newWriter().write(newTestEntity("6", "6")); }
@Test public void testLimitedWriter() { final View<TestEntity> range = ds .fromAfter(NAMES[0], "1").to(NAMES[0], "5") .fromAfter(NAMES[1], "1").to(NAMES[1], "5"); DatasetWriter<TestEntity> writer = range.newWriter(); try { writer.write(newTestEntity("3", "3")); writer.write(newTestEntity("5", "5")); } finally { writer.close(); } }
final long earlier = instant - 1; final RefinableView<StandardEvent> afterSep = unbounded.fromAfter("timestamp", instant); afterSep.from("timestamp", later)); Assert.assertNotNull("fromAfter(later instant) should succeed", afterSep.fromAfter("timestamp", later)); Assert.assertNotNull("to(later instant) should succeed", afterSep.to("timestamp", later));
(Signalable) unbounded.fromAfter("timestamp", instant); Assert.assertFalse("To after the instant should not be ready", afterSpecificTimestamp.isReady());
beforeOct.from("timestamp", earlier)); Assert.assertNotNull("fromAfter(earlier instant) should succeed", beforeOct.fromAfter("timestamp", earlier)); Assert.assertNotNull("to(earlier instant) should succeed", beforeOct.to("timestamp", earlier));
fromOctober.from("timestamp", later)); Assert.assertNotNull("fromAfter(later instant) should succeed", fromOctober.fromAfter("timestamp", later)); Assert.assertNotNull("to(later instant) should succeed", fromOctober.to("timestamp", later));
toOct.from("timestamp", earlier)); Assert.assertNotNull("fromAfter(earlier instant) should succeed", toOct.fromAfter("timestamp", earlier)); Assert.assertNotNull("to(earlier instant) should succeed", toOct.to("timestamp", earlier));
oct.from("timestamp", included)); Assert.assertNotNull("fromAfter(included instant) should succeed", oct.fromAfter("timestamp", included)); Assert.assertNotNull("to(included instant) should succeed", oct.to("timestamp", included));
@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)); }