Search in sources :

Example 6 with WindowData

use of edu.snu.mist.common.windows.WindowData in project mist by snuspl.

the class OperatorTestUtils method checkWindowData.

/**
 * Checks the windowed result is equal to the expected result.
 */
public static void checkWindowData(final MistEvent result, final Collection<Integer> expectedResult, final long expectedWindowStartMoment, final long expectedWindowSize, final long expectedWindowTimestamp) {
    Assert.assertTrue(result.isData());
    Assert.assertTrue(((MistDataEvent) result).getValue() instanceof WindowData);
    final WindowData windowData = (WindowData) ((MistDataEvent) result).getValue();
    Assert.assertEquals(expectedResult, windowData.getDataCollection());
    Assert.assertEquals(expectedWindowStartMoment, windowData.getStart());
    Assert.assertEquals(expectedWindowSize, windowData.getEnd() - windowData.getStart() + 1);
    Assert.assertEquals(expectedWindowTimestamp, result.getTimestamp());
}
Also used : WindowData(edu.snu.mist.common.windows.WindowData) MistDataEvent(edu.snu.mist.core.MistDataEvent)

Aggregations

WindowData (edu.snu.mist.common.windows.WindowData)6 MISTFunction (edu.snu.mist.common.functions.MISTFunction)3 MistDataEvent (edu.snu.mist.core.MistDataEvent)3 Test (org.junit.Test)3 APIQueryControlResult (edu.snu.mist.client.APIQueryControlResult)2 MISTQueryBuilder (edu.snu.mist.client.MISTQueryBuilder)2 SourceConfiguration (edu.snu.mist.client.datastreams.configurations.SourceConfiguration)2 MistEvent (edu.snu.mist.core.MistEvent)2 MistWatermarkEvent (edu.snu.mist.core.MistWatermarkEvent)2 WindowImpl (edu.snu.mist.core.operators.window.WindowImpl)2 OutputBufferEmitter (edu.snu.mist.core.utils.OutputBufferEmitter)2 NettySourceAddress (edu.snu.mist.examples.parameters.NettySourceAddress)2 IOException (java.io.IOException)2 URISyntaxException (java.net.URISyntaxException)2 LinkedList (java.util.LinkedList)2 List (java.util.List)2 Configuration (org.apache.reef.tang.Configuration)2 JavaConfigurationBuilder (org.apache.reef.tang.JavaConfigurationBuilder)2 Tang (org.apache.reef.tang.Tang)2 InjectionException (org.apache.reef.tang.exceptions.InjectionException)2