use of org.wso2.siddhi.core.table.Table in project siddhi by wso2.
the class DefineTableTestCase method testQuery18.
@Test
public void testQuery18() {
log.info("testTableDefinition18 - Table w/ ref and additional properties");
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', uri='http://localhost:8080', table.name ='Foo')" + "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:8080");
expectedSystemConfigs.put("table.name", "Foo");
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 testQuery6.
@Test(expectedExceptions = DuplicateDefinitionException.class)
public void testQuery6() throws InterruptedException {
log.info("testTableDefinition6 - OUT 0");
SiddhiManager siddhiManager = new SiddhiManager();
String definitions = "define stream TestTable(symbol string, price int, volume float); " + "define table TestTable(symbol string, price int, volume float); ";
SiddhiAppRuntime siddhiAppRuntime = siddhiManager.createSiddhiAppRuntime(definitions);
siddhiAppRuntime.shutdown();
}
use of org.wso2.siddhi.core.table.Table in project siddhi by wso2.
the class DefineTableTestCase method testQuery21.
@Test(expectedExceptions = SiddhiAppCreationException.class)
public void testQuery21() {
log.info("testTableDefinition21 - Table w/ ref to an undefined store type");
Map<String, String> systemConfigs = new HashMap<>();
systemConfigs.put("test1.type", "testdb");
systemConfigs.put("test1.uri", "http://localhost");
InMemoryConfigManager inMemoryConfigManager = new InMemoryConfigManager(null, systemConfigs);
inMemoryConfigManager.extractSystemConfigs("test2");
SiddhiManager siddhiManager = new SiddhiManager();
siddhiManager.setConfigManager(inMemoryConfigManager);
siddhiManager.setExtension("store:test", TestStore.class);
String siddhiApp = "" + "@store(ref='test2', uri='http://localhost:8080', table.name ='Foo')" + "define table testTable (symbol string, price int, volume float); ";
SiddhiAppRuntime siddhiAppRuntime = siddhiManager.createSiddhiAppRuntime(siddhiApp);
siddhiAppRuntime.shutdown();
}
use of org.wso2.siddhi.core.table.Table in project siddhi by wso2.
the class DefineTableTestCase method testQuery9.
@Test(expectedExceptions = DuplicateDefinitionException.class)
public void testQuery9() throws InterruptedException {
log.info("testTableDefinition9 - OUT 0");
SiddhiManager siddhiManager = new SiddhiManager();
String siddhiApp = "" + "define stream StockStream(symbol string, price int, volume float);" + "define table OutputStream (symbol string, price float, volume long); " + "" + "from StockStream " + "select symbol, price, volume " + "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 testQuery12.
@Test
public void testQuery12() throws InterruptedException {
log.info("testTableDefinition12 - 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 StockStream " + "select * " + "insert into OutputStream;";
SiddhiAppRuntime siddhiAppRuntime = siddhiManager.createSiddhiAppRuntime(siddhiApp);
siddhiAppRuntime.shutdown();
}
Aggregations