• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java SiddhiAppCreationException类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: testClusTree2D_3

import org.wso2.siddhi.core.exception.SiddhiAppCreationException; //导入依赖的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_4

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

    String query = (
            "@info(name = 'query1') " +
                    "from InputStream#streamingml:clusTree(2, maxIterations, 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 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_5

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

    String query = (
            "@info(name = 'query1') " +
                    "from InputStream#streamingml:clusTree(2, 10, noOfEventsToRefreshMacroModel, " +
                    "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("noOfEventsToRefreshMacroModel has to be a " +
                "constant but found org.wso2.siddhi.core.executor.VariableExpressionExecutor"));
    }
}
 
开发者ID:wso2-extensions,项目名称:siddhi-gpl-execution-streamingml,代码行数:23,代码来源:ClusTreeStreamProcessorExtensionTest.java


示例4: testClusTree2D_6

import org.wso2.siddhi.core.exception.SiddhiAppCreationException; //导入依赖的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


示例5: testClusTree2D_7

import org.wso2.siddhi.core.exception.SiddhiAppCreationException; //导入依赖的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


示例6: testClusTree2D_9

import org.wso2.siddhi.core.exception.SiddhiAppCreationException; //导入依赖的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


示例7: testClusTree2D_10

import org.wso2.siddhi.core.exception.SiddhiAppCreationException; //导入依赖的package包/类
@Test
public void testClusTree2D_10() throws Exception {
    logger.info("ClusTreeStreamProcessorExtension Test - Test case to validate attribute_1 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, x, 3.1f) " +
                    "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("7th 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


示例8: testClusTree2D_11

import org.wso2.siddhi.core.exception.SiddhiAppCreationException; //导入依赖的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


示例9: testClusTree2D_12

import org.wso2.siddhi.core.exception.SiddhiAppCreationException; //导入依赖的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


示例10: testClusTree2D_13

import org.wso2.siddhi.core.exception.SiddhiAppCreationException; //导入依赖的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


示例11: testClusTree2D_15

import org.wso2.siddhi.core.exception.SiddhiAppCreationException; //导入依赖的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


示例12: testClusTree2D_17

import org.wso2.siddhi.core.exception.SiddhiAppCreationException; //导入依赖的package包/类
@Test
public void testClusTree2D_17() throws Exception {
    logger.info("ClusTreeStreamProcessorExtension Test - Test case to validate horizon 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, 2, 50.3f, 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 of type int but found FLOAT"));
    }
}
 
开发者ID:wso2-extensions,项目名称:siddhi-gpl-execution-streamingml,代码行数:20,代码来源:ClusTreeStreamProcessorExtensionTest.java


示例13: testClusTree2D_18

import org.wso2.siddhi.core.exception.SiddhiAppCreationException; //导入依赖的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


示例14: testClusTree2D_19

import org.wso2.siddhi.core.exception.SiddhiAppCreationException; //导入依赖的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


示例15: testClusTree2D_20

import org.wso2.siddhi.core.exception.SiddhiAppCreationException; //导入依赖的package包/类
@Test
public void testClusTree2D_20() throws Exception {
    logger.info("ClusTreeStreamProcessorExtension Test - Test case to validate noOfEventsToRefreshMacroModel " +
            "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("noOfEventsToRefreshMacroModel should be a " +
                "positive integer but found -20"));
    }
}
 
开发者ID:wso2-extensions,项目名称:siddhi-gpl-execution-streamingml,代码行数:22,代码来源:ClusTreeStreamProcessorExtensionTest.java


示例16: testClusTree2D_21

import org.wso2.siddhi.core.exception.SiddhiAppCreationException; //导入依赖的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


示例17: testClusTree2D_22

import org.wso2.siddhi.core.exception.SiddhiAppCreationException; //导入依赖的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


示例18: testClusTree2D_25

import org.wso2.siddhi.core.exception.SiddhiAppCreationException; //导入依赖的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


示例19: testClassificationStreamProcessorExtension2

import org.wso2.siddhi.core.exception.SiddhiAppCreationException; //导入依赖的package包/类
@Test
public void testClassificationStreamProcessorExtension2() throws InterruptedException {
    logger.info("HoeffdingClassifierStreamProcessorExtension TestCase - Features are not of numeric type");
    SiddhiManager siddhiManager = new SiddhiManager();

    String inStreamDefinition = "define stream StreamA (attribute_0 double, attribute_1 double, attribute_2 " +
            "double, attribute_3 bool );";
    String query = ("@info(name = 'query1') from StreamA#streamingml:hoeffdingTreeClassifier('model1', " +
            " attribute_0, attribute_1, attribute_2, attribute_3) \n" +
            "select attribute_0, attribute_1, attribute_2, attribute_3, prediction, confidenceLevel " +
            "insert into outputStream;");

    try {
        SiddhiAppRuntime siddhiAppRuntime = siddhiManager.createSiddhiAppRuntime(inStreamDefinition + query);
        AssertJUnit.fail();
    } catch (Exception e) {
        logger.error(e.getCause().getMessage());
        AssertJUnit.assertTrue(e instanceof SiddhiAppCreationException);
        AssertJUnit.assertTrue(e.getCause().getMessage().contains("model.features in 5th parameter is not " +
                "a numerical type attribute. Found BOOL. Check the input stream definition"));
    }
}
 
开发者ID:wso2-extensions,项目名称:siddhi-gpl-execution-streamingml,代码行数:23,代码来源:HoeffdingClassifierStreamProcessorExtensionTestCase.java


示例20: testClassificationStreamProcessorExtension3

import org.wso2.siddhi.core.exception.SiddhiAppCreationException; //导入依赖的package包/类
@Test
public void testClassificationStreamProcessorExtension3() throws InterruptedException {
    logger.info("HoeffdingClassifierStreamProcessorExtension TestCase - model.name is not String");
    SiddhiManager siddhiManager = new SiddhiManager();

    String inStreamDefinition = "define stream StreamA (attribute_0 double, attribute_1 double, attribute_2 " +
            "double, attribute_3 double );";
    String query = ("@info(name = 'query1') from StreamA#streamingml:hoeffdingTreeClassifier(123, " +
            "attribute_0, attribute_1, attribute_2, attribute_3) \n" + "" +
            "select attribute_0, attribute_1, attribute_2, attribute_3, prediction, confidenceLevel " +
            "insert into outputStream;");

    try {
        SiddhiAppRuntime siddhiAppRuntime = siddhiManager.createSiddhiAppRuntime(inStreamDefinition + query);
        AssertJUnit.fail();
    } catch (Exception e) {
        logger.error(e.getCause().getMessage());
        AssertJUnit.assertTrue(e instanceof SiddhiAppCreationException);
        AssertJUnit.assertTrue(e.getCause().getMessage().contains("Invalid parameter type found for " +
                "the model.name argument, required STRING but found INT"));
    }
}
 
开发者ID:wso2-extensions,项目名称:siddhi-gpl-execution-streamingml,代码行数:23,代码来源:HoeffdingClassifierStreamProcessorExtensionTestCase.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java EntityManagerFactoryInfo类代码示例发布时间:2022-05-22
下一篇:
Java IgnitePredicate类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap