use of org.wso2.siddhi.core.table.Table in project siddhi by wso2.
the class DefineTableTestCase method testQuery14.
@Test(expectedExceptions = DuplicateDefinitionException.class)
public void testQuery14() throws InterruptedException {
log.info("testTableDefinition14 - OUT 0");
SiddhiManager siddhiManager = new SiddhiManager();
String siddhiApp = "" + "define stream StockStream(symbol string, price int, volume float);" + "define table OutputStream (symbol string, price int, volume int); " + "" + "from StockStream " + "select * " + "insert into OutputStream;";
SiddhiAppRuntime siddhiAppRuntime = siddhiManager.createSiddhiAppRuntime(siddhiApp);
siddhiAppRuntime.shutdown();
}
use of org.wso2.siddhi.core.table.Table in project siddhi by wso2.
the class DefineTableTestCase method testQuery15.
@Test(expectedExceptions = SiddhiAppCreationException.class)
public void testQuery15() throws InterruptedException {
log.info("testTableDefinition15 - OUT 0");
SiddhiManager siddhiManager = new SiddhiManager();
String siddhiApp = "" + "define stream StockStream(symbol string, price int, volume float);" + "define table OutputStream (symbol string, price int, volume float); " + "" + "from OutputStream " + "select symbol, price, volume " + "insert into StockStream;";
SiddhiAppRuntime siddhiAppRuntime = siddhiManager.createSiddhiAppRuntime(siddhiApp);
siddhiAppRuntime.shutdown();
}
use of org.wso2.siddhi.core.table.Table in project siddhi by wso2.
the class DefineTableTestCase method testQuery2.
@Test
public void testQuery2() throws InterruptedException {
log.info("testTableDefinition2 - OUT 0");
SiddhiManager siddhiManager = new SiddhiManager();
String tables = "define table Table(symbol string, price int, volume float) ";
SiddhiAppRuntime siddhiAppRuntime = siddhiManager.createSiddhiAppRuntime(tables);
siddhiAppRuntime.shutdown();
}
use of org.wso2.siddhi.core.table.Table in project siddhi by wso2.
the class DefineTableTestCase method testQuery16.
@Test
public void testQuery16() {
log.info("testTableDefinition16 - Table w/ ref");
Map<String, String> systemConfigs = new HashMap<>();
systemConfigs.put("test1.type", "test");
systemConfigs.put("test1.uri", "http://localhost");
InMemoryConfigManager inMemoryConfigManager = new InMemoryConfigManager(null, systemConfigs);
inMemoryConfigManager.extractSystemConfigs("test1");
SiddhiManager siddhiManager = new SiddhiManager();
siddhiManager.setConfigManager(inMemoryConfigManager);
siddhiManager.setExtension("store:test", TestStore.class);
String siddhiApp = "" + "@store(ref='test1')" + "define table testTable (symbol string, price int, volume float); ";
SiddhiAppRuntime siddhiAppRuntime = siddhiManager.createSiddhiAppRuntime(siddhiApp);
siddhiAppRuntime.shutdown();
Map<String, String> expectedSystemConfigs = new HashMap<>();
expectedSystemConfigs.put("type", "test");
expectedSystemConfigs.put("uri", "http://localhost");
AssertJUnit.assertEquals("Test store initialization failure", expectedSystemConfigs, TestStore.systemConfigs);
}
use of org.wso2.siddhi.core.table.Table in project siddhi by wso2.
the class DefineTableTestCase method testQuery4.
@Test(expectedExceptions = DuplicateDefinitionException.class)
public void testQuery4() throws InterruptedException {
log.info("testTableDefinition4 - OUT 0");
SiddhiManager siddhiManager = new SiddhiManager();
String tables = "define table TestTable(symbol string, volume float); " + "define table TestTable(symbols string, price int, volume float); ";
SiddhiAppRuntime siddhiAppRuntime = siddhiManager.createSiddhiAppRuntime(tables);
siddhiAppRuntime.shutdown();
}
Aggregations