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


Java SiddhiManager类代码示例

本文整理汇总了Java中org.wso2.siddhi.core.SiddhiManager的典型用法代码示例。如果您正苦于以下问题:Java SiddhiManager类的具体用法?Java SiddhiManager怎么用?Java SiddhiManager使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: testClusTree2D_3

import org.wso2.siddhi.core.SiddhiManager; //导入依赖的package包/类
@Test
public void testClusTree2D_3() throws Exception {
    logger.info("ClusTreeStreamProcessorExtension Test - Test case to validate noOfClusters to be constant");
    SiddhiManager siddhiManager = new SiddhiManager();
    String inputStream = "define stream InputStream (x double, y double, noOfClusters int);";

    String query = (
            "@info(name = 'query1') " +
                    "from InputStream#streamingml:clusTree(noOfClusters, 10, 20, 5, 50, x, y) " +
                    "select closestCentroidCoordinate1, closestCentroidCoordinate2, x, y " +
                    "insert into OutputStream;");
    try {
        SiddhiAppRuntime siddhiAppRuntime = siddhiManager.createSiddhiAppRuntime(inputStream + query);
    } catch (Exception e) {
        logger.info("Error caught");
        AssertJUnit.assertTrue(e instanceof SiddhiAppCreationException);
        AssertJUnit.assertTrue(e.getCause().getMessage().contains("noOfClusters has to be a constant but " +
                "found org.wso2.siddhi.core.executor.VariableExpressionExecutor"));
    }
}
 
开发者ID:wso2-extensions,项目名称:siddhi-gpl-execution-streamingml,代码行数:21,代码来源:ClusTreeStreamProcessorExtensionTest.java

示例2: testClusTree2D_6

import org.wso2.siddhi.core.SiddhiManager; //导入依赖的package包/类
@Test
public void testClusTree2D_6() throws Exception {
    logger.info("ClusTreeStreamProcessorExtension Test - Test case to validate maxHeightOfTree to be constant");
    SiddhiManager siddhiManager = new SiddhiManager();
    String inputStream = "define stream InputStream (x double, y double, maxHeightOfTree int);";

    String query = (
            "@info(name = 'query1') " +
                    "from InputStream#streamingml:clusTree(2, 10, 20, maxHeightOfTree, 50, x, y) " +
                    "select closestCentroidCoordinate1, closestCentroidCoordinate2, x, y " +
                    "insert into OutputStream;");
    try {
        SiddhiAppRuntime siddhiAppRuntime = siddhiManager.createSiddhiAppRuntime(inputStream + query);
    } catch (Exception e) {
        logger.info("Error caught");
        AssertJUnit.assertTrue(e instanceof SiddhiAppCreationException);
        AssertJUnit.assertTrue(e.getCause().getMessage().contains("maxHeightOfTree has to be a constant but " +
                "found org.wso2.siddhi.core.executor.VariableExpressionExecutor"));
    }
}
 
开发者ID:wso2-extensions,项目名称:siddhi-gpl-execution-streamingml,代码行数:21,代码来源:ClusTreeStreamProcessorExtensionTest.java

示例3: testClusTree2D_7

import org.wso2.siddhi.core.SiddhiManager; //导入依赖的package包/类
@Test
public void testClusTree2D_7() throws Exception {
    logger.info("ClusTreeStreamProcessorExtension Test - Test case to validate horizon to be constant");
    SiddhiManager siddhiManager = new SiddhiManager();
    String inputStream = "define stream InputStream (x double, y double, horizon int);";

    String query = (
            "@info(name = 'query1') " +
                    "from InputStream#streamingml:clusTree(2, 10, 20, 5, horizon, x, y) " +
                    "select closestCentroidCoordinate1, closestCentroidCoordinate2, x, y " +
                    "insert into OutputStream;");
    try {
        SiddhiAppRuntime siddhiAppRuntime = siddhiManager.createSiddhiAppRuntime(inputStream + query);
    } catch (Exception e) {
        logger.info("Error caught");
        AssertJUnit.assertTrue(e instanceof SiddhiAppCreationException);
        AssertJUnit.assertTrue(e.getCause().getMessage().contains("horizon has to be a constant but found " +
                "org.wso2.siddhi.core.executor.VariableExpressionExecutor"));
    }
}
 
开发者ID:wso2-extensions,项目名称:siddhi-gpl-execution-streamingml,代码行数:21,代码来源:ClusTreeStreamProcessorExtensionTest.java

示例4: testClusTree2D_9

import org.wso2.siddhi.core.SiddhiManager; //导入依赖的package包/类
@Test
public void testClusTree2D_9() throws Exception {
    logger.info("ClusTreeStreamProcessorExtension Test - Test case to validate attribute_0 to be variable");
    SiddhiManager siddhiManager = new SiddhiManager();
    String inputStream = "define stream InputStream (x double, y double);";

    String query = (
            "@info(name = 'query1') " +
                    "from InputStream#streamingml:clusTree(2, 10, 20, 5, 50, 8, y) " +
                    "select closestCentroidCoordinate1, closestCentroidCoordinate2, x, y " +
                    "insert into OutputStream;");
    try {
        SiddhiAppRuntime siddhiAppRuntime = siddhiManager.createSiddhiAppRuntime(inputStream + query);
    } catch (Exception e) {
        logger.info("Error caught");
        AssertJUnit.assertTrue(e instanceof SiddhiAppCreationException);
        AssertJUnit.assertTrue(e.getCause().getMessage().contains("6th parameter is not an attribute " +
                "(VariableExpressionExecutor) present in the stream definition. Found a " +
                "org.wso2.siddhi.core.executor.ConstantExpressionExecutor"));
    }
}
 
开发者ID:wso2-extensions,项目名称:siddhi-gpl-execution-streamingml,代码行数:22,代码来源:ClusTreeStreamProcessorExtensionTest.java

示例5: testClusTree2D_11

import org.wso2.siddhi.core.SiddhiManager; //导入依赖的package包/类
@Test
public void testClusTree2D_11() throws Exception {
    logger.info("ClusTreeStreamProcessorExtension Test - Test case to validate noOfClusters to be int");
    SiddhiManager siddhiManager = new SiddhiManager();
    String inputStream = "define stream InputStream (x double, y double);";

    String query = (
            "@info(name = 'query1') " +
                    "from InputStream#streamingml:clusTree(2.1, 10, 20, 5, 50, x, y) " +
                    "select closestCentroidCoordinate1, closestCentroidCoordinate2, x, y " +
                    "insert into OutputStream;");
    try {
        SiddhiAppRuntime siddhiAppRuntime = siddhiManager.createSiddhiAppRuntime(inputStream + query);
    } catch (Exception e) {
        logger.info("Error caught");
        AssertJUnit.assertTrue(e instanceof SiddhiAppCreationException);
        AssertJUnit.assertTrue(e.getCause().getMessage().contains("noOfClusters should be of type int but " +
                "found DOUBLE"));
    }
}
 
开发者ID:wso2-extensions,项目名称:siddhi-gpl-execution-streamingml,代码行数:21,代码来源:ClusTreeStreamProcessorExtensionTest.java

示例6: testClusTree2D_12

import org.wso2.siddhi.core.SiddhiManager; //导入依赖的package包/类
@Test
public void testClusTree2D_12() throws Exception {
    logger.info("ClusTreeStreamProcessorExtension Test - Test case to validate maxIterations to be int");
    SiddhiManager siddhiManager = new SiddhiManager();
    String inputStream = "define stream InputStream (x double, y double);";

    String query = (
            "@info(name = 'query1') " +
                    "from InputStream#streamingml:clusTree(2, 10.3f, 20, 5, 50, x, y) " +
                    "select closestCentroidCoordinate1, closestCentroidCoordinate2, x, y " +
                    "insert into OutputStream;");
    try {
        SiddhiAppRuntime siddhiAppRuntime = siddhiManager.createSiddhiAppRuntime(inputStream + query);
    } catch (Exception e) {
        logger.info("Error caught");
        AssertJUnit.assertTrue(e instanceof SiddhiAppCreationException);
        AssertJUnit.assertTrue(e.getCause().getMessage().contains("Maximum iterations should be of type int " +
                "but found FLOAT"));
    }
}
 
开发者ID:wso2-extensions,项目名称:siddhi-gpl-execution-streamingml,代码行数:21,代码来源:ClusTreeStreamProcessorExtensionTest.java

示例7: testClusTree2D_13

import org.wso2.siddhi.core.SiddhiManager; //导入依赖的package包/类
@Test
public void testClusTree2D_13() throws Exception {
    logger.info("ClusTreeStreamProcessorExtension Test - Test case to validate maxHeightOfTree " +
            "to be int");
    SiddhiManager siddhiManager = new SiddhiManager();
    String inputStream = "define stream InputStream (x double, y double);";

    String query = (
            "@info(name = 'query1') " +
                    "from InputStream#streamingml:clusTree(2, 10, 20, 5.4, 50, x, y) " +
                    "select closestCentroidCoordinate1, closestCentroidCoordinate2, x, y " +
                    "insert into OutputStream;");
    try {
        SiddhiAppRuntime siddhiAppRuntime = siddhiManager.createSiddhiAppRuntime(inputStream + query);
    } catch (Exception e) {
        logger.info("Error caught");
        AssertJUnit.assertTrue(e instanceof SiddhiAppCreationException);
        AssertJUnit.assertTrue(e.getCause().getMessage().contains("maxHeightOfTree should be of type int but " +
                "found DOUBLE"));
    }
}
 
开发者ID:wso2-extensions,项目名称:siddhi-gpl-execution-streamingml,代码行数:22,代码来源:ClusTreeStreamProcessorExtensionTest.java

示例8: testClusTree2D_15

import org.wso2.siddhi.core.SiddhiManager; //导入依赖的package包/类
@Test
public void testClusTree2D_15() throws Exception {
    logger.info("ClusTreeStreamProcessorExtension Test - Test case for incorrect type stream definition");
    SiddhiManager siddhiManager = new SiddhiManager();
    String inputStream = "define stream InputStream (x double, y String);";

    String query = (
            "@info(name = 'query1') " +
                    "from InputStream#streamingml:clusTree(2, 10, 20, 5, 50, x, y) " +
                    "select closestCentroidCoordinate1, closestCentroidCoordinate2, attribute_0, y " +
                    "insert into OutputStream;");
    try {
        SiddhiAppRuntime siddhiAppRuntime = siddhiManager.createSiddhiAppRuntime(inputStream + query);
    } catch (Exception e) {
        logger.info("Error caught");
        AssertJUnit.assertTrue(e instanceof SiddhiAppCreationException);
        AssertJUnit.assertTrue(e.getCause().getMessage().contains("model.features in 7th parameter is not a " +
                "numerical type attribute. Found STRING. Check the input stream definition."));
    }
}
 
开发者ID:wso2-extensions,项目名称:siddhi-gpl-execution-streamingml,代码行数:21,代码来源:ClusTreeStreamProcessorExtensionTest.java

示例9: testClusTree2D_16

import org.wso2.siddhi.core.SiddhiManager; //导入依赖的package包/类
@Test
public void testClusTree2D_16() throws Exception {
    logger.info("ClusTreeStreamProcessorExtension Test - Test case for testing the robustness of validations " +
            "when more stream attributes than needed are given");
    SiddhiManager siddhiManager = new SiddhiManager();
    String inputStream = "define stream InputStream (x double, y double, z String);";

    String query = (
            "@info(name = 'query1') " +
                    "from InputStream#streamingml:clusTree(2, 10, 20, 5, 50, x, y) " +
                    "select closestCentroidCoordinate1, closestCentroidCoordinate2, x, y " +
                    "insert into OutputStream;");
    try {
        SiddhiAppRuntime siddhiAppRuntime = siddhiManager.createSiddhiAppRuntime(inputStream + query);
    } catch (Exception e) {
        logger.info(e.getMessage());
    }
}
 
开发者ID:wso2-extensions,项目名称:siddhi-gpl-execution-streamingml,代码行数:19,代码来源:ClusTreeStreamProcessorExtensionTest.java

示例10: testClusTree2D_18

import org.wso2.siddhi.core.SiddhiManager; //导入依赖的package包/类
@Test
public void testClusTree2D_18() throws Exception {
    logger.info("ClusTreeStreamProcessorExtension Test - Test case to validate noOfClusters to be positive");
    SiddhiManager siddhiManager = new SiddhiManager();
    String inputStream = "define stream InputStream (x double, y double);";

    String query = (
            "@info(name = 'query1') " +
                    "from InputStream#streamingml:clusTree(-2, 10, 20, 2, 50, x, y) " +
                    "select closestCentroidCoordinate1, closestCentroidCoordinate2, x, y " +
                    "insert into OutputStream;");
    try {
        SiddhiAppRuntime siddhiAppRuntime = siddhiManager.createSiddhiAppRuntime(inputStream + query);
    } catch (Exception e) {
        logger.info("Error caught");
        AssertJUnit.assertTrue(e instanceof SiddhiAppCreationException);
        AssertJUnit.assertTrue(e.getCause().getMessage().contains("noOfClusters should be a positive integer " +
                "but found -2"));
    }
}
 
开发者ID:wso2-extensions,项目名称:siddhi-gpl-execution-streamingml,代码行数:21,代码来源:ClusTreeStreamProcessorExtensionTest.java

示例11: testClusTree2D_19

import org.wso2.siddhi.core.SiddhiManager; //导入依赖的package包/类
@Test
public void testClusTree2D_19() throws Exception {
    logger.info("ClusTreeStreamProcessorExtension Test - Test case to validate maxIterations to be positive");
    SiddhiManager siddhiManager = new SiddhiManager();
    String inputStream = "define stream InputStream (x double, y double);";

    String query = (
            "@info(name = 'query1') " +
                    "from InputStream#streamingml:clusTree(2, -10, 20, 2, 50, x, y) " +
                    "select closestCentroidCoordinate1, closestCentroidCoordinate2, x, y " +
                    "insert into OutputStream;");
    try {
        SiddhiAppRuntime siddhiAppRuntime = siddhiManager.createSiddhiAppRuntime(inputStream + query);
    } catch (Exception e) {
        logger.info("Error caught");
        AssertJUnit.assertTrue(e instanceof SiddhiAppCreationException);
        AssertJUnit.assertTrue(e.getCause().getMessage().contains("maxIterations should be a positive integer " +
                "but found -10"));
    }
}
 
开发者ID:wso2-extensions,项目名称:siddhi-gpl-execution-streamingml,代码行数:21,代码来源:ClusTreeStreamProcessorExtensionTest.java

示例12: testClusTree2D_21

import org.wso2.siddhi.core.SiddhiManager; //导入依赖的package包/类
@Test
public void testClusTree2D_21() throws Exception {
    logger.info("ClusTreeStreamProcessorExtension Test - Test case to validate maxHeightOfTree " +
            "to be above a minimum value to produce required noOfClusters");
    SiddhiManager siddhiManager = new SiddhiManager();
    String inputStream = "define stream InputStream (x double, y double);";

    String query = (
            "@info(name = 'query1') " +
                    "from InputStream#streamingml:clusTree(20, 10, 20, 2, 50, x, y) " +
                    "select closestCentroidCoordinate1, closestCentroidCoordinate2, x, y " +
                    "insert into OutputStream;");
    try {
        SiddhiAppRuntime siddhiAppRuntime = siddhiManager.createSiddhiAppRuntime(inputStream + query);
    } catch (Exception e) {
        logger.info("Error caught");
        AssertJUnit.assertTrue(e instanceof SiddhiAppCreationException);
        AssertJUnit.assertTrue(e.getCause().getMessage().contains("maxHeightOfTree should be an int greater " +
                "than 2.7268 but found 2"));
    }
}
 
开发者ID:wso2-extensions,项目名称:siddhi-gpl-execution-streamingml,代码行数:22,代码来源:ClusTreeStreamProcessorExtensionTest.java

示例13: testClusTree2D_22

import org.wso2.siddhi.core.SiddhiManager; //导入依赖的package包/类
@Test
public void testClusTree2D_22() throws Exception {
    logger.info("ClusTreeStreamProcessorExtension Test - Test case to validate horizon to be positive");
    SiddhiManager siddhiManager = new SiddhiManager();
    String inputStream = "define stream InputStream (x double, y double);";

    String query = (
            "@info(name = 'query1') " +
                    "from InputStream#streamingml:clusTree(2, 10, 20, 2, -50, x, y) " +
                    "select closestCentroidCoordinate1, closestCentroidCoordinate2, x, y " +
                    "insert into OutputStream;");
    try {
        SiddhiAppRuntime siddhiAppRuntime = siddhiManager.createSiddhiAppRuntime(inputStream + query);
    } catch (Exception e) {
        logger.info("Error caught");
        AssertJUnit.assertTrue(e instanceof SiddhiAppCreationException);
        AssertJUnit.assertTrue(e.getCause().getMessage().contains("horizon should be a positive integer but " +
                "found -50"));
    }
}
 
开发者ID:wso2-extensions,项目名称:siddhi-gpl-execution-streamingml,代码行数:21,代码来源:ClusTreeStreamProcessorExtensionTest.java

示例14: testClusTree2D_23

import org.wso2.siddhi.core.SiddhiManager; //导入依赖的package包/类
@Test
public void testClusTree2D_23() throws Exception {
    logger.info("ClusTreeStreamProcessorExtension Test - Test case with non existing stream");
    SiddhiManager siddhiManager = new SiddhiManager();
    //String inputStream = "define stream InputStream (x double, y double);";

    String query = (
            "@info(name = 'query1') " +
                    "from InputStream#streamingml:clusTree(2, 10, 20, 2, -50, x, y) " +
                    "select closestCentroidCoordinate1, closestCentroidCoordinate2, x, y " +
                    "insert into OutputStream;");
    try {
        SiddhiAppRuntime siddhiAppRuntime = siddhiManager.createSiddhiAppRuntime(query);
    } catch (Exception e) {
        logger.info("Error caught");
        AssertJUnit.assertTrue(e instanceof SiddhiParserException);
        AssertJUnit.assertTrue(e.getMessage().contains("Syntax error in SiddhiQL, no viable alternative at input "
                + "'@info(name = query1)"));
    }
}
 
开发者ID:wso2-extensions,项目名称:siddhi-gpl-execution-streamingml,代码行数:21,代码来源:ClusTreeStreamProcessorExtensionTest.java

示例15: testClusTree2D_25

import org.wso2.siddhi.core.SiddhiManager; //导入依赖的package包/类
@Test
public void testClusTree2D_25() throws Exception {
    logger.info("ClusTreeStreamProcessorExtension Test - Test case with less than 2 params");
    SiddhiManager siddhiManager = new SiddhiManager();
    String inputStream = "define stream InputStream (x double, y double);";

    String query = (
            "@info(name = 'query1') " +
                    "from InputStream#streamingml:clusTree(2) " +
                    "select closestCentroidCoordinate1, closestCentroidCoordinate2, x, y " +
                    "insert into OutputStream;");
    try {
        SiddhiAppRuntime siddhiAppRuntime = siddhiManager.createSiddhiAppRuntime(inputStream + query);
    } catch (Exception e) {
        logger.info("Error caught");
        AssertJUnit.assertTrue(e instanceof SiddhiAppCreationException);
        AssertJUnit.assertTrue(e.getCause().getMessage().contains("Invalid number of parameters. User can " +
                "either choose to give all 4 hyper parameters or none at all. So query can have between 2 or " +
                "7 but found 1 parameters"));
    }
}
 
开发者ID:wso2-extensions,项目名称:siddhi-gpl-execution-streamingml,代码行数:22,代码来源:ClusTreeStreamProcessorExtensionTest.java


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