eagle-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From haoch <...@git.apache.org>
Subject [GitHub] incubator-eagle pull request #709: EAGLE-818 implement CEPFunction
Date Sat, 03 Dec 2016 15:23:42 GMT
Github user haoch commented on a diff in the pull request:

    https://github.com/apache/incubator-eagle/pull/709#discussion_r90759169
  
    --- Diff: eagle-core/eagle-app/eagle-app-base/src/test/java/org/apache/eagle/app/stream/CEPFunctionTest.java
---
    @@ -29,22 +30,31 @@
         public void testSiddhiFunction() {
             CEPFunction function = new CEPFunction(
                 "define stream inputStream (name string, value double);\n "
    -                + "from inputStream#window.timeBatch( 1 min ) \n" +
    +                + "from inputStream#window.timeBatch( 10 sec ) \n" +
                     "select name, avg(value) as avgValue\n" +
                     "group by name \n" +
                     "insert into outputStream ",
                 "inputStream","outputStream");
             Collector collector = new Collector() {
                 @Override
                 public void collect(Object key, Map event) {
    -
    +                Assert.assertTrue(Double.valueOf(event.get("avgValue").toString()) ==
0.97);
                 }
             };
             function.open(collector);
             function.transform(new HashMap<String,Object>() {{
                 put("name","cpu.usage");
                 put("value", 0.98);
             }});
    +        function.transform(new HashMap<String,Object>() {{
    +            put("name","cpu.usage");
    +            put("value", 0.96);
    +        }});
    +        try {
    +            Thread.sleep(60000);
    --- End diff --
    
    Avoid use sleep in unit test especially,here sleep for `60s`, learn to use `Semaphore`
for *async unit test case*


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message