eagle-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From yonzhang2...@apache.org
Subject incubator-eagle git commit: EAGLE-119 fix siddhi related unit test > siddhi related unit test > https://issues.apache.org/jira/browse/EAGLE-119 > Author: yonzhang yonzhang2012@apache.org > Reviewer: yonzhang yonzhang2012@apache.org > Closes: 60
Date Tue, 12 Jan 2016 19:20:29 GMT
Repository: incubator-eagle
Updated Branches:
  refs/heads/master da8f419c6 -> 178d06646


EAGLE-119 fix siddhi related unit test
> siddhi related unit test
> https://issues.apache.org/jira/browse/EAGLE-119
> Author: yonzhang yonzhang2012@apache.org
> Reviewer: yonzhang yonzhang2012@apache.org
> Closes: 60


Project: http://git-wip-us.apache.org/repos/asf/incubator-eagle/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-eagle/commit/178d0664
Tree: http://git-wip-us.apache.org/repos/asf/incubator-eagle/tree/178d0664
Diff: http://git-wip-us.apache.org/repos/asf/incubator-eagle/diff/178d0664

Branch: refs/heads/master
Commit: 178d0664629eb753e68378f70bb6b3905efab113
Parents: da8f419
Author: yonzhang <yonzhang@ebay.com>
Authored: Tue Jan 12 11:20:00 2016 -0800
Committer: yonzhang <yonzhang@ebay.com>
Committed: Tue Jan 12 11:20:00 2016 -0800

----------------------------------------------------------------------
 .../eagle/alert/cep/TestSiddhiEvaluator.java      |  4 ++--
 .../alert/dao/TestSiddhiStreamMetadataUtils.java  | 18 +++++++++---------
 .../alert/dao/TestStreamDefinitionDAOImpl.java    |  3 +--
 .../state/TestSiddhiStateSnapshotAndRestore.java  |  5 ++++-
 4 files changed, 16 insertions(+), 14 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/178d0664/eagle-core/eagle-alert/eagle-alert-process/src/test/java/org/apache/eagle/alert/cep/TestSiddhiEvaluator.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-alert/eagle-alert-process/src/test/java/org/apache/eagle/alert/cep/TestSiddhiEvaluator.java
b/eagle-core/eagle-alert/eagle-alert-process/src/test/java/org/apache/eagle/alert/cep/TestSiddhiEvaluator.java
index 3d69887..3aad31b 100644
--- a/eagle-core/eagle-alert/eagle-alert-process/src/test/java/org/apache/eagle/alert/cep/TestSiddhiEvaluator.java
+++ b/eagle-core/eagle-alert/eagle-alert-process/src/test/java/org/apache/eagle/alert/cep/TestSiddhiEvaluator.java
@@ -74,7 +74,8 @@ public class TestSiddhiEvaluator {
 				return list;
 			}
 		};
-		StreamMetadataManager.getInstance().init(config, streamDao);
+        StreamMetadataManager.getInstance().reset();
+        StreamMetadataManager.getInstance().init(config, streamDao);
 
 		Map<String, Object> data1 =  new TreeMap<String, Object>(){{
 			put("cmd", "open");
@@ -124,6 +125,5 @@ public class TestSiddhiEvaluator {
 		evaluator.evaluate(new ValuesArray(context, "hdfsAuditLogEventStream", data1));
 		Thread.sleep(2 * 1000);
 		Assert.assertEquals(alertCount, 1);
-		StreamMetadataManager.getInstance().reset();
 	}
 }

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/178d0664/eagle-core/eagle-alert/eagle-alert-process/src/test/java/org/apache/eagle/alert/dao/TestSiddhiStreamMetadataUtils.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-alert/eagle-alert-process/src/test/java/org/apache/eagle/alert/dao/TestSiddhiStreamMetadataUtils.java
b/eagle-core/eagle-alert/eagle-alert-process/src/test/java/org/apache/eagle/alert/dao/TestSiddhiStreamMetadataUtils.java
index 82aa89f..fe45f80 100644
--- a/eagle-core/eagle-alert/eagle-alert-process/src/test/java/org/apache/eagle/alert/dao/TestSiddhiStreamMetadataUtils.java
+++ b/eagle-core/eagle-alert/eagle-alert-process/src/test/java/org/apache/eagle/alert/dao/TestSiddhiStreamMetadataUtils.java
@@ -34,18 +34,18 @@ public class TestSiddhiStreamMetadataUtils {
 	@Test
 	public void test() throws Exception{
         Config config = ConfigFactory.load();
-		StreamMetadataManager.getInstance().init(config, new AlertStreamSchemaDAO(){
-			@Override
-			public List<AlertStreamSchemaEntity> findAlertStreamSchemaByDataSource(
+        StreamMetadataManager.getInstance().reset();
+        StreamMetadataManager.getInstance().init(config, new AlertStreamSchemaDAO() {
+            @Override
+            public List<AlertStreamSchemaEntity> findAlertStreamSchemaByDataSource(
                     String dataSource) {
-				return Arrays.asList(generateStreamMetadataAPIEntity("attrName1", "STRING"),
-						generateStreamMetadataAPIEntity("attrName2", "LONG")
-						);
-			}
-		});
+                return Arrays.asList(generateStreamMetadataAPIEntity("attrName1", "STRING"),
+                        generateStreamMetadataAPIEntity("attrName2", "LONG")
+                );
+            }
+        });
 		String siddhiStreamDef = SiddhiStreamMetadataUtils.convertToStreamDef("testStreamName");
 		Assert.assertEquals("define stream " + "testStreamName" + "(eagleAlertContext object, attrName1
string,attrName2 long);", siddhiStreamDef);
-		StreamMetadataManager.getInstance().reset();
 	}
 	
 	private AlertStreamSchemaEntity generateStreamMetadataAPIEntity(final String attrName, String
attrType){

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/178d0664/eagle-core/eagle-alert/eagle-alert-process/src/test/java/org/apache/eagle/alert/dao/TestStreamDefinitionDAOImpl.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-alert/eagle-alert-process/src/test/java/org/apache/eagle/alert/dao/TestStreamDefinitionDAOImpl.java
b/eagle-core/eagle-alert/eagle-alert-process/src/test/java/org/apache/eagle/alert/dao/TestStreamDefinitionDAOImpl.java
index 91c5332..15c64af 100644
--- a/eagle-core/eagle-alert/eagle-alert-process/src/test/java/org/apache/eagle/alert/dao/TestStreamDefinitionDAOImpl.java
+++ b/eagle-core/eagle-alert/eagle-alert-process/src/test/java/org/apache/eagle/alert/dao/TestStreamDefinitionDAOImpl.java
@@ -59,10 +59,9 @@ public class TestStreamDefinitionDAOImpl {
 				return list;
 			}
 		};
-
+        StreamMetadataManager.getInstance().reset();
 		StreamMetadataManager.getInstance().init(config, dao);
 		Map<String, List<AlertStreamSchemaEntity>> retMap = StreamMetadataManager.getInstance().getMetadataEntitiesForAllStreams();
 		Assert.assertTrue(retMap.get("TestStream").size() == 4);
-		StreamMetadataManager.getInstance().reset();
 	}
 }

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/178d0664/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
index 3dd43ac..bd65b9b 100644
--- 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
@@ -416,7 +416,10 @@ public class TestSiddhiStateSnapshotAndRestore {
         eventArrived = false;
     }
 
-    @Test
+    /**
+     * Siddhi does not support external time window based snapshot
+     * @throws InterruptedException
+     */
     public void persistenceTest7() throws InterruptedException {
         PersistenceStore persistenceStore = new InMemoryPersistenceStore();
 


Mime
View raw message