use of com.yahoo.bullet.aggregations.MockStrategy in project bullet-core by yahoo.
the class SlidingRecordTest method setup.
@BeforeMethod
private void setup() {
strategy = new MockStrategy();
config = new BulletConfig();
addMetadata(config, ALL_METADATA);
}
use of com.yahoo.bullet.aggregations.MockStrategy in project bullet-core by yahoo.
the class AdditiveTumblingTest method setup.
@BeforeMethod
private void setup() {
strategy = new MockStrategy();
config = new BulletConfig();
addMetadata(config, ALL_METADATA);
}
use of com.yahoo.bullet.aggregations.MockStrategy in project bullet-core by yahoo.
the class BasicTest method setup.
@BeforeMethod
private void setup() {
config = new BulletConfig();
strategy = new MockStrategy();
}
use of com.yahoo.bullet.aggregations.MockStrategy in project bullet-core by yahoo.
the class ReactiveTest method setup.
@BeforeMethod
private void setup() {
strategy = new MockStrategy();
config = new BulletConfig();
addMetadata(config, ALL_METADATA);
}
use of com.yahoo.bullet.aggregations.MockStrategy in project bullet-core by yahoo.
the class ReactiveTest method testReachingWindowSizeOnCombine.
@Test
public void testReachingWindowSizeOnCombine() {
Window window = makeReactiveWindow();
Reactive reactive = new Reactive(strategy, window, config);
Assert.assertFalse(reactive.initialize().isPresent());
reactive.consume(RecordBox.get().getRecord());
Assert.assertTrue(reactive.isClosed());
Assert.assertTrue(reactive.isClosedForPartition());
Assert.assertEquals(strategy.getConsumeCalls(), 1);
byte[] data = reactive.getData();
// Recreate
strategy = new MockStrategy();
reactive = new Reactive(strategy, window, config);
Assert.assertFalse(reactive.initialize().isPresent());
Assert.assertFalse(reactive.isClosed());
Assert.assertFalse(reactive.isClosedForPartition());
reactive.combine(data);
Assert.assertTrue(reactive.isClosed());
Assert.assertTrue(reactive.isClosedForPartition());
Assert.assertEquals(strategy.getConsumeCalls(), 0);
Assert.assertEquals(strategy.getCombineCalls(), 1);
}
Aggregations