Search in sources :

Example 11 with TableDefinition

use of org.ballerinalang.siddhi.query.api.definition.TableDefinition in project ballerina by ballerina-lang.

the class DefineTableTestCase method test1.

@Test
public void test1() throws SiddhiParserException {
    TableDefinition streamDefinition = SiddhiCompiler.parseTableDefinition("define table cseStream ( symbol " + "string, price int, volume float )");
    AssertJUnit.assertEquals(TableDefinition.id("cseStream").attribute("symbol", Attribute.Type.STRING).attribute("price", Attribute.Type.INT).attribute("volume", Attribute.Type.FLOAT).toString(), streamDefinition.toString());
}
Also used : TableDefinition(org.ballerinalang.siddhi.query.api.definition.TableDefinition) Test(org.testng.annotations.Test)

Aggregations

TableDefinition (org.ballerinalang.siddhi.query.api.definition.TableDefinition)11 Test (org.testng.annotations.Test)5 Attribute (org.ballerinalang.siddhi.query.api.definition.Attribute)3 Table (org.ballerinalang.siddhi.core.table.Table)2 AggregationDefinition (org.ballerinalang.siddhi.query.api.definition.AggregationDefinition)2 StreamDefinition (org.ballerinalang.siddhi.query.api.definition.StreamDefinition)2 WindowDefinition (org.ballerinalang.siddhi.query.api.definition.WindowDefinition)2 DuplicateDefinitionException (org.ballerinalang.siddhi.query.api.exception.DuplicateDefinitionException)2 OutputAttribute (org.ballerinalang.siddhi.query.api.execution.query.selection.OutputAttribute)2 Variable (org.ballerinalang.siddhi.query.api.expression.Variable)2 HashMap (java.util.HashMap)1 ANTLRInputStream (org.antlr.v4.runtime.ANTLRInputStream)1 CommonTokenStream (org.antlr.v4.runtime.CommonTokenStream)1 ParseTree (org.antlr.v4.runtime.tree.ParseTree)1 SiddhiAppRuntime (org.ballerinalang.siddhi.core.SiddhiAppRuntime)1 SiddhiManager (org.ballerinalang.siddhi.core.SiddhiManager)1 StateEventPool (org.ballerinalang.siddhi.core.event.state.StateEventPool)1 MetaStreamEvent (org.ballerinalang.siddhi.core.event.stream.MetaStreamEvent)1 StreamEventPool (org.ballerinalang.siddhi.core.event.stream.StreamEventPool)1 StreamEventConverter (org.ballerinalang.siddhi.core.event.stream.converter.StreamEventConverter)1