当前位置: 首页>>代码示例>>Java>>正文


Java SiddhiCompiler.parseStreamDefinition方法代码示例

本文整理汇总了Java中org.wso2.siddhi.query.compiler.SiddhiCompiler.parseStreamDefinition方法的典型用法代码示例。如果您正苦于以下问题:Java SiddhiCompiler.parseStreamDefinition方法的具体用法?Java SiddhiCompiler.parseStreamDefinition怎么用?Java SiddhiCompiler.parseStreamDefinition使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.wso2.siddhi.query.compiler.SiddhiCompiler的用法示例。


在下文中一共展示了SiddhiCompiler.parseStreamDefinition方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: testMultilevelNestedAnnotations1

import org.wso2.siddhi.query.compiler.SiddhiCompiler; //导入方法依赖的package包/类
@Test
public void testMultilevelNestedAnnotations1() throws SiddhiParserException {
    StreamDefinition streamDefinition = SiddhiCompiler.parseStreamDefinition(
            "@sink(url='http://foo.com/test/{{data}}', " +
                    "   @map(type='xml', " +
                    "@payload('<test><time>{{time}}</time></test>')" +
                    "   )" +
                    ") " +
                    "define stream fooStream (id int, name string);"
    );

    AssertJUnit.assertEquals(
            StreamDefinition
                    .id("fooStream")
                    .attribute("id", Attribute.Type.INT)
                    .attribute("name", Attribute.Type.STRING)
                    .annotation(Annotation.annotation("sink")
                            .element("url", "http://foo.com/test/{{data}}")
                            .annotation(Annotation.annotation("map")
                                    .element("type", "xml")
                                    .annotation(Annotation.annotation("payload")
                                            .element("<test><time>{{time}}</time></test>")))),
            streamDefinition);
}
 
开发者ID:wso2,项目名称:siddhi,代码行数:25,代码来源:DefineStreamTestCase.java

示例2: Test1

import org.wso2.siddhi.query.compiler.SiddhiCompiler; //导入方法依赖的package包/类
@Test
public void Test1() throws RecognitionException, SiddhiParserException {
    StreamDefinition streamDefinition = SiddhiCompiler.parseStreamDefinition("define stream cseStream ( symbol string, price int, volume float )");
    Assert.assertEquals(new StreamDefinition().
            name("cseStream").
            attribute("symbol", Attribute.Type.STRING).
            attribute("price", Attribute.Type.INT).
            attribute("volume", Attribute.Type.FLOAT).toString(),
                        streamDefinition.toString());
}
 
开发者ID:redBorder,项目名称:rb-bi,代码行数:11,代码来源:DefineStreamTestCase.java

示例3: Test2

import org.wso2.siddhi.query.compiler.SiddhiCompiler; //导入方法依赖的package包/类
@Test
public void Test2() throws RecognitionException, SiddhiParserException {
    StreamDefinition streamDefinition = SiddhiCompiler.parseStreamDefinition("define stream `define` ( `string` string, price int, volume float );");
    Assert.assertEquals(new StreamDefinition().
            name("define").
            attribute("string", Attribute.Type.STRING).
            attribute("price", Attribute.Type.INT).
            attribute("volume", Attribute.Type.FLOAT).toString(),
                        streamDefinition.toString());
}
 
开发者ID:redBorder,项目名称:rb-bi,代码行数:11,代码来源:DefineStreamTestCase.java

示例4: test1

import org.wso2.siddhi.query.compiler.SiddhiCompiler; //导入方法依赖的package包/类
@Test
public void test1() throws SiddhiParserException {
    StreamDefinition streamDefinition = SiddhiCompiler.parseStreamDefinition("define stream cseStream ( symbol " +
            "string, price int, volume float )");
    AssertJUnit.assertEquals(StreamDefinition.
                    id("cseStream").
                    attribute("symbol", Attribute.Type.STRING).
                    attribute("price", Attribute.Type.INT).
                    attribute("volume", Attribute.Type.FLOAT).toString(),
            streamDefinition.toString());
}
 
开发者ID:wso2,项目名称:siddhi,代码行数:12,代码来源:DefineStreamTestCase.java

示例5: test2

import org.wso2.siddhi.query.compiler.SiddhiCompiler; //导入方法依赖的package包/类
@Test
public void test2() throws SiddhiParserException {
    StreamDefinition streamDefinition = SiddhiCompiler.parseStreamDefinition("define stream `define` ( `string` " +
            "string, price int, volume float );");
    AssertJUnit.assertEquals(StreamDefinition.
                    id("define").
                    attribute("string", Attribute.Type.STRING).
                    attribute("price", Attribute.Type.INT).
                    attribute("volume", Attribute.Type.FLOAT).toString(),
            streamDefinition.toString());
}
 
开发者ID:wso2,项目名称:siddhi,代码行数:12,代码来源:DefineStreamTestCase.java

示例6: testCreatingStreamDefinition

import org.wso2.siddhi.query.compiler.SiddhiCompiler; //导入方法依赖的package包/类
@Test
public void testCreatingStreamDefinition() {
    StreamDefinition streamDefinition = SiddhiCompiler.parseStreamDefinition("define stream StockStream ( symbol " +
            "string, price int, volume float );");
    StreamDefinition api = StreamDefinition.id("StockStream").attribute("symbol", Attribute.Type.STRING)
            .attribute("price", Attribute.Type.INT).attribute("volume", Attribute.Type.FLOAT);
    AssertJUnit.assertEquals(api, streamDefinition);
}
 
开发者ID:wso2,项目名称:siddhi,代码行数:9,代码来源:DefineStreamTestCase.java

示例7: testCreatingStreamWithDuplicateAttribute

import org.wso2.siddhi.query.compiler.SiddhiCompiler; //导入方法依赖的package包/类
@Test(expectedExceptions = SiddhiParserException.class)
    public void testCreatingStreamWithDuplicateAttribute() {
        StreamDefinition streamDefinition = SiddhiCompiler.parseStreamDefinition("define stream StockStream ( symbol " +
                "string, symbol int, volume float );");
//        StreamDefinition.id("StockStream").attribute("symbol", Attribute.Type.STRING).attribute("symbol", Attribute
// .Type.INT).attribute("volume", Attribute.Type.FLOAT);
    }
 
开发者ID:wso2,项目名称:siddhi,代码行数:8,代码来源:DefineStreamTestCase.java

示例8: testCreatingStreamDefinition2

import org.wso2.siddhi.query.compiler.SiddhiCompiler; //导入方法依赖的package包/类
@Test
public void testCreatingStreamDefinition2() {
    StreamDefinition streamDefinition = SiddhiCompiler.parseStreamDefinition("define stream StockStream ( symbol " +
            "string, price int, volume double, data Object );");
    StreamDefinition api = StreamDefinition.id("StockStream").attribute("symbol", Attribute.Type.STRING)
            .attribute("price", Attribute.Type.INT).attribute("volume", Attribute.Type.DOUBLE).attribute("data",
                    Attribute.Type.OBJECT);
    AssertJUnit.assertEquals(api, streamDefinition);
}
 
开发者ID:wso2,项目名称:siddhi,代码行数:10,代码来源:DefineStreamTestCase.java

示例9: testEqualObjects

import org.wso2.siddhi.query.compiler.SiddhiCompiler; //导入方法依赖的package包/类
@Test
public void testEqualObjects() throws SiddhiParserException {
    StreamDefinition streamDefinition = SiddhiCompiler.parseStreamDefinition("@Foo(name='bar','Custom')define " +
            "stream cseStream ( symbol string, price int, volume float )");
    AssertJUnit.assertEquals(StreamDefinition.
                    id("cseStream").
                    attribute("symbol", Attribute.Type.STRING).
                    attribute("price", Attribute.Type.INT).
                    attribute("volume", Attribute.Type.FLOAT).annotation(Annotation.annotation("Foo").element
                    ("name", "bar").element("Custom")),
            streamDefinition);
}
 
开发者ID:wso2,项目名称:siddhi,代码行数:13,代码来源:DefineStreamTestCase.java

示例10: testMultilevelNestedAnnotations2

import org.wso2.siddhi.query.compiler.SiddhiCompiler; //导入方法依赖的package包/类
@Test
public void testMultilevelNestedAnnotations2() throws SiddhiParserException {
    StreamDefinition streamDefinition = SiddhiCompiler.parseStreamDefinition("" +
            "@source(" +
            "   type='http', " +
            "   context='/test', " +
            "   transport='http,https', " +
            "   @map(" +
            "       type='xml', " +
            "       namespace = \"h=uri, a=uri\", " +
            "       @attributes(" +
            "           '//h:time', " +
            "           '//h:data'" +
            "       )" +
            "   )" +
            ") " +
            "define stream fooStream (id int, name string);");

    AssertJUnit.assertEquals(
            StreamDefinition
                    .id("fooStream")
                    .attribute("id", Attribute.Type.INT)
                    .attribute("name", Attribute.Type.STRING)
                    .annotation(Annotation.annotation("source")
                            .element("type", "http")
                            .element("context", "/test")
                            .element("transport", "http,https")
                            .annotation(Annotation.annotation("map")
                                    .element("type", "xml")
                                    .element("namespace", "h=uri, a=uri")
                                    .annotation(Annotation.annotation("attributes")
                                            .element("//h:time")
                                            .element("//h:data")
                                    )
                            )
                    ),
            streamDefinition);
}
 
开发者ID:wso2,项目名称:siddhi,代码行数:39,代码来源:DefineStreamTestCase.java

示例11: Test1

import org.wso2.siddhi.query.compiler.SiddhiCompiler; //导入方法依赖的package包/类
@Test
public void Test1() throws SiddhiParserException {
    StreamDefinition streamDefinition = SiddhiCompiler.parseStreamDefinition("define stream cseStream ( symbol string, price int, volume float )");
    Assert.assertEquals(StreamDefinition.
                    id("cseStream").
                    attribute("symbol", Attribute.Type.STRING).
                    attribute("price", Attribute.Type.INT).
                    attribute("volume", Attribute.Type.FLOAT).toString(),
            streamDefinition.toString());
}
 
开发者ID:sacjaya,项目名称:siddhi-3,代码行数:11,代码来源:DefineStreamTestCase.java

示例12: Test2

import org.wso2.siddhi.query.compiler.SiddhiCompiler; //导入方法依赖的package包/类
@Test
public void Test2() throws SiddhiParserException {
    StreamDefinition streamDefinition = SiddhiCompiler.parseStreamDefinition("define stream `define` ( `string` string, price int, volume float );");
    Assert.assertEquals(StreamDefinition.
                    id("define").
                    attribute("string", Attribute.Type.STRING).
                    attribute("price", Attribute.Type.INT).
                    attribute("volume", Attribute.Type.FLOAT).toString(),
            streamDefinition.toString());
}
 
开发者ID:sacjaya,项目名称:siddhi-3,代码行数:11,代码来源:DefineStreamTestCase.java

示例13: testEqualObjects

import org.wso2.siddhi.query.compiler.SiddhiCompiler; //导入方法依赖的package包/类
@Test
public void testEqualObjects() throws SiddhiParserException {
    StreamDefinition streamDefinition = SiddhiCompiler.parseStreamDefinition("@Foo(name='bar','Custom')define stream cseStream ( symbol string, price int, volume float )");
    Assert.assertEquals(StreamDefinition.
                    id("cseStream").
                    attribute("symbol", Attribute.Type.STRING).
                    attribute("price", Attribute.Type.INT).
                    attribute("volume", Attribute.Type.FLOAT).annotation(Annotation.annotation("Foo").element("name","bar").element("Custom")),
            streamDefinition);
}
 
开发者ID:sacjaya,项目名称:siddhi-3,代码行数:11,代码来源:DefineStreamTestCase.java

示例14: testCreatingStreamDefinition

import org.wso2.siddhi.query.compiler.SiddhiCompiler; //导入方法依赖的package包/类
@Test
public void testCreatingStreamDefinition() {
    StreamDefinition streamDefinition = SiddhiCompiler.parseStreamDefinition("define stream StockStream ( symbol string, price int, volume float );");
    StreamDefinition api = StreamDefinition.id("StockStream").attribute("symbol", Attribute.Type.STRING).attribute("price", Attribute.Type.INT).attribute("volume", Attribute.Type.FLOAT);
    Assert.assertEquals(api, streamDefinition);
}
 
开发者ID:sacjaya,项目名称:siddhi-3,代码行数:7,代码来源:DefineStreamTestCase.java

示例15: testCreatingStreamWithDuplicateAttribute

import org.wso2.siddhi.query.compiler.SiddhiCompiler; //导入方法依赖的package包/类
@Test(expected = SiddhiParserException.class)
    public void testCreatingStreamWithDuplicateAttribute() {
        StreamDefinition streamDefinition = SiddhiCompiler.parseStreamDefinition("define stream StockStream ( symbol string, symbol int, volume float );");
//        StreamDefinition.id("StockStream").attribute("symbol", Attribute.Type.STRING).attribute("symbol", Attribute.Type.INT).attribute("volume", Attribute.Type.FLOAT);
    }
 
开发者ID:sacjaya,项目名称:siddhi-3,代码行数:6,代码来源:DefineStreamTestCase.java


注:本文中的org.wso2.siddhi.query.compiler.SiddhiCompiler.parseStreamDefinition方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。