eagle-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jay...@apache.org
Subject [02/10] eagle git commit: [EAGLE-1081] Checkstyle fixes for eagle-entity-base module
Date Wed, 07 Feb 2018 07:07:09 GMT
http://git-wip-us.apache.org/repos/asf/eagle/blob/6e919c2e/eagle-core/eagle-query/eagle-entity-base/src/test/java/org/apache/eagle/log/entity/TestHBaseWritePerformance.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-query/eagle-entity-base/src/test/java/org/apache/eagle/log/entity/TestHBaseWritePerformance.java b/eagle-core/eagle-query/eagle-entity-base/src/test/java/org/apache/eagle/log/entity/TestHBaseWritePerformance.java
index 75b55ba..9ee52c9 100644
--- a/eagle-core/eagle-query/eagle-entity-base/src/test/java/org/apache/eagle/log/entity/TestHBaseWritePerformance.java
+++ b/eagle-core/eagle-query/eagle-entity-base/src/test/java/org/apache/eagle/log/entity/TestHBaseWritePerformance.java
@@ -27,74 +27,71 @@ import org.junit.Test;
 
 public class TestHBaseWritePerformance {
 
-	public static void main(String[] args) throws IOException {
-		
-		HTableInterface tbl = EagleConfigFactory.load().getHTable("unittest");
+    public static void main(String[] args) throws IOException {
 
-		int putSize = 1000;
-		List<Put> list = new ArrayList<Put>(putSize);
-		for (int i = 0; i < putSize; ++i) {
-			byte[] v = Integer.toString(i).getBytes();
-			Put p = new Put(v);
-			p.add("f".getBytes(), "a".getBytes(), 100, v);
-			list.add(p);
-		}
+        HTableInterface tbl = EagleConfigFactory.load().getHTable("unittest");
 
-		// Case 1
-		System.out.println("Case 1: autoflush = true, individual put");
-		tbl.setAutoFlush(true);
-		long startTime = System.currentTimeMillis();
-		for (int i = 0; i < 1; ++i) {
-			for (Put p : list) {
-				tbl.put(p);
-			}
-			tbl.flushCommits();
-		}
-		long endTime = System.currentTimeMillis();
-		System.out.println("Case 1: " + (endTime - startTime) + " ms");
-		
-		
-		// Case 2
-		System.out.println("Case 2: autoflush = true, multi-put");
-		tbl.setAutoFlush(true);
-		startTime = System.currentTimeMillis();
-		for (int i = 0; i < 1; ++i) {
-			tbl.put(list);
-			tbl.flushCommits();
-		}
-		endTime = System.currentTimeMillis();
-		System.out.println("Case 2: " + (endTime - startTime) + " ms");
+        int putSize = 1000;
+        List<Put> list = new ArrayList<Put>(putSize);
+        for (int i = 0; i < putSize; ++i) {
+            byte[] v = Integer.toString(i).getBytes();
+            Put p = new Put(v);
+            p.add("f".getBytes(), "a".getBytes(), 100, v);
+            list.add(p);
+        }
 
-		
-		// Case 3
-		System.out.println("Case 3: autoflush = false, multi-put");
-		tbl.setAutoFlush(false);
-		startTime = System.currentTimeMillis();
-		for (int i = 0; i < 1; ++i) {
-			tbl.put(list);
-			tbl.flushCommits();
-		}
-		endTime = System.currentTimeMillis();
-		System.out.println("Case 3: " + (endTime - startTime) + " ms");
+        // Case 1
+        System.out.println("Case 1: autoflush = true, individual put");
+        tbl.setAutoFlush(true);
+        long startTime = System.currentTimeMillis();
+        for (int i = 0; i < 1; ++i) {
+            for (Put p : list) {
+                tbl.put(p);
+            }
+            tbl.flushCommits();
+        }
+        long endTime = System.currentTimeMillis();
+        System.out.println("Case 1: " + (endTime - startTime) + " ms");
 
-		
-		// Case 4
-		System.out.println("Case 4: autoflush = false, individual put");
-		tbl.setAutoFlush(true);
-		startTime = System.currentTimeMillis();
-		for (int i = 0; i < 1; ++i) {
-			for (Put p : list) {
-				tbl.put(p);
-			}
-			tbl.flushCommits();
-		}
-		endTime = System.currentTimeMillis();
-		System.out.println("Case 4: " + (endTime - startTime) + " ms");
+        // Case 2
+        System.out.println("Case 2: autoflush = true, multi-put");
+        tbl.setAutoFlush(true);
+        startTime = System.currentTimeMillis();
+        for (int i = 0; i < 1; ++i) {
+            tbl.put(list);
+            tbl.flushCommits();
+        }
+        endTime = System.currentTimeMillis();
+        System.out.println("Case 2: " + (endTime - startTime) + " ms");
 
-	}
-	
-	@Test
-	public void test() {
-		
-	}
+        // Case 3
+        System.out.println("Case 3: autoflush = false, multi-put");
+        tbl.setAutoFlush(false);
+        startTime = System.currentTimeMillis();
+        for (int i = 0; i < 1; ++i) {
+            tbl.put(list);
+            tbl.flushCommits();
+        }
+        endTime = System.currentTimeMillis();
+        System.out.println("Case 3: " + (endTime - startTime) + " ms");
+
+        // Case 4
+        System.out.println("Case 4: autoflush = false, individual put");
+        tbl.setAutoFlush(true);
+        startTime = System.currentTimeMillis();
+        for (int i = 0; i < 1; ++i) {
+            for (Put p : list) {
+                tbl.put(p);
+            }
+            tbl.flushCommits();
+        }
+        endTime = System.currentTimeMillis();
+        System.out.println("Case 4: " + (endTime - startTime) + " ms");
+
+    }
+
+    @Test
+    public void test() {
+
+    }
 }

http://git-wip-us.apache.org/repos/asf/eagle/blob/6e919c2e/eagle-core/eagle-query/eagle-entity-base/src/test/java/org/apache/eagle/log/entity/TestTestLogAPIEntity.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-query/eagle-entity-base/src/test/java/org/apache/eagle/log/entity/TestTestLogAPIEntity.java b/eagle-core/eagle-query/eagle-entity-base/src/test/java/org/apache/eagle/log/entity/TestTestLogAPIEntity.java
index 63b1d82..6d7a9ef 100755
--- a/eagle-core/eagle-query/eagle-entity-base/src/test/java/org/apache/eagle/log/entity/TestTestLogAPIEntity.java
+++ b/eagle-core/eagle-query/eagle-entity-base/src/test/java/org/apache/eagle/log/entity/TestTestLogAPIEntity.java
@@ -25,7 +25,6 @@ import org.apache.eagle.log.entity.meta.IndexDefinition;
 import org.apache.eagle.log.entity.old.GenericDeleter;
 import org.apache.eagle.log.entity.test.TestLogAPIEntity;
 import org.apache.eagle.service.hbase.TestHBaseBase;
-import org.junit.AfterClass;
 import org.junit.Assert;
 import org.junit.BeforeClass;
 import org.junit.Test;
@@ -40,13 +39,16 @@ public class TestTestLogAPIEntity extends TestHBaseBase {
 
     @BeforeClass
     public static void createTable() throws IllegalAccessException, InstantiationException, IOException {
-        EntityDefinition ed = EntityDefinitionManager.getEntityDefinitionByEntityClass(TestLogAPIEntity.class);
+        EntityDefinition ed = EntityDefinitionManager
+            .getEntityDefinitionByEntityClass(TestLogAPIEntity.class);
         hbase.createTable(ed.getTable(), ed.getColumnFamily());
     }
 
     @Test
-    public void testGetValue() throws InstantiationException, IllegalAccessException, IllegalArgumentException, InvocationTargetException {
-        EntityDefinition ed = EntityDefinitionManager.getEntityDefinitionByEntityClass(TestLogAPIEntity.class);
+    public void testGetValue() throws InstantiationException, IllegalAccessException,
+        IllegalArgumentException, InvocationTargetException {
+        EntityDefinition ed = EntityDefinitionManager
+            .getEntityDefinitionByEntityClass(TestLogAPIEntity.class);
         if (ed == null) {
             EntityDefinitionManager.registerEntity(TestLogAPIEntity.class);
             ed = EntityDefinitionManager.getEntityDefinitionByEntityClass(TestLogAPIEntity.class);
@@ -79,7 +81,8 @@ public class TestTestLogAPIEntity extends TestHBaseBase {
     @Test
     public void testIndexDefinition() throws InstantiationException, IllegalAccessException {
 
-        EntityDefinition ed = EntityDefinitionManager.getEntityDefinitionByEntityClass(TestLogAPIEntity.class);
+        EntityDefinition ed = EntityDefinitionManager
+            .getEntityDefinitionByEntityClass(TestLogAPIEntity.class);
         if (ed == null) {
             EntityDefinitionManager.registerEntity(TestLogAPIEntity.class);
             ed = EntityDefinitionManager.getEntityDefinitionByEntityClass(TestLogAPIEntity.class);
@@ -97,10 +100,12 @@ public class TestTestLogAPIEntity extends TestHBaseBase {
 
     @Test
     public void testWriteEmptyIndexFieldAndDeleteWithoutPartition() throws Exception {
-        EntityDefinition entityDefinition = EntityDefinitionManager.getEntityDefinitionByEntityClass(TestLogAPIEntity.class);
+        EntityDefinition entityDefinition = EntityDefinitionManager
+            .getEntityDefinitionByEntityClass(TestLogAPIEntity.class);
         // hbase.createTable(entityDefinition.getTable(), entityDefinition.getColumnFamily());
 
-        EntityDefinition ed = EntityDefinitionManager.getEntityDefinitionByEntityClass(TestLogAPIEntity.class);
+        EntityDefinition ed = EntityDefinitionManager
+            .getEntityDefinitionByEntityClass(TestLogAPIEntity.class);
         if (ed == null) {
             EntityDefinitionManager.registerEntity(TestLogAPIEntity.class);
             ed = EntityDefinitionManager.getEntityDefinitionByEntityClass(TestLogAPIEntity.class);
@@ -141,14 +146,15 @@ public class TestTestLogAPIEntity extends TestHBaseBase {
             qualifiers[5] = "f".getBytes();
             qualifiers[6] = "g".getBytes();
 
-            UniqueIndexLogReader reader = new UniqueIndexLogReader(indexDefs[0], indexRowkeys, qualifiers, null);
+            UniqueIndexLogReader reader = new UniqueIndexLogReader(indexDefs[0], indexRowkeys, qualifiers,
+                                                                   null);
             reader.open();
             InternalLog log = reader.read();
             Assert.assertNotNull(log);
 
             TaggedLogAPIEntity newEntity = HBaseInternalLogHelper.buildEntity(log, ed);
             Assert.assertEquals(TestLogAPIEntity.class, newEntity.getClass());
-            TestLogAPIEntity e1 = (TestLogAPIEntity) newEntity;
+            TestLogAPIEntity e1 = (TestLogAPIEntity)newEntity;
             Assert.assertEquals(e.getField1(), e1.getField1());
             Assert.assertEquals(e.getField2(), e1.getField2());
             Assert.assertEquals(e.getField3(), e1.getField3());
@@ -161,7 +167,7 @@ public class TestTestLogAPIEntity extends TestHBaseBase {
             Assert.assertNotNull(log);
             newEntity = HBaseInternalLogHelper.buildEntity(log, ed);
             Assert.assertEquals(TestLogAPIEntity.class, newEntity.getClass());
-            e1 = (TestLogAPIEntity) newEntity;
+            e1 = (TestLogAPIEntity)newEntity;
             Assert.assertEquals(e.getField1(), e1.getField1());
             Assert.assertEquals(e.getField2(), e1.getField2());
             Assert.assertEquals(e.getField3(), e1.getField3());
@@ -188,16 +194,18 @@ public class TestTestLogAPIEntity extends TestHBaseBase {
         // hbase.deleteTable(entityDefinition.getTable());
     }
 
-
     /*
-     *  testWriteEmptyIndexFieldAndDeleteWithPartition(eagle.log.entity.TestTestLogAPIEntity): expected:<86400000> but was:<0>
+     * testWriteEmptyIndexFieldAndDeleteWithPartition(eagle.log.entity.TestTestLogAPIEntity):
+     * expected:<86400000> but was:<0>
      */
-    //@Test
+    // @Test
     public void testWriteEmptyIndexFieldAndDeleteWithPartition() throws Exception {
-        EntityDefinition entityDefinition = EntityDefinitionManager.getEntityDefinitionByEntityClass(TestLogAPIEntity.class);
+        EntityDefinition entityDefinition = EntityDefinitionManager
+            .getEntityDefinitionByEntityClass(TestLogAPIEntity.class);
         // hbase.createTable(entityDefinition.getTable(), entityDefinition.getColumnFamily());
 
-        EntityDefinition ed = EntityDefinitionManager.getEntityDefinitionByEntityClass(TestLogAPIEntity.class);
+        EntityDefinition ed = EntityDefinitionManager
+            .getEntityDefinitionByEntityClass(TestLogAPIEntity.class);
         if (ed == null) {
             EntityDefinitionManager.registerEntity(TestLogAPIEntity.class);
             ed = EntityDefinitionManager.getEntityDefinitionByEntityClass(TestLogAPIEntity.class);
@@ -244,14 +252,15 @@ public class TestTestLogAPIEntity extends TestHBaseBase {
             qualifiers[7] = "cluster".getBytes();
             qualifiers[8] = "datacenter".getBytes();
 
-            UniqueIndexLogReader reader = new UniqueIndexLogReader(indexDefs[0], indexRowkeys, qualifiers, null);
+            UniqueIndexLogReader reader = new UniqueIndexLogReader(indexDefs[0], indexRowkeys, qualifiers,
+                                                                   null);
             reader.open();
             InternalLog log = reader.read();
             Assert.assertNotNull(log);
 
             TaggedLogAPIEntity newEntity = HBaseInternalLogHelper.buildEntity(log, ed);
             Assert.assertEquals(TestLogAPIEntity.class, newEntity.getClass());
-            TestLogAPIEntity e1 = (TestLogAPIEntity) newEntity;
+            TestLogAPIEntity e1 = (TestLogAPIEntity)newEntity;
             Assert.assertEquals(e.getField1(), e1.getField1());
             Assert.assertEquals(e.getField2(), e1.getField2());
             Assert.assertEquals(e.getField3(), e1.getField3());
@@ -267,7 +276,7 @@ public class TestTestLogAPIEntity extends TestHBaseBase {
             Assert.assertNotNull(log);
             newEntity = HBaseInternalLogHelper.buildEntity(log, ed);
             Assert.assertEquals(TestLogAPIEntity.class, newEntity.getClass());
-            e1 = (TestLogAPIEntity) newEntity;
+            e1 = (TestLogAPIEntity)newEntity;
             Assert.assertEquals(e.getField1(), e1.getField1());
             Assert.assertEquals(e.getField2(), e1.getField2());
             Assert.assertEquals(e.getField3(), e1.getField3());
@@ -298,15 +307,18 @@ public class TestTestLogAPIEntity extends TestHBaseBase {
     }
 
     /**
-     * testWriteEmptyIndexFieldAndDeleteWithPartitionAndTimeSeries(eagle.log.entity.TestTestLogAPIEntity): expected:<1434809555569> but was:<0>
+     * testWriteEmptyIndexFieldAndDeleteWithPartitionAndTimeSeries(eagle.log.entity.TestTestLogAPIEntity):
+     * expected:<1434809555569> but was:<0>
      */
 
-    //@Test
+    // @Test
     public void testWriteEmptyIndexFieldAndDeleteWithPartitionAndTimeSeries() throws Exception {
-        EntityDefinition entityDefinition = EntityDefinitionManager.getEntityDefinitionByEntityClass(TestLogAPIEntity.class);
+        EntityDefinition entityDefinition = EntityDefinitionManager
+            .getEntityDefinitionByEntityClass(TestLogAPIEntity.class);
         // hbase.createTable(entityDefinition.getTable(), entityDefinition.getColumnFamily());
 
-        EntityDefinition ed = EntityDefinitionManager.getEntityDefinitionByEntityClass(TestLogAPIEntity.class);
+        EntityDefinition ed = EntityDefinitionManager
+            .getEntityDefinitionByEntityClass(TestLogAPIEntity.class);
         if (ed == null) {
             EntityDefinitionManager.registerEntity(TestLogAPIEntity.class);
             ed = EntityDefinitionManager.getEntityDefinitionByEntityClass(TestLogAPIEntity.class);
@@ -357,14 +369,15 @@ public class TestTestLogAPIEntity extends TestHBaseBase {
             qualifiers[7] = "cluster".getBytes();
             qualifiers[8] = "datacenter".getBytes();
 
-            UniqueIndexLogReader reader = new UniqueIndexLogReader(indexDefs[0], indexRowkeys, qualifiers, null);
+            UniqueIndexLogReader reader = new UniqueIndexLogReader(indexDefs[0], indexRowkeys, qualifiers,
+                                                                   null);
             reader.open();
             InternalLog log = reader.read();
             Assert.assertNotNull(log);
 
             TaggedLogAPIEntity newEntity = HBaseInternalLogHelper.buildEntity(log, ed);
             Assert.assertEquals(TestLogAPIEntity.class, newEntity.getClass());
-            TestLogAPIEntity e1 = (TestLogAPIEntity) newEntity;
+            TestLogAPIEntity e1 = (TestLogAPIEntity)newEntity;
             Assert.assertEquals(e.getField1(), e1.getField1());
             Assert.assertEquals(e.getField2(), e1.getField2());
             Assert.assertEquals(e.getField3(), e1.getField3());
@@ -380,7 +393,7 @@ public class TestTestLogAPIEntity extends TestHBaseBase {
             Assert.assertNotNull(log);
             newEntity = HBaseInternalLogHelper.buildEntity(log, ed);
             Assert.assertEquals(TestLogAPIEntity.class, newEntity.getClass());
-            e1 = (TestLogAPIEntity) newEntity;
+            e1 = (TestLogAPIEntity)newEntity;
             Assert.assertEquals(e.getField1(), e1.getField1());
             Assert.assertEquals(e.getField2(), e1.getField2());
             Assert.assertEquals(e.getField3(), e1.getField3());

http://git-wip-us.apache.org/repos/asf/eagle/blob/6e919c2e/eagle-core/eagle-query/eagle-entity-base/src/test/java/org/apache/eagle/log/entity/base/taggedlog/TestTaggedLogAPIEntity.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-query/eagle-entity-base/src/test/java/org/apache/eagle/log/entity/base/taggedlog/TestTaggedLogAPIEntity.java b/eagle-core/eagle-query/eagle-entity-base/src/test/java/org/apache/eagle/log/entity/base/taggedlog/TestTaggedLogAPIEntity.java
index 2b59831..3dfd893 100755
--- a/eagle-core/eagle-query/eagle-entity-base/src/test/java/org/apache/eagle/log/entity/base/taggedlog/TestTaggedLogAPIEntity.java
+++ b/eagle-core/eagle-query/eagle-entity-base/src/test/java/org/apache/eagle/log/entity/base/taggedlog/TestTaggedLogAPIEntity.java
@@ -24,7 +24,6 @@ import java.util.Map;
 
 import com.fasterxml.jackson.core.JsonProcessingException;
 import com.fasterxml.jackson.databind.ObjectMapper;
-import com.fasterxml.jackson.databind.SerializationFeature;
 import org.apache.eagle.log.base.taggedlog.EntityJsonModule;
 import org.apache.eagle.log.base.taggedlog.TaggedLogAPIEntity;
 import org.apache.eagle.log.entity.meta.Column;
@@ -38,13 +37,13 @@ public class TestTaggedLogAPIEntity {
     private static ObjectMapper objectMapper;
 
     @BeforeClass
-    public static void setUp(){
+    public static void setUp() {
         objectMapper = new ObjectMapper();
         objectMapper.setFilters(TaggedLogAPIEntity.getFilterProvider());
         objectMapper.registerModule(new EntityJsonModule());
     }
 
-    @JsonSerialize(include=JsonSerialize.Inclusion.NON_NULL)
+    @JsonSerialize(include = JsonSerialize.Inclusion.NON_NULL)
     private class MockSubTaggedLogAPIEntity extends TaggedLogAPIEntity {
         public double getField1() {
             return field1;
@@ -72,7 +71,7 @@ public class TestTaggedLogAPIEntity {
     }
 
     @SuppressWarnings("unchecked")
-	@Test
+    @Test
     public void testJsonSerializeFilter() throws IOException {
         MockSubTaggedLogAPIEntity mock = new MockSubTaggedLogAPIEntity();
         Assert.assertTrue(mock instanceof TaggedLogAPIEntity);
@@ -91,12 +90,16 @@ public class TestTaggedLogAPIEntity {
         mock.setPrefix("mock");
         mock.setField2("ok");
         mock.setField1(12.345);
-        mock.setTags(new HashMap<String, String>(){{
-            put("tagName", "tagValue");
-        }});
-        mock.setExp(new HashMap<String, Object>() {{
-            put("extra_field", 3.14);
-        }});
+        mock.setTags(new HashMap<String, String>() {
+            {
+                put("tagName", "tagValue");
+            }
+        });
+        mock.setExp(new HashMap<String, Object>() {
+            {
+                put("extra_field", 3.14);
+            }
+        });
         json = objectMapper.writeValueAsString(mock);
         System.out.println(json);
         Assert.assertTrue(json.contains("field2"));
@@ -105,13 +108,13 @@ public class TestTaggedLogAPIEntity {
 
     @Test
     public void testJsonSerializeMap() throws JsonProcessingException {
-        Map<List<String>,List<Object>> entries = new HashMap<List<String>,List<Object>>(){
+        Map<List<String>, List<Object>> entries = new HashMap<List<String>, List<Object>>() {
             {
-                put(Arrays.asList("a","b"),Arrays.asList(1,2,3));
+                put(Arrays.asList("a", "b"), Arrays.asList(1, 2, 3));
             }
         };
         String json = objectMapper.writeValueAsString(entries.entrySet());
         Assert.assertNotNull(json);
         System.out.print(json);
     }
-}
\ No newline at end of file
+}

http://git-wip-us.apache.org/repos/asf/eagle/blob/6e919c2e/eagle-core/eagle-query/eagle-entity-base/src/test/java/org/apache/eagle/log/entity/filter/TestEntityQualifierHelper.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-query/eagle-entity-base/src/test/java/org/apache/eagle/log/entity/filter/TestEntityQualifierHelper.java b/eagle-core/eagle-query/eagle-entity-base/src/test/java/org/apache/eagle/log/entity/filter/TestEntityQualifierHelper.java
index e22c699..63dcca2 100755
--- a/eagle-core/eagle-query/eagle-entity-base/src/test/java/org/apache/eagle/log/entity/filter/TestEntityQualifierHelper.java
+++ b/eagle-core/eagle-query/eagle-entity-base/src/test/java/org/apache/eagle/log/entity/filter/TestEntityQualifierHelper.java
@@ -28,155 +28,156 @@ import org.junit.Test;
 import java.util.List;
 
 /**
-* @since : 10/15/14 2014
-*/
+ * @since : 10/15/14 2014
+ */
 public class TestEntityQualifierHelper {
-	private EntityDefinition ed;
-	@Before
-	public void setUp(){
-		try {
-			if(EntityDefinitionManager.getEntityByServiceName("TestLogAPIEntity") == null){
-				EntityDefinitionManager.registerEntity(TestLogAPIEntity.class);
-			}
-			ed = EntityDefinitionManager.getEntityByServiceName("TestLogAPIEntity");
-		} catch (InstantiationException e) {
-			e.printStackTrace();  //To change body of catch statement use File | Settings | File Templates.
-		} catch (IllegalAccessException e) {
-			e.printStackTrace();  //To change body of catch statement use File | Settings | File Templates.
-		}
-	}
-
-	@Test
-	public void testEd(){
-		Assert.assertNotNull(ed);
-		Assert.assertNotNull(ed.getQualifierNameMap().get("a"));
-		Assert.assertNull(ed.getQualifierNameMap().get("notexist"));
-	}
-
-	@Test
-	public void  testIntEntityQualifierHelper(){
-		byte[] value = EntityQualifierUtils.toBytes(ed, "field1", "2");
-		Assert.assertTrue(Bytes.compareTo(value, Bytes.toBytes(1)) > 0);
-		Assert.assertTrue(Bytes.compareTo(value, Bytes.toBytes(2)) == 0);
-		Assert.assertTrue(Bytes.compareTo(value, Bytes.toBytes(3)) < 0);
-	}
-
-	@Test
-	public void  testStringEntityQualifierHelper(){
-		byte[] value = EntityQualifierUtils.toBytes(ed, "field7", "xyz");
-		Assert.assertTrue(Bytes.compareTo(value, Bytes.toBytes("xyy")) > 0);
-		Assert.assertTrue(Bytes.compareTo(value, Bytes.toBytes("xyz")) == 0);
-		Assert.assertTrue(Bytes.compareTo(value, Bytes.toBytes("xzz")) < 0);
-
-		Assert.assertTrue(Bytes.compareTo(value, Bytes.toBytes("xy")) > 0);
-	}
-
-	@Test
-	public void  testDoubleEntityQualifierHelper(){
-		byte[] value = EntityQualifierUtils.toBytes(ed, "field5", "1.0");
-		Assert.assertTrue(Bytes.compareTo(value,Bytes.toBytes(0.5)) > 0);
-		Assert.assertTrue(Bytes.compareTo(value, Bytes.toBytes(1.0)) == 0);
-		Assert.assertTrue(Bytes.compareTo(value, Bytes.toBytes(2.2)) < 0);
-
-//      TODO There is problem with negative double
-//		Assert.assertTrue(Bytes.compareTo(Bytes.toBytes(-0.6),Bytes.toBytes(-0.5)) < 0);
-	}
-
-	@Test
-	public void  testLongEntityQualifierHelper(){
-		byte[] value = EntityQualifierUtils.toBytes(ed, "field4", "100000");
-		Assert.assertTrue(Bytes.compareTo(value,Bytes.toBytes(100000l-1l )) > 0);
-		Assert.assertTrue(Bytes.compareTo(value, Bytes.toBytes(100000l)) == 0);
-		Assert.assertTrue(Bytes.compareTo(value, Bytes.toBytes(100000l + 1l)) < 0);
-	}
-
-	@Test
-	public void  testNegativeLongEntityQualifierHelper(){
-		Exception ex = null;
-		try{
-			byte[] value = EntityQualifierUtils.toBytes(ed, "field4", "-100000");
-		}catch (IllegalArgumentException e){
-			ex = e;
-		}
-		Assert.assertNull(ex);
-	}
-
-	@Test
-	public void testParseAsList(){
-		List<String> set = EntityQualifierUtils.parseList("(\"abc1\",\"abc2\")");
-		Assert.assertEquals(2,set.size());
-		Assert.assertEquals("abc1",set.toArray()[0]);
-		Assert.assertEquals("abc2",set.toArray()[1]);
-
-		set = EntityQualifierUtils.parseList("(1,\"abc2\")");
-		Assert.assertEquals(2,set.size());
-		Assert.assertEquals("1",set.toArray()[0]);
-		Assert.assertEquals("abc2",set.toArray()[1]);
-
-		set = EntityQualifierUtils.parseList("(-1.5,\"abc2\")");
-		Assert.assertEquals(2,set.size());
-		Assert.assertEquals("-1.5",set.toArray()[0]);
-		Assert.assertEquals("abc2",set.toArray()[1]);
-
-		set = EntityQualifierUtils.parseList("(-1.5,\"-1.5,abc\")");
-		Assert.assertEquals(2,set.size());
-		Assert.assertEquals("-1.5",set.toArray()[0]);
-		Assert.assertEquals("-1.5,abc",set.toArray()[1]);
-
-		set = EntityQualifierUtils.parseList("(-1.5,\"\\\"abc\\\"\")");
-		Assert.assertEquals(2,set.size());
-		Assert.assertEquals("-1.5",set.toArray()[0]);
-		Assert.assertEquals("\"abc\"",set.toArray()[1]);
-
-		set = EntityQualifierUtils.parseList("(-1.5,\"-1.5,\\\"abc\")");
-		Assert.assertEquals(2,set.size());
-		Assert.assertEquals("-1.5",set.toArray()[0]);
-		Assert.assertEquals("-1.5,\"abc",set.toArray()[1]);
-
-		set = EntityQualifierUtils.parseList("(\"\\\"-1.5\\\",abc1\",\"-1.5,\\\"abc2\")");
-		Assert.assertEquals(2,set.size());
-		Assert.assertEquals("\"-1.5\",abc1",set.toArray()[0]);
-		Assert.assertEquals("-1.5,\"abc2",set.toArray()[1]);
-
-		set = EntityQualifierUtils.parseList("(-1.5,\"-1.5,\"abc\")");
-		Assert.assertEquals(2,set.size());
-		Assert.assertEquals("-1.5",set.toArray()[0]);
-		Assert.assertEquals("-1.5,\"abc",set.toArray()[1]);
-
-		set = EntityQualifierUtils.parseList("(\"\\\"value1,part1\\\",\\\"value1,part2\\\"\",\"value2\")");
-		Assert.assertEquals(2,set.size());
-		Assert.assertEquals("\"value1,part1\",\"value1,part2\"",set.toArray()[0]);
-		Assert.assertEquals("value2",set.toArray()[1]);
-
-		////////////////////////////////
-		// Bad Format
-		////////////////////////////////
-		set = EntityQualifierUtils.parseList("(\"a,b)");
-		Assert.assertEquals(1,set.size());
-		Assert.assertEquals("a,b",set.toArray()[0]);
-
-		set = EntityQualifierUtils.parseList("(a,b\")");
-		Assert.assertEquals(2,set.size());
-		Assert.assertEquals("a",set.toArray()[0]);
-		Assert.assertEquals("b",set.toArray()[1]);
-
-		set = EntityQualifierUtils.parseList("(a\",b)");
-		Assert.assertEquals(1,set.size());
-		Assert.assertEquals("a\",b",set.toArray()[0]);
-
-		set = EntityQualifierUtils.parseList("(abc,def)");
-		Assert.assertEquals(2,set.size());
-		Assert.assertEquals("abc",set.toArray()[0]);
-		Assert.assertEquals("def",set.toArray()[1]);
-
-		set = EntityQualifierUtils.parseList("(1.5,def)");
-		Assert.assertEquals(2,set.size());
-		Assert.assertEquals("1.5",set.toArray()[0]);
-		Assert.assertEquals("def",set.toArray()[1]);
-	}
-
-//	@Test
-//	public void testEscapeRegExp(){
-//		Assert.assertEquals("abc\\.def",EntityQualifierHelper.escapeRegExp("abc.def"));
-//	}
-}
\ No newline at end of file
+    private EntityDefinition ed;
+
+    @Before
+    public void setUp() {
+        try {
+            if (EntityDefinitionManager.getEntityByServiceName("TestLogAPIEntity") == null) {
+                EntityDefinitionManager.registerEntity(TestLogAPIEntity.class);
+            }
+            ed = EntityDefinitionManager.getEntityByServiceName("TestLogAPIEntity");
+        } catch (InstantiationException e) {
+            e.printStackTrace(); // To change body of catch statement use File | Settings | File Templates.
+        } catch (IllegalAccessException e) {
+            e.printStackTrace(); // To change body of catch statement use File | Settings | File Templates.
+        }
+    }
+
+    @Test
+    public void testEd() {
+        Assert.assertNotNull(ed);
+        Assert.assertNotNull(ed.getQualifierNameMap().get("a"));
+        Assert.assertNull(ed.getQualifierNameMap().get("notexist"));
+    }
+
+    @Test
+    public void testIntEntityQualifierHelper() {
+        byte[] value = EntityQualifierUtils.toBytes(ed, "field1", "2");
+        Assert.assertTrue(Bytes.compareTo(value, Bytes.toBytes(1)) > 0);
+        Assert.assertTrue(Bytes.compareTo(value, Bytes.toBytes(2)) == 0);
+        Assert.assertTrue(Bytes.compareTo(value, Bytes.toBytes(3)) < 0);
+    }
+
+    @Test
+    public void testStringEntityQualifierHelper() {
+        byte[] value = EntityQualifierUtils.toBytes(ed, "field7", "xyz");
+        Assert.assertTrue(Bytes.compareTo(value, Bytes.toBytes("xyy")) > 0);
+        Assert.assertTrue(Bytes.compareTo(value, Bytes.toBytes("xyz")) == 0);
+        Assert.assertTrue(Bytes.compareTo(value, Bytes.toBytes("xzz")) < 0);
+
+        Assert.assertTrue(Bytes.compareTo(value, Bytes.toBytes("xy")) > 0);
+    }
+
+    @Test
+    public void testDoubleEntityQualifierHelper() {
+        byte[] value = EntityQualifierUtils.toBytes(ed, "field5", "1.0");
+        Assert.assertTrue(Bytes.compareTo(value, Bytes.toBytes(0.5)) > 0);
+        Assert.assertTrue(Bytes.compareTo(value, Bytes.toBytes(1.0)) == 0);
+        Assert.assertTrue(Bytes.compareTo(value, Bytes.toBytes(2.2)) < 0);
+
+        // TODO There is problem with negative double
+        // Assert.assertTrue(Bytes.compareTo(Bytes.toBytes(-0.6),Bytes.toBytes(-0.5)) < 0);
+    }
+
+    @Test
+    public void testLongEntityQualifierHelper() {
+        byte[] value = EntityQualifierUtils.toBytes(ed, "field4", "100000");
+        Assert.assertTrue(Bytes.compareTo(value, Bytes.toBytes(100000l - 1l)) > 0);
+        Assert.assertTrue(Bytes.compareTo(value, Bytes.toBytes(100000l)) == 0);
+        Assert.assertTrue(Bytes.compareTo(value, Bytes.toBytes(100000l + 1l)) < 0);
+    }
+
+    @Test
+    public void testNegativeLongEntityQualifierHelper() {
+        Exception ex = null;
+        try {
+            byte[] value = EntityQualifierUtils.toBytes(ed, "field4", "-100000");
+        } catch (IllegalArgumentException e) {
+            ex = e;
+        }
+        Assert.assertNull(ex);
+    }
+
+    @Test
+    public void testParseAsList() {
+        List<String> set = EntityQualifierUtils.parseList("(\"abc1\",\"abc2\")");
+        Assert.assertEquals(2, set.size());
+        Assert.assertEquals("abc1", set.toArray()[0]);
+        Assert.assertEquals("abc2", set.toArray()[1]);
+
+        set = EntityQualifierUtils.parseList("(1,\"abc2\")");
+        Assert.assertEquals(2, set.size());
+        Assert.assertEquals("1", set.toArray()[0]);
+        Assert.assertEquals("abc2", set.toArray()[1]);
+
+        set = EntityQualifierUtils.parseList("(-1.5,\"abc2\")");
+        Assert.assertEquals(2, set.size());
+        Assert.assertEquals("-1.5", set.toArray()[0]);
+        Assert.assertEquals("abc2", set.toArray()[1]);
+
+        set = EntityQualifierUtils.parseList("(-1.5,\"-1.5,abc\")");
+        Assert.assertEquals(2, set.size());
+        Assert.assertEquals("-1.5", set.toArray()[0]);
+        Assert.assertEquals("-1.5,abc", set.toArray()[1]);
+
+        set = EntityQualifierUtils.parseList("(-1.5,\"\\\"abc\\\"\")");
+        Assert.assertEquals(2, set.size());
+        Assert.assertEquals("-1.5", set.toArray()[0]);
+        Assert.assertEquals("\"abc\"", set.toArray()[1]);
+
+        set = EntityQualifierUtils.parseList("(-1.5,\"-1.5,\\\"abc\")");
+        Assert.assertEquals(2, set.size());
+        Assert.assertEquals("-1.5", set.toArray()[0]);
+        Assert.assertEquals("-1.5,\"abc", set.toArray()[1]);
+
+        set = EntityQualifierUtils.parseList("(\"\\\"-1.5\\\",abc1\",\"-1.5,\\\"abc2\")");
+        Assert.assertEquals(2, set.size());
+        Assert.assertEquals("\"-1.5\",abc1", set.toArray()[0]);
+        Assert.assertEquals("-1.5,\"abc2", set.toArray()[1]);
+
+        set = EntityQualifierUtils.parseList("(-1.5,\"-1.5,\"abc\")");
+        Assert.assertEquals(2, set.size());
+        Assert.assertEquals("-1.5", set.toArray()[0]);
+        Assert.assertEquals("-1.5,\"abc", set.toArray()[1]);
+
+        set = EntityQualifierUtils.parseList("(\"\\\"value1,part1\\\",\\\"value1,part2\\\"\",\"value2\")");
+        Assert.assertEquals(2, set.size());
+        Assert.assertEquals("\"value1,part1\",\"value1,part2\"", set.toArray()[0]);
+        Assert.assertEquals("value2", set.toArray()[1]);
+
+        ////////////////////////////////
+        // Bad Format
+        ////////////////////////////////
+        set = EntityQualifierUtils.parseList("(\"a,b)");
+        Assert.assertEquals(1, set.size());
+        Assert.assertEquals("a,b", set.toArray()[0]);
+
+        set = EntityQualifierUtils.parseList("(a,b\")");
+        Assert.assertEquals(2, set.size());
+        Assert.assertEquals("a", set.toArray()[0]);
+        Assert.assertEquals("b", set.toArray()[1]);
+
+        set = EntityQualifierUtils.parseList("(a\",b)");
+        Assert.assertEquals(1, set.size());
+        Assert.assertEquals("a\",b", set.toArray()[0]);
+
+        set = EntityQualifierUtils.parseList("(abc,def)");
+        Assert.assertEquals(2, set.size());
+        Assert.assertEquals("abc", set.toArray()[0]);
+        Assert.assertEquals("def", set.toArray()[1]);
+
+        set = EntityQualifierUtils.parseList("(1.5,def)");
+        Assert.assertEquals(2, set.size());
+        Assert.assertEquals("1.5", set.toArray()[0]);
+        Assert.assertEquals("def", set.toArray()[1]);
+    }
+
+    // @Test
+    // public void testEscapeRegExp(){
+    // Assert.assertEquals("abc\\.def",EntityQualifierHelper.escapeRegExp("abc.def"));
+    // }
+}

http://git-wip-us.apache.org/repos/asf/eagle/blob/6e919c2e/eagle-core/eagle-query/eagle-entity-base/src/test/java/org/apache/eagle/log/entity/filter/TestExpressionComparator.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-query/eagle-entity-base/src/test/java/org/apache/eagle/log/entity/filter/TestExpressionComparator.java b/eagle-core/eagle-query/eagle-entity-base/src/test/java/org/apache/eagle/log/entity/filter/TestExpressionComparator.java
index 37adb55..8a9a4b4 100755
--- a/eagle-core/eagle-query/eagle-entity-base/src/test/java/org/apache/eagle/log/entity/filter/TestExpressionComparator.java
+++ b/eagle-core/eagle-query/eagle-entity-base/src/test/java/org/apache/eagle/log/entity/filter/TestExpressionComparator.java
@@ -27,7 +27,7 @@ import java.util.Map;
 
 public class TestExpressionComparator {
     @Test
-    public void testCompareToForEval(){
+    public void testCompareToForEval() {
         QualifierFilterEntity entity = new QualifierFilterEntity();
         // a+b >= a+100.0
         entity.setKey("a/b");
@@ -36,36 +36,38 @@ public class TestExpressionComparator {
         entity.setValueType(TokenType.EXP);
         entity.setOp(ComparisonOperator.GREATER_OR_EQUAL);
         EntityDefinition qualifierDisplayNameMap = null;
-        BooleanExpressionComparator comparator = new BooleanExpressionComparator(entity,qualifierDisplayNameMap);
+        BooleanExpressionComparator comparator = new BooleanExpressionComparator(entity,
+                                                                                 qualifierDisplayNameMap);
 
-        Map<String,Double> context = new HashMap<String,Double>();
-        Assert.assertEquals("Should return 0 because not given enough variable",0,comparator.compareTo(context));
+        Map<String, Double> context = new HashMap<String, Double>();
+        Assert.assertEquals("Should return 0 because not given enough variable", 0,
+                            comparator.compareTo(context));
 
         context.put("a", 80.0);
-        context.put("b",20.0);
-        context.put("c",3.0);
-        Assert.assertEquals(1,comparator.compareTo(context));
+        context.put("b", 20.0);
+        context.put("c", 3.0);
+        Assert.assertEquals(1, comparator.compareTo(context));
 
-        context.put("a",80.0);
-        context.put("b",20.0);
-        context.put("c",4.0);
-        Assert.assertEquals(1,comparator.compareTo(context));
+        context.put("a", 80.0);
+        context.put("b", 20.0);
+        context.put("c", 4.0);
+        Assert.assertEquals(1, comparator.compareTo(context));
 
-        context.put("a",80.0);
-        context.put("b",20.0);
-        context.put("c",5.0);
-        Assert.assertEquals(0,comparator.compareTo(context));
+        context.put("a", 80.0);
+        context.put("b", 20.0);
+        context.put("c", 5.0);
+        Assert.assertEquals(0, comparator.compareTo(context));
 
         // Return false once any Double.isInfinite ( 80.0 / 0.0 )
-        Assert.assertTrue(Double.isInfinite( 80.0 / 0.0 ));
-        context.put("a",80.0);
-        context.put("b",0.0);
+        Assert.assertTrue(Double.isInfinite(80.0 / 0.0));
+        context.put("a", 80.0);
+        context.put("b", 0.0);
         context.put("c", 5.0);
-        Assert.assertEquals(0,comparator.compareTo(context));
+        Assert.assertEquals(0, comparator.compareTo(context));
     }
 
     @Test
-    public void testCompareToForOp(){
+    public void testCompareToForOp() {
         QualifierFilterEntity entity = new QualifierFilterEntity();
 
         // a+b >= a+100.0
@@ -74,122 +76,123 @@ public class TestExpressionComparator {
         entity.setOp(ComparisonOperator.GREATER_OR_EQUAL);
         EntityDefinition qualifierDisplayNameMap = new EntityDefinition();
 
-        BooleanExpressionComparator comparator = new BooleanExpressionComparator(entity,qualifierDisplayNameMap);
+        BooleanExpressionComparator comparator = new BooleanExpressionComparator(entity,
+                                                                                 qualifierDisplayNameMap);
 
-        Map<String,Double> context = new HashMap<String,Double>();
-        context.put("a",100.1);
-        context.put("b",100.1);
-        Assert.assertEquals(1,comparator.compareTo(context));
+        Map<String, Double> context = new HashMap<String, Double>();
+        context.put("a", 100.1);
+        context.put("b", 100.1);
+        Assert.assertEquals(1, comparator.compareTo(context));
 
-        context.put("a",100.1);
-        context.put("b",100.0);
-        Assert.assertEquals(1,comparator.compareTo(context));
+        context.put("a", 100.1);
+        context.put("b", 100.0);
+        Assert.assertEquals(1, comparator.compareTo(context));
 
-        context.put("a",100.0);
-        context.put("b",99.9);
-        Assert.assertEquals(0,comparator.compareTo(context));
+        context.put("a", 100.0);
+        context.put("b", 99.9);
+        Assert.assertEquals(0, comparator.compareTo(context));
 
-        context.put("a",-200.0);
-        context.put("b",100.0);
-        Assert.assertEquals(1,comparator.compareTo(context));
+        context.put("a", -200.0);
+        context.put("b", 100.0);
+        Assert.assertEquals(1, comparator.compareTo(context));
 
-        context.put("a",-200.0);
-        context.put("b",-100.0);
-        Assert.assertEquals(0,comparator.compareTo(context));
+        context.put("a", -200.0);
+        context.put("b", -100.0);
+        Assert.assertEquals(0, comparator.compareTo(context));
 
         // a+b = a+100.0
         entity.setOp(ComparisonOperator.GREATER);
-        comparator = new BooleanExpressionComparator(entity,qualifierDisplayNameMap);
+        comparator = new BooleanExpressionComparator(entity, qualifierDisplayNameMap);
 
-        context.put("a",100.1);
-        context.put("b",100.1);
-        Assert.assertEquals(1,comparator.compareTo(context));
+        context.put("a", 100.1);
+        context.put("b", 100.1);
+        Assert.assertEquals(1, comparator.compareTo(context));
 
-        context.put("a",100.1);
-        context.put("b",100.0);
-        Assert.assertEquals(0,comparator.compareTo(context));
+        context.put("a", 100.1);
+        context.put("b", 100.0);
+        Assert.assertEquals(0, comparator.compareTo(context));
 
-        context.put("a",100.0);
-        context.put("b",99.9);
-        Assert.assertEquals(0,comparator.compareTo(context));
+        context.put("a", 100.0);
+        context.put("b", 99.9);
+        Assert.assertEquals(0, comparator.compareTo(context));
 
-        context.put("a",-200.0);
-        context.put("b",100.0);
-        Assert.assertEquals(0,comparator.compareTo(context));
+        context.put("a", -200.0);
+        context.put("b", 100.0);
+        Assert.assertEquals(0, comparator.compareTo(context));
 
-        context.put("a",-200.0);
-        context.put("b",-100.0);
-        Assert.assertEquals(0,comparator.compareTo(context));
+        context.put("a", -200.0);
+        context.put("b", -100.0);
+        Assert.assertEquals(0, comparator.compareTo(context));
 
         // a+b = a+100.0
         entity.setOp(ComparisonOperator.LESS);
-        comparator = new BooleanExpressionComparator(entity,qualifierDisplayNameMap);
+        comparator = new BooleanExpressionComparator(entity, qualifierDisplayNameMap);
 
-        context.put("a",100.1);
-        context.put("b",100.1);
-        Assert.assertEquals(0,comparator.compareTo(context));
+        context.put("a", 100.1);
+        context.put("b", 100.1);
+        Assert.assertEquals(0, comparator.compareTo(context));
 
-        context.put("a",100.1);
-        context.put("b",100.0);
-        Assert.assertEquals(0,comparator.compareTo(context));
+        context.put("a", 100.1);
+        context.put("b", 100.0);
+        Assert.assertEquals(0, comparator.compareTo(context));
 
-        context.put("a",100.0);
-        context.put("b",99.9);
-        Assert.assertEquals(1,comparator.compareTo(context));
+        context.put("a", 100.0);
+        context.put("b", 99.9);
+        Assert.assertEquals(1, comparator.compareTo(context));
 
-        context.put("a",-200.0);
-        context.put("b",100.0);
-        Assert.assertEquals(0,comparator.compareTo(context));
+        context.put("a", -200.0);
+        context.put("b", 100.0);
+        Assert.assertEquals(0, comparator.compareTo(context));
 
-        context.put("a",-200.0);
-        context.put("b",-100.0);
-        Assert.assertEquals(1,comparator.compareTo(context));
+        context.put("a", -200.0);
+        context.put("b", -100.0);
+        Assert.assertEquals(1, comparator.compareTo(context));
 
         // a+b <= a+100.0
         entity.setOp(ComparisonOperator.LESS_OR_EQUAL);
-        comparator = new BooleanExpressionComparator(entity,qualifierDisplayNameMap);
+        comparator = new BooleanExpressionComparator(entity, qualifierDisplayNameMap);
 
-        context.put("a",100.1);
-        context.put("b",100.1);
-        Assert.assertEquals(0,comparator.compareTo(context));
+        context.put("a", 100.1);
+        context.put("b", 100.1);
+        Assert.assertEquals(0, comparator.compareTo(context));
 
-        context.put("a",100.1);
-        context.put("b",100.0);
-        Assert.assertEquals(1,comparator.compareTo(context));
+        context.put("a", 100.1);
+        context.put("b", 100.0);
+        Assert.assertEquals(1, comparator.compareTo(context));
 
-        context.put("a",100.0);
-        context.put("b",99.9);
-        Assert.assertEquals(1,comparator.compareTo(context));
+        context.put("a", 100.0);
+        context.put("b", 99.9);
+        Assert.assertEquals(1, comparator.compareTo(context));
 
-        context.put("a",-200.0);
-        context.put("b",100.0);
-        Assert.assertEquals(1,comparator.compareTo(context));
+        context.put("a", -200.0);
+        context.put("b", 100.0);
+        Assert.assertEquals(1, comparator.compareTo(context));
 
-        context.put("a",-200.0);
-        context.put("b",-100.0);
-        Assert.assertEquals(1,comparator.compareTo(context));
+        context.put("a", -200.0);
+        context.put("b", -100.0);
+        Assert.assertEquals(1, comparator.compareTo(context));
 
         entity.setOp(ComparisonOperator.NOT_EQUAL);
-        comparator = new BooleanExpressionComparator(entity,qualifierDisplayNameMap);
+        comparator = new BooleanExpressionComparator(entity, qualifierDisplayNameMap);
 
-        context.put("a",100.1);
-        context.put("b",100.1);
-        Assert.assertEquals(1,comparator.compareTo(context));
+        context.put("a", 100.1);
+        context.put("b", 100.1);
+        Assert.assertEquals(1, comparator.compareTo(context));
 
-        context.put("a",100.1);
-        context.put("b",100.0);
-        Assert.assertEquals(0,comparator.compareTo(context));
+        context.put("a", 100.1);
+        context.put("b", 100.0);
+        Assert.assertEquals(0, comparator.compareTo(context));
 
-        context.put("a",100.0);
-        context.put("b",99.9);
-        Assert.assertEquals(1,comparator.compareTo(context));
+        context.put("a", 100.0);
+        context.put("b", 99.9);
+        Assert.assertEquals(1, comparator.compareTo(context));
 
-        context.put("a",-200.0);
-        context.put("b",100.0);
-        Assert.assertEquals(0,comparator.compareTo(context));
+        context.put("a", -200.0);
+        context.put("b", 100.0);
+        Assert.assertEquals(0, comparator.compareTo(context));
 
-        context.put("a",-200.0);
+        context.put("a", -200.0);
         context.put("b", -100.0);
-        Assert.assertEquals(1,comparator.compareTo(context));
+        Assert.assertEquals(1, comparator.compareTo(context));
     }
 }

http://git-wip-us.apache.org/repos/asf/eagle/blob/6e919c2e/eagle-core/eagle-query/eagle-entity-base/src/test/java/org/apache/eagle/log/entity/filter/TestHBaseFilterBuilder.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-query/eagle-entity-base/src/test/java/org/apache/eagle/log/entity/filter/TestHBaseFilterBuilder.java b/eagle-core/eagle-query/eagle-entity-base/src/test/java/org/apache/eagle/log/entity/filter/TestHBaseFilterBuilder.java
index 30e4523..93602a5 100755
--- a/eagle-core/eagle-query/eagle-entity-base/src/test/java/org/apache/eagle/log/entity/filter/TestHBaseFilterBuilder.java
+++ b/eagle-core/eagle-query/eagle-entity-base/src/test/java/org/apache/eagle/log/entity/filter/TestHBaseFilterBuilder.java
@@ -32,251 +32,258 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 public class TestHBaseFilterBuilder {
-	private final static Logger LOG = LoggerFactory.getLogger(TestHBaseFilterBuilder.class);
-	private EntityDefinition ed;
+    private static final Logger LOG = LoggerFactory.getLogger(TestHBaseFilterBuilder.class);
+    private EntityDefinition ed;
 
-	private Filter buildFilter(String query) throws EagleQueryParseException {
-		ORExpression expression = new EagleQueryParser(query).parse();
-		HBaseFilterBuilder builder = new HBaseFilterBuilder(ed,expression);
-		Filter filterList =  builder.buildFilters();
-		LOG.info("\n" + expression + " \n=> " + filterList);
-		return filterList;
-	}
+    private Filter buildFilter(String query) throws EagleQueryParseException {
+        ORExpression expression = new EagleQueryParser(query).parse();
+        HBaseFilterBuilder builder = new HBaseFilterBuilder(ed, expression);
+        Filter filterList = builder.buildFilters();
+        LOG.info("\n" + expression + " \n=> " + filterList);
+        return filterList;
+    }
 
-	@Before
-	public void setUp(){
-		try {
-			ed = EntityDefinitionManager.getEntityDefinitionByEntityClass(TestLogAPIEntity.class);
-			if(ed == null){
-				EntityDefinitionManager.registerEntity(TestLogAPIEntity.class);
-				ed = EntityDefinitionManager.getEntityDefinitionByEntityClass(TestLogAPIEntity.class);
-			}
-		} catch (InstantiationException e) {
-			Assert.fail(e.getMessage());
-		} catch (IllegalAccessException e) {
-			Assert.fail(e.getMessage());
-		}
-	}
+    @Before
+    public void setUp() {
+        try {
+            ed = EntityDefinitionManager.getEntityDefinitionByEntityClass(TestLogAPIEntity.class);
+            if (ed == null) {
+                EntityDefinitionManager.registerEntity(TestLogAPIEntity.class);
+                ed = EntityDefinitionManager.getEntityDefinitionByEntityClass(TestLogAPIEntity.class);
+            }
+        } catch (InstantiationException e) {
+            Assert.fail(e.getMessage());
+        } catch (IllegalAccessException e) {
+            Assert.fail(e.getMessage());
+        }
+    }
 
-	/**
-	 * Should success without exception
-	 */
-	@Test
-	public void testQueryParseAndBuildFilterSuccess(){
-		String[] queries = new String[]{
-			"@cluster = \"cluster1\" and @datacenter = \"dc1\"",
-			"@cluster = \"cluster1\" and @datacenter = \"dc1\" and @jobID = \"job_1234\"",
-			"@cluster = \"cluster1\" and @datacenter = \"dc1\" and @jobID = \"PigLatin: \\\"quoted_pig_job_name_value\\\"\"",
-			"@cluster = \"cluster1\" and @datacenter = \"dc1\" and @jobID in (\"job_1234\",\"job_4567\")",
-			"@cluster = \"cluster1\" and @datacenter = \"dc1\" and @jobID in (1234,\"job_4567\")",
-			"@cluster = \"cluster1\" and @datacenter = \"dc1\" and @jobID in (1234,\"sample job name: \\\"quoted_job_name_value\\\"\")",
-			"@cluster = \"cluster1\" and @datacenter = \"dc1\" and @jobID CONTAINS \"job_1234\"",
-			"@cluster = \"cluster1\" and @datacenter = \"dc1\" and @jobID CONTAINS job_1234",
-			"@cluster = \"cluster1\" and @datacenter = \"dc1\" and @jobID NOT CONTAINS \"job_456\"",
-			"@cluster = \"cluster1\" and @datacenter = \"dc1\" and @jobID is \"job_789\"",
-			"@cluster = \"cluster1\" and @datacenter = \"dc1\" and @jobID is not \"job_789\"",
-			"@cluster = \"cluster1\" and @datacenter = \"dc1\" and @jobID is null",
-			"@cluster = \"cluster1\" and @datacenter = \"dc1\" and @jobID is not null",
-			"@cluster = \"cluster1\" and @datacenter = \"dc1\" and @jobID is NULL",
-			"@cluster = \"cluster1\" and @datacenter = \"dc1\" and @jobID is not NULL",
-			"@cluster = \"cluster1\" and @datacenter = \"dc1\" and @jobID = NULL",
-			"@cluster = \"cluster1\" and @datacenter = \"dc1\" and @jobID != null",
-			"@cluster = \"cluster1\" and @datacenter = \"dc1\" and @jobID =~ \".*job_1234.*\"",
-			"@cluster = \"cluster1\" and @datacenter = \"dc1\" and @jobID !=~ \".*job_1234.*\"",
-			"@cluster = \"cluster1\" and @datacenter = \"dc1\" and @jobID !=~ \"\\\\|_\"",
-			"@cluster = \"cluster1\" and @datacenter = \"dc1\" and @field1 = 1 ",
-			"@cluster = \"cluster1\" and @datacenter = \"dc1\" and @field1 = 1 and @field3 = 100000",
-			"@cluster = \"cluster1\" and @datacenter = \"dc1\" and @field1 = 1 and @field5 = 1.56",
-			"@cluster = \"cluster1\" and @datacenter = \"dc1\" and @field1 = 1 and @field5 > 1.56",
-			"@cluster = \"cluster1\" and @datacenter = \"dc1\" and @field1 = 1 and @field5 >= 1.56",
-			"@cluster = \"cluster1\" and @datacenter = \"dc1\" and @field1 = 1 and @field5 < 1.56",
-			"@cluster = \"cluster1\" and @datacenter = \"dc1\" and @field1 = 1 and @field5 <= 1.56",
-			"@cluster = \"cluster1\" and @datacenter = \"dc1\" and ( @field3 = 100000 or @field3 < 100000)\"",
-			"@cluster = \"cluster1\" and @datacenter = \"dc1\" and ( @field3 = 100000 or @field3 in (\"100000\",\"1\"))\"",
-			"@cluster = \"cluster1\" and @datacenter = \"dc1\" and ( @field3 = 100000 or @field3 in (\"100000\",\"1\"))\"",
-			"@cluster = \"cluster1\" and @datacenter = \"dc1\" and ( @field3 = 100000 or @field7 in (\"\\\"value1-part1,value1-part2\\\"\",\"value2\"))\"",
-			"@cluster = \"cluster1\" and @datacenter = \"dc1\" and ( @field3 = 100000 or @field3 not in (\"100000\",\"1\"))\"",
-			"@cluster = \"cluster1\" and @datacenter = \"dc1\" and ( @field3 = 100000 or @field3 NOT IN (\"100000\",\"1\"))\"",
-			"@cluster = \"cluster1\" and @datacenter = \"dc1\" and ( @field3 = 100000 or @field7 NOT IN (\"\\\"value1-part1,value1-part2\\\"\",\"value2\"))\"",
-			// expression filter
-			"@cluster = \"cluster1\" and @datacenter = \"dc1\" and EXP{field3/field7 - field2} > 12",
-			"@cluster = \"cluster1\" and @datacenter = \"dc1\" and @field5 > EXP{field3/field7 - field2}",
-			"@cluster = \"cluster1\" and @datacenter = \"dc1\" and EXP{field3/field7 - field2} > EXP{field1 * field2}",
-			"@cluster = \"cluster1\" and @datacenter = \"dc1\" and EXP{field3/field7 - field2} > EXP{field1 * field2}",
-		};
-		for(String query: queries){
-			try {
-				Filter filter = buildFilter(query);
-				Assert.assertNotNull(filter);
-			} catch (EagleQueryParseException e) {
-				Assert.fail(e.getMessage());
-			} catch (Exception ex){
-				Assert.fail(ex.getMessage());
-			}
-		}
-	}
+    /**
+     * Should success without exception
+     */
+    @Test
+    public void testQueryParseAndBuildFilterSuccess() {
+        String[] queries = new String[] {
+                                         "@cluster = \"cluster1\" and @datacenter = \"dc1\"",
+                                         "@cluster = \"cluster1\" and @datacenter = \"dc1\" and @jobID = \"job_1234\"",
+                                         "@cluster = \"cluster1\" and @datacenter = \"dc1\" and @jobID = \"PigLatin: \\\"quoted_pig_job_name_value\\\"\"",
+                                         "@cluster = \"cluster1\" and @datacenter = \"dc1\" and @jobID in (\"job_1234\",\"job_4567\")",
+                                         "@cluster = \"cluster1\" and @datacenter = \"dc1\" and @jobID in (1234,\"job_4567\")",
+                                         "@cluster = \"cluster1\" and @datacenter = \"dc1\" and @jobID in (1234,\"sample job name: \\\"quoted_job_name_value\\\"\")",
+                                         "@cluster = \"cluster1\" and @datacenter = \"dc1\" and @jobID CONTAINS \"job_1234\"",
+                                         "@cluster = \"cluster1\" and @datacenter = \"dc1\" and @jobID CONTAINS job_1234",
+                                         "@cluster = \"cluster1\" and @datacenter = \"dc1\" and @jobID NOT CONTAINS \"job_456\"",
+                                         "@cluster = \"cluster1\" and @datacenter = \"dc1\" and @jobID is \"job_789\"",
+                                         "@cluster = \"cluster1\" and @datacenter = \"dc1\" and @jobID is not \"job_789\"",
+                                         "@cluster = \"cluster1\" and @datacenter = \"dc1\" and @jobID is null",
+                                         "@cluster = \"cluster1\" and @datacenter = \"dc1\" and @jobID is not null",
+                                         "@cluster = \"cluster1\" and @datacenter = \"dc1\" and @jobID is NULL",
+                                         "@cluster = \"cluster1\" and @datacenter = \"dc1\" and @jobID is not NULL",
+                                         "@cluster = \"cluster1\" and @datacenter = \"dc1\" and @jobID = NULL",
+                                         "@cluster = \"cluster1\" and @datacenter = \"dc1\" and @jobID != null",
+                                         "@cluster = \"cluster1\" and @datacenter = \"dc1\" and @jobID =~ \".*job_1234.*\"",
+                                         "@cluster = \"cluster1\" and @datacenter = \"dc1\" and @jobID !=~ \".*job_1234.*\"",
+                                         "@cluster = \"cluster1\" and @datacenter = \"dc1\" and @jobID !=~ \"\\\\|_\"",
+                                         "@cluster = \"cluster1\" and @datacenter = \"dc1\" and @field1 = 1 ",
+                                         "@cluster = \"cluster1\" and @datacenter = \"dc1\" and @field1 = 1 and @field3 = 100000",
+                                         "@cluster = \"cluster1\" and @datacenter = \"dc1\" and @field1 = 1 and @field5 = 1.56",
+                                         "@cluster = \"cluster1\" and @datacenter = \"dc1\" and @field1 = 1 and @field5 > 1.56",
+                                         "@cluster = \"cluster1\" and @datacenter = \"dc1\" and @field1 = 1 and @field5 >= 1.56",
+                                         "@cluster = \"cluster1\" and @datacenter = \"dc1\" and @field1 = 1 and @field5 < 1.56",
+                                         "@cluster = \"cluster1\" and @datacenter = \"dc1\" and @field1 = 1 and @field5 <= 1.56",
+                                         "@cluster = \"cluster1\" and @datacenter = \"dc1\" and ( @field3 = 100000 or @field3 < 100000)\"",
+                                         "@cluster = \"cluster1\" and @datacenter = \"dc1\" and ( @field3 = 100000 or @field3 in (\"100000\",\"1\"))\"",
+                                         "@cluster = \"cluster1\" and @datacenter = \"dc1\" and ( @field3 = 100000 or @field3 in (\"100000\",\"1\"))\"",
+                                         "@cluster = \"cluster1\" and @datacenter = \"dc1\" and ( @field3 = 100000 or @field7 in (\"\\\"value1-part1,value1-part2\\\"\",\"value2\"))\"",
+                                         "@cluster = \"cluster1\" and @datacenter = \"dc1\" and ( @field3 = 100000 or @field3 not in (\"100000\",\"1\"))\"",
+                                         "@cluster = \"cluster1\" and @datacenter = \"dc1\" and ( @field3 = 100000 or @field3 NOT IN (\"100000\",\"1\"))\"",
+                                         "@cluster = \"cluster1\" and @datacenter = \"dc1\" and ( @field3 = 100000 or @field7 NOT IN (\"\\\"value1-part1,value1-part2\\\"\",\"value2\"))\"",
+                                         // expression filter
+                                         "@cluster = \"cluster1\" and @datacenter = \"dc1\" and EXP{field3/field7 - field2} > 12",
+                                         "@cluster = \"cluster1\" and @datacenter = \"dc1\" and @field5 > EXP{field3/field7 - field2}",
+                                         "@cluster = \"cluster1\" and @datacenter = \"dc1\" and EXP{field3/field7 - field2} > EXP{field1 * field2}",
+                                         "@cluster = \"cluster1\" and @datacenter = \"dc1\" and EXP{field3/field7 - field2} > EXP{field1 * field2}",
+        };
+        for (String query : queries) {
+            try {
+                Filter filter = buildFilter(query);
+                Assert.assertNotNull(filter);
+            } catch (EagleQueryParseException e) {
+                Assert.fail(e.getMessage());
+            } catch (Exception ex) {
+                Assert.fail(ex.getMessage());
+            }
+        }
+    }
 
-	/**
-	 * Should throw exception
-	 */
-	@Test
-	public void testNegativeQueryParseSuccessfullyButBuildFilterFailed(){
-		String[] queries = new String[]{
-				"@cluster = \"cluster1\" and @datacenter = \"dc1\" and @tag < \"job_1234\"",
-				"@cluster = \"cluster1\" and @datacenter = \"dc1\" and @tag <= \"job_1234\"",
-				"@cluster = \"cluster1\" and @datacenter = \"dc1\" and @tag >= \"job_1234\"",
-				"@cluster = \"cluster1\" and @datacenter = \"dc1\" and @field1 < null",
-				"@cluster = \"cluster1\" and @datacenter = \"dc1\" and @field1 <= null",
-				"@cluster = \"cluster1\" and @datacenter = \"dc1\" and @field1 > NULL",
-				"@cluster = \"cluster1\" and @datacenter = \"dc1\" and @field1 >= NULL",
-				"@cluster = \"cluster1\" and @datacenter = \"dc1\" and @field1 =~ NULL",
-				"@cluster = \"cluster1\" and @datacenter = \"dc1\" and @field1 !=~ NULL",
-				"@cluster = \"cluster1\" and @datacenter = \"dc1\" and @field1 contains NULL",
-				"@cluster = \"cluster1\" and @datacenter = \"dc1\" and @field1 not contains NULL"
-		};
-		for(String query: queries){
-			try {
-				@SuppressWarnings("unused")
-				Filter filter = buildFilter(query);
-				Assert.fail("Should throw exception: "+query);
-			} catch (IllegalArgumentException e) {
-				LOG.info("Expect exception: " + e.getMessage());
-			} catch (EagleQueryParseException e) {
-				Assert.fail("Should parse successfully: "+query);
-			}
-		}
-	}
+    /**
+     * Should throw exception
+     */
+    @Test
+    public void testNegativeQueryParseSuccessfullyButBuildFilterFailed() {
+        String[] queries = new String[] {
+                                         "@cluster = \"cluster1\" and @datacenter = \"dc1\" and @tag < \"job_1234\"",
+                                         "@cluster = \"cluster1\" and @datacenter = \"dc1\" and @tag <= \"job_1234\"",
+                                         "@cluster = \"cluster1\" and @datacenter = \"dc1\" and @tag >= \"job_1234\"",
+                                         "@cluster = \"cluster1\" and @datacenter = \"dc1\" and @field1 < null",
+                                         "@cluster = \"cluster1\" and @datacenter = \"dc1\" and @field1 <= null",
+                                         "@cluster = \"cluster1\" and @datacenter = \"dc1\" and @field1 > NULL",
+                                         "@cluster = \"cluster1\" and @datacenter = \"dc1\" and @field1 >= NULL",
+                                         "@cluster = \"cluster1\" and @datacenter = \"dc1\" and @field1 =~ NULL",
+                                         "@cluster = \"cluster1\" and @datacenter = \"dc1\" and @field1 !=~ NULL",
+                                         "@cluster = \"cluster1\" and @datacenter = \"dc1\" and @field1 contains NULL",
+                                         "@cluster = \"cluster1\" and @datacenter = \"dc1\" and @field1 not contains NULL"
+        };
+        for (String query : queries) {
+            try {
+                @SuppressWarnings("unused")
+                Filter filter = buildFilter(query);
+                Assert.fail("Should throw exception: " + query);
+            } catch (IllegalArgumentException e) {
+                LOG.info("Expect exception: " + e.getMessage());
+            } catch (EagleQueryParseException e) {
+                Assert.fail("Should parse successfully: " + query);
+            }
+        }
+    }
 
-	@Test
-	public void testParsedFilter(){
-		String q1 = "@cluster = \"cluster1\" and @datacenter = \"dc1\" and @field3 = 100000";
-		try {
-			FilterList filterList = (FilterList) buildFilter(q1);
-			Assert.assertEquals(FilterList.Operator.MUST_PASS_ONE,filterList.getOperator());
-			Assert.assertEquals(1,filterList.getFilters().size());
-			Assert.assertEquals(2,((FilterList) filterList.getFilters().get(0)).getFilters().size());
-		} catch (EagleQueryParseException e) {
-			Assert.fail(e.getMessage());
-		}
+    @Test
+    public void testParsedFilter() {
+        String q1 = "@cluster = \"cluster1\" and @datacenter = \"dc1\" and @field3 = 100000";
+        try {
+            FilterList filterList = (FilterList)buildFilter(q1);
+            Assert.assertEquals(FilterList.Operator.MUST_PASS_ONE, filterList.getOperator());
+            Assert.assertEquals(1, filterList.getFilters().size());
+            Assert.assertEquals(2, ((FilterList)filterList.getFilters().get(0)).getFilters().size());
+        } catch (EagleQueryParseException e) {
+            Assert.fail(e.getMessage());
+        }
 
-		String q2 = "@cluster = \"cluster1\" and @datacenter = \"dc1\" and ( @field3 = 100000 or @field3 < 100000)";
-		try {
-			FilterList filterList = (FilterList) buildFilter(q2);
-			Assert.assertEquals(FilterList.Operator.MUST_PASS_ONE,filterList.getOperator());
-			Assert.assertEquals(2,filterList.getFilters().size());
-			Assert.assertEquals(2,((FilterList) filterList.getFilters().get(0)).getFilters().size());
-		} catch (EagleQueryParseException e) {
-			Assert.fail(e.getMessage());
-		}
+        String q2 = "@cluster = \"cluster1\" and @datacenter = \"dc1\" and ( @field3 = 100000 or @field3 < 100000)";
+        try {
+            FilterList filterList = (FilterList)buildFilter(q2);
+            Assert.assertEquals(FilterList.Operator.MUST_PASS_ONE, filterList.getOperator());
+            Assert.assertEquals(2, filterList.getFilters().size());
+            Assert.assertEquals(2, ((FilterList)filterList.getFilters().get(0)).getFilters().size());
+        } catch (EagleQueryParseException e) {
+            Assert.fail(e.getMessage());
+        }
 
-		// Test parse success but bad type of value
-		String q3 = "@cluster = \"cluster1\" and @datacenter = \"dc1\" and ( @field3 = 100000 or @field3 < \"bad_int_100000\")";
-		boolean q3Ex = false;
-		try {
-			Assert.assertNull(buildFilter(q3));
-		} catch (EagleQueryParseException e) {
-			Assert.fail(e.getMessage());
-		} catch (IllegalArgumentException e){
-			LOG.debug("Expect: ", e);
-			Assert.assertTrue(e.getCause() instanceof NumberFormatException);
-			q3Ex = true;
-		}
-		Assert.assertTrue(q3Ex);
-	}
+        // Test parse success but bad type of value
+        String q3 = "@cluster = \"cluster1\" and @datacenter = \"dc1\" and ( @field3 = 100000 or @field3 < \"bad_int_100000\")";
+        boolean q3Ex = false;
+        try {
+            Assert.assertNull(buildFilter(q3));
+        } catch (EagleQueryParseException e) {
+            Assert.fail(e.getMessage());
+        } catch (IllegalArgumentException e) {
+            LOG.debug("Expect: ", e);
+            Assert.assertTrue(e.getCause() instanceof NumberFormatException);
+            q3Ex = true;
+        }
+        Assert.assertTrue(q3Ex);
+    }
 
-	@Test
-	public void testWithUnescapedString(){
-		///////////////////////////////////
-		// Tag filter with IN or EQUAL
-		// Should use RowKeyFilter only
-		///////////////////////////////////
-		String query = "@cluster = \"cluster1\" and @datacenter = \"dc1\" and @jobID = \"job.1234\"";
-		try {
-			FilterList filter = (FilterList) buildFilter(query);
-			Assert.assertEquals(RowFilter.class, ((FilterList) filter.getFilters().get(0)).getFilters().get(0).getClass());
-			Assert.assertFalse("Should use rowkey filter only",filter.toString().matches(".*job.1234.*"));
-		} catch (EagleQueryParseException e) {
-			Assert.fail(e.getMessage());
-		} catch (Exception ex){
-			Assert.fail(ex.getMessage());
-		}
+    @Test
+    public void testWithUnescapedString() {
+        ///////////////////////////////////
+        // Tag filter with IN or EQUAL
+        // Should use RowKeyFilter only
+        ///////////////////////////////////
+        String query = "@cluster = \"cluster1\" and @datacenter = \"dc1\" and @jobID = \"job.1234\"";
+        try {
+            FilterList filter = (FilterList)buildFilter(query);
+            Assert.assertEquals(RowFilter.class,
+                                ((FilterList)filter.getFilters().get(0)).getFilters().get(0).getClass());
+            Assert.assertFalse("Should use rowkey filter only", filter.toString().matches(".*job.1234.*"));
+        } catch (EagleQueryParseException e) {
+            Assert.fail(e.getMessage());
+        } catch (Exception ex) {
+            Assert.fail(ex.getMessage());
+        }
 
-		query = "@cluster = \"cluster1\" and @datacenter = \"dc1\" and @jobID in (\"job_1234\")";
-		try {
-			FilterList filter = (FilterList) buildFilter(query);
-			Assert.assertEquals(RowFilter.class, ((FilterList) filter.getFilters().get(0)).getFilters().get(0).getClass());
-			Assert.assertFalse("Should use rowkey filter only",filter.toString().matches(".*job_1234.*"));
-		} catch (EagleQueryParseException e) {
-			Assert.fail(e.getMessage());
-		} catch (Exception ex){
-			Assert.fail(ex.getMessage());
-		}
+        query = "@cluster = \"cluster1\" and @datacenter = \"dc1\" and @jobID in (\"job_1234\")";
+        try {
+            FilterList filter = (FilterList)buildFilter(query);
+            Assert.assertEquals(RowFilter.class,
+                                ((FilterList)filter.getFilters().get(0)).getFilters().get(0).getClass());
+            Assert.assertFalse("Should use rowkey filter only", filter.toString().matches(".*job_1234.*"));
+        } catch (EagleQueryParseException e) {
+            Assert.fail(e.getMessage());
+        } catch (Exception ex) {
+            Assert.fail(ex.getMessage());
+        }
 
-		query = "@cluster = \"cluster1\" and @datacenter = \"dc1\" and @jobID in (\"job.1234\")";
-		try {
-			FilterList filter = (FilterList) buildFilter(query);
-			Assert.assertEquals(RowFilter.class, ((FilterList) filter.getFilters().get(0)).getFilters().get(0).getClass());
-			Assert.assertFalse("Should use rowkey filter only",filter.toString().matches(".*job.*1234.*"));
-		} catch (EagleQueryParseException e) {
-			Assert.fail(e.getMessage());
-		} catch (Exception ex){
-			Assert.fail(ex.getMessage());
-		}
+        query = "@cluster = \"cluster1\" and @datacenter = \"dc1\" and @jobID in (\"job.1234\")";
+        try {
+            FilterList filter = (FilterList)buildFilter(query);
+            Assert.assertEquals(RowFilter.class,
+                                ((FilterList)filter.getFilters().get(0)).getFilters().get(0).getClass());
+            Assert.assertFalse("Should use rowkey filter only", filter.toString().matches(".*job.*1234.*"));
+        } catch (EagleQueryParseException e) {
+            Assert.fail(e.getMessage());
+        } catch (Exception ex) {
+            Assert.fail(ex.getMessage());
+        }
 
-		///////////////////////////////
-		// Tag with other operators
-		///////////////////////////////
-		query = "@cluster = \"cluster1\" and @datacenter = \"dc1\" and @jobID =~ \"job_1234\"";
+        ///////////////////////////////
+        // Tag with other operators
+        ///////////////////////////////
+        query = "@cluster = \"cluster1\" and @datacenter = \"dc1\" and @jobID =~ \"job_1234\"";
 
-		try {
-			FilterList filter = (FilterList) buildFilter(query);
-			Assert.assertEquals(RowFilter.class, ((FilterList) filter.getFilters().get(0)).getFilters().get(0).getClass());
-			Assert.assertTrue(filter.toString().matches(".*job_1234.*"));
-		} catch (EagleQueryParseException e) {
-			Assert.fail(e.getMessage());
-		} catch (Exception ex){
-			Assert.fail(ex.getMessage());
-		}
+        try {
+            FilterList filter = (FilterList)buildFilter(query);
+            Assert.assertEquals(RowFilter.class,
+                                ((FilterList)filter.getFilters().get(0)).getFilters().get(0).getClass());
+            Assert.assertTrue(filter.toString().matches(".*job_1234.*"));
+        } catch (EagleQueryParseException e) {
+            Assert.fail(e.getMessage());
+        } catch (Exception ex) {
+            Assert.fail(ex.getMessage());
+        }
 
-		query = "@cluster = \"cluster1\" and @datacenter = \"dc1\" and @jobID =~ \"job.1234\"";
+        query = "@cluster = \"cluster1\" and @datacenter = \"dc1\" and @jobID =~ \"job.1234\"";
 
-		try {
-			FilterList filter = (FilterList) buildFilter(query);
-			Assert.assertEquals(RowFilter.class, ((FilterList) filter.getFilters().get(0)).getFilters().get(0).getClass());
-			Assert.assertTrue(filter.toString().matches(".*job.1234.*"));
-		} catch (EagleQueryParseException e) {
-			Assert.fail(e.getMessage());
-		} catch (Exception ex){
-			Assert.fail(ex.getMessage());
-		}
+        try {
+            FilterList filter = (FilterList)buildFilter(query);
+            Assert.assertEquals(RowFilter.class,
+                                ((FilterList)filter.getFilters().get(0)).getFilters().get(0).getClass());
+            Assert.assertTrue(filter.toString().matches(".*job.1234.*"));
+        } catch (EagleQueryParseException e) {
+            Assert.fail(e.getMessage());
+        } catch (Exception ex) {
+            Assert.fail(ex.getMessage());
+        }
 
-		///////////////////////////////
-		// Tag with IN
-		// Should escape regexp chars
-		///////////////////////////////
-		query = "@cluster = \"cluster1\" and @datacenter = \"dc1\" and @field7 = \"job_1234\"";
+        ///////////////////////////////
+        // Tag with IN
+        // Should escape regexp chars
+        ///////////////////////////////
+        query = "@cluster = \"cluster1\" and @datacenter = \"dc1\" and @field7 = \"job_1234\"";
 
-		try {
-			FilterList filter = (FilterList) buildFilter(query);
-			Assert.assertEquals(RowFilter.class, ((FilterList) filter.getFilters().get(0)).getFilters().get(0).getClass());
-			Assert.assertTrue(filter.toString().matches(".*job_1234.*"));
-		} catch (EagleQueryParseException e) {
-			Assert.fail(e.getMessage());
-		} catch (Exception ex){
-			ex.printStackTrace();
-			Assert.fail(ex.getMessage());
-		}
+        try {
+            FilterList filter = (FilterList)buildFilter(query);
+            Assert.assertEquals(RowFilter.class,
+                                ((FilterList)filter.getFilters().get(0)).getFilters().get(0).getClass());
+            Assert.assertTrue(filter.toString().matches(".*job_1234.*"));
+        } catch (EagleQueryParseException e) {
+            Assert.fail(e.getMessage());
+        } catch (Exception ex) {
+            ex.printStackTrace();
+            Assert.fail(ex.getMessage());
+        }
 
-		query = "@cluster = \"cluster1\" and @datacenter = \"dc1\" and @field7 in (\"job.1234\",\"others\")";
+        query = "@cluster = \"cluster1\" and @datacenter = \"dc1\" and @field7 in (\"job.1234\",\"others\")";
 
-		try {
-			FilterList filter = (FilterList) buildFilter(query);
-			Assert.assertEquals(RowFilter.class, ((FilterList) filter.getFilters().get(0)).getFilters().get(0).getClass());
-			Assert.assertTrue(filter.toString().matches(".*job\\.1234.*"));
-		} catch (EagleQueryParseException e) {
-			Assert.fail(e.getMessage());
-		} catch (Exception ex){
-			Assert.fail(ex.getMessage());
-		}
-	}
+        try {
+            FilterList filter = (FilterList)buildFilter(query);
+            Assert.assertEquals(RowFilter.class,
+                                ((FilterList)filter.getFilters().get(0)).getFilters().get(0).getClass());
+            Assert.assertTrue(filter.toString().matches(".*job\\.1234.*"));
+        } catch (EagleQueryParseException e) {
+            Assert.fail(e.getMessage());
+        } catch (Exception ex) {
+            Assert.fail(ex.getMessage());
+        }
+    }
 }

http://git-wip-us.apache.org/repos/asf/eagle/blob/6e919c2e/eagle-core/eagle-query/eagle-entity-base/src/test/java/org/apache/eagle/log/entity/filter/TestTypedByteArrayComparator.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-query/eagle-entity-base/src/test/java/org/apache/eagle/log/entity/filter/TestTypedByteArrayComparator.java b/eagle-core/eagle-query/eagle-entity-base/src/test/java/org/apache/eagle/log/entity/filter/TestTypedByteArrayComparator.java
index 1c0f416..c680f8f 100755
--- a/eagle-core/eagle-query/eagle-entity-base/src/test/java/org/apache/eagle/log/entity/filter/TestTypedByteArrayComparator.java
+++ b/eagle-core/eagle-query/eagle-entity-base/src/test/java/org/apache/eagle/log/entity/filter/TestTypedByteArrayComparator.java
@@ -28,23 +28,24 @@ import org.junit.Test;
  */
 public class TestTypedByteArrayComparator {
     @Test
-    public void testCompare(){
+    public void testCompare() {
         EntitySerDeser serDeser = new DoubleSerDeser();
-        TypedByteArrayComparator comparator = new TypedByteArrayComparator(serDeser.serialize(0.9),serDeser.type());
+        TypedByteArrayComparator comparator = new TypedByteArrayComparator(serDeser.serialize(0.9),
+                                                                           serDeser.type());
         Assert.assertTrue(comparator.compareTo(serDeser.serialize(0.8)) > 0);
         Assert.assertTrue(comparator.compareTo(serDeser.serialize(1.1)) < 0);
         Assert.assertTrue(comparator.compareTo(serDeser.serialize(0.9)) == 0);
-        Assert.assertTrue(comparator.compareTo(serDeser.serialize(- 0.9)) > 0);
+        Assert.assertTrue(comparator.compareTo(serDeser.serialize(-0.9)) > 0);
 
         serDeser = new IntSerDeser();
-        comparator = new TypedByteArrayComparator(serDeser.serialize(9),serDeser.type());
+        comparator = new TypedByteArrayComparator(serDeser.serialize(9), serDeser.type());
         Assert.assertTrue(comparator.compareTo(serDeser.serialize(8)) > 0);
         Assert.assertTrue(comparator.compareTo(serDeser.serialize(11)) < 0);
         Assert.assertTrue(comparator.compareTo(serDeser.serialize(9)) == 0);
         Assert.assertTrue(comparator.compareTo(serDeser.serialize(-9)) > 0);
 
         serDeser = new LongSerDeser();
-        comparator = new TypedByteArrayComparator(serDeser.serialize(9l),serDeser.type());
+        comparator = new TypedByteArrayComparator(serDeser.serialize(9l), serDeser.type());
         Assert.assertTrue(comparator.compareTo(serDeser.serialize(8l)) > 0);
         Assert.assertTrue(comparator.compareTo(serDeser.serialize(11l)) < 0);
         Assert.assertTrue(comparator.compareTo(serDeser.serialize(9l)) == 0);
@@ -52,10 +53,10 @@ public class TestTypedByteArrayComparator {
     }
 
     @Test
-    public void testClassName(){
-        Assert.assertEquals("long",long.class.getName());
+    public void testClassName() {
+        Assert.assertEquals("long", long.class.getName());
         Assert.assertEquals("java.lang.Long", Long.class.getName());
-        Assert.assertEquals("long",long.class.toString());
+        Assert.assertEquals("long", long.class.toString());
         Assert.assertEquals("class java.lang.Long", Long.class.toString());
     }
 }

http://git-wip-us.apache.org/repos/asf/eagle/blob/6e919c2e/eagle-core/eagle-query/eagle-entity-base/src/test/java/org/apache/eagle/log/entity/meta/TestArraySerDeser.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-query/eagle-entity-base/src/test/java/org/apache/eagle/log/entity/meta/TestArraySerDeser.java b/eagle-core/eagle-query/eagle-entity-base/src/test/java/org/apache/eagle/log/entity/meta/TestArraySerDeser.java
index 98db12f..eb31b15 100755
--- a/eagle-core/eagle-query/eagle-entity-base/src/test/java/org/apache/eagle/log/entity/meta/TestArraySerDeser.java
+++ b/eagle-core/eagle-query/eagle-entity-base/src/test/java/org/apache/eagle/log/entity/meta/TestArraySerDeser.java
@@ -21,44 +21,50 @@ import org.junit.Assert;
 import org.junit.Test;
 
 public class TestArraySerDeser {
-	
-	@Test
-	public void testIntArraySerDeser(){
-		IntArraySerDeser serDeser = new IntArraySerDeser();
-		int[] ints = new int[] {1, 34, 21, 82};
-		byte[] bytes = serDeser.serialize(ints);
-		Assert.assertEquals((ints.length+1)*4, bytes.length);
-		int[] targets = serDeser.deserialize(bytes);
-		Assert.assertEquals(ints.length, targets.length);
-		for(int i=0; i<ints.length; i++){
-			Assert.assertEquals(ints[i], targets[i]);
-		}
-	}
-	
-	@Test
-	public void testDoubleArraySerDeser(){
-		DoubleArraySerDeser serDeser = new DoubleArraySerDeser();
-		double[] doubles = new double[] {1.0, 34.0, 21.0, 82.0};
-		byte[] bytes = serDeser.serialize(doubles);
-		Assert.assertEquals(4 + doubles.length*8, bytes.length);
-		double[] targets = serDeser.deserialize(bytes);
-		Assert.assertEquals(doubles.length, targets.length);
-		for(int i=0; i<doubles.length; i++){
-			Assert.assertEquals(doubles[i], targets[i], 0.0001);
-		}
-	}
 
-	@Test
-	public void testStringArraySerDeser(){
-		StringArraySerDeser serDeser = new StringArraySerDeser();
-		String[] sources = new String[] {"a", "", "1", "2", "3"};
-		byte[] bytes = serDeser.serialize(sources);
-		Assert.assertEquals(4 + sources.length*4 + 4, bytes.length);
-		String[] targets = serDeser.deserialize(bytes);
-		Assert.assertEquals(sources.length, targets.length);
-		for(int i=0; i<sources.length; i++){
-			Assert.assertEquals(sources[i], targets[i]);
-		}
-	}
+    @Test
+    public void testIntArraySerDeser() {
+        IntArraySerDeser serDeser = new IntArraySerDeser();
+        int[] ints = new int[] {
+                                1, 34, 21, 82
+        };
+        byte[] bytes = serDeser.serialize(ints);
+        Assert.assertEquals((ints.length + 1) * 4, bytes.length);
+        int[] targets = serDeser.deserialize(bytes);
+        Assert.assertEquals(ints.length, targets.length);
+        for (int i = 0; i < ints.length; i++) {
+            Assert.assertEquals(ints[i], targets[i]);
+        }
+    }
+
+    @Test
+    public void testDoubleArraySerDeser() {
+        DoubleArraySerDeser serDeser = new DoubleArraySerDeser();
+        double[] doubles = new double[] {
+                                         1.0, 34.0, 21.0, 82.0
+        };
+        byte[] bytes = serDeser.serialize(doubles);
+        Assert.assertEquals(4 + doubles.length * 8, bytes.length);
+        double[] targets = serDeser.deserialize(bytes);
+        Assert.assertEquals(doubles.length, targets.length);
+        for (int i = 0; i < doubles.length; i++) {
+            Assert.assertEquals(doubles[i], targets[i], 0.0001);
+        }
+    }
+
+    @Test
+    public void testStringArraySerDeser() {
+        StringArraySerDeser serDeser = new StringArraySerDeser();
+        String[] sources = new String[] {
+                                         "a", "", "1", "2", "3"
+        };
+        byte[] bytes = serDeser.serialize(sources);
+        Assert.assertEquals(4 + sources.length * 4 + 4, bytes.length);
+        String[] targets = serDeser.deserialize(bytes);
+        Assert.assertEquals(sources.length, targets.length);
+        for (int i = 0; i < sources.length; i++) {
+            Assert.assertEquals(sources[i], targets[i]);
+        }
+    }
 
 }

http://git-wip-us.apache.org/repos/asf/eagle/blob/6e919c2e/eagle-core/eagle-query/eagle-entity-base/src/test/java/org/apache/eagle/log/entity/meta/TestEntityDefinitionManager.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-query/eagle-entity-base/src/test/java/org/apache/eagle/log/entity/meta/TestEntityDefinitionManager.java b/eagle-core/eagle-query/eagle-entity-base/src/test/java/org/apache/eagle/log/entity/meta/TestEntityDefinitionManager.java
index 3b5669d..b7c858f 100755
--- a/eagle-core/eagle-query/eagle-entity-base/src/test/java/org/apache/eagle/log/entity/meta/TestEntityDefinitionManager.java
+++ b/eagle-core/eagle-query/eagle-entity-base/src/test/java/org/apache/eagle/log/entity/meta/TestEntityDefinitionManager.java
@@ -23,13 +23,16 @@ import org.junit.Test;
 
 public class TestEntityDefinitionManager {
     @Test
-    public void testCreateEntityDefinition(){
-        EntityDefinition entityDefinition = EntityDefinitionManager.createEntityDefinition(TestLogAPIEntity.class);
+    public void testCreateEntityDefinition() {
+        EntityDefinition entityDefinition = EntityDefinitionManager
+            .createEntityDefinition(TestLogAPIEntity.class);
         Assert.assertNotNull(entityDefinition);
     }
+
     @Test
-    public void testCreateMetricEntityDefinition(){
-        EntityDefinition entityDefinition = EntityDefinitionManager.createEntityDefinition(GenericMetricEntity.class);
+    public void testCreateMetricEntityDefinition() {
+        EntityDefinition entityDefinition = EntityDefinitionManager
+            .createEntityDefinition(GenericMetricEntity.class);
         Assert.assertNotNull(entityDefinition);
     }
 }

http://git-wip-us.apache.org/repos/asf/eagle/blob/6e919c2e/eagle-core/eagle-query/eagle-entity-base/src/test/java/org/apache/eagle/log/entity/meta/TestListSerDeser.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-query/eagle-entity-base/src/test/java/org/apache/eagle/log/entity/meta/TestListSerDeser.java b/eagle-core/eagle-query/eagle-entity-base/src/test/java/org/apache/eagle/log/entity/meta/TestListSerDeser.java
index fb0018c..9160311 100644
--- a/eagle-core/eagle-query/eagle-entity-base/src/test/java/org/apache/eagle/log/entity/meta/TestListSerDeser.java
+++ b/eagle-core/eagle-query/eagle-entity-base/src/test/java/org/apache/eagle/log/entity/meta/TestListSerDeser.java
@@ -25,77 +25,77 @@ import org.junit.Test;
 
 public class TestListSerDeser {
 
-	@SuppressWarnings("rawtypes")
-	@Test
-	public void testStringListSerDeser() {
-		ListSerDeser serDeser = new ListSerDeser();
-		List<String> sources = new ArrayList<String>();
-		sources.add("value1");
-		sources.add("value2");
-		sources.add("value3");		
-				
-		byte[] bytes = serDeser.serialize(sources);
-		Assert.assertEquals(4 + sources.size() * 8 + 18, bytes.length);
-		List targets = serDeser.deserialize(bytes);
-		Assert.assertEquals(sources.size(), targets.size());
-		
-		Assert.assertTrue(targets.contains("value1"));
-		Assert.assertTrue(targets.contains("value2"));
-		Assert.assertTrue(targets.contains("value3"));
-	}
+    @SuppressWarnings("rawtypes")
+    @Test
+    public void testStringListSerDeser() {
+        ListSerDeser serDeser = new ListSerDeser();
+        List<String> sources = new ArrayList<String>();
+        sources.add("value1");
+        sources.add("value2");
+        sources.add("value3");
 
-	
-	@SuppressWarnings("rawtypes")
-	@Test
-	public void testIntegerMapSerDeser() {
-		ListSerDeser serDeser = new ListSerDeser();
-		List<Integer> sources = new ArrayList<Integer>();
-		sources.add(1);
-		sources.add(2);
-		sources.add(3);
-		
-		byte[] bytes = serDeser.serialize(sources);
-		Assert.assertEquals(4 + sources.size() * 8 + 12, bytes.length);
-		List targets = serDeser.deserialize(bytes);
-		Assert.assertEquals(sources.size(), targets.size());
-		
-		Assert.assertTrue(targets.contains(1));
-		Assert.assertTrue(targets.contains(2));
-		Assert.assertTrue(targets.contains(3));
-	}
+        byte[] bytes = serDeser.serialize(sources);
+        Assert.assertEquals(4 + sources.size() * 8 + 18, bytes.length);
+        List targets = serDeser.deserialize(bytes);
+        Assert.assertEquals(sources.size(), targets.size());
 
-	
-	@SuppressWarnings({ "rawtypes", "unchecked" })
-	@Test
-	public void testListListSerDeser() {
-		ListSerDeser serDeser = new ListSerDeser();
-		List<List<String>> sources = new ArrayList<List<String>>();
-		List<String> list1 = new ArrayList<String>();
-		list1.add("value1");
-		list1.add("value2");
-		list1.add("value3");
-		sources.add(list1);
-		
-		List<String> list2 = new ArrayList<String>();
-		list2.add("value4");
-		list2.add("value5");		
-		sources.add(list2);
-		
-		byte[] bytes = serDeser.serialize(sources);
-		List targets = serDeser.deserialize(bytes);
-		Assert.assertEquals(sources.size(), targets.size());
+        Assert.assertTrue(targets.contains("value1"));
+        Assert.assertTrue(targets.contains("value2"));
+        Assert.assertTrue(targets.contains("value3"));
+    }
 
-		list1 = (List)targets.get(0);
-		Assert.assertNotNull(list1);
-		Assert.assertEquals(3, list1.size());
-		Assert.assertTrue(list1.contains("value1"));
-		Assert.assertTrue(list1.contains("value2"));
-		Assert.assertTrue(list1.contains("value3"));
+    @SuppressWarnings("rawtypes")
+    @Test
+    public void testIntegerMapSerDeser() {
+        ListSerDeser serDeser = new ListSerDeser();
+        List<Integer> sources = new ArrayList<Integer>();
+        sources.add(1);
+        sources.add(2);
+        sources.add(3);
 
-		list2 = (List)targets.get(1);
-		Assert.assertNotNull(list2);
-		Assert.assertEquals(2, list2.size());
-		Assert.assertTrue(list2.contains("value4"));
-		Assert.assertTrue(list2.contains("value5"));
-	}
+        byte[] bytes = serDeser.serialize(sources);
+        Assert.assertEquals(4 + sources.size() * 8 + 12, bytes.length);
+        List targets = serDeser.deserialize(bytes);
+        Assert.assertEquals(sources.size(), targets.size());
+
+        Assert.assertTrue(targets.contains(1));
+        Assert.assertTrue(targets.contains(2));
+        Assert.assertTrue(targets.contains(3));
+    }
+
+    @SuppressWarnings({
+                       "rawtypes", "unchecked"
+    })
+    @Test
+    public void testListListSerDeser() {
+        ListSerDeser serDeser = new ListSerDeser();
+        List<List<String>> sources = new ArrayList<List<String>>();
+        List<String> list1 = new ArrayList<String>();
+        list1.add("value1");
+        list1.add("value2");
+        list1.add("value3");
+        sources.add(list1);
+
+        List<String> list2 = new ArrayList<String>();
+        list2.add("value4");
+        list2.add("value5");
+        sources.add(list2);
+
+        byte[] bytes = serDeser.serialize(sources);
+        List targets = serDeser.deserialize(bytes);
+        Assert.assertEquals(sources.size(), targets.size());
+
+        list1 = (List)targets.get(0);
+        Assert.assertNotNull(list1);
+        Assert.assertEquals(3, list1.size());
+        Assert.assertTrue(list1.contains("value1"));
+        Assert.assertTrue(list1.contains("value2"));
+        Assert.assertTrue(list1.contains("value3"));
+
+        list2 = (List)targets.get(1);
+        Assert.assertNotNull(list2);
+        Assert.assertEquals(2, list2.size());
+        Assert.assertTrue(list2.contains("value4"));
+        Assert.assertTrue(list2.contains("value5"));
+    }
 }


Mime
View raw message