Search in sources :

Example 11 with TestAppenderToValidateLogsForCachingTests

use of io.siddhi.core.query.table.util.TestAppenderToValidateLogsForCachingTests in project siddhi by wso2.

the class CacheLRUTestCase method cacheLRUTestCase0.

// using query api and 2 primary keys & LRu
@Test(description = "cacheLRUTestCase0")
public void cacheLRUTestCase0() throws InterruptedException, SQLException {
    final TestAppenderToValidateLogsForCachingTests appender = new TestAppenderToValidateLogsForCachingTests("TestAppenderToValidateLogsForCachingTests", null);
    final Logger logger = (Logger) LogManager.getRootLogger();
    logger.setLevel(Level.DEBUG);
    logger.addAppender(appender);
    SiddhiManager siddhiManager = new SiddhiManager();
    String streams = "" + "define stream StockStream (symbol string, price float, volume long); " + "define stream DeleteStockStream (symbol string, price float, volume long); " + "@Store(type=\"testStoreForCacheMiss\", @Cache(size=\"2\", cache.policy=\"LRU\"))\n" + "@PrimaryKey(\'symbol\', \'price\') " + "define table StockTable (symbol string, price float, volume long); ";
    String query = "" + "@info(name = 'query1') " + "from StockStream " + "insert into StockTable ;" + "" + "@info(name = 'query2') " + "from DeleteStockStream " + "delete StockTable " + "   on StockTable.symbol == symbol AND StockTable.price == price AND StockTable.volume == volume;";
    SiddhiAppRuntime siddhiAppRuntime = siddhiManager.createSiddhiAppRuntime(streams + query);
    InputHandler stockStream = siddhiAppRuntime.getInputHandler("StockStream");
    InputHandler deleteStockStream = siddhiAppRuntime.getInputHandler("DeleteStockStream");
    siddhiAppRuntime.start();
    deleteStockStream.send(new Object[] { "WSO2", 55.6f, 1L });
    deleteStockStream.send(new Object[] { "IBM", 75.6f, 2L });
    stockStream.send(new Object[] { "CISCO", 75.6f, 3L });
    Thread.sleep(10);
    stockStream.send(new Object[] { "APPLE", 75.6f, 4L });
    Thread.sleep(1000);
    Event[] events = siddhiAppRuntime.query("" + "from StockTable " + "on symbol == \"WSO2\" AND price == 55.6f ");
    EventPrinter.print(events);
    AssertJUnit.assertEquals(1, events.length);
    final List<String> loggedEvents = ((TestAppenderToValidateLogsForCachingTests) logger.getAppenders().get("TestAppenderToValidateLogsForCachingTests")).getLog();
    List<String> logMessages = new ArrayList<>();
    for (String logEvent : loggedEvents) {
        String message = String.valueOf(logEvent);
        if (message.contains(":")) {
            message = message.split(":")[1].trim();
        }
        logMessages.add(message);
    }
    Assert.assertEquals(logMessages.contains("store table size is smaller than max cache. Sending results from cache"), false);
    Assert.assertEquals(logMessages.contains("store table size is bigger than cache."), true);
    Assert.assertEquals(Collections.frequency(logMessages, "store table size is bigger than cache."), 1);
    Assert.assertEquals(logMessages.contains("cache constraints satisfied. Checking cache"), true);
    Assert.assertEquals(Collections.frequency(logMessages, "cache constraints satisfied. Checking cache"), 1);
    Assert.assertEquals(logMessages.contains("cache hit. Sending results from cache"), false);
    Assert.assertEquals(logMessages.contains("cache miss. Loading from store"), true);
    Assert.assertEquals(Collections.frequency(logMessages, "cache miss. Loading from store"), 1);
    Assert.assertEquals(logMessages.contains("store also miss. sending null"), false);
    Assert.assertEquals(logMessages.contains("sending results from cache after loading from store"), true);
    Assert.assertEquals(Collections.frequency(logMessages, "sending results from cache after loading from store"), 1);
    Assert.assertEquals(logMessages.contains("sending results from store"), false);
    logger.removeAppender(appender);
    siddhiAppRuntime.shutdown();
}
Also used : InputHandler(io.siddhi.core.stream.input.InputHandler) TestAppenderToValidateLogsForCachingTests(io.siddhi.core.query.table.util.TestAppenderToValidateLogsForCachingTests) ArrayList(java.util.ArrayList) SiddhiAppRuntime(io.siddhi.core.SiddhiAppRuntime) Event(io.siddhi.core.event.Event) Logger(org.apache.logging.log4j.core.Logger) SiddhiManager(io.siddhi.core.SiddhiManager) Test(org.testng.annotations.Test)

Example 12 with TestAppenderToValidateLogsForCachingTests

use of io.siddhi.core.query.table.util.TestAppenderToValidateLogsForCachingTests in project siddhi by wso2.

the class CacheLRUTestCase method cacheLRUTestCase5.

@Test(description = "cacheLRUTestCase5", dependsOnMethods = { "cacheLRUTestCase4" })
public // 2 primary keys & LRu & update func
void cacheLRUTestCase5() throws InterruptedException, SQLException {
    final TestAppenderToValidateLogsForCachingTests appender = new TestAppenderToValidateLogsForCachingTests("TestAppenderToValidateLogsForCachingTests", null);
    final Logger logger = (Logger) LogManager.getRootLogger();
    logger.setLevel(Level.DEBUG);
    logger.addAppender(appender);
    SiddhiManager siddhiManager = new SiddhiManager();
    String streams = "" + "define stream StockStream (symbol string, price float, volume long); " + "define stream UpdateStockStream (symbol string, price float, volume long); " + "@Store(type=\"testStoreForCacheMiss\", @Cache(size=\"2\", cache.policy=\"LRU\"))\n" + "@PrimaryKey(\'symbol\', \'price\') " + "define table StockTable (symbol string, price float, volume long); ";
    String query = "" + "@info(name = 'query1') " + "from StockStream " + "insert into StockTable ;" + "" + "@info(name = 'query2') " + "from UpdateStockStream\n" + "select symbol, price, volume\n" + "update StockTable\n" + "on (StockTable.symbol == symbol AND StockTable.price == price);";
    SiddhiAppRuntime siddhiAppRuntime = siddhiManager.createSiddhiAppRuntime(streams + query);
    siddhiAppRuntime.addCallback("query2", new QueryCallback() {

        @Override
        public void receive(long timestamp, Event[] inEvents, Event[] removeEvents) {
            EventPrinter.print(timestamp, inEvents, removeEvents);
            if (inEvents != null) {
                for (Event event : inEvents) {
                    inEventCount++;
                    switch(inEventCount) {
                        case 1:
                            Assert.assertEquals(event.getData(), new Object[] { "WSO2", 55.6f, 3L });
                            break;
                    }
                }
                eventArrived = true;
            }
        }
    });
    InputHandler stockStream = siddhiAppRuntime.getInputHandler("StockStream");
    InputHandler updateStockStream = siddhiAppRuntime.getInputHandler("UpdateStockStream");
    siddhiAppRuntime.start();
    stockStream.send(new Object[] { "WSO2", 55.6f, 1L });
    Thread.sleep(10);
    stockStream.send(new Object[] { "APPLE", 75.6f, 2L });
    Thread.sleep(10);
    updateStockStream.send(new Object[] { "WSO2", 55.6f, 3L });
    Thread.sleep(10);
    stockStream.send(new Object[] { "CISCO", 86.6f, 5L });
    Event[] events = siddhiAppRuntime.query("" + "from StockTable " + "on symbol == \"APPLE\" AND price == 75.6f ");
    EventPrinter.print(events);
    AssertJUnit.assertEquals(1, events.length);
    final List<String> loggedEvents = ((TestAppenderToValidateLogsForCachingTests) logger.getAppenders().get("TestAppenderToValidateLogsForCachingTests")).getLog();
    List<String> logMessages = new ArrayList<>();
    for (String logEvent : loggedEvents) {
        String message = String.valueOf(logEvent);
        if (message.contains(":")) {
            message = message.split(":")[1].trim();
        }
        logMessages.add(message);
    }
    Assert.assertEquals(logMessages.contains("store table size is smaller than max cache. Sending results from cache"), false);
    Assert.assertEquals(logMessages.contains("store table size is bigger than cache."), true);
    Assert.assertEquals(Collections.frequency(logMessages, "store table size is bigger than cache."), 1);
    Assert.assertEquals(logMessages.contains("cache constraints satisfied. Checking cache"), true);
    Assert.assertEquals(Collections.frequency(logMessages, "cache constraints satisfied. Checking cache"), 1);
    Assert.assertEquals(logMessages.contains("cache hit. Sending results from cache"), false);
    Assert.assertEquals(logMessages.contains("cache miss. Loading from store"), true);
    Assert.assertEquals(Collections.frequency(logMessages, "cache miss. Loading from store"), 1);
    Assert.assertEquals(logMessages.contains("store also miss. sending null"), false);
    Assert.assertEquals(logMessages.contains("sending results from cache after loading from store"), true);
    Assert.assertEquals(Collections.frequency(logMessages, "sending results from cache after loading from store"), 1);
    Assert.assertEquals(logMessages.contains("sending results from store"), false);
    logger.removeAppender(appender);
    siddhiAppRuntime.shutdown();
}
Also used : InputHandler(io.siddhi.core.stream.input.InputHandler) TestAppenderToValidateLogsForCachingTests(io.siddhi.core.query.table.util.TestAppenderToValidateLogsForCachingTests) ArrayList(java.util.ArrayList) Logger(org.apache.logging.log4j.core.Logger) QueryCallback(io.siddhi.core.query.output.callback.QueryCallback) SiddhiAppRuntime(io.siddhi.core.SiddhiAppRuntime) Event(io.siddhi.core.event.Event) SiddhiManager(io.siddhi.core.SiddhiManager) Test(org.testng.annotations.Test)

Example 13 with TestAppenderToValidateLogsForCachingTests

use of io.siddhi.core.query.table.util.TestAppenderToValidateLogsForCachingTests in project siddhi by wso2.

the class CacheLRUTestCase method cacheLRUTestCase8.

@Test(description = "cacheLRUTestCase8", dependsOnMethods = { "cacheLRUTestCase7" })
public // 2 primary keys & LRu & update or add func with update
void cacheLRUTestCase8() throws InterruptedException, SQLException {
    final TestAppenderToValidateLogsForCachingTests appender = new TestAppenderToValidateLogsForCachingTests("TestAppenderToValidateLogsForCachingTests", null);
    final Logger logger = (Logger) LogManager.getRootLogger();
    logger.setLevel(Level.DEBUG);
    logger.addAppender(appender);
    SiddhiManager siddhiManager = new SiddhiManager();
    String streams = "" + "define stream StockStream (symbol string, price float, volume long); " + "define stream UpdateStockStream (symbol string, price float, volume long); " + "@Store(type=\"testStoreForCacheMiss\", @Cache(size=\"2\", cache.policy=\"LRU\"))\n" + "@PrimaryKey(\'symbol\', \'price\') " + "define table StockTable (symbol string, price float, volume long); ";
    String query = "" + "@info(name = 'query1') " + "from StockStream " + "insert into StockTable ;" + "" + "@info(name = 'query2') " + "from UpdateStockStream " + "update or insert into StockTable " + "   on (StockTable.symbol == symbol AND StockTable.price == price);";
    SiddhiAppRuntime siddhiAppRuntime = siddhiManager.createSiddhiAppRuntime(streams + query);
    siddhiAppRuntime.addCallback("query2", new QueryCallback() {

        @Override
        public void receive(long timestamp, Event[] inEvents, Event[] removeEvents) {
            EventPrinter.print(timestamp, inEvents, removeEvents);
            if (inEvents != null) {
                for (Event event : inEvents) {
                    inEventCount++;
                    switch(inEventCount) {
                        case 1:
                            Assert.assertEquals(event.getData(), new Object[] { "WSO2", 55.6f, 3L });
                            break;
                    }
                }
                eventArrived = true;
            }
        }
    });
    InputHandler stockStream = siddhiAppRuntime.getInputHandler("StockStream");
    InputHandler updateStockStream = siddhiAppRuntime.getInputHandler("UpdateStockStream");
    siddhiAppRuntime.start();
    stockStream.send(new Object[] { "WSO2", 55.6f, 1L });
    Thread.sleep(10);
    stockStream.send(new Object[] { "APPLE", 75.6f, 2L });
    Thread.sleep(10);
    updateStockStream.send(new Object[] { "WSO2", 55.6f, 3L });
    Thread.sleep(10);
    stockStream.send(new Object[] { "CISCO", 86.6f, 5L });
    Event[] events = siddhiAppRuntime.query("" + "from StockTable " + "on symbol == \"APPLE\" AND price == 75.6f ");
    EventPrinter.print(events);
    AssertJUnit.assertEquals(1, events.length);
    final List<String> loggedEvents = ((TestAppenderToValidateLogsForCachingTests) logger.getAppenders().get("TestAppenderToValidateLogsForCachingTests")).getLog();
    List<String> logMessages = new ArrayList<>();
    for (String logEvent : loggedEvents) {
        String message = String.valueOf(logEvent);
        if (message.contains(":")) {
            message = message.split(":")[1].trim();
        }
        logMessages.add(message);
    }
    Assert.assertEquals(logMessages.contains("store table size is smaller than max cache. Sending results from cache"), false);
    Assert.assertEquals(logMessages.contains("store table size is bigger than cache."), true);
    Assert.assertEquals(Collections.frequency(logMessages, "store table size is bigger than cache."), 1);
    Assert.assertEquals(logMessages.contains("cache constraints satisfied. Checking cache"), true);
    Assert.assertEquals(Collections.frequency(logMessages, "cache constraints satisfied. Checking cache"), 1);
    Assert.assertEquals(logMessages.contains("cache hit. Sending results from cache"), false);
    Assert.assertEquals(logMessages.contains("cache miss. Loading from store"), true);
    Assert.assertEquals(Collections.frequency(logMessages, "cache miss. Loading from store"), 1);
    Assert.assertEquals(logMessages.contains("store also miss. sending null"), false);
    Assert.assertEquals(logMessages.contains("sending results from cache after loading from store"), true);
    Assert.assertEquals(Collections.frequency(logMessages, "sending results from cache after loading from store"), 1);
    Assert.assertEquals(logMessages.contains("sending results from store"), false);
    logger.removeAppender(appender);
    siddhiAppRuntime.shutdown();
}
Also used : InputHandler(io.siddhi.core.stream.input.InputHandler) TestAppenderToValidateLogsForCachingTests(io.siddhi.core.query.table.util.TestAppenderToValidateLogsForCachingTests) ArrayList(java.util.ArrayList) Logger(org.apache.logging.log4j.core.Logger) QueryCallback(io.siddhi.core.query.output.callback.QueryCallback) SiddhiAppRuntime(io.siddhi.core.SiddhiAppRuntime) Event(io.siddhi.core.event.Event) SiddhiManager(io.siddhi.core.SiddhiManager) Test(org.testng.annotations.Test)

Example 14 with TestAppenderToValidateLogsForCachingTests

use of io.siddhi.core.query.table.util.TestAppenderToValidateLogsForCachingTests in project siddhi by wso2.

the class CacheLRUTestCase method cacheLRUTestCase10.

@Test(description = "cacheLRUTestCase9", dependsOnMethods = { "cacheLRUTestCase9" })
public void cacheLRUTestCase10() throws InterruptedException, SQLException {
    TestAppenderToValidateLogsForCachingTests appender = new TestAppenderToValidateLogsForCachingTests("TestAppenderToValidateLogsForCachingTests", null);
    final Logger logger = (Logger) LogManager.getRootLogger();
    // logger.removeAllAppenders();
    logger.setLevel(Level.DEBUG);
    logger.addAppender(appender);
    log.info("cacheLRUTestCase10 - OUT 1");
    SiddhiManager siddhiManager = new SiddhiManager();
    String streams = "" + "define stream StockStream (symbol string, price float, volume long); " + "define stream CheckStockStream (symbol string, price float); " + "@Store(type=\"testStoreForCacheMiss\", @Cache(size=\"2\", cache.policy=\"LRU\"))\n" + "@PrimaryKey(\'symbol\', \'price\') " + "define table StockTable (symbol string, price float, volume long); ";
    String query = "" + "@info(name = 'query1') " + "from StockStream " + "insert into StockTable ;" + "" + "@info(name = 'query2') " + "from CheckStockStream join StockTable " + " on CheckStockStream.symbol==StockTable.symbol AND CheckStockStream.price==StockTable.price " + "select CheckStockStream.symbol as checkSymbol, StockTable.symbol as symbol, " + "StockTable.volume as volume  " + "insert into OutputStream ;";
    SiddhiAppRuntime siddhiAppRuntime = siddhiManager.createSiddhiAppRuntime(streams + query);
    siddhiAppRuntime.addCallback("query2", new QueryCallback() {

        @Override
        public void receive(long timeStamp, Event[] inEvents, Event[] removeEvents) {
            EventPrinter.print(timeStamp, inEvents, removeEvents);
            if (inEvents != null) {
                for (Event event : inEvents) {
                    inEventCount++;
                    switch(inEventCount) {
                        case 1:
                            Assert.assertEquals(event.getData(), new Object[] { "WSO2", "WSO2", 100L });
                            break;
                        default:
                            Assert.assertSame(inEventCount, 1);
                    }
                }
                eventArrived = true;
            }
            if (removeEvents != null) {
                removeEventCount = removeEventCount + removeEvents.length;
            }
            eventArrived = true;
        }
    });
    InputHandler stockStream = siddhiAppRuntime.getInputHandler("StockStream");
    InputHandler checkStockStream = siddhiAppRuntime.getInputHandler("CheckStockStream");
    siddhiAppRuntime.start();
    stockStream.send(new Object[] { "WSO2", 55.6f, 100L });
    stockStream.send(new Object[] { "IBM", 75.6f, 10L });
    Thread.sleep(100);
    checkStockStream.send(new Object[] { "WSO2", 55.6f });
    Thread.sleep(10);
    stockStream.send(new Object[] { "CISCO", 86.6f, 5L });
    Thread.sleep(15000);
    Event[] events = siddhiAppRuntime.query("" + "from StockTable " + "on symbol == \"IBM\" AND price == 75.6 ");
    EventPrinter.print(events);
    AssertJUnit.assertEquals(1, events.length);
    final List<String> loggedEvents = ((TestAppenderToValidateLogsForCachingTests) logger.getAppenders().get("TestAppenderToValidateLogsForCachingTests")).getLog();
    List<String> logMessages = new ArrayList<>();
    for (String logEvent : loggedEvents) {
        String message = String.valueOf(logEvent);
        if (message.contains(":")) {
            message = message.split(":")[1].trim();
        }
        logMessages.add(message);
    }
    Assert.assertEquals(logMessages.contains("store table size is smaller than max cache. Sending results from cache"), true);
    Assert.assertEquals(Collections.frequency(logMessages, "store table size is smaller than max cache. Sending results from cache"), 1);
    Assert.assertEquals(logMessages.contains("store table size is bigger than cache."), true);
    Assert.assertEquals(Collections.frequency(logMessages, "store table size is bigger than cache."), 1);
    Assert.assertEquals(logMessages.contains("cache constraints satisfied. Checking cache"), true);
    Assert.assertEquals(Collections.frequency(logMessages, "cache constraints satisfied. Checking cache"), 1);
    Assert.assertEquals(logMessages.contains("cache hit. Sending results from cache"), false);
    Assert.assertEquals(logMessages.contains("cache miss. Loading from store"), true);
    Assert.assertEquals(Collections.frequency(logMessages, "cache miss. Loading from store"), 1);
    Assert.assertEquals(logMessages.contains("store also miss. sending null"), false);
    Assert.assertEquals(logMessages.contains("sending results from cache after loading from store"), true);
    Assert.assertEquals(Collections.frequency(logMessages, "sending results from cache after loading from store"), 1);
    Assert.assertEquals(logMessages.contains("sending results from store"), false);
    logger.removeAppender(appender);
    siddhiAppRuntime.shutdown();
}
Also used : InputHandler(io.siddhi.core.stream.input.InputHandler) TestAppenderToValidateLogsForCachingTests(io.siddhi.core.query.table.util.TestAppenderToValidateLogsForCachingTests) ArrayList(java.util.ArrayList) Logger(org.apache.logging.log4j.core.Logger) QueryCallback(io.siddhi.core.query.output.callback.QueryCallback) SiddhiAppRuntime(io.siddhi.core.SiddhiAppRuntime) Event(io.siddhi.core.event.Event) SiddhiManager(io.siddhi.core.SiddhiManager) Test(org.testng.annotations.Test)

Example 15 with TestAppenderToValidateLogsForCachingTests

use of io.siddhi.core.query.table.util.TestAppenderToValidateLogsForCachingTests in project siddhi by wso2.

the class CacheLRUTestCase method cacheLRUTestCase4.

@Test(description = "cacheLRUTestCase4", dependsOnMethods = { "cacheLRUTestCase3" })
public // 1 primary key & LRu & update func
void cacheLRUTestCase4() throws InterruptedException, SQLException {
    final TestAppenderToValidateLogsForCachingTests appender = new TestAppenderToValidateLogsForCachingTests("TestAppenderToValidateLogsForCachingTests", null);
    final Logger logger = (Logger) LogManager.getRootLogger();
    logger.setLevel(Level.DEBUG);
    logger.addAppender(appender);
    SiddhiManager siddhiManager = new SiddhiManager();
    String streams = "" + "define stream StockStream (symbol string, price float, volume long); " + "define stream UpdateStockStream (symbol string, price float, volume long); " + "@Store(type=\"testStoreForCacheMiss\", @Cache(size=\"2\", cache.policy=\"LRU\"))\n" + "@PrimaryKey(\'symbol\') " + "define table StockTable (symbol string, price float, volume long); ";
    String query = "" + "@info(name = 'query1') " + "from StockStream " + "insert into StockTable ;" + "" + "@info(name = 'query2') " + "from UpdateStockStream\n" + "select symbol, price, volume\n" + "update StockTable\n" + "on (StockTable.symbol == symbol);";
    SiddhiAppRuntime siddhiAppRuntime = siddhiManager.createSiddhiAppRuntime(streams + query);
    siddhiAppRuntime.addCallback("query2", new QueryCallback() {

        @Override
        public void receive(long timestamp, Event[] inEvents, Event[] removeEvents) {
            EventPrinter.print(timestamp, inEvents, removeEvents);
            if (inEvents != null) {
                for (Event event : inEvents) {
                    inEventCount++;
                    switch(inEventCount) {
                        case 1:
                            Assert.assertEquals(event.getData(), new Object[] { "WSO2", 66.5f, 3L });
                            break;
                    }
                }
                eventArrived = true;
            }
        }
    });
    InputHandler stockStream = siddhiAppRuntime.getInputHandler("StockStream");
    InputHandler updateStockStream = siddhiAppRuntime.getInputHandler("UpdateStockStream");
    siddhiAppRuntime.start();
    stockStream.send(new Object[] { "WSO2", 55.6f, 1L });
    Thread.sleep(10);
    stockStream.send(new Object[] { "APPLE", 75.6f, 2L });
    Thread.sleep(10);
    updateStockStream.send(new Object[] { "WSO2", 66.5f, 3L });
    Thread.sleep(10);
    stockStream.send(new Object[] { "CISCO", 86.6f, 5L });
    Event[] events = siddhiAppRuntime.query("" + "from StockTable " + "on symbol == \"APPLE\" ");
    EventPrinter.print(events);
    AssertJUnit.assertEquals(1, events.length);
    final List<String> loggedEvents = ((TestAppenderToValidateLogsForCachingTests) logger.getAppenders().get("TestAppenderToValidateLogsForCachingTests")).getLog();
    List<String> logMessages = new ArrayList<>();
    for (String logEvent : loggedEvents) {
        String message = String.valueOf(logEvent);
        if (message.contains(":")) {
            message = message.split(":")[1].trim();
        }
        logMessages.add(message);
    }
    Assert.assertEquals(logMessages.contains("store table size is smaller than max cache. Sending results from cache"), false);
    Assert.assertEquals(logMessages.contains("store table size is bigger than cache."), true);
    Assert.assertEquals(Collections.frequency(logMessages, "store table size is bigger than cache."), 1);
    Assert.assertEquals(logMessages.contains("cache constraints satisfied. Checking cache"), true);
    Assert.assertEquals(Collections.frequency(logMessages, "cache constraints satisfied. Checking cache"), 1);
    Assert.assertEquals(logMessages.contains("cache hit. Sending results from cache"), false);
    Assert.assertEquals(logMessages.contains("cache miss. Loading from store"), true);
    Assert.assertEquals(Collections.frequency(logMessages, "cache miss. Loading from store"), 1);
    Assert.assertEquals(logMessages.contains("store also miss. sending null"), false);
    Assert.assertEquals(logMessages.contains("sending results from cache after loading from store"), true);
    Assert.assertEquals(Collections.frequency(logMessages, "sending results from cache after loading from store"), 1);
    Assert.assertEquals(logMessages.contains("sending results from store"), false);
    logger.removeAppender(appender);
    siddhiAppRuntime.shutdown();
}
Also used : InputHandler(io.siddhi.core.stream.input.InputHandler) TestAppenderToValidateLogsForCachingTests(io.siddhi.core.query.table.util.TestAppenderToValidateLogsForCachingTests) ArrayList(java.util.ArrayList) Logger(org.apache.logging.log4j.core.Logger) QueryCallback(io.siddhi.core.query.output.callback.QueryCallback) SiddhiAppRuntime(io.siddhi.core.SiddhiAppRuntime) Event(io.siddhi.core.event.Event) SiddhiManager(io.siddhi.core.SiddhiManager) Test(org.testng.annotations.Test)

Aggregations

SiddhiAppRuntime (io.siddhi.core.SiddhiAppRuntime)34 SiddhiManager (io.siddhi.core.SiddhiManager)34 Event (io.siddhi.core.event.Event)34 TestAppenderToValidateLogsForCachingTests (io.siddhi.core.query.table.util.TestAppenderToValidateLogsForCachingTests)34 Logger (org.apache.logging.log4j.core.Logger)34 Test (org.testng.annotations.Test)34 InputHandler (io.siddhi.core.stream.input.InputHandler)33 ArrayList (java.util.ArrayList)28 QueryCallback (io.siddhi.core.query.output.callback.QueryCallback)21 LoggerContext (org.apache.logging.log4j.core.LoggerContext)2 Configuration (org.apache.logging.log4j.core.config.Configuration)2