Search in sources :

Example 1 with SlidingTimeCorrectness

use of org.apache.storm.st.topology.window.SlidingTimeCorrectness in project storm by apache.

the class SlidingWindowTest method testTimeWindow.

@Test(dataProvider = "generateTimeWindows")
public void testTimeWindow(int windowSec, int slideSec) throws Exception {
    final SlidingTimeCorrectness testable = new SlidingTimeCorrectness(windowSec, slideSec);
    final String topologyName = this.getClass().getSimpleName() + "w" + windowSec + "s" + slideSec;
    if (windowSec <= 0 || slideSec <= 0) {
        try {
            testable.newTopology();
            Assert.fail("Expected IllegalArgumentException was not thrown.");
        } catch (IllegalArgumentException ignore) {
            return;
        }
    }
    topo = new TopoWrap(cluster, topologyName, testable.newTopology());
    runAndVerifyTime(windowSec, slideSec, testable, topo);
}
Also used : TopoWrap(org.apache.storm.st.wrapper.TopoWrap) SlidingTimeCorrectness(org.apache.storm.st.topology.window.SlidingTimeCorrectness) Test(org.testng.annotations.Test) AbstractTest(org.apache.storm.st.helper.AbstractTest)

Aggregations

AbstractTest (org.apache.storm.st.helper.AbstractTest)1 SlidingTimeCorrectness (org.apache.storm.st.topology.window.SlidingTimeCorrectness)1 TopoWrap (org.apache.storm.st.wrapper.TopoWrap)1 Test (org.testng.annotations.Test)1