Search in sources :

Example 1 with MockStrategy

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);
}
Also used : MockStrategy(com.yahoo.bullet.aggregations.MockStrategy) BulletConfig(com.yahoo.bullet.common.BulletConfig) BeforeMethod(org.testng.annotations.BeforeMethod)

Example 2 with MockStrategy

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);
}
Also used : MockStrategy(com.yahoo.bullet.aggregations.MockStrategy) BulletConfig(com.yahoo.bullet.common.BulletConfig) BeforeMethod(org.testng.annotations.BeforeMethod)

Example 3 with MockStrategy

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();
}
Also used : BulletConfig(com.yahoo.bullet.common.BulletConfig) MockStrategy(com.yahoo.bullet.aggregations.MockStrategy) BeforeMethod(org.testng.annotations.BeforeMethod)

Example 4 with 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);
}
Also used : MockStrategy(com.yahoo.bullet.aggregations.MockStrategy) BulletConfig(com.yahoo.bullet.common.BulletConfig) BeforeMethod(org.testng.annotations.BeforeMethod)

Example 5 with MockStrategy

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);
}
Also used : Window(com.yahoo.bullet.parsing.Window) MockStrategy(com.yahoo.bullet.aggregations.MockStrategy) Test(org.testng.annotations.Test)

Aggregations

MockStrategy (com.yahoo.bullet.aggregations.MockStrategy)7 BulletConfig (com.yahoo.bullet.common.BulletConfig)5 BeforeMethod (org.testng.annotations.BeforeMethod)5 Window (com.yahoo.bullet.parsing.Window)2 Test (org.testng.annotations.Test)2