eagle-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From h..@apache.org
Subject [42/51] [partial] incubator-eagle git commit: EAGLE-184 Migrate eagle website from https://github.com/eaglemonitoring/eaglemonitoring.github.io to document branch
Date Thu, 03 Mar 2016 18:10:15 GMT
http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/0ea130ef/eagle-core/eagle-alert/eagle-alert-process/src/test/java/org/apache/eagle/alert/siddhi/TestExternalBatchWindow.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-alert/eagle-alert-process/src/test/java/org/apache/eagle/alert/siddhi/TestExternalBatchWindow.java b/eagle-core/eagle-alert/eagle-alert-process/src/test/java/org/apache/eagle/alert/siddhi/TestExternalBatchWindow.java
deleted file mode 100644
index 7903e0d..0000000
--- a/eagle-core/eagle-alert/eagle-alert-process/src/test/java/org/apache/eagle/alert/siddhi/TestExternalBatchWindow.java
+++ /dev/null
@@ -1,307 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *    http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.eagle.alert.siddhi;
-
-import java.text.MessageFormat;
-import java.util.Calendar;
-import java.util.Date;
-import java.util.Random;
-import java.util.concurrent.atomic.AtomicBoolean;
-import java.util.concurrent.atomic.AtomicInteger;
-
-import org.junit.AfterClass;
-import org.junit.Assert;
-import org.junit.BeforeClass;
-import org.junit.Test;
-import org.wso2.siddhi.core.ExecutionPlanRuntime;
-import org.wso2.siddhi.core.SiddhiManager;
-import org.wso2.siddhi.core.event.Event;
-import org.wso2.siddhi.core.query.output.callback.QueryCallback;
-import org.wso2.siddhi.core.stream.input.InputHandler;
-import org.wso2.siddhi.core.stream.output.StreamCallback;
-
-/**
- * @since Dec 23, 2015
- *
- */
-public class TestExternalBatchWindow {
-
-    private static SiddhiManager siddhiManager;
-    
-    @BeforeClass
-    public static void beforeClass() {
-        siddhiManager = new SiddhiManager();
-    }
-    
-    @AfterClass
-    public static void afterClass() {
-        siddhiManager.shutdown();
-    }
-
-    @Test
-    public void test02NoMsg() throws Exception {
-        ExecutionPlanRuntime runtime = simpleQueryRuntime();
-
-        final AtomicBoolean recieved = new AtomicBoolean();
-        runtime.addCallback("query", new QueryCallback() {
-
-            @Override
-            public void receive(long arg0, Event[] arg1, Event[] arg2) {
-                recieved.set(true);
-                System.out.println(arg1);
-            }
-        });
-
-        InputHandler input = runtime.getInputHandler("jmxMetric");
-
-        runtime.start();
-        // external events' time stamp less than the window, should not have event recieved in call back.
-        long now = System.currentTimeMillis();
-        int length = 5;
-        for (int i = 0; i < length; i++) {
-            input.send(new Object[] { 15, now + i * 1000 });
-        }
-        
-        Thread.sleep(1000);
-        Assert.assertFalse("Event happens inner external time batch window, should not have event recieved in callback!", recieved.get());
-
-        runtime.shutdown();
-    }
-
-    private ExecutionPlanRuntime simpleQueryRuntime() {
-        String query = "define stream jmxMetric(cpu int, timestamp long); " 
-                + "@info(name='query')"
-                + "from jmxMetric#window.eagle:externalTimeBatch(timestamp, 10 sec) " 
-                + "select avg(cpu) as avgCpu, count(1) as count insert into tmp;";
-
-        return siddhiManager.createExecutionPlanRuntime(query);
-    }
-
-    /**
-     * This case try to capture the case that the window get a chunk of event that exceed the time batch.
-     * In this case, two next processor should be triggered.
-     */
-    @Test
-    public void test03BunchChunkExceedBatch() {
-        // TODO
-    }
-    @Test
-    public void test04MultiThread() {
-        // TODO
-    }
-
-    @Test
-    public void test05ExternalJoin() {
-        // TODO
-    }
-    
-    @Test
-    public void test06EdgeCase() throws Exception {
-        // every 10 sec
-        ExecutionPlanRuntime runtime = simpleQueryRuntime();
-
-        final AtomicInteger recCount = new AtomicInteger(0);
-//        final CountDownLatch latch = new CountDownLatch(2);// for debug
-        runtime.addCallback("query", new QueryCallback() {
-            @Override
-            public void receive(long arg0, Event[] arg1, Event[] arg2) {
-//                latch.countDown();
-                Assert.assertEquals(1, arg1.length);
-                recCount.incrementAndGet();
-                int avgCpu = ((Double) arg1[0].getData()[0]).intValue();
-                if (recCount.get() == 1) {
-                    Assert.assertEquals(15, avgCpu);
-                } else if (recCount.get() == 2) {
-                    Assert.assertEquals(85, avgCpu);
-                }
-                int count = ((Long) arg1[0].getData()[1]).intValue();
-                Assert.assertEquals(3, count);
-            }
-        });
-
-        InputHandler input = runtime.getInputHandler("jmxMetric");
-        runtime.start();
-        // external events' time stamp less than the window, should not have event recieved in call back.
-        long now = 0;
-        int length = 3;
-        for (int i = 0; i < length; i++) {
-            input.send(new Object[] { 15, now + i * 10 });
-        }
-        
-        // second round
-        // if the trigger event mix with the last window, we should see the avgValue is not expected
-        for (int i = 0; i < length; i++) {
-            input.send(new Object[] { 85, now + 10000 + i * 10 }); // the first entity of the second round
-        }
-        // to trigger second round
-        input.send(new Object[] { 10000, now + 10 * 10000 });
-        
-//        latch.await();// for debug
-
-        Thread.sleep(1000);
-        
-        Assert.assertEquals(2, recCount.get());
-    }
-
-    @Test
-    public void test07Pull76() throws Exception {
-        String defaultStream = "define stream LoginEvents (myTime long, ip string, phone string,price int);";
-
-        String query = " @info(name='pull76') "
-                + " from LoginEvents#window.eagle:externalTimeBatch(myTime, 5 sec)  "
-                + " select myTime, phone, ip, price, count(ip) as cntip , "
-                + " min(myTime) as mintime, max(myTime) as maxtime "
-                + " insert into events ;";
-        
-        ExecutionPlanRuntime runtime = siddhiManager.createExecutionPlanRuntime(defaultStream + query);
-
-        InputHandler inputHandler = runtime.getInputHandler("LoginEvents");
-
-        runtime.addCallback("pull76", new QueryCallback() {
-            @Override
-            public void receive(long timeStamp, Event[] inEvents, Event[] removeEvents) {
-                if (inEvents != null) {
-                    System.out.println("======================== START ===============================");
-                    int i = 0;
-                    System.out.println(" Events Size:" + inEvents.length);
-                    for (i = 0; i < inEvents.length; i++) {
-                        Event e = inEvents[i];
-                        System.out.println("----------------------------");
-                        System.out.println(new Date((Long) e.getData(0)));
-                        System.out.println("IP:" + e.getData(2));
-                        System.out.println("price :" + e.getData(3));
-                        System.out.println("count :" + e.getData(4));
-                        System.out.println("mintime :" + new Date((Long) e.getData(5)) );
-                        System.out.println("maxtime :" + new Date((Long) e.getData(6)) );
-                        System.out.println("----------------------------");
-                    }
-                    System.out.println("======================== END  ===============================");
-
-                }
-            }
-        });
-        
-        
-        runtime.start();
-        
-        long start = System.currentTimeMillis();
-        Calendar c = Calendar.getInstance();
-        c.add(Calendar.HOUR, 1);
-        c.add(Calendar.SECOND, 1);
-        int i = 0;
-        for (i = 0; i <= 10000; i++) {
-            c.add(Calendar.SECOND, 1);
-            inputHandler.send(c.getTime().getTime(),
-                    new Object[] { c.getTime().getTime(), new String("192.10.1.1"), "1", new Random().nextInt(1000) });
-        }
-        long end = System.currentTimeMillis();
-        System.out.printf("End : %d ", end - start);
-
-        Thread.sleep(1000);
-        runtime.shutdown();
-    }
-    
-    @Test
-    public void test01DownSampling() throws Exception {
-        String stream = "define stream jmxMetric(cpu int, memory int, bytesIn long, bytesOut long, timestamp long);";
-        String query = "@info(name = 'downSample') " 
-                + "from jmxMetric#window.eagle:externalTimeBatch(timestamp, 10 sec) "
-                + "select "
-                + "avg(cpu) as avgCpu, max(cpu) as maxCpu, min(cpu) as minCpu, "
-                + " '|' as s, "
-                + " avg(memory) as avgMem, max(memory) as maxMem, min(memory) as minMem, "
-                + " '|' as s1, "
-                + " avg(bytesIn) as avgBytesIn, max(bytesIn) as maxBytesIn, min(bytesIn) as minBytesIn, "
-                + " '|' as s2, "
-                + " avg(bytesOut) as avgBytesOut, max(bytesOut) as maxBytesOut, min(bytesOut) as minBytesOut, " 
-                + " '|' as s3, "
-                + " timestamp as timeWindowEnds, "
-                + " '|' as s4, "
-                + " count(1) as metric_count "
-                + " INSERT INTO tmp;";
-
-        SiddhiManager sm = new SiddhiManager();
-        ExecutionPlanRuntime plan = sm.createExecutionPlanRuntime(stream + query);
-
-        InputHandler input = plan.getInputHandler("jmxMetric");
-
-        // stream call back doesn't follow the counter
-        final AtomicInteger counter = new AtomicInteger();
-        {
-            // stream callback
-            plan.addCallback("jmxMetric", new StreamCallback() {
-                @Override
-                public void receive(Event[] arg0) {
-                    counter.addAndGet(arg0.length);
-                }
-            });
-        }
-        final AtomicInteger queryWideCounter = new AtomicInteger();
-        {
-            plan.addCallback("downSample", new QueryCallback() {
-                @Override
-                public void receive(long arg0, Event[] inevents, Event[] removeevents) {
-                    int currentCount = queryWideCounter.addAndGet(inevents.length);
-                    System.out.println(MessageFormat.format("Round {0} ====", currentCount));
-                    System.out.println(" events count " + inevents.length);
-
-                    for (Event e : inevents) {
-                        Object[] tranformedData = e.getData();
-                        for (Object o : tranformedData) {
-                            System.out.print(o);
-                            System.out.print(' ');
-                        }
-                        System.out.println(" events endendend");
-                    }
-                }
-
-            });
-        }
-
-        plan.start();
-
-        int round = 4;
-        int eventsPerRound= 0;
-        long externalTs = System.currentTimeMillis();
-        for (int i = 0; i < round; i++) {
-            eventsPerRound = sendEvent(input, i, externalTs);
-            Thread.sleep(3000);
-        }
-        //
-        sendEvent(input, round, externalTs);
-
-        plan.shutdown();
-        Thread.sleep(1000);
-        Assert.assertEquals(round * eventsPerRound + eventsPerRound, counter.get());
-        Assert.assertEquals(round, queryWideCounter.get());
-    }
-
-    // one round of sending events
-    private int sendEvent(InputHandler input, int ite, long externalTs) throws Exception {
-        int len = 3;
-        Event[] events = new Event[len];
-        for (int i = 0; i < len; i++) {
-            // cpu int, memory int, bytesIn long, bytesOut long, timestamp long
-            events[i] = new Event(externalTs,
-                    new Object[] { 15 + 10 * i * ite, 1500 + 10 * i * ite, 1000L, 2000L, externalTs + ite * 10000 + i * 50 });
-        }
-
-        input.send(events);
-        return len;
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/0ea130ef/eagle-core/eagle-alert/eagle-alert-process/src/test/java/org/apache/eagle/alert/siddhi/TestSiddhiEngine.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-alert/eagle-alert-process/src/test/java/org/apache/eagle/alert/siddhi/TestSiddhiEngine.java b/eagle-core/eagle-alert/eagle-alert-process/src/test/java/org/apache/eagle/alert/siddhi/TestSiddhiEngine.java
deleted file mode 100644
index acead47..0000000
--- a/eagle-core/eagle-alert/eagle-alert-process/src/test/java/org/apache/eagle/alert/siddhi/TestSiddhiEngine.java
+++ /dev/null
@@ -1,243 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *    http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.eagle.alert.siddhi;
-
-import java.lang.reflect.Field;
-
-import org.apache.eagle.alert.executor.AlertExecutor;
-import junit.framework.Assert;
-import org.junit.Test;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.wso2.siddhi.core.ExecutionPlanRuntime;
-import org.wso2.siddhi.core.SiddhiManager;
-import org.wso2.siddhi.core.event.Event;
-import org.wso2.siddhi.core.query.output.callback.QueryCallback;
-import org.wso2.siddhi.core.stream.input.InputHandler;
-import org.wso2.siddhi.core.util.EventPrinter;
-
-public class TestSiddhiEngine {
-    static final Logger log = LoggerFactory.getLogger(TestSiddhiEngine.class);
-    int alertCount = 0;
-
-    @Test
-    public void TestStrContains() throws Exception {
-        alertCount = 0;
-        SiddhiManager siddhiManager = new SiddhiManager();
-
-        String cseEventStream = "" +
-                "@config(async = 'true') " +
-                "define stream typeStream (cmd string, src string, dst string) ;";
-        String queryString = "" +
-                "@info(name = 'query1') " +
-                "from typeStream[(cmd == 'rename') and (src == '/tmp/pii') and (str:contains(dst,'/user/hdfs/.Trash/Current/tmp/pii')==true)] " +
-                "select cmd, src, dst " +
-                "insert into outputStream ;";
-
-        ExecutionPlanRuntime executionPlanRuntime = siddhiManager.createExecutionPlanRuntime(cseEventStream + queryString);
-
-        QueryCallback callback = new QueryCallback() {
-            @Override
-            public void receive(long timeStamp, Event[] inEvents, Event[] removeEvents) {
-                EventPrinter.print(timeStamp, inEvents, removeEvents);
-                alertCount++;
-            }
-        };
-        executionPlanRuntime.addCallback("query1", callback);
-
-        InputHandler inputHandler = executionPlanRuntime.getInputHandler("typeStream");
-        executionPlanRuntime.start();
-        inputHandler.send(new Object[]{"rename", "/tmp/pii", "/user/hdfs/.Trash/Current/tmp/pii"});
-        Thread.sleep(100);
-        Assert.assertTrue(alertCount == 1);
-        executionPlanRuntime.shutdown();
-    }
-
-    @Test
-    public void TestRegexp() throws Exception {
-        alertCount = 0;
-        SiddhiManager siddhiManager = new SiddhiManager();
-
-        String cseEventStream = "" +
-                "@config(async = 'true') " +
-                "define stream typeStream (str string, other string, num double) ;";
-        String queryString = "" +
-                "@info(name = 'query1') " +
-                "from typeStream " +
-                "select str as str1, other as other1 , num as num1, count(num) as number " +
-                "having str:regexp(str1, '/usr/data/[0-9]+/[0-9]+/[0-9]+') == true " + 
-                "insert into outputStream ;";
-
-        ExecutionPlanRuntime executionPlanRuntime = siddhiManager.createExecutionPlanRuntime(cseEventStream + queryString);
-
-        QueryCallback callback = new QueryCallback() {
-            @Override
-            public void receive(long timeStamp, Event[] inEvents, Event[] removeEvents) {
-                alertCount++;
-                EventPrinter.print(timeStamp, inEvents, removeEvents);
-            }
-        };
-        
-        executionPlanRuntime.addCallback("query1", callback);
-
-        InputHandler inputHandler = executionPlanRuntime.getInputHandler("typeStream");
-        executionPlanRuntime.start();
-        inputHandler.send(new Object[]{"/usr/data/000/001/002", "other", 1.0});
-        Thread.sleep(100);
-        Assert.assertTrue(alertCount == 1);
-        executionPlanRuntime.shutdown();
-    }
-
-    @Test
-    public void TestStrEqualsIgnoreCase() throws Exception {
-        alertCount = 0;
-        SiddhiManager siddhiManager = new SiddhiManager();
-
-        String cseEventStream = "define stream typeStream (cmd string, src string, dst string) ;";
-        String queryString = "" +
-                "@info(name = 'query1') " +
-                "from typeStream[(cmd == 'rename') and (src == '/tmp/pii') and (str:equalsIgnoreCase(dst,'/user/hdfs/.TRAsh/current/TMP/PII')==true)] " +
-                "select cmd, src, dst " +
-                "insert into outputStream ;";
-
-        ExecutionPlanRuntime executionPlanRuntime = siddhiManager.createExecutionPlanRuntime(cseEventStream + queryString);
-
-        QueryCallback callback = new QueryCallback() {
-            @Override
-            public void receive(long timeStamp, Event[] inEvents, Event[] removeEvents) {
-                alertCount++;
-                EventPrinter.print(timeStamp, inEvents, removeEvents);
-            }
-        };
-
-        executionPlanRuntime.addCallback("query1", callback);
-
-        Field field = QueryCallback.class.getDeclaredField("query");
-        field.setAccessible(true);
-
-        InputHandler inputHandler = executionPlanRuntime.getInputHandler("typeStream");
-        executionPlanRuntime.start();
-        inputHandler.send(new Object[]{"rename", "/tmp/pii", "/user/HDFS/.Trash/Current/TMP/pii"}); // match case
-        inputHandler.send(new Object[]{"rename", "/tmp/pii", "/user/HDFS/.Trash///Current/TMP/pii"}); //non-match case
-        Thread.sleep(100);
-        Assert.assertTrue(alertCount == 1);
-        executionPlanRuntime.shutdown();
-    }
-
-    @Test
-    public void TestStrContainsIgnoreCase() throws Exception {
-        alertCount = 0;
-        SiddhiManager siddhiManager = new SiddhiManager();
-
-        String cseEventStream = "define stream typeStream (cmd string, src string, dst string) ;";
-        String queryString = "" +
-                "@info(name = 'query1') " +
-                "from typeStream[(cmd == 'rename') and (src == '/tmp/pii') and (str:containsIgnoreCase(dst,'.TRASH/CURRENT/tMp/pII')==true)] " +
-                "select cmd, src, dst " +
-                "insert into outputStream ;";
-
-        ExecutionPlanRuntime executionPlanRuntime = siddhiManager.createExecutionPlanRuntime(cseEventStream + queryString);
-
-        QueryCallback callback = new QueryCallback() {
-            @Override
-            public void receive(long timeStamp, Event[] inEvents, Event[] removeEvents) {
-                EventPrinter.print(timeStamp, inEvents, removeEvents);
-                alertCount++;
-            }
-        };
-
-        executionPlanRuntime.addCallback("query1", callback);
-
-        Field field = QueryCallback.class.getDeclaredField("query");
-        field.setAccessible(true);
-
-        InputHandler inputHandler = executionPlanRuntime.getInputHandler("typeStream");
-        executionPlanRuntime.start();
-        inputHandler.send(new Object[]{"rename", "/tmp/pii", "/user/hdfs/.Trash/Current/TMP/pii"}); // match case
-        inputHandler.send(new Object[]{"rename", "/tmp/pii", "/user/hdfs/.Trash///Current/TMP/pii"}); //non-match case
-        Thread.sleep(100);
-        Assert.assertTrue(alertCount == 1);
-        executionPlanRuntime.shutdown();
-    }
-
-    @Test
-    public void TestRegexpIgnoreCase() throws Exception {
-        alertCount = 0;
-        SiddhiManager siddhiManager = new SiddhiManager();
-
-        String cseEventStream = "define stream typeStream (str string, other string, num double) ;";
-        String queryString = "" +
-                "@info(name = 'query1') " +
-                "from typeStream " +
-                "select str as str1, other as other1 , num as num1, count(num) as number " +
-                "having str:regexpIgnoreCase(str1, '/usr/DATA/[0-9]+/[0-9]+/[0-9]+') == true " +
-                "insert into outputStream ;";
-
-        ExecutionPlanRuntime executionPlanRuntime = siddhiManager.createExecutionPlanRuntime(cseEventStream + queryString);
-
-        QueryCallback callback = new QueryCallback() {
-            @Override
-            public void receive(long timeStamp, Event[] inEvents, Event[] removeEvents) {
-                alertCount++;
-                EventPrinter.print(timeStamp, inEvents, removeEvents);
-            }
-        };
-        executionPlanRuntime.addCallback("query1", callback);
-
-        InputHandler inputHandler = executionPlanRuntime.getInputHandler("typeStream");
-        executionPlanRuntime.start();
-        inputHandler.send(new Object[]{"/USR/data/000/001/002", "other", 1.0});
-        Thread.sleep(100);
-        Assert.assertTrue(alertCount == 1);
-        executionPlanRuntime.shutdown();
-    }
-    
-    @Test
-    public void TestDataObject() throws Exception {
-        alertCount = 0;
-        SiddhiManager siddhiManager = new SiddhiManager();
-        
-        String cseEventStream = "" +
-                "@config(async = 'true') " +
-                "define stream typeStream (dataobj object, str string, first string) ;";
-        String queryString = "" +
-                "@info(name = 'query1') " +
-                "from typeStream " +
-                "select * " +
-                "having str:regexp(str, '/usr/data/[0-9]+/[0-9]+/[0-9]+') == true " + 
-                "insert into outputStream ;";
-
-        ExecutionPlanRuntime executionPlanRuntime = siddhiManager.createExecutionPlanRuntime(cseEventStream + queryString);
-
-        QueryCallback callback = new QueryCallback() {
-            @Override
-           public void receive(long timeStamp, Event[] inEvents, Event[] removeEvents) {
-                alertCount++;
-                EventPrinter.print(timeStamp, inEvents, removeEvents);
-            }
-        };
-
-        executionPlanRuntime.addCallback("query1", callback);
-
-        InputHandler inputHandler = executionPlanRuntime.getInputHandler("typeStream");
-        executionPlanRuntime.start();
-        inputHandler.send(new Object[]{new AlertExecutor(queryString, null, 0, 1, null, null), "/usr/data/000/001/002", "second"});
-        Thread.sleep(100);
-        Assert.assertTrue(alertCount == 1);
-        executionPlanRuntime.shutdown();
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/0ea130ef/eagle-core/eagle-alert/eagle-alert-process/src/test/java/org/apache/eagle/alert/siddhi/TestSiddhiSlideWindow.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-alert/eagle-alert-process/src/test/java/org/apache/eagle/alert/siddhi/TestSiddhiSlideWindow.java b/eagle-core/eagle-alert/eagle-alert-process/src/test/java/org/apache/eagle/alert/siddhi/TestSiddhiSlideWindow.java
deleted file mode 100644
index 521317c..0000000
--- a/eagle-core/eagle-alert/eagle-alert-process/src/test/java/org/apache/eagle/alert/siddhi/TestSiddhiSlideWindow.java
+++ /dev/null
@@ -1,129 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *    http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.eagle.alert.siddhi;
-
-import org.junit.Assert;
-import org.junit.Test;
-import org.wso2.siddhi.core.ExecutionPlanRuntime;
-import org.wso2.siddhi.core.SiddhiManager;
-import org.wso2.siddhi.core.event.Event;
-import org.wso2.siddhi.core.query.output.callback.QueryCallback;
-import org.wso2.siddhi.core.stream.input.InputHandler;
-import org.wso2.siddhi.core.util.EventPrinter;
-
-import org.apache.eagle.common.DateTimeUtil;
-
-public class TestSiddhiSlideWindow {
-
-    int alertCount = 0;
-
-    @Test
-    public void testSlideWindow1() throws Exception{
-        alertCount = 0;
-        SiddhiManager siddhiManager = new SiddhiManager();
-
-        String cseEventStream = "define stream eventStream (user string, path string, cmd string);";
-//        String query = "@info(name = 'query1') from eventStream[cmd == 'open' AND str:regexp(path, '/usr/data/[0-9]+/[0-9]+/[0-9]+')]#window.time(1 sec)"
-//        		     + " select user, path, cmd, count(path) as cnt" 
-//        			 + " group by user"
-//        			 + " having cnt > 3 insert all events into outputStream;";
-
-//        String query = "@info(name = 'query1') from eventStream[cmd == 'open' AND str:regexp(path, '/usr/data/[0-9]+/[0-9]+/[0-9]+')]#window.length(10)"
-//        		+ " select user, path, cmd, count(path) as cnt" 
-//        		+ " group by user"
-//        		+ " having cnt > 3 insert all events into outputStream;";
-
-//      String query = "@info(name = 'query1') from eventStream[cmd == 'open' AND str:regexp(path, '/usr/data/[0-9]+/[0-9]+/[0-9]+')]#window.timeBatch(1 sec)"
-//				+ " select user, path, cmd, count(path) as cnt" 
-//				+ " group by user"
-//				+ " having cnt > 3 insert all events into outputStream;";
-
-        String query = "@info(name = 'query1') from eventStream[cmd == 'open' AND str:regexp(path, '/usr/data/[0-9]+/[0-9]+/[0-9]+')]#window.lengthBatch(10)"
-                + " select user, path, cmd, count(path) as cnt"
-                + " group by user"
-                + " having cnt > 3 insert all events into outputStream;";
-
-        ExecutionPlanRuntime executionPlanRuntime = siddhiManager.createExecutionPlanRuntime(cseEventStream + query);
-
-        executionPlanRuntime.addCallback("query1", new QueryCallback() {
-            @Override
-            public void receive(long timeStamp, Event[] inEvents, Event[] removeEvents) {
-                EventPrinter.print(timeStamp, inEvents, removeEvents);
-                alertCount++;
-            }
-        });
-
-        InputHandler inputHandler = executionPlanRuntime.getInputHandler("eventStream");
-        executionPlanRuntime.start();
-        inputHandler.send(new Object[]{"user", "/usr/data/0000/0000/0000", "open"});
-        inputHandler.send(new Object[]{"user", "/usr/data/0000/0000/1111", "open"});
-        inputHandler.send(new Object[]{"user", "/usr/data/0000/0000/2222", "open"});
-        inputHandler.send(new Object[]{"user", "/usr/data/0000/0000/3333", "open"});
-
-        inputHandler.send(new Object[]{"user", "/usr/data/1111/0000/0000", "open"});
-        inputHandler.send(new Object[]{"user", "/usr/data/1111/0000/1111", "open"});
-
-        inputHandler.send(new Object[]{"user", "/usr/data/2222/0000/0000", "open"});
-        inputHandler.send(new Object[]{"user", "/usr/data/2222/0000/1111", "open"});
-        inputHandler.send(new Object[]{"user", "/usr/data/2222/0000/2222", "open"});
-        Thread.sleep(100);
-        Assert.assertTrue(alertCount == 0);
-        inputHandler.send(new Object[]{"user", "/usr/data/2222/0000/3333", "open"});
-        Thread.sleep(100);
-        Assert.assertTrue(alertCount == 1);
-        executionPlanRuntime.shutdown();
-    }
-
-    @Test
-    public void testSlideWindow2() throws Exception{
-        alertCount = 0;
-        SiddhiManager siddhiManager = new SiddhiManager();
-
-        String cseEventStream = "define stream eventStream (timeStamp long, user string, path string, cmd string);";
-        String query = "@info(name = 'query1') from eventStream[cmd == 'open' AND str:regexp(path, '/usr/data/[0-9]+/[0-9]+/[0-9]+')]#window.externalTime(timeStamp,1 sec)"
-                + " select user, path, cmd, count(path) as cnt"
-                + " group by user"
-                + " having cnt > 3 insert all events into outputStream;";
-
-        ExecutionPlanRuntime executionPlanRuntime = siddhiManager.createExecutionPlanRuntime(cseEventStream + query);
-
-        executionPlanRuntime.addCallback("query1", new QueryCallback() {
-            @Override
-            public void receive(long timeStamp, Event[] inEvents, Event[] removeEvents) {
-                alertCount++;
-                EventPrinter.print(timeStamp, inEvents, removeEvents);
-            }
-        });
-
-        InputHandler inputHandler = executionPlanRuntime.getInputHandler("eventStream");
-        executionPlanRuntime.start();
-        long curTime = DateTimeUtil.humanDateToMilliseconds("2015-09-17 00:00:00,000");
-        inputHandler.send(new Object[]{curTime, "user", "/usr/data/0000/0000/0000", "open"});
-        Thread.sleep(1100);
-        inputHandler.send(new Object[]{curTime, "user", "/usr/data/0000/0000/1111", "open"});
-        Thread.sleep(100);
-        inputHandler.send(new Object[]{curTime, "user", "/usr/data/0000/0000/2222", "open"});
-        Thread.sleep(100);
-        inputHandler.send(new Object[]{curTime, "user", "/usr/data/0000/0000/3333", "open"});
-        Thread.sleep(100);
-        Assert.assertTrue(alertCount == 1);
-        inputHandler.send(new Object[]{curTime, "user", "/usr/data/0000/0000/5555", "open"});
-        Thread.sleep(100);
-        Assert.assertTrue(alertCount == 2);
-        executionPlanRuntime.shutdown();
-    }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/0ea130ef/eagle-core/eagle-alert/eagle-alert-process/src/test/java/org/apache/eagle/alert/siddhi/TestSiddhiStream.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-alert/eagle-alert-process/src/test/java/org/apache/eagle/alert/siddhi/TestSiddhiStream.java b/eagle-core/eagle-alert/eagle-alert-process/src/test/java/org/apache/eagle/alert/siddhi/TestSiddhiStream.java
deleted file mode 100644
index 0027bce..0000000
--- a/eagle-core/eagle-alert/eagle-alert-process/src/test/java/org/apache/eagle/alert/siddhi/TestSiddhiStream.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *    http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.eagle.alert.siddhi;
-
-import org.apache.eagle.policy.siddhi.SiddhiPolicyEvaluator;
-import org.junit.Assert;
-import org.junit.Test;
-
-
-public class TestSiddhiStream {
-	
-	@Test
-	public void test() {
-		String rule = "from hiveAccessLogStream[sensitivityType=='PHONE_NUMBER'] select user,timestamp,resource,define stream hdfsAuditLogEventStream(eagleAlertContext object, allowed string,cmd string,dst string,host string,securityZone string,sensitivityType string,src string,timestamp long,user string); @info(name = 'query') from hdfsAuditLogEventStream[cmd=='open'] select * insert into outputStream ; insert into outputStream;";
-		Assert.assertFalse(SiddhiPolicyEvaluator.addContextFieldIfNotExist(rule).equals(rule));
-		
-		rule = "from hiveAccessLogStream[sensitivityType=='PHONE_NUMBER'] select    * insert into outputStream;";
-		Assert.assertTrue(SiddhiPolicyEvaluator.addContextFieldIfNotExist(rule).equals(rule));
-	}
-}

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/0ea130ef/eagle-core/eagle-alert/eagle-alert-process/src/test/java/org/apache/eagle/alert/state/TestAggregation.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-alert/eagle-alert-process/src/test/java/org/apache/eagle/alert/state/TestAggregation.java b/eagle-core/eagle-alert/eagle-alert-process/src/test/java/org/apache/eagle/alert/state/TestAggregation.java
deleted file mode 100644
index adcd728..0000000
--- a/eagle-core/eagle-alert/eagle-alert-process/src/test/java/org/apache/eagle/alert/state/TestAggregation.java
+++ /dev/null
@@ -1,98 +0,0 @@
-/*
- *
- *  * Licensed to the Apache Software Foundation (ASF) under one or more
- *  * contributor license agreements.  See the NOTICE file distributed with
- *  * this work for additional information regarding copyright ownership.
- *  * The ASF licenses this file to You under the Apache License, Version 2.0
- *  * (the "License"); you may not use this file except in compliance with
- *  * the License.  You may obtain a copy of the License at
- *  *
- *  *    http://www.apache.org/licenses/LICENSE-2.0
- *  *
- *  * Unless required by applicable law or agreed to in writing, software
- *  * distributed under the License is distributed on an "AS IS" BASIS,
- *  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  * See the License for the specific language governing permissions and
- *  * limitations under the License.
- *
- */
-
-package org.apache.eagle.alert.state;
-
-import java.util.concurrent.atomic.AtomicInteger;
-
-import org.junit.Test;
-import org.wso2.siddhi.core.ExecutionPlanRuntime;
-import org.wso2.siddhi.core.SiddhiManager;
-import org.wso2.siddhi.core.event.Event;
-import org.wso2.siddhi.core.query.output.callback.QueryCallback;
-import org.wso2.siddhi.core.stream.input.InputHandler;
-
-import junit.framework.Assert;
-import org.wso2.siddhi.core.util.EventPrinter;
-
-public class TestAggregation {
-    @Test
-    public void test01DownSampling() throws Exception {
-        String stream = "define stream jmxMetric(cpu double, memory int, bytesIn int, bytesOut long, timestamp long);";
-        String query = "@info(name = 'downSample') "
-                + "from jmxMetric#window.timeBatch(1 sec) "
-                + "select "
-                + " min(cpu) as minCpu, max(cpu) as maxCpu, avg(cpu) as avgCpu, "
-                + " min(memory) as minMem, max(memory) as maxMem, avg(memory) as avgMem, "
-                + " min(bytesIn) as minBytesIn, max(bytesIn) as maxBytesIn, avg(bytesIn) as avgBytesIn, sum(bytesIn) as totalBytesIn, "
-                + " min(bytesOut) as minBytesOut, max(bytesOut) as maxBytesOut, avg(bytesOut) as avgBytesOut, sum(bytesOut) as totalBytesOut, "
-                + " timestamp as timeWindowEnds "
-                + " INSERT  INTO tmp;";
-
-        SiddhiManager sm = new SiddhiManager();
-        ExecutionPlanRuntime plan = sm.createExecutionPlanRuntime(stream + query);
-
-        final AtomicInteger counter = new AtomicInteger();
-        plan.addCallback("downSample", new QueryCallback() {
-            @Override
-            public void receive(long timeStamp, Event[] inEvents, Event[] removeEvents) {
-                EventPrinter.print(timeStamp, inEvents, removeEvents);
-                int count = counter.incrementAndGet();
-                if (count == 1) {
-                    Assert.assertEquals(6000L, inEvents[0].getData(9));
-                } else if(count == 2) {
-                    Assert.assertEquals(6000L, inEvents[0].getData(9));
-                }
-            }
-        });
-        InputHandler input = plan.getInputHandler("jmxMetric");
-
-        plan.start();
-        sendEvent(input);
-        Thread.sleep(100);
-        sendEvent(input);
-        Thread.sleep(1000);
-        sendEvent(input);
-        Thread.sleep(1000);
-        sendEvent(input);
-        Thread.sleep(200);
-        plan.shutdown();
-    }
-
-    // send 3 events
-    private void sendEvent(InputHandler input) throws Exception {
-        int len = 3;
-        Event[] events = new Event[len];
-        for (int i = 0; i < len; i++) {
-            long externalTs = System.currentTimeMillis();
-            // cpu int, memory int, bytesIn long, bytesOut long, timestamp long
-            events[i] = new Event(externalTs + i, new Object[] {
-                    15.0,
-                    15,
-                    1000,
-                    2000L,
-                    externalTs + i
-            });
-        }
-
-        for (Event e : events) {
-            input.send(e);
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/0ea130ef/eagle-core/eagle-alert/eagle-alert-process/src/test/java/org/apache/eagle/alert/state/TestSiddhiExpiredEvents.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-alert/eagle-alert-process/src/test/java/org/apache/eagle/alert/state/TestSiddhiExpiredEvents.java b/eagle-core/eagle-alert/eagle-alert-process/src/test/java/org/apache/eagle/alert/state/TestSiddhiExpiredEvents.java
deleted file mode 100644
index e0be82c..0000000
--- a/eagle-core/eagle-alert/eagle-alert-process/src/test/java/org/apache/eagle/alert/state/TestSiddhiExpiredEvents.java
+++ /dev/null
@@ -1,129 +0,0 @@
-/*
- *
- *  * Licensed to the Apache Software Foundation (ASF) under one or more
- *  * contributor license agreements.  See the NOTICE file distributed with
- *  * this work for additional information regarding copyright ownership.
- *  * The ASF licenses this file to You under the Apache License, Version 2.0
- *  * (the "License"); you may not use this file except in compliance with
- *  * the License.  You may obtain a copy of the License at
- *  *
- *  *    http://www.apache.org/licenses/LICENSE-2.0
- *  *
- *  * Unless required by applicable law or agreed to in writing, software
- *  * distributed under the License is distributed on an "AS IS" BASIS,
- *  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  * See the License for the specific language governing permissions and
- *  * limitations under the License.
- *
- */
-
-package org.apache.eagle.alert.state;
-
-import org.junit.Assert;
-import org.junit.Test;
-import org.wso2.siddhi.core.ExecutionPlanRuntime;
-import org.wso2.siddhi.core.SiddhiManager;
-import org.wso2.siddhi.core.event.Event;
-import org.wso2.siddhi.core.query.output.callback.QueryCallback;
-import org.wso2.siddhi.core.stream.input.InputHandler;
-import org.wso2.siddhi.core.util.EventPrinter;
-
-/**
- * Created by yonzhang on 11/25/15.
- */
-public class TestSiddhiExpiredEvents {
-    @Test
-    public void testExpiredEventsInLengthWindow() throws Exception{
-        SiddhiManager siddhiManager = new SiddhiManager();
-
-        String cseEventStream = "define stream TempStream (user string, cmd string);";
-        String query = "@info(name = 'query1') from TempStream#window.length(3) "
-                + " select *"
-                + " insert all events into DelayedTempStream";
-
-        ExecutionPlanRuntime executionPlanRuntime = siddhiManager.createExecutionPlanRuntime(cseEventStream + query);
-
-        executionPlanRuntime.addCallback("query1", new QueryCallback() {
-            @Override
-            public void receive(long timeStamp, Event[] inEvents, Event[] removeEvents) {
-                EventPrinter.print(timeStamp, inEvents, removeEvents);
-            }
-        });
-
-        InputHandler inputHandler = executionPlanRuntime.getInputHandler("TempStream");
-        executionPlanRuntime.start();
-        inputHandler.send(new Object[]{"user", "open1"});
-        inputHandler.send(new Object[]{"user", "open2"});
-        inputHandler.send(new Object[]{"user", "open3"});
-        inputHandler.send(new Object[]{"user", "open4"});
-        inputHandler.send(new Object[]{"user", "open5"});
-        inputHandler.send(new Object[]{"user", "open6"});
-        Thread.sleep(1000);
-        executionPlanRuntime.shutdown();
-    }
-
-    @Test
-    public void testExpiredEventsInLengthBatchWindow() throws Exception{
-        SiddhiManager siddhiManager = new SiddhiManager();
-
-        String cseEventStream = "define stream TempStream (user string, cmd string);";
-        String query = "@info(name = 'query1') from TempStream#window.lengthBatch(2) "
-                + " select *"
-                + " insert all events into DelayedTempStream";
-
-        ExecutionPlanRuntime executionPlanRuntime = siddhiManager.createExecutionPlanRuntime(cseEventStream + query);
-
-        executionPlanRuntime.addCallback("query1", new QueryCallback() {
-            @Override
-            public void receive(long timeStamp, Event[] inEvents, Event[] removeEvents) {
-                EventPrinter.print(timeStamp, inEvents, removeEvents);
-            }
-        });
-
-        InputHandler inputHandler = executionPlanRuntime.getInputHandler("TempStream");
-        executionPlanRuntime.start();
-        inputHandler.send(new Object[]{"user", "open1"});
-        inputHandler.send(new Object[]{"user", "open2"});
-        inputHandler.send(new Object[]{"user", "open3"});
-        inputHandler.send(new Object[]{"user", "open4"});
-        inputHandler.send(new Object[]{"user", "open5"});
-        inputHandler.send(new Object[]{"user", "open6"});
-        Thread.sleep(1000);
-        executionPlanRuntime.shutdown();
-    }
-
-    @Test
-    public void testExpireEvents2() throws Exception{
-        SiddhiManager siddhiManager = new SiddhiManager();
-
-        String cseEventStream = "define stream TempStream (user string, cmd string);";
-        String query = "@info(name = 'query1') from TempStream#window.length(4) "
-                + " select user, cmd, count(user) as cnt " +
-                " group by user " +
-                "having cnt > 2 "
-                + " insert all events into DelayedTempStream";
-
-        ExecutionPlanRuntime executionPlanRuntime = siddhiManager.createExecutionPlanRuntime(cseEventStream + query);
-
-        executionPlanRuntime.addCallback("query1", new QueryCallback() {
-            @Override
-            public void receive(long timeStamp, Event[] inEvents, Event[] removeEvents) {
-                EventPrinter.print(timeStamp, inEvents, removeEvents);
-            }
-        });
-
-        InputHandler inputHandler = executionPlanRuntime.getInputHandler("TempStream");
-        executionPlanRuntime.start();
-        inputHandler.send(new Object[]{"user", "open1"});
-        inputHandler.send(new Object[]{"user", "open2"});
-        inputHandler.send(new Object[]{"user", "open3"});
-        inputHandler.send(new Object[]{"user", "open4"});
-        inputHandler.send(new Object[]{"user", "open5"});
-//        inputHandler.send(new Object[]{"user", "open6"});
-//        inputHandler.send(new Object[]{"user", "open7"});
-//        inputHandler.send(new Object[]{"user", "open8"});
-//        inputHandler.send(new Object[]{"user", "open9"});
-        Thread.sleep(1000);
-        executionPlanRuntime.shutdown();
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/0ea130ef/eagle-core/eagle-alert/eagle-alert-process/src/test/java/org/apache/eagle/alert/state/TestSiddhiStateSnapshotAndRestore.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-alert/eagle-alert-process/src/test/java/org/apache/eagle/alert/state/TestSiddhiStateSnapshotAndRestore.java b/eagle-core/eagle-alert/eagle-alert-process/src/test/java/org/apache/eagle/alert/state/TestSiddhiStateSnapshotAndRestore.java
deleted file mode 100644
index bd65b9b..0000000
--- a/eagle-core/eagle-alert/eagle-alert-process/src/test/java/org/apache/eagle/alert/state/TestSiddhiStateSnapshotAndRestore.java
+++ /dev/null
@@ -1,504 +0,0 @@
-/*
- *
- *  * Licensed to the Apache Software Foundation (ASF) under one or more
- *  * contributor license agreements.  See the NOTICE file distributed with
- *  * this work for additional information regarding copyright ownership.
- *  * The ASF licenses this file to You under the Apache License, Version 2.0
- *  * (the "License"); you may not use this file except in compliance with
- *  * the License.  You may obtain a copy of the License at
- *  *
- *  *    http://www.apache.org/licenses/LICENSE-2.0
- *  *
- *  * Unless required by applicable law or agreed to in writing, software
- *  * distributed under the License is distributed on an "AS IS" BASIS,
- *  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  * See the License for the specific language governing permissions and
- *  * limitations under the License.
- *
- */
-
-package org.apache.eagle.alert.state;
-
-import org.apache.eagle.common.DateTimeUtil;
-import org.junit.Assert;
-import org.junit.Before;
-import org.junit.Test;
-import org.wso2.siddhi.core.ExecutionPlanRuntime;
-import org.wso2.siddhi.core.SiddhiManager;
-import org.wso2.siddhi.core.event.Event;
-import org.wso2.siddhi.core.query.output.callback.QueryCallback;
-import org.wso2.siddhi.core.stream.input.InputHandler;
-import org.wso2.siddhi.core.util.EventPrinter;
-import org.wso2.siddhi.core.util.persistence.InMemoryPersistenceStore;
-import org.wso2.siddhi.core.util.persistence.PersistenceStore;
-
-import java.io.FileInputStream;
-import java.io.FileOutputStream;
-
-/**
- * experiment Siddhi state snapshot and restore
- */
-public class TestSiddhiStateSnapshotAndRestore {
-    private ExecutionPlanRuntime setupRuntimeForSimple(){
-        SiddhiManager siddhiManager = new SiddhiManager();
-
-        String cseEventStream = "" +
-                "define stream testStream (cmd string, src string) ;";
-        String queryString = "" +
-                "@info(name = 'query1') " +
-                "from testStream[(cmd == 'rename') and (src == '/tmp/pii')] " +
-                "select cmd, src " +
-                "insert into outputStream ;";
-
-        ExecutionPlanRuntime executionPlanRuntime = siddhiManager.createExecutionPlanRuntime("@Plan:name('testPlan') " + cseEventStream + queryString);
-
-        QueryCallback callback = new QueryCallback() {
-            @Override
-            public void receive(long timeStamp, Event[] inEvents, Event[] removeEvents) {
-                EventPrinter.print(timeStamp, inEvents, removeEvents);
-            }
-        };
-        executionPlanRuntime.addCallback("query1", callback);
-        executionPlanRuntime.start();
-        return executionPlanRuntime;
-    }
-
-    @Test
-    public void testSimpleSiddhiQuery() throws Exception{
-        String tmpdir = System.getProperty("java.io.tmpdir");
-        System.out.println("temporary directory: " + tmpdir);
-
-        String stateFile = tmpdir + "/siddhi-state";
-        ExecutionPlanRuntime executionPlanRuntime = setupRuntimeForSimple();
-        executionPlanRuntime.getInputHandler("testStream").send(new Object[]{"rename", "/tmp/pii"});
-        byte[] state = executionPlanRuntime.snapshot();
-        int length = state.length;
-        FileOutputStream output = new FileOutputStream(stateFile);
-        output.write(state);
-        output.close();
-        executionPlanRuntime.shutdown();
-
-        ExecutionPlanRuntime restoredRuntime = setupRuntimeForSimple();
-        FileInputStream input = new FileInputStream(stateFile);
-        byte[] restoredState = new byte[length];
-        input.read(restoredState);
-        restoredRuntime.restore(restoredState);
-        restoredRuntime.getInputHandler("testStream").send(new Object[]{"rename", "/tmp/pii"});
-        input.close();
-        restoredRuntime.shutdown();
-    }
-
-    private ExecutionPlanRuntime setupRuntimeForLengthSlideWindow(){
-        SiddhiManager siddhiManager = new SiddhiManager();
-
-        String cseEventStream = "define stream testStream (user string, cmd string);";
-        String query = "@info(name = 'query1') from testStream#window.length(3) "
-                + " select *"
-                + " insert all events into OutputStream";
-
-        ExecutionPlanRuntime executionPlanRuntime = siddhiManager.createExecutionPlanRuntime("@Plan:name('testPlan') " + cseEventStream + query);
-
-        executionPlanRuntime.addCallback("query1", new QueryCallback() {
-            @Override
-            public void receive(long timeStamp, Event[] inEvents, Event[] removeEvents) {
-                EventPrinter.print(timeStamp, inEvents, removeEvents);
-            }
-        });
-
-        executionPlanRuntime.start();
-        return executionPlanRuntime;
-    }
-
-    @Test
-    public void testLengthSlideWindow() throws Exception{
-        String tmpdir = System.getProperty("java.io.tmpdir");
-        System.out.println("temporary directory: " + tmpdir);
-
-        String stateFile = tmpdir + "/siddhi-state-lengthslidewindow";
-        ExecutionPlanRuntime executionPlanRuntime = setupRuntimeForLengthSlideWindow();
-        executionPlanRuntime.getInputHandler("testStream").send(new Object[]{"rename", "/tmp/pii_1"});
-        executionPlanRuntime.getInputHandler("testStream").send(new Object[]{"rename", "/tmp/pii_2"});
-        executionPlanRuntime.getInputHandler("testStream").send(new Object[]{"rename", "/tmp/pii_3"});
-        executionPlanRuntime.getInputHandler("testStream").send(new Object[]{"rename", "/tmp/pii_4"});
-        byte[] state = executionPlanRuntime.snapshot();
-        int length = state.length;
-        FileOutputStream output = new FileOutputStream(stateFile);
-        output.write(state);
-        output.close();
-        executionPlanRuntime.shutdown();
-
-        ExecutionPlanRuntime restoredRuntime = setupRuntimeForLengthSlideWindow();
-        FileInputStream input = new FileInputStream(stateFile);
-        byte[] restoredState = new byte[length];
-        input.read(restoredState);
-        restoredRuntime.restore(restoredState);
-        restoredRuntime.getInputHandler("testStream").send(new Object[]{"rename", "/tmp/pii_5"});
-        input.close();
-        restoredRuntime.shutdown();
-    }
-
-    private ExecutionPlanRuntime setupRuntimeForLengthSlideWindowWithGroupby(){
-        SiddhiManager siddhiManager = new SiddhiManager();
-
-        String cseEventStream = "define stream testStream (user string, cmd string);";
-        String query = "@info(name = 'query1') from testStream#window.length(50) "
-                + " select user, cmd, count(user) as cnt"
-                + " insert all events into OutputStream";
-
-        ExecutionPlanRuntime executionPlanRuntime = siddhiManager.createExecutionPlanRuntime("@Plan:name('testPlan') " + cseEventStream + query);
-
-        executionPlanRuntime.addCallback("query1", new QueryCallback() {
-            @Override
-            public void receive(long timeStamp, Event[] inEvents, Event[] removeEvents) {
-                EventPrinter.print(timeStamp, inEvents, removeEvents);
-            }
-        });
-
-        executionPlanRuntime.start();
-        return executionPlanRuntime;
-    }
-
-    @Test
-    public void testLengthSlideWindowWithGroupby() throws Exception{
-        String tmpdir = System.getProperty("java.io.tmpdir");
-        System.out.println("temporary directory: " + tmpdir);
-
-        String stateFile = tmpdir + "/siddhi-state-lengthslidewindowwithgroupby";
-        ExecutionPlanRuntime executionPlanRuntime = setupRuntimeForLengthSlideWindowWithGroupby();
-        executionPlanRuntime.getInputHandler("testStream").send(new Object[]{"rename", "/tmp/pii_1"});
-        executionPlanRuntime.getInputHandler("testStream").send(new Object[]{"rename", "/tmp/pii_2"});
-        executionPlanRuntime.getInputHandler("testStream").send(new Object[]{"rename", "/tmp/pii_3"});
-        executionPlanRuntime.getInputHandler("testStream").send(new Object[]{"rename", "/tmp/pii_4"});
-        byte[] state = executionPlanRuntime.snapshot();
-        int length = state.length;
-        FileOutputStream output = new FileOutputStream(stateFile);
-        output.write(state);
-        output.close();
-        executionPlanRuntime.shutdown();
-
-        ExecutionPlanRuntime restoredRuntime = setupRuntimeForLengthSlideWindowWithGroupby();
-        FileInputStream input = new FileInputStream(stateFile);
-        byte[] restoredState = new byte[length];
-        input.read(restoredState);
-        restoredRuntime.restore(restoredState);
-        restoredRuntime.getInputHandler("testStream").send(new Object[]{"rename", "/tmp/pii_5"});
-        input.close();
-        restoredRuntime.shutdown();
-    }
-
-    private ExecutionPlanRuntime setupRuntimeForTimeSlideWindow(){
-        SiddhiManager siddhiManager = new SiddhiManager();
-        String cseEventStream = "define stream testStream (timeStamp long, user string, cmd string);";
-        String query = "@info(name = 'query1') from testStream[cmd == 'open']#window.externalTime(timeStamp,3 sec)"
-                + " select user, timeStamp " +
-                "insert all events into outputStream;";
-
-        ExecutionPlanRuntime executionPlanRuntime = siddhiManager.createExecutionPlanRuntime("@Plan:name('testPlan') " + cseEventStream + query);
-
-        executionPlanRuntime.addCallback("query1", new QueryCallback() {
-            @Override
-            public void receive(long timeStamp, Event[] inEvents, Event[] removeEvents) {
-                EventPrinter.print(timeStamp, inEvents, removeEvents);
-            }
-        });
-        executionPlanRuntime.start();
-        return executionPlanRuntime;
-    }
-
-    @Test
-    public void testTimeSlideWindow() throws Exception{
-        String tmpdir = System.getProperty("java.io.tmpdir");
-        System.out.println("temporary directory: " + tmpdir);
-
-        String stateFile = tmpdir + "/siddhi-state-timeslidewindow";
-        ExecutionPlanRuntime executionPlanRuntime = setupRuntimeForTimeSlideWindow();
-        InputHandler inputHandler = executionPlanRuntime.getInputHandler("testStream");
-        long curTime = DateTimeUtil.humanDateToMilliseconds("2015-09-17 00:00:00,000");
-        inputHandler.send(new Object[]{curTime, "user", "open"});
-        inputHandler.send(new Object[]{curTime + 1000, "user", "open"});
-        inputHandler.send(new Object[]{curTime + 2000, "user", "open"});
-        inputHandler.send(new Object[]{curTime + 3000, "user", "open"});
-
-        byte[] state = executionPlanRuntime.snapshot();
-        int length = state.length;
-        FileOutputStream output = new FileOutputStream(stateFile);
-        output.write(state);
-        output.close();
-        executionPlanRuntime.shutdown();
-
-        ExecutionPlanRuntime restoredRuntime = setupRuntimeForTimeSlideWindow();
-        FileInputStream input = new FileInputStream(stateFile);
-        byte[] restoredState = new byte[length];
-        input.read(restoredState);
-        restoredRuntime.restore(restoredState);
-        inputHandler = restoredRuntime.getInputHandler("testStream");
-        inputHandler.send(new Object[]{curTime + 4000, "user", "open"});
-        inputHandler.send(new Object[]{curTime + 5000, "user", "open"});
-        inputHandler.send(new Object[]{curTime + 6000, "user", "open"});
-        inputHandler.send(new Object[]{curTime + 7000, "user", "open"});
-        Thread.sleep(1000);
-        input.close();
-        restoredRuntime.shutdown();
-    }
-    
-    private ExecutionPlanRuntime setupRuntimeForExternalTimeSlideWindowWithGroupby(){
-        SiddhiManager siddhiManager = new SiddhiManager();
-        String cseEventStream = "define stream testStream (timeStamp long, user string, cmd string);";
-        String query = "@info(name = 'query1') from testStream[cmd == 'open']#window.externalTime(timeStamp,30 sec)"
-                + " select user, timeStamp, count(user) as cnt"
-                + " group by user"
-                + " having cnt > 2"
-               + " insert all events into outputStream;";
-
-        ExecutionPlanRuntime executionPlanRuntime = siddhiManager.createExecutionPlanRuntime("@Plan:name('testPlan') " + cseEventStream + query);
-
-        executionPlanRuntime.addCallback("query1", new QueryCallback() {
-            @Override
-            public void receive(long timeStamp, Event[] inEvents, Event[] removeEvents) {
-                EventPrinter.print(timeStamp, inEvents, removeEvents);
-            }
-        });
-        executionPlanRuntime.start();
-        return executionPlanRuntime;
-    }
-
-    @Test
-    public void testExternalTimeSlideWindowWithGroupby() throws Exception{
-        String tmpdir = System.getProperty("java.io.tmpdir");
-        System.out.println("temporary directory: " + tmpdir);
-
-        String stateFile = tmpdir + "/siddhi-state-externaltimeslidewindow";
-        ExecutionPlanRuntime executionPlanRuntime = setupRuntimeForExternalTimeSlideWindowWithGroupby();
-        InputHandler inputHandler = executionPlanRuntime.getInputHandler("testStream");
-        long curTime = DateTimeUtil.humanDateToMilliseconds("2015-09-17 00:00:00,000");
-        inputHandler.send(new Object[]{curTime, "user", "open"});
-        inputHandler.send(new Object[]{curTime + 1000, "user", "open"});
-        inputHandler.send(new Object[]{curTime + 2000, "user", "open"});
-        inputHandler.send(new Object[]{curTime + 3000, "user", "open"});
-
-        byte[] state = executionPlanRuntime.snapshot();
-        int length = state.length;
-        FileOutputStream output = new FileOutputStream(stateFile);
-        output.write(state);
-        output.close();
-        executionPlanRuntime.shutdown();
-
-        ExecutionPlanRuntime restoredRuntime = setupRuntimeForExternalTimeSlideWindowWithGroupby();
-        FileInputStream input = new FileInputStream(stateFile);
-        byte[] restoredState = new byte[length];
-        input.read(restoredState);
-        restoredRuntime.restore(restoredState);
-        inputHandler = restoredRuntime.getInputHandler("testStream");
-        inputHandler.send(new Object[]{curTime + 4000, "user", "open"});
-        inputHandler.send(new Object[]{curTime + 5000, "user", "open"});
-        inputHandler.send(new Object[]{curTime + 6000, "user", "open"});
-        inputHandler.send(new Object[]{curTime + 7000, "user", "open"});
-        Thread.sleep(1000);
-        input.close();
-        restoredRuntime.shutdown();
-    }
-
-    private ExecutionPlanRuntime setupRuntimeForExternalTimeSlideWindowWithGroupby_2(SiddhiManager siddhiManager){
-        String cseEventStream = "define stream testStream (timeStamp long, user string, cmd string);";
-        String query = "@info(name = 'query1') from testStream[cmd == 'open']#window.externalTime(timeStamp,300 sec)"
-                + " select user, timeStamp, count(user) as cnt"
-                + " group by user"
-                + " insert all events into outputStream;";
-
-        ExecutionPlanRuntime executionPlanRuntime = siddhiManager.createExecutionPlanRuntime("@Plan:name('testPlan') " + cseEventStream + query);
-
-        executionPlanRuntime.addCallback("query1", new QueryCallback() {
-            @Override
-            public void receive(long timeStamp, Event[] inEvents, Event[] removeEvents) {
-                EventPrinter.print(timeStamp, inEvents, removeEvents);
-            }
-        });
-        return executionPlanRuntime;
-    }
-
-    @Test
-    public void testExternalTimeSlideWindowWithGroupby_2() throws Exception{
-        SiddhiManager siddhiManager = new SiddhiManager();
-        PersistenceStore persistenceStore = new InMemoryPersistenceStore();
-        siddhiManager.setPersistenceStore(persistenceStore);
-
-        ExecutionPlanRuntime executionPlanRuntime = setupRuntimeForExternalTimeSlideWindowWithGroupby_2(siddhiManager);
-        InputHandler inputHandler = executionPlanRuntime.getInputHandler("testStream");
-        executionPlanRuntime.start();
-        long curTime = DateTimeUtil.humanDateToMilliseconds("2015-09-17 00:00:00,000");
-        inputHandler.send(new Object[]{curTime, "user", "open"});
-        inputHandler.send(new Object[]{curTime + 1000, "user", "open"});
-        inputHandler.send(new Object[]{curTime + 2000, "user", "open"});
-        inputHandler.send(new Object[]{curTime + 3000, "user", "open"});
-        Thread.sleep(100);
-        executionPlanRuntime.persist();
-        executionPlanRuntime.shutdown();
-        ExecutionPlanRuntime restoredRuntime = setupRuntimeForExternalTimeSlideWindowWithGroupby_2(siddhiManager);
-        inputHandler = restoredRuntime.getInputHandler("testStream");
-        restoredRuntime.start();
-        restoredRuntime.restoreLastRevision();
-        inputHandler.send(new Object[]{curTime + 4000, "user", "open"});
-        inputHandler.send(new Object[]{curTime + 5000, "user", "open"});
-        inputHandler.send(new Object[]{curTime + 6000, "user", "open"});
-        inputHandler.send(new Object[]{curTime + 7000, "user", "open"});
-        Thread.sleep(1000);
-        restoredRuntime.shutdown();
-    }
-
-    private ExecutionPlanRuntime setupRuntimeForInternalTimeSlideWindowWithGroupby(){
-        SiddhiManager siddhiManager = new SiddhiManager();
-        String cseEventStream = "define stream testStream (user string, cmd string);";
-        String query = "@info(name = 'query1') from testStream[cmd == 'open']#window.time(5 sec)"
-                + " select user, count(user) as cnt"
-                + " group by user"
-                + " having cnt > 2"
-                + " insert events into outputStream;";
-
-        ExecutionPlanRuntime executionPlanRuntime = siddhiManager.createExecutionPlanRuntime("@Plan:name('testPlan') " + cseEventStream + query);
-
-        executionPlanRuntime.addCallback("query1", new QueryCallback() {
-            @Override
-            public void receive(long timeStamp, Event[] inEvents, Event[] removeEvents) {
-                EventPrinter.print(timeStamp, inEvents, removeEvents);
-            }
-        });
-        executionPlanRuntime.start();
-        return executionPlanRuntime;
-    }
-
-    @Test
-    public void testInternalTimeSlideWindowWithGroupby() throws Exception{
-        String tmpdir = System.getProperty("java.io.tmpdir");
-        System.out.println("temporary directory: " + tmpdir);
-
-        String stateFile = tmpdir + "/siddhi-state-internaltimeslidewindow";
-        ExecutionPlanRuntime executionPlanRuntime = setupRuntimeForInternalTimeSlideWindowWithGroupby();
-        InputHandler inputHandler = executionPlanRuntime.getInputHandler("testStream");
-        inputHandler.send(new Object[]{"user", "open"});
-        Thread.sleep(1000);
-        inputHandler.send(new Object[]{"user", "open"});
-        Thread.sleep(1000);
-        inputHandler.send(new Object[]{"user", "open"});
-        Thread.sleep(1000);
-        inputHandler.send(new Object[]{"user", "open"});
-
-        byte[] state = executionPlanRuntime.snapshot();
-        int length = state.length;
-        FileOutputStream output = new FileOutputStream(stateFile);
-        output.write(state);
-        output.close();
-        executionPlanRuntime.shutdown();
-
-        ExecutionPlanRuntime restoredRuntime = setupRuntimeForInternalTimeSlideWindowWithGroupby();
-        FileInputStream input = new FileInputStream(stateFile);
-        byte[] restoredState = new byte[length];
-        input.read(restoredState);
-        restoredRuntime.restore(restoredState);
-        inputHandler = restoredRuntime.getInputHandler("testStream");
-        inputHandler.send(new Object[]{"user", "open"});
-        Thread.sleep(1000);
-        inputHandler.send(new Object[]{"user", "open"});
-        Thread.sleep(1000);
-        inputHandler.send(new Object[]{"user", "open"});
-        Thread.sleep(1000);
-        inputHandler.send(new Object[]{"user", "open"});
-        Thread.sleep(1000);
-        input.close();
-        restoredRuntime.shutdown();
-    }
-
-    private int count;
-    private boolean eventArrived;
-
-    @Before
-    public void init() {
-        count = 0;
-        eventArrived = false;
-    }
-
-    /**
-     * Siddhi does not support external time window based snapshot
-     * @throws InterruptedException
-     */
-    public void persistenceTest7() throws InterruptedException {
-        PersistenceStore persistenceStore = new InMemoryPersistenceStore();
-
-        SiddhiManager siddhiManager = new SiddhiManager();
-        siddhiManager.setPersistenceStore(persistenceStore);
-
-        String executionPlan = "" +
-                "@plan:name('Test') " +
-                "" +
-                "define stream StockStream (symbol string, price float, volume int, timestamp long);" +
-                "" +
-                "@info(name = 'query1')" +
-                "from StockStream#window.externalTime(timestamp,30 sec) " +
-                "select symbol, price, sum(volume) as totalVol, count(symbol) as cnt " +
-                "group by symbol " +
-                "insert into OutStream ";
-
-        QueryCallback queryCallback = new QueryCallback() {
-            @Override
-            public void receive(long timeStamp, Event[] inEvents, Event[] removeEvents) {
-                EventPrinter.print(timeStamp, inEvents, removeEvents);
-                eventArrived = true;
-                for (Event inEvent : inEvents) {
-                    count++;
-                    Assert.assertTrue("IBM".equals(inEvent.getData(0)) || "WSO2".equals(inEvent.getData(0)));
-                    if (count == 5) {
-                        Assert.assertEquals(400l, inEvent.getData(2));
-                    }
-                    if (count == 6) {
-                        Assert.assertEquals(200l, inEvent.getData(2));
-                    }
-                }
-            }
-        };
-
-        ExecutionPlanRuntime executionPlanRuntime = siddhiManager.createExecutionPlanRuntime(executionPlan);
-        executionPlanRuntime.addCallback("query1", queryCallback);
-
-        InputHandler inputHandler = executionPlanRuntime.getInputHandler("StockStream");
-        executionPlanRuntime.start();
-        long currentTime = 0;
-
-        inputHandler.send(new Object[]{"IBM", 75.1f, 100, currentTime + 1000});
-        Thread.sleep(100);
-        inputHandler.send(new Object[]{"WSO2", 75.2f, 100, currentTime + 2000});
-        Thread.sleep(100);
-        inputHandler.send(new Object[]{"IBM", 75.3f, 100, currentTime + 3000});
-
-        Thread.sleep(500);
-        Assert.assertTrue(eventArrived);
-        Assert.assertEquals(3, count);
-
-        //persisting
-        Thread.sleep(500);
-        executionPlanRuntime.persist();
-
-        //restarting execution plan
-        Thread.sleep(500);
-        executionPlanRuntime.shutdown();
-        executionPlanRuntime = siddhiManager.createExecutionPlanRuntime(executionPlan);
-        executionPlanRuntime.addCallback("query1", queryCallback);
-        inputHandler = executionPlanRuntime.getInputHandler("StockStream");
-        executionPlanRuntime.start();
-
-        //loading
-        executionPlanRuntime.restoreLastRevision();
-
-        inputHandler.send(new Object[]{"IBM", 75.4f, 100, currentTime + 4000});
-        Thread.sleep(100);
-        inputHandler.send(new Object[]{"IBM", 75.5f, 100, currentTime + 5000});
-        Thread.sleep(100);
-        inputHandler.send(new Object[]{"WSO2", 75.6f, 100, currentTime + 6000});
-
-        //shutdown execution plan
-        Thread.sleep(500);
-        executionPlanRuntime.shutdown();
-
-        Assert.assertEquals(count, 6);
-        Assert.assertEquals(true, eventArrived);
-
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/0ea130ef/eagle-core/eagle-alert/eagle-alert-process/src/test/resources/application.conf
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-alert/eagle-alert-process/src/test/resources/application.conf b/eagle-core/eagle-alert/eagle-alert-process/src/test/resources/application.conf
deleted file mode 100644
index 524b867..0000000
--- a/eagle-core/eagle-alert/eagle-alert-process/src/test/resources/application.conf
+++ /dev/null
@@ -1,33 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements.  See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You under the Apache License, Version 2.0
-# (the "License"); you may not use this file except in compliance with
-# the License.  You may obtain a copy of the License at
-#
-#    http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-{
-  "eagleProps" : {
-    "site" : "sandbox",
-    "application" : "UnitTest",
-    "eagleService": {
-      "host": "localhost",
-      "port": 38080,
-      "username": "admin",
-      "password": "secret"
-    }
-  },
-  "dynamicConfigSource" : {
-    "enabled" : true,
-    "initDelayMillis" : 0,
-    "delayMillis" : 30000,
-    "ignoreDeleteFromSource" : true
-  }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/0ea130ef/eagle-core/eagle-alert/eagle-alert-process/src/test/resources/log4j.properties
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-alert/eagle-alert-process/src/test/resources/log4j.properties b/eagle-core/eagle-alert/eagle-alert-process/src/test/resources/log4j.properties
deleted file mode 100644
index 71a5dac..0000000
--- a/eagle-core/eagle-alert/eagle-alert-process/src/test/resources/log4j.properties
+++ /dev/null
@@ -1,34 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements.  See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You under the Apache License, Version 2.0
-# (the "License"); you may not use this file except in compliance with
-# the License.  You may obtain a copy of the License at
-#
-#    http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-log4j.rootLogger=INFO, DRFA, stdout
-eagle.log.dir=./logs
-eagle.log.file=eagle.log
-
-# standard output
-log4j.appender.stdout=org.apache.log4j.ConsoleAppender
-log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
-log4j.appender.stdout.layout.ConversionPattern=%d{ISO8601} %p [%t] %c{2}[%L]: %m%n
-
-# Daily Rolling File Appender
-log4j.appender.DRFA=org.apache.log4j.DailyRollingFileAppender
-log4j.appender.DRFA.File=${eagle.log.dir}/${eagle.log.file}
-log4j.appender.DRFA.DatePattern=.yyyy-MM-dd
-# 30-day backup
-#log4j.appender.DRFA.MaxBackupIndex=30
-log4j.appender.DRFA.layout=org.apache.log4j.PatternLayout
-
-# Pattern format: Date LogLevel LoggerName LogMessage
-log4j.appender.DRFA.layout.ConversionPattern=%d{ISO8601} %p [%t] %c{2}[%L]: %m%n
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/0ea130ef/eagle-core/eagle-alert/eagle-alert-process/src/test/resources/str.siddhiext
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-alert/eagle-alert-process/src/test/resources/str.siddhiext b/eagle-core/eagle-alert/eagle-alert-process/src/test/resources/str.siddhiext
deleted file mode 100644
index 435b4c3..0000000
--- a/eagle-core/eagle-alert/eagle-alert-process/src/test/resources/str.siddhiext
+++ /dev/null
@@ -1,39 +0,0 @@
-#
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements.  See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You under the Apache License, Version 2.0
-# (the "License"); you may not use this file except in compliance with
-# the License.  You may obtain a copy of the License at
-#
-#    http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-
-charAt=org.wso2.siddhi.extension.string.CharAtFunctionExtension
-coalesce=org.wso2.siddhi.extension.string.CoalesceFunctionExtension
-concat=org.wso2.siddhi.extension.string.ConcatFunctionExtension
-length=org.wso2.siddhi.extension.string.LengthFunctionExtension
-lower=org.wso2.siddhi.extension.string.LowerFunctionExtension
-regexp=org.wso2.siddhi.extension.string.RegexpFunctionExtension
-repeat=org.wso2.siddhi.extension.string.RepeatFunctionExtension
-replaceAll=org.wso2.siddhi.extension.string.ReplaceAllFunctionExtension
-replaceFirst=org.wso2.siddhi.extension.string.ReplaceFirstFunctionExtension
-reverse=org.wso2.siddhi.extension.string.ReverseFunctionExtension
-strcmp=org.wso2.siddhi.extension.string.StrcmpFunctionExtension
-substr=org.wso2.siddhi.extension.string.SubstrFunctionExtension
-trim=org.wso2.siddhi.extension.string.TrimFunctionExtension
-upper=org.wso2.siddhi.extension.string.UpperFunctionExtension
-hex=org.wso2.siddhi.extension.string.HexFunctionExtension
-unhex=org.wso2.siddhi.extension.string.UnhexFunctionExtension
-contains=org.wso2.siddhi.extension.string.ContainsFunctionExtension
-
-# Eagle Siddhi Extension
-equalsIgnoreCase=org.apache.eagle.policy.siddhi.extension.EqualsIgnoreCaseExtension
-containsIgnoreCase=org.apache.eagle.policy.siddhi.extension.ContainsIgnoreCaseExtension
-regexpIgnoreCase=org.apache.eagle.policy.siddhi.extension.RegexpIgnoreCaseFunctionExtension
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/0ea130ef/eagle-core/eagle-alert/eagle-alert-process/src/test/resources/unittest.conf
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-alert/eagle-alert-process/src/test/resources/unittest.conf b/eagle-core/eagle-alert/eagle-alert-process/src/test/resources/unittest.conf
deleted file mode 100644
index 1d18b67..0000000
--- a/eagle-core/eagle-alert/eagle-alert-process/src/test/resources/unittest.conf
+++ /dev/null
@@ -1,65 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements.  See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You under the Apache License, Version 2.0
-# (the "License"); you may not use this file except in compliance with
-# the License.  You may obtain a copy of the License at
-#
-#    http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-{
-  "envContextConfig" : {
-    "env" : "storm",
-    "mode" : "local",
-    "topologyName" : "auditLogProcessTopology",
-    "stormConfigFile" : "security-auditlog-storm.yaml",
-    "parallelismConfig" : {
-      "kafkaMsgConsumer" : 2,
-      "hdfsAuditLogAlertExecutor*" : 3
-    }
-  },
-  "dataSourceConfig": {
-    "flavor" : "stormkafka",
-    "topic" : "hdfs_audit_log",
-    "zkConnection" : "localhost:2181",
-    "zkConnectionTimeoutMS" : 15000,
-    "consumerGroupId" : "EagleConsumer",
-    "fetchSize" : 1048586,
-    "deserializerClass" : "org.apache.eagle.security.auditlog.HdfsAuditLogKafkaDeserializer",
-    "transactionZKServers" : "localhost",
-    "transactionZKPort" : 2181,
-    "transactionZKRoot" : "/brokers/topics",
-    "transactionStateUpdateMS" : 2000
-  },
-  "alertExecutorConfigs" : {
-     "hdfsAuditLogAlertExecutor" : {
-       "parallelism" : 2,
-       "partitioner" : "org.apache.eagle.policy.DefaultPolicyPartitioner"
-       "needValidation" : "true"
-     }
-  },
-  "eagleProps" : {
-    "site": "site1",
-    "application": "hdfsAuditLog",
-    "eagleService": {
-       "host": "localhost",
-       "port": 38080
-    },
-  	"dataJoinPollIntervalSec" : 30,
-    "env"       : "test",
-    "mail.host" : "mailHost.com",
-	  "mail.smtp.port":"25",
-    "mail.debug" : "true"
-  },
-  "dynamicConfigSource" : {
-  	"enabled" : false,
-  	"initDelayMillis" : 0,
-  	"delayMillis" : 1000
-  }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/0ea130ef/eagle-core/eagle-alert/eagle-alert-service/pom.xml
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-alert/eagle-alert-service/pom.xml b/eagle-core/eagle-alert/eagle-alert-service/pom.xml
deleted file mode 100644
index 6bf09d1..0000000
--- a/eagle-core/eagle-alert/eagle-alert-service/pom.xml
+++ /dev/null
@@ -1,60 +0,0 @@
-<?xml version="1.0"?>
-<!--
-  ~ Licensed to the Apache Software Foundation (ASF) under one or more
-  ~ contributor license agreements.  See the NOTICE file distributed with
-  ~ this work for additional information regarding copyright ownership.
-  ~ The ASF licenses this file to You under the Apache License, Version 2.0
-  ~ (the "License"); you may not use this file except in compliance with
-  ~ the License.  You may obtain a copy of the License at
-  ~
-  ~    http://www.apache.org/licenses/LICENSE-2.0
-  ~
-  ~ Unless required by applicable law or agreed to in writing, software
-  ~ distributed under the License is distributed on an "AS IS" BASIS,
-  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  ~ See the License for the specific language governing permissions and
-  ~ limitations under the License.
-  -->
-
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
-	<modelVersion>4.0.0</modelVersion>
-
-	<parent>
-		<groupId>eagle</groupId>
-		<artifactId>eagle-alert-parent</artifactId>
-		<version>0.3.0</version>
-        <relativePath>../pom.xml</relativePath>
-	</parent>
-
-	<artifactId>eagle-alert-service</artifactId>
-	<packaging>jar</packaging>
-	<name>eagle-alert-service</name>
-
-	<dependencies>
-		<dependency>
-			<groupId>eagle</groupId>
-			<artifactId>eagle-alert-base</artifactId>
-			<version>${project.version}</version>
-		</dependency>
-		<dependency>
-			<groupId>eagle</groupId>
-			<artifactId>eagle-alert-process</artifactId>
-			<version>${project.version}</version>
-		</dependency>
-	  	<dependency>
-  			<groupId>eagle</groupId>
-  			<artifactId>eagle-service-base</artifactId>
-			<version>${project.version}</version>
-  		</dependency>
-	  	<dependency>
-  			<groupId>org.wso2.siddhi</groupId>
-  			<artifactId>siddhi-core</artifactId>
-  		</dependency>
-		<dependency>
-  			<groupId>org.wso2.siddhi</groupId>
-  			<artifactId>siddhi-extension-string</artifactId>
-  		</dependency>
-	</dependencies>
-</project>
-

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/0ea130ef/eagle-core/eagle-alert/eagle-alert-service/src/main/java/org/apache/eagle/service/alert/AlertPolicyValidateProvider.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-alert/eagle-alert-service/src/main/java/org/apache/eagle/service/alert/AlertPolicyValidateProvider.java b/eagle-core/eagle-alert/eagle-alert-service/src/main/java/org/apache/eagle/service/alert/AlertPolicyValidateProvider.java
deleted file mode 100644
index 47ddcb9..0000000
--- a/eagle-core/eagle-alert/eagle-alert-service/src/main/java/org/apache/eagle/service/alert/AlertPolicyValidateProvider.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *    http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.eagle.service.alert;
-
-import java.util.List;
-
-import org.apache.eagle.log.entity.GenericServiceAPIResponseEntity;
-import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
-import com.fasterxml.jackson.annotation.JsonTypeInfo;
-import com.fasterxml.jackson.databind.Module;
-
-@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "type", visible=true)
-@JsonIgnoreProperties(ignoreUnknown = true)
-public abstract class AlertPolicyValidateProvider {
-	public String type;
-
-	public abstract GenericServiceAPIResponseEntity<String> validate();
-	
-	public abstract String PolicyType();
-	
-	public abstract List<Module> BindingModules();
-}

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/0ea130ef/eagle-core/eagle-alert/eagle-alert-service/src/main/java/org/apache/eagle/service/alert/PolicyValidateResource.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-alert/eagle-alert-service/src/main/java/org/apache/eagle/service/alert/PolicyValidateResource.java b/eagle-core/eagle-alert/eagle-alert-service/src/main/java/org/apache/eagle/service/alert/PolicyValidateResource.java
deleted file mode 100644
index e4c19d6..0000000
--- a/eagle-core/eagle-alert/eagle-alert-service/src/main/java/org/apache/eagle/service/alert/PolicyValidateResource.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *    http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.eagle.service.alert;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-import java.util.ServiceLoader;
-
-import javax.ws.rs.Consumes;
-import javax.ws.rs.POST;
-import javax.ws.rs.Path;
-import javax.ws.rs.Produces;
-import javax.ws.rs.core.MediaType;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import org.apache.eagle.dataproc.core.JsonSerDeserUtils;
-import org.apache.eagle.log.entity.GenericServiceAPIResponseEntity;
-import com.fasterxml.jackson.databind.Module;
-
-@Path("/policy/validate")
-public class PolicyValidateResource {
-		
-	public static Logger LOG = LoggerFactory.getLogger(PolicyValidateResource.class);
-	
-	@SuppressWarnings({"rawtypes"})
-	@POST
-	@Consumes(MediaType.APPLICATION_JSON)
-	@Produces(MediaType.APPLICATION_JSON)
-	public GenericServiceAPIResponseEntity validatePolicy(String policyToValidate) {
-        ServiceLoader<AlertPolicyValidateProvider> loader = ServiceLoader.load(AlertPolicyValidateProvider.class);
-        Iterator<AlertPolicyValidateProvider> iter = loader.iterator();
-        List<Module> modules = new ArrayList<Module>();
-        while(iter.hasNext()) {
-        	AlertPolicyValidateProvider factory = iter.next();
-            LOG.info("Supported policy type : " + factory.PolicyType());
-            modules.addAll(factory.BindingModules());
-        }
-        AlertPolicyValidateProvider policyValidate = null;
-        try {
-        	policyValidate = JsonSerDeserUtils.deserialize(policyToValidate, AlertPolicyValidateProvider.class, modules);    		
-        }
-        catch (Exception ex) {
-        	LOG.error("Fail consutructing AlertPolicyValidateProvider ", ex);
-        }
-        return policyValidate.validate();
-	}
-}
\ No newline at end of file


Mime
View raw message