eagle-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From qingwz...@apache.org
Subject [2/3] incubator-eagle git commit: [EAGLE-724] Fix eagle-common checkstyle problem
Date Fri, 04 Nov 2016 10:50:56 GMT
http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/ca0fae40/eagle-core/eagle-common/src/main/java/org/apache/eagle/common/service/LdapService.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-common/src/main/java/org/apache/eagle/common/service/LdapService.java b/eagle-core/eagle-common/src/main/java/org/apache/eagle/common/service/LdapService.java
index 31f1d01..eb2b0a0 100644
--- a/eagle-core/eagle-common/src/main/java/org/apache/eagle/common/service/LdapService.java
+++ b/eagle-core/eagle-common/src/main/java/org/apache/eagle/common/service/LdapService.java
@@ -29,62 +29,66 @@ import javax.naming.directory.*;
 import java.util.*;
 
 /**
+ * Ldap Service.
  * @since : 7/11/14,2014
  */
 public class LdapService {
-    private final static Logger LOG = LoggerFactory.getLogger(LdapService.class);
+    private static final Logger LOG = LoggerFactory.getLogger(LdapService.class);
 
     private final List<String> ldapSrvs;
     private String ldapCerts;
     private final String securityPrincipal;
     private final String securityCredentials;
 
-    public final static String SECURITY_PRINCIPAL_CONFIG_NAME = "eagle.ldap.security-principal";
-    public final static String SECURITY_CREDENTIALS_CONFIG_NAME = "eagle.ldap.security-credentials";
-    public final static String LDAP_SERVER_CONFIG_NAME = "eagle.ldap.server";
-    public final static String LDAP_CERTS_CONFIG_NAME = "eagle.ldap.certs";
-    public final static String DEFAULT_LDAP_CERTS_FILE_NAME = "jssecacerts";
+    public static final String SECURITY_PRINCIPAL_CONFIG_NAME = "eagle.ldap.security-principal";
+    public static final String SECURITY_CREDENTIALS_CONFIG_NAME = "eagle.ldap.security-credentials";
+    public static final String LDAP_SERVER_CONFIG_NAME = "eagle.ldap.server";
+    public static final String LDAP_CERTS_CONFIG_NAME = "eagle.ldap.certs";
+    public static final String DEFAULT_LDAP_CERTS_FILE_NAME = "jssecacerts";
 
-    private LdapService(){
+    private LdapService() {
         EagleConfig manager = EagleConfigFactory.load();
         securityPrincipal = manager.getConfig().getString(SECURITY_PRINCIPAL_CONFIG_NAME);
         securityCredentials = manager.getConfig().getString(SECURITY_CREDENTIALS_CONFIG_NAME);
         String ldapServer = manager.getConfig().getString(LDAP_SERVER_CONFIG_NAME);
-        if(LOG.isDebugEnabled())
-            LOG.debug(SECURITY_PRINCIPAL_CONFIG_NAME+":"+securityPrincipal);
-        if(securityCredentials!=null){
-            if(LOG.isDebugEnabled())
-                LOG.debug(SECURITY_CREDENTIALS_CONFIG_NAME+": (hidden for security, length: "+securityCredentials.length()+")");
-        }else{
-            LOG.warn(SECURITY_CREDENTIALS_CONFIG_NAME+":"+null);
+        if (LOG.isDebugEnabled()) {
+            LOG.debug(SECURITY_PRINCIPAL_CONFIG_NAME + ":" + securityPrincipal);
+        }
+        if (securityCredentials != null) {
+            if (LOG.isDebugEnabled()) {
+                LOG.debug(SECURITY_CREDENTIALS_CONFIG_NAME + ": (hidden for security, length: " + securityCredentials.length() + ")");
+            }
+        } else {
+            LOG.warn(SECURITY_CREDENTIALS_CONFIG_NAME + ":" + null);
+        }
+        if (LOG.isDebugEnabled()) {
+            LOG.debug(LDAP_SERVER_CONFIG_NAME + ":" + ldapServer);
         }
-        if(LOG.isDebugEnabled())
-            LOG.debug(LDAP_SERVER_CONFIG_NAME+":"+ldapServer);
 
         ldapSrvs = Arrays.asList(ldapServer.split(","));
         ldapCerts = manager.getConfig().getString(LDAP_CERTS_CONFIG_NAME);
-        if(ldapCerts == null) {
+        if (ldapCerts == null) {
             ldapCerts = LdapService.class.getClassLoader().getResource(DEFAULT_LDAP_CERTS_FILE_NAME).getPath();
-        }else if(!ldapCerts.startsWith("/") && !ldapCerts.matches("[a-zA-Z]+:.*")) {
+        } else if (!ldapCerts.startsWith("/") && !ldapCerts.matches("[a-zA-Z]+:.*")) {
             ldapCerts = LdapService.class.getClassLoader().getResource(ldapCerts).getPath();
         }
-        if(LOG.isDebugEnabled()) {
-            LOG.debug(SECURITY_PRINCIPAL_CONFIG_NAME +": "+securityPrincipal);
-            if(securityCredentials == null){
-                LOG.debug(SECURITY_CREDENTIALS_CONFIG_NAME +": null");
-            }else{
-                LOG.debug(SECURITY_CREDENTIALS_CONFIG_NAME +": (hidden, length: "+securityCredentials .length()+")");
+        if (LOG.isDebugEnabled()) {
+            LOG.debug(SECURITY_PRINCIPAL_CONFIG_NAME + ": " + securityPrincipal);
+            if (securityCredentials == null) {
+                LOG.debug(SECURITY_CREDENTIALS_CONFIG_NAME + ": null");
+            } else {
+                LOG.debug(SECURITY_CREDENTIALS_CONFIG_NAME + ": (hidden, length: " + securityCredentials.length() + ")");
             }
 
-            LOG.debug(LDAP_SERVER_CONFIG_NAME +": "+ldapSrvs);
-            LOG.debug(LDAP_CERTS_CONFIG_NAME +": "+ldapCerts);
+            LOG.debug(LDAP_SERVER_CONFIG_NAME + ": " + ldapSrvs);
+            LOG.debug(LDAP_CERTS_CONFIG_NAME + ": " + ldapCerts);
         }
     }
 
     private static LdapService instance;
 
-    public static LdapService getInstance(){
-        if(instance == null){
+    public static LdapService getInstance() {
+        if (instance == null) {
             instance = new LdapService();
         }
         return instance;
@@ -99,16 +103,16 @@ public class LdapService {
         String host = ldapSrvs.get(id);
 
         Hashtable<String, String> env = new Hashtable<String, String>();
-//		if (ldapCerts != null) {
+        //if (ldapCerts != null) {
         env.put(Context.SECURITY_PROTOCOL, "ssl");
-//		}
+        //}
         env.put(Context.INITIAL_CONTEXT_FACTORY, "com.sun.jndi.ldap.LdapCtxFactory");
         env.put(Context.PROVIDER_URL, host);
         env.put(Context.SECURITY_AUTHENTICATION, "simple");
         env.put(Context.SECURITY_PRINCIPAL, securityPrincipal);
         env.put(Context.SECURITY_CREDENTIALS, securityCredentials);
         env.put("java.naming.ldap.attributes.binary", "objectSID");
-        env.put("java.naming.ldap.factory.socket","hadoop.eagle.common.service.TrustAllSSLSocketFactory");
+        env.put("java.naming.ldap.factory.socket", "hadoop.eagle.common.service.TrustAllSSLSocketFactory");
 
         DirContext ctx = null;
         try {
@@ -120,40 +124,40 @@ public class LdapService {
         return ctx;
     }
 
-    public final static String CN= "cn";
-    public final static String DISPLAY_NAME =  "displayName";
-    public final static String DESCRIPTION= "description";
-    public final static String SAMACCOUNT_NAME= "sAMAccountName";
-    public final static String TELEPHONE_NUMBER= "telephonenumber";
-    public final static String GIVEN_NAME= "givenName";
-    public final static String UID_NUMBER =  "uidNumber";
-    public final static String L = "l";
-    public final static String ST = "st";
-    public final static String CO = "co";
-    public final static String MEMBER_OF = "memberof";
-    public final static String SN =  "sn";
-    public final static String MAIL = "mail";
-    public final static String DISTINGUISHED_NAME =  "distinguishedName";
+    public static final String CN = "cn";
+    public static final String DISPLAY_NAME = "displayName";
+    public static final String DESCRIPTION = "description";
+    public static final String SAMACCOUNT_NAME = "sAMAccountName";
+    public static final String TELEPHONE_NUMBER = "telephonenumber";
+    public static final String GIVEN_NAME = "givenName";
+    public static final String UID_NUMBER = "uidNumber";
+    public static final String L = "l";
+    public static final String ST = "st";
+    public static final String CO = "co";
+    public static final String MEMBER_OF = "memberof";
+    public static final String SN = "sn";
+    public static final String MAIL = "mail";
+    public static final String DISTINGUISHED_NAME = "distinguishedName";
 
     protected SearchControls getSearchControl() {
-        SearchControls sc = new SearchControls();
 
         String[] attributeFilter = new String[15];
         attributeFilter[0] = CN;
-        attributeFilter[1] =  DISPLAY_NAME ;
+        attributeFilter[1] = DISPLAY_NAME;
         attributeFilter[2] = DESCRIPTION;
-        attributeFilter[3] =  SAMACCOUNT_NAME;
-        attributeFilter[4] =  TELEPHONE_NUMBER;
+        attributeFilter[3] = SAMACCOUNT_NAME;
+        attributeFilter[4] = TELEPHONE_NUMBER;
         attributeFilter[5] = GIVEN_NAME;
         attributeFilter[6] = UID_NUMBER;
         attributeFilter[7] = L;
         attributeFilter[8] = ST;
-        attributeFilter[9] =CO;
+        attributeFilter[9] = CO;
         attributeFilter[10] = MEMBER_OF;
         attributeFilter[11] = SN;
         attributeFilter[12] = MAIL;
         attributeFilter[13] = DISTINGUISHED_NAME;
 
+        SearchControls sc = new SearchControls();
         sc.setReturningAttributes(attributeFilter);
         sc.setSearchScope(SearchControls.SUBTREE_SCOPE);
 
@@ -163,16 +167,21 @@ public class LdapService {
     public Map<String, String> getUserInfo(String userName) {
         Map<String, String> infos = null;
         for (int i = 0; i < ldapSrvs.size(); i++) {
-            if(LOG.isDebugEnabled()) LOG.debug("Using server: "+ldapSrvs.get(i));
+            if (LOG.isDebugEnabled()) {
+                LOG.debug("Using server: " + ldapSrvs.get(i));
+            }
             infos = getUserInfo(i, userName);
-            if (infos.size() > 0)
+            if (infos.size() > 0) {
                 break;
+            }
         }
         return infos;
     }
 
     public Map<String, String> getUserInfo(int id, String userName) {
-        if(LOG.isDebugEnabled()) LOG.debug("Ldap get user information for id:"+id+", username:"+userName);
+        if (LOG.isDebugEnabled()) {
+            LOG.debug("Ldap get user information for id:" + id + ", username:" + userName);
+        }
         DirContext ctx = getDirContext(id);
         Map<String, String> infos = new HashMap<String, String>();
 
@@ -186,28 +195,31 @@ public class LdapService {
                     SearchResult sr = (SearchResult) results.next();
                     Attributes attrs = sr.getAttributes();
 
-                    for (NamingEnumeration<?> ae = attrs.getAll(); ae.hasMoreElements();) {
+                    for (NamingEnumeration<?> ae = attrs.getAll(); ae.hasMoreElements(); ) {
                         Attribute attr = (Attribute) ae.next();
                         String attrId = attr.getID();
-                        for (NamingEnumeration<?> vals = attr.getAll(); vals.hasMore();) {
+                        for (NamingEnumeration<?> vals = attr.getAll(); vals.hasMore(); ) {
                             String thing = vals.next().toString();
                             infos.put(attrId, thing);
                         }
                     }
                 }
             } catch (NamingException e) {
-                LOG.error("LDAP authentication failed with exception: "+e.getMessage(),e);
+                LOG.error("LDAP authentication failed with exception: " + e.getMessage(), e);
             }
         }
 
-        if(LOG.isDebugEnabled()) LOG.debug(infos.toString());
+        if (LOG.isDebugEnabled()) {
+            LOG.debug(infos.toString());
+        }
         return infos;
     }
 
     public boolean authenticate(String userName, String password) {
         for (int i = 0; i < ldapSrvs.size(); i++) {
-            if (authenticate(i, userName, password))
+            if (authenticate(i, userName, password)) {
                 return true;
+            }
         }
         return false;
     }
@@ -235,15 +247,15 @@ public class LdapService {
 
                 if (userDN != null) {
                     Hashtable<String, String> uenv = new Hashtable<String, String>();
-//					if (ldapCerts != null) {
+                    //if (ldapCerts != null) {
                     uenv.put(Context.SECURITY_PROTOCOL, "ssl");
-//					}
+                    //}
                     uenv.put(Context.INITIAL_CONTEXT_FACTORY, "com.sun.jndi.ldap.LdapCtxFactory");
                     uenv.put(Context.PROVIDER_URL, ldapSrvs.get(id));
                     uenv.put(Context.SECURITY_AUTHENTICATION, "simple");
                     uenv.put(Context.SECURITY_PRINCIPAL, userDN);
                     uenv.put(Context.SECURITY_CREDENTIALS, password);
-                    uenv.put("java.naming.ldap.factory.socket","hadoop.eagle.common.service.TrustAllSSLSocketFactory");
+                    uenv.put("java.naming.ldap.factory.socket", "hadoop.eagle.common.service.TrustAllSSLSocketFactory");
                     DirContext uctx = new InitialDirContext(uenv);
                     uctx.close();
 

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/ca0fae40/eagle-core/eagle-common/src/main/java/org/apache/eagle/common/service/POSTResultEntityBase.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-common/src/main/java/org/apache/eagle/common/service/POSTResultEntityBase.java b/eagle-core/eagle-common/src/main/java/org/apache/eagle/common/service/POSTResultEntityBase.java
index e0daeb7..b1a7e97 100644
--- a/eagle-core/eagle-common/src/main/java/org/apache/eagle/common/service/POSTResultEntityBase.java
+++ b/eagle-core/eagle-common/src/main/java/org/apache/eagle/common/service/POSTResultEntityBase.java
@@ -25,18 +25,22 @@ import javax.xml.bind.annotation.XmlType;
 @XmlAccessorType(XmlAccessType.FIELD)
 @XmlType(propOrder = {"success", "exception"})
 public class POSTResultEntityBase {
-	private boolean success;
-	private String exception;
-	public boolean isSuccess() {
-		return success;
-	}
-	public void setSuccess(boolean success) {
-		this.success = success;
-	}
-	public String getException() {
-		return exception;
-	}
-	public void setException(String exception) {
-		this.exception = exception;
-	}
+    private boolean success;
+    private String exception;
+
+    public boolean isSuccess() {
+        return success;
+    }
+
+    public void setSuccess(boolean success) {
+        this.success = success;
+    }
+
+    public String getException() {
+        return exception;
+    }
+
+    public void setException(String exception) {
+        this.exception = exception;
+    }
 }

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/ca0fae40/eagle-core/eagle-common/src/main/java/org/apache/eagle/common/service/TrustAllSSLSocketFactory.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-common/src/main/java/org/apache/eagle/common/service/TrustAllSSLSocketFactory.java b/eagle-core/eagle-common/src/main/java/org/apache/eagle/common/service/TrustAllSSLSocketFactory.java
index 8058b58..22b775b 100644
--- a/eagle-core/eagle-common/src/main/java/org/apache/eagle/common/service/TrustAllSSLSocketFactory.java
+++ b/eagle-core/eagle-common/src/main/java/org/apache/eagle/common/service/TrustAllSSLSocketFactory.java
@@ -34,9 +34,10 @@ public class TrustAllSSLSocketFactory extends SSLSocketFactory {
         try {
             SSLContext ctx = SSLContext.getInstance("SSL");
             //  ctx.init(null, new TrustManager[]{new TrustAnyTrustManager() {}}, new SecureRandom());
-            ctx.init(null, new TrustManager[]{new TrustAnyTrustManager() {}}, null);
+            ctx.init(null, new TrustManager[] {new TrustAnyTrustManager() {
+            }}, null);
             socketFactory = ctx.getSocketFactory();
-        } catch ( Exception ex ) {
+        } catch (Exception ex) {
             ex.printStackTrace(System.err);
             /* handle exception */
         }
@@ -83,12 +84,12 @@ public class TrustAllSSLSocketFactory extends SSLSocketFactory {
 
     private static class TrustAnyTrustManager implements X509TrustManager {
         @Override
-        public void checkClientTrusted( final X509Certificate[] chain, final String authType ) {
+        public void checkClientTrusted(final X509Certificate[] chain, final String authType) {
 
         }
 
         @Override
-        public void checkServerTrusted( final X509Certificate[] chain, final String authType ) {
+        public void checkServerTrusted(final X509Certificate[] chain, final String authType) {
 
         }
 

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/ca0fae40/eagle-core/eagle-common/src/main/resources/footer.vm
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-common/src/main/resources/footer.vm b/eagle-core/eagle-common/src/main/resources/footer.vm
index 89cf245..d255988 100755
--- a/eagle-core/eagle-common/src/main/resources/footer.vm
+++ b/eagle-core/eagle-common/src/main/resources/footer.vm
@@ -16,9 +16,9 @@
  *
  * @version 0.3.0
  *#
-	</td>
-  </tr>
-  </tr>
+</td>
+</tr>
+</tr>
 </table>
 <!-- End of wrapper table -->
 </body>

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/ca0fae40/eagle-core/eagle-common/src/main/resources/header.vm
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-common/src/main/resources/header.vm b/eagle-core/eagle-common/src/main/resources/header.vm
index 6731aee..922a003 100755
--- a/eagle-core/eagle-common/src/main/resources/header.vm
+++ b/eagle-core/eagle-common/src/main/resources/header.vm
@@ -19,285 +19,286 @@
 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
 <html xmlns="http://www.w3.org/1999/xhtml">
 <head>
-  <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
-  <meta name="viewport" content="width=device-width, initial-scale=1.0"/>
-  <title></title>
-  <style type="text/css">
-    /* Based on The MailChimp Reset INLINE: Yes. */
-    /* Client-specific Styles */
-    .outlook a {
-      color: #091D42;
-      padding: 0;
-      text-decoration: none;
-    }
-
-    /* Force Outlook to provide a "view in browser" menu link. */
-    body {
-      width: 100% !important;
-      -webkit-text-size-adjust: 100%;
-      -ms-text-size-adjust: 100%;
-      margin: 0;
-      padding: 0;
-    }
-
-    /* Prevent Webkit and Windows Mobile platforms from changing default font sizes.*/
-    .ExternalClass {
-      width: 100%;
-    }
-
-    /* Force Hotmail to display emails at full width */
-    .ExternalClass, .ExternalClass p, .ExternalClass span, .ExternalClass font, .ExternalClass td, .ExternalClass div {
-      line-height: 100%;
-    }
-
-    /* Forces Hotmail to display normal line spacing.  More on that: http://www.emailonacid.com/forum/viewthread/43/ */
-    #backgroundTable {
-      margin: 0;
-      padding: 0;
-      width: 100% !important;
-      line-height: 100% !important;
-        border: 1pt solid #BFB8AF;
-        background-color: #fff;
-    }
-
-    /* End reset */
-
-    /* Some sensible defaults for images
-    Bring inline: Yes. */
-    img {
-      outline: none;
-      text-decoration: none;
-      -ms-interpolation-mode: bicubic;
-    }
-
-    a img {
-      border: none;
-    }
-
-    .image_fix {
-      display: block;
-    }
-
-    /* Yahoo paragraph fix
-    Bring inline: Yes. */
-    p {
-      margin: 1em 0;
-    }
-
-    /* Hotmail header color reset
-    Bring inline: Yes. */
-    h1, h2, h3, h4, h5, h6 {
-      color: black !important;
-    }
-
-    h1 a, h2 a, h3 a, h4 a, h5 a, h6 a {
-      color: blue !important;
-    }
-
-    h1 a:active, h2 a:active, h3 a:active, h4 a:active, h5 a:active, h6 a:active {
-      color: red !important; /* Preferably not the same color as the normal header link color.  There is limited support for psuedo classes in email clients, this was added just for good measure. */
-    }
-
-    h1 a:visited, h2 a:visited, h3 a:visited, h4 a:visited, h5 a:visited, h6 a:visited {
-      color: purple !important; /* Preferably not the same color as the normal header link color. There is limited support for psuedo classes in email clients, this was added just for good measure. */
-    }
-
-    table{
-        width: 100%;
-    }
-
-    /* Outlook 07, 10 Padding issue fix
-    Bring inline: No.*/
-    table td {
-      border-collapse: collapse;
-    }
-
-    /* Remove spacing around Outlook 07, 10 tables
-    Bring inline: Yes */
-    table {
-      border-collapse: collapse;
-      mso-table-lspace: 0pt;
-      mso-table-rspace: 0pt;
-    }
-
-    /* Styling your links has become much simpler with the new Yahoo.  In fact, it falls in line with the main credo of styling in email and make sure to bring your styles inline.  Your link colors will be uniform across clients when brought inline.
-    Bring inline: Yes. */
-    a {
-      color: orange;
-    }
-
-    /***************************************************
+    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
+    <meta name="viewport" content="width=device-width, initial-scale=1.0"/>
+    <title></title>
+    <style type="text/css">
+        /* Based on The MailChimp Reset INLINE: Yes. */
+        /* Client-specific Styles */
+        .outlook a {
+            color: #091D42;
+            padding: 0;
+            text-decoration: none;
+        }
+
+        /* Force Outlook to provide a "view in browser" menu link. */
+        body {
+            width: 100% !important;
+            -webkit-text-size-adjust: 100%;
+            -ms-text-size-adjust: 100%;
+            margin: 0;
+            padding: 0;
+        }
+
+        /* Prevent Webkit and Windows Mobile platforms from changing default font sizes.*/
+        .ExternalClass {
+            width: 100%;
+        }
+
+        /* Force Hotmail to display emails at full width */
+        .ExternalClass, .ExternalClass p, .ExternalClass span, .ExternalClass font, .ExternalClass td, .ExternalClass div {
+            line-height: 100%;
+        }
+
+        /* Forces Hotmail to display normal line spacing.  More on that: http://www.emailonacid.com/forum/viewthread/43/ */
+        #backgroundTable {
+            margin: 0;
+            padding: 0;
+            width: 100% !important;
+            line-height: 100% !important;
+            border: 1pt solid #BFB8AF;
+            background-color: #fff;
+        }
+
+        /* End reset */
+
+        /* Some sensible defaults for images
+        Bring inline: Yes. */
+        img {
+            outline: none;
+            text-decoration: none;
+            -ms-interpolation-mode: bicubic;
+        }
+
+        a img {
+            border: none;
+        }
+
+        .image_fix {
+            display: block;
+        }
+
+        /* Yahoo paragraph fix
+        Bring inline: Yes. */
+        p {
+            margin: 1em 0;
+        }
+
+        /* Hotmail header color reset
+        Bring inline: Yes. */
+        h1, h2, h3, h4, h5, h6 {
+            color: black !important;
+        }
+
+        h1 a, h2 a, h3 a, h4 a, h5 a, h6 a {
+            color: blue !important;
+        }
+
+        h1 a:active, h2 a:active, h3 a:active, h4 a:active, h5 a:active, h6 a:active {
+            color: red !important; /* Preferably not the same color as the normal header link color.  There is limited support for psuedo classes in email clients, this was added just for good measure. */
+        }
+
+        h1 a:visited, h2 a:visited, h3 a:visited, h4 a:visited, h5 a:visited, h6 a:visited {
+            color: purple !important; /* Preferably not the same color as the normal header link color. There is limited support for psuedo classes in email clients, this was added just for good measure. */
+        }
+
+        table {
+            width: 100%;
+        }
+
+        /* Outlook 07, 10 Padding issue fix
+        Bring inline: No.*/
+        table td {
+            border-collapse: collapse;
+        }
+
+        /* Remove spacing around Outlook 07, 10 tables
+        Bring inline: Yes */
+        table {
+            border-collapse: collapse;
+            mso-table-lspace: 0pt;
+            mso-table-rspace: 0pt;
+        }
+
+        /* Styling your links has become much simpler with the new Yahoo.  In fact, it falls in line with the main credo of styling in email and make sure to bring your styles inline.  Your link colors will be uniform across clients when brought inline.
+        Bring inline: Yes. */
+        a {
+            color: orange;
+        }
+
+        /***************************************************
+        ****************************************************
+        MOBILE TARGETING
+        ****************************************************
+        ***************************************************/
+        @media only screen and (max-device-width: 480px) {
+            /* Part one of controlling phone number linking for mobile. */
+            a[href^="tel"], a[href^="sms"] {
+                text-decoration: none;
+                color: blue; /* or whatever your want */
+                pointer-events: none;
+                cursor: default;
+            }
+
+            .mobile_link a[href^="tel"], .mobile_link a[href^="sms"] {
+                text-decoration: default;
+                color: orange !important;
+                pointer-events: auto;
+                cursor: default;
+            }
+
+        }
+
+        /* More Specific Targeting */
+
+        @media only screen and (min-device-width: 768px) and (max-device-width: 1024px) {
+            /* You guessed it, ipad (tablets, smaller screens, etc) */
+            /* repeating for the ipad */
+            a[href^="tel"], a[href^="sms"] {
+                text-decoration: none;
+                color: blue; /* or whatever your want */
+                pointer-events: none;
+                cursor: default;
+            }
+
+            .mobile_link a[href^="tel"], .mobile_link a[href^="sms"] {
+                text-decoration: default;
+                color: orange !important;
+                pointer-events: auto;
+                cursor: default;
+            }
+        }
+
+        @media only screen and (-webkit-min-device-pixel-ratio: 2) {
+            /* Put your iPhone 4g styles in here */
+        }
+
+        /* Android targeting */
+        @media only screen and (-webkit-device-pixel-ratio: .75) {
+            /* Put CSS for low density (ldpi) Android layouts in here */
+        }
+
+        @media only screen and (-webkit-device-pixel-ratio: 1) {
+            /* Put CSS for medium density (mdpi) Android layouts in here */
+        }
+
+        @media only screen and (-webkit-device-pixel-ratio: 1.5) {
+            /* Put CSS for high density (hdpi) Android layouts in here */
+        }
+
+        /* end Android targeting */
+        .head {
+            font-family: Helvetica, Arial;
+            font-size: 30px;
+            text-decoration: none;
+            text-align: left;
+            color: #333;
+            align: left;
+            padding: 25px 0 15px 0;
+            valign: middle;
+            font-weight: 500;
+            border-bottom: 1px solid #cccccc;
+        }
+
+        .head2 {
+            font-family: Helvetica, Arial;
+            font-size: 24px;
+            text-decoration: none;
+            text-align: left;
+            color: #333;
+            align: left;
+            padding: 20px 0 10px 0;
+            valign: middle;
+            font-weight: 500;
+        }
+
+        .text {
+            font-family: Helvetica, Arial;
+            font-size: 14px;
+            text-decoration: none;
+            text-align: left;
+            color: #333;
+            align: left;
+            padding: 0.5em 0em 0.5em 0em;
+            valign: middle;
+        }
+
+        .info {
+            font-family: Helvetica, Arial;
+            font-size: 16px;
+            text-decoration: none;
+            text-align: left;
+            padding-left: 10px;
+            border-left: 3px solid #396A92;
+            background-color: #9AB4CB;
+            color: #091D42;
+            align: left;
+            padding: 1em 0em 1em 1em;
+            valign: middle;
+        }
+
+        .table-border {
+            border: 1px solid #ddd;
+            border-radius: 4px 4px 0 0;
+            box-shadow: none;
+        }
+
+        .table-border-th {
+            font-family: Helvetica, Arial;
+            font-size: 14px;
+            text-decoration: none;
+            text-align: left;
+            border-top: 1px solid #cccccc;
+            border-right: 1px solid #cccccc;
+            padding: 8px;
+        }
+
+        .table-border-td {
+            font-family: Helvetica, Arial;
+            font-size: 14px;
+            text-decoration: none;
+            text-align: left;
+            border-top: 1px solid #cccccc;
+            border-right: 1px solid #cccccc;
+            padding: 8px;
+            word-break: break-all;
+        }
+
+        .foot {
+            font-family: Arial;
+            font-size: 14px;
+            text-decoration: none;
+            text-align: left;
+            padding: 0.5em 0em 0.5em 0.5em;
+            border-top: 1px solid #cccccc;
+            color: #777;
+        }
+
+        /* extend by hchen9 */
+
+    </style>
+
+    <!-- Targeting Windows Mobile -->
+    <!--[if IEMobile 7]>
+    <style type="text/css">
+
+    </style>
+    <![endif]-->
+
+    <!-- ***********************************************
     ****************************************************
-    MOBILE TARGETING
+    END MOBILE TARGETING
     ****************************************************
-    ***************************************************/
-    @media only screen and (max-device-width: 480px) {
-      /* Part one of controlling phone number linking for mobile. */
-      a[href^="tel"], a[href^="sms"] {
-        text-decoration: none;
-        color: blue; /* or whatever your want */
-        pointer-events: none;
-        cursor: default;
-      }
-
-      .mobile_link a[href^="tel"], .mobile_link a[href^="sms"] {
-        text-decoration: default;
-        color: orange !important;
-        pointer-events: auto;
-        cursor: default;
-      }
-
-    }
-
-    /* More Specific Targeting */
-
-    @media only screen and (min-device-width: 768px) and (max-device-width: 1024px) {
-      /* You guessed it, ipad (tablets, smaller screens, etc) */
-      /* repeating for the ipad */
-      a[href^="tel"], a[href^="sms"] {
-        text-decoration: none;
-        color: blue; /* or whatever your want */
-        pointer-events: none;
-        cursor: default;
-      }
-
-      .mobile_link a[href^="tel"], .mobile_link a[href^="sms"] {
-        text-decoration: default;
-        color: orange !important;
-        pointer-events: auto;
-        cursor: default;
-      }
-    }
-
-    @media only screen and (-webkit-min-device-pixel-ratio: 2) {
-      /* Put your iPhone 4g styles in here */
-    }
-
-    /* Android targeting */
-    @media only screen and (-webkit-device-pixel-ratio: .75) {
-      /* Put CSS for low density (ldpi) Android layouts in here */
-    }
-
-    @media only screen and (-webkit-device-pixel-ratio: 1) {
-      /* Put CSS for medium density (mdpi) Android layouts in here */
-    }
-
-    @media only screen and (-webkit-device-pixel-ratio: 1.5) {
-      /* Put CSS for high density (hdpi) Android layouts in here */
-    }
-
-    /* end Android targeting */
-    .head{
-      font-family:Helvetica, Arial;
-      font-size:30px;
-      text-decoration:none;
-      text-align:left;
-      color:#333;
-      align:left;
-      padding: 25px 0 15px 0;
-      valign:middle;
-      font-weight: 500;
-      border-bottom: 1px solid #cccccc;
-    }
-
-    .head2{
-      font-family:Helvetica, Arial;
-      font-size:24px;
-      text-decoration:none;
-      text-align:left;
-      color:#333;
-      align:left;
-      padding: 20px 0 10px 0;
-      valign:middle;
-      font-weight: 500;
-    }
-
-    .text{
-      font-family:Helvetica, Arial;
-      font-size:14px;
-      text-decoration:none;
-      text-align:left;
-      color:#333;
-      align:left;
-      padding: 0.5em 0em 0.5em 0em;
-      valign:middle;
-    }
-
-    .info {
-      font-family:Helvetica, Arial;
-      font-size:16px;
-      text-decoration:none;
-      text-align:left;
-      padding-left:10px;
-      border-left: 3px solid #396A92;
-      background-color: #9AB4CB;
-      color:#091D42;
-      align:left;
-      padding: 1em 0em 1em 1em;
-      valign:middle;
-    }
-
-    .table-border{
-      border: 1px solid #ddd;
-      border-radius: 4px 4px 0 0;
-      box-shadow: none;
-    }
-
-    .table-border-th{
-      font-family:Helvetica, Arial;
-      font-size:14px;
-      text-decoration:none;
-      text-align:left;
-      border-top: 1px solid #cccccc;
-      border-right: 1px solid #cccccc;
-      padding: 8px;
-    }
-    .table-border-td{
-      font-family:Helvetica, Arial;
-      font-size:14px;
-      text-decoration:none;
-      text-align:left;
-      border-top: 1px solid #cccccc;
-      border-right: 1px solid #cccccc;
-      padding: 8px;
-      word-break: break-all;
-    }
-
-    .foot{
-      font-family:Arial;
-      font-size:14px;
-      text-decoration:none;
-      text-align:left;
-      padding: 0.5em 0em 0.5em 0.5em;
-      border-top: 1px solid #cccccc;
-      color:#777;
-    }
-
-  /* extend by hchen9 */
-
-  </style>
-
-  <!-- Targeting Windows Mobile -->
-  <!--[if IEMobile 7]>
-  <style type="text/css">
-
-  </style>
-  <![endif]-->
-
-  <!-- ***********************************************
-  ****************************************************
-  END MOBILE TARGETING
-  ****************************************************
-  ************************************************ -->
-
-  <!--[if gte mso 9]>
-  <style>
-    /* Target Outlook 2007 and 2010 */
-  </style>
-  <![endif]-->
+    ************************************************ -->
+
+    <!--[if gte mso 9]>
+    <style>
+        /* Target Outlook 2007 and 2010 */
+    </style>
+    <![endif]-->
 </head>
 <body>
 <!-- Wrapper/Container Table: Use a wrapper table to control the width and the background color consistently of your email. Use this approach instead of setting attributes on the body tag. -->
 <table cellpadding="0" cellspacing="0" border="0" id="backgroundTable" width="100%">
-  <tr>
-    <td valign="top" style="padding-left: 10px">
+    <tr>
+        <td valign="top" style="padding-left: 10px">

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/ca0fae40/eagle-core/eagle-common/src/main/resources/templates/tec_alert.vm
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-common/src/main/resources/templates/tec_alert.vm b/eagle-core/eagle-common/src/main/resources/templates/tec_alert.vm
index fa3eee5..797c351 100755
--- a/eagle-core/eagle-common/src/main/resources/templates/tec_alert.vm
+++ b/eagle-core/eagle-common/src/main/resources/templates/tec_alert.vm
@@ -18,96 +18,97 @@
  *#
 #parse("header.vm")
 <table cellpadding="0" cellspacing="0" border="0" align="left" width="800" style="">
-  <tr>
-    <td class="head" width="800">
-      <span style="color: #091D42">Eagle Service <small style="color: #999999;">$startTime ~ $endTime</small></span>
-    </td>
-  </tr>
-  <tr>
-    <td class="head2" width="800">
+    <tr>
+        <td class="head" width="800">
+            <span style="color: #091D42">Eagle Service <small style="color: #999999;">$startTime
+                ~ $endTime</small></span>
+        </td>
+    </tr>
+    <tr>
+        <td class="head2" width="800">
       <span>
         Statistics
       </span>
-    </td>
-  </tr>
-  <tr>
-    <td valign="top" style="padding: 0.5em 0em 0.5em 0em;">
-      <table cellpadding="0" cellspacing="0" border="0" align="left" width="800" class="table-border">
-        <thead>
-        <tr>
-          <th class="table-border-th" style="width: 25%">type</th>
-          <th class="table-border-th" style="width: 25%">count</th>
-          <th class="table-border-th" style="width: 25%">type</th>
-          <th class="table-border-th" style="width: 25%">count</th>
-        </tr>
-        </thead>
-        <tbody>
-        #foreach($key in $statistics.keySet())
-          #if( $foreach.count % 2 == 1 )
-          <tr>
-          #end
-            <td class="table-border-td">$key</td>
-            <td class="table-border-td">$statistics.get($key)</td>
-          #if( $foreach.count % 2 == 0)
-          </tr>
-          #end
-          #if( $foreach.count % 2 == 1 && !$foreach.hasNext )
-          	<td class="table-border-td"></td>
-            <td class="table-border-td"></td>
-          </tr>
-          #end
-       	#end
-        </tbody>
-      </table>
-    </td>
-  </tr>
-  <tr>
-    <td class="head2" width="800">
+        </td>
+    </tr>
+    <tr>
+        <td valign="top" style="padding: 0.5em 0em 0.5em 0em;">
+            <table cellpadding="0" cellspacing="0" border="0" align="left" width="800" class="table-border">
+                <thead>
+                <tr>
+                    <th class="table-border-th" style="width: 25%">type</th>
+                    <th class="table-border-th" style="width: 25%">count</th>
+                    <th class="table-border-th" style="width: 25%">type</th>
+                    <th class="table-border-th" style="width: 25%">count</th>
+                </tr>
+                </thead>
+                <tbody>
+                    #foreach($key in $statistics.keySet())
+                        #if( $foreach.count % 2 == 1 )
+                        <tr>
+                        #end
+                        <td class="table-border-td">$key</td>
+                        <td class="table-border-td">$statistics.get($key)</td>
+                        #if( $foreach.count % 2 == 0)
+                        </tr>
+                        #end
+                        #if( $foreach.count % 2 == 1 && !$foreach.hasNext )
+                        <td class="table-border-td"></td>
+                        <td class="table-border-td"></td>
+                        </tr>
+                        #end
+                    #end
+                </tbody>
+            </table>
+        </td>
+    </tr>
+    <tr>
+        <td class="head2" width="800">
       <span>
         Detail Info
       </span>
-    </td>
-  </tr>
-  <tr>
-    <td class="info" width="800">
+        </td>
+    </tr>
+    <tr>
+        <td class="info" width="800">
       <span>
           These are the alerts that we can not find its hostname.
       </span>
-    </td>
-  </tr>
-  <tr>
-    <td valign="top" style="padding: 0.5em 0em 0.5em 0em;">
-      <table cellpadding="0" cellspacing="0" border="0" align="left" width="800" class="table-border">
-        <thead>
-          <tr>
-            <th class="table-border-th">hostname</th>
-            <th class="table-border-th">date_reception</th>
-            <th class="table-border-th">type</th>
-            <th class="table-border-th">origin</th>
-            <th class="table-border-th">msg</th>
-          </tr>
-        </thead>
-        <tbody>
-        #foreach($entry in $noHostnameItems)
-          <tr>
-            <td class="table-border-td">$entry.hostname</td>
-            <td class="table-border-td">$entry.date_reception</td>
-            <td class="table-border-td">$entry.type</td>
-            <td class="table-border-td">$entry.origin</td>
-            <td class="table-border-td">$entry.msg</td>
-          </tr>
-       	#end
-        </tbody>
-      </table>
-    </td>
-  </tr>
-  <tr>
-    <td class="foot" width="800">
+        </td>
+    </tr>
+    <tr>
+        <td valign="top" style="padding: 0.5em 0em 0.5em 0em;">
+            <table cellpadding="0" cellspacing="0" border="0" align="left" width="800" class="table-border">
+                <thead>
+                <tr>
+                    <th class="table-border-th">hostname</th>
+                    <th class="table-border-th">date_reception</th>
+                    <th class="table-border-th">type</th>
+                    <th class="table-border-th">origin</th>
+                    <th class="table-border-th">msg</th>
+                </tr>
+                </thead>
+                <tbody>
+                    #foreach($entry in $noHostnameItems)
+                    <tr>
+                        <td class="table-border-td">$entry.hostname</td>
+                        <td class="table-border-td">$entry.date_reception</td>
+                        <td class="table-border-td">$entry.type</td>
+                        <td class="table-border-td">$entry.origin</td>
+                        <td class="table-border-td">$entry.msg</td>
+                    </tr>
+                    #end
+                </tbody>
+            </table>
+        </td>
+    </tr>
+    <tr>
+        <td class="foot" width="800">
       <span class="outlook">
          Apache Eagle <a href="http://<Eagle-Host>:9090/eagle-web/ui/eagle.html"
-                  target ="_blank" title="Hadoop Eagle">Apache Eagle</a>
+                         target="_blank" title="Hadoop Eagle">Apache Eagle</a>
       </span>
-    </td>
-  </tr>
+        </td>
+    </tr>
 </table>
 #parse("footer.vm")
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/ca0fae40/eagle-core/eagle-common/src/test/java/org/apache/eagle/common/TestByteUtil.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-common/src/test/java/org/apache/eagle/common/TestByteUtil.java b/eagle-core/eagle-common/src/test/java/org/apache/eagle/common/TestByteUtil.java
index a08c3d1..ce7fc89 100644
--- a/eagle-core/eagle-common/src/test/java/org/apache/eagle/common/TestByteUtil.java
+++ b/eagle-core/eagle-common/src/test/java/org/apache/eagle/common/TestByteUtil.java
@@ -20,92 +20,92 @@ import org.junit.Assert;
 import org.junit.Test;
 
 public class TestByteUtil {
-	
-	@Test
-	public void testLongAndBytesConversion() {
-		long origValue = 0x1234567812345678L;
-		byte[] bytes = ByteUtil.longToBytes(origValue);
-		checkNonZeros(bytes);
-		long value = ByteUtil.bytesToLong(bytes);
-		Assert.assertEquals(origValue, value);
-		bytes = new byte[16];
-		checkZeros(bytes);
-		ByteUtil.longToBytes(origValue, bytes, 4);
-		checkZeros(bytes, 0, 4);
-		checkZeros(bytes, 12, 16);
-		checkNonZeros(bytes, 4, 12);
-		value = ByteUtil.bytesToLong(bytes, 4);
-		Assert.assertEquals(origValue, value);
-	}
-	
-	@Test
-	public void testDoubleAndBytesConversion() {
-		double origValue =  (double)0x1234567812345678L;
-		byte[] bytes = ByteUtil.doubleToBytes(origValue);
-		checkNonZeros(bytes);
-		double value = ByteUtil.bytesToDouble(bytes);
-		Assert.assertEquals(origValue, value, 0.0001);
-		bytes = new byte[16];
-		checkZeros(bytes);
-		ByteUtil.doubleToBytes(origValue, bytes, 4);
-		checkZeros(bytes, 0, 4);
-		checkZeros(bytes, 12, 16);
-		checkNonZeros(bytes, 4, 12);
-		value = ByteUtil.bytesToDouble(bytes, 4);
-		Assert.assertEquals(origValue, value, 0.0001);
-	}
-	
-	@Test
-	public void testIntAndBytesConversion() {
-		int origValue = 0x12345678;
-		byte[] bytes = ByteUtil.intToBytes(origValue);
-		Assert.assertEquals(4, bytes.length);
-		Assert.assertEquals(0x12, bytes[0]);
-		Assert.assertEquals(0x34, bytes[1]);
-		Assert.assertEquals(0x56, bytes[2]);
-		Assert.assertEquals(0x78, bytes[3]);
-		checkNonZeros(bytes);
-		int value = ByteUtil.bytesToInt(bytes);
-		Assert.assertEquals(origValue, value);
-		bytes = new byte[12];
-		checkZeros(bytes);
-		ByteUtil.intToBytes(origValue, bytes, 4);
-		checkZeros(bytes, 0, 4);
-		checkZeros(bytes, 8, 12);
-		checkNonZeros(bytes, 4, 8);
-		value = ByteUtil.bytesToInt(bytes, 4);
-		Assert.assertEquals(origValue, value);
-	}
 
-	@Test
-	public void testShortAndBytesConversion() {
-		short origValue = 0x1234;
-		byte[] bytes = ByteUtil.shortToBytes(origValue);
-		Assert.assertEquals(2, bytes.length);
-		Assert.assertEquals(0x12, bytes[0]);
-		Assert.assertEquals(0x34, bytes[1]);
-		checkNonZeros(bytes);
-		short value = ByteUtil.bytesToShort(bytes);
-		Assert.assertEquals(origValue, value);
-	}
+    @Test
+    public void testLongAndBytesConversion() {
+        long origValue = 0x1234567812345678L;
+        byte[] bytes = ByteUtil.longToBytes(origValue);
+        checkNonZeros(bytes);
+        long value = ByteUtil.bytesToLong(bytes);
+        Assert.assertEquals(origValue, value);
+        bytes = new byte[16];
+        checkZeros(bytes);
+        ByteUtil.longToBytes(origValue, bytes, 4);
+        checkZeros(bytes, 0, 4);
+        checkZeros(bytes, 12, 16);
+        checkNonZeros(bytes, 4, 12);
+        value = ByteUtil.bytesToLong(bytes, 4);
+        Assert.assertEquals(origValue, value);
+    }
 
-	private void checkZeros(byte[] bytes) {
-		checkZeros(bytes, 0, bytes.length);
-	}
-	
-	private void checkZeros(byte[] bytes, int i, int j) {
-		for (int k = i; k < j; ++k) {
-			Assert.assertEquals((byte)0, bytes[k]);
-		}
-	}
+    @Test
+    public void testDoubleAndBytesConversion() {
+        double origValue = (double) 0x1234567812345678L;
+        byte[] bytes = ByteUtil.doubleToBytes(origValue);
+        checkNonZeros(bytes);
+        double value = ByteUtil.bytesToDouble(bytes);
+        Assert.assertEquals(origValue, value, 0.0001);
+        bytes = new byte[16];
+        checkZeros(bytes);
+        ByteUtil.doubleToBytes(origValue, bytes, 4);
+        checkZeros(bytes, 0, 4);
+        checkZeros(bytes, 12, 16);
+        checkNonZeros(bytes, 4, 12);
+        value = ByteUtil.bytesToDouble(bytes, 4);
+        Assert.assertEquals(origValue, value, 0.0001);
+    }
 
-	private void checkNonZeros(byte[] bytes) {
-		checkNonZeros(bytes, 0, bytes.length);
-	}
-	
-	private void checkNonZeros(byte[] bytes, int i, int j) {
-		for (int k = i; k < j; ++k) {
-			Assert.assertNotSame((byte)0, bytes[k]);
-		}
-	}
+    @Test
+    public void testIntAndBytesConversion() {
+        int origValue = 0x12345678;
+        byte[] bytes = ByteUtil.intToBytes(origValue);
+        Assert.assertEquals(4, bytes.length);
+        Assert.assertEquals(0x12, bytes[0]);
+        Assert.assertEquals(0x34, bytes[1]);
+        Assert.assertEquals(0x56, bytes[2]);
+        Assert.assertEquals(0x78, bytes[3]);
+        checkNonZeros(bytes);
+        int value = ByteUtil.bytesToInt(bytes);
+        Assert.assertEquals(origValue, value);
+        bytes = new byte[12];
+        checkZeros(bytes);
+        ByteUtil.intToBytes(origValue, bytes, 4);
+        checkZeros(bytes, 0, 4);
+        checkZeros(bytes, 8, 12);
+        checkNonZeros(bytes, 4, 8);
+        value = ByteUtil.bytesToInt(bytes, 4);
+        Assert.assertEquals(origValue, value);
+    }
+
+    @Test
+    public void testShortAndBytesConversion() {
+        short origValue = 0x1234;
+        byte[] bytes = ByteUtil.shortToBytes(origValue);
+        Assert.assertEquals(2, bytes.length);
+        Assert.assertEquals(0x12, bytes[0]);
+        Assert.assertEquals(0x34, bytes[1]);
+        checkNonZeros(bytes);
+        short value = ByteUtil.bytesToShort(bytes);
+        Assert.assertEquals(origValue, value);
+    }
+
+    private void checkZeros(byte[] bytes) {
+        checkZeros(bytes, 0, bytes.length);
+    }
+
+    private void checkZeros(byte[] bytes, int i, int j) {
+        for (int k = i; k < j; ++k) {
+            Assert.assertEquals((byte) 0, bytes[k]);
+        }
+    }
+
+    private void checkNonZeros(byte[] bytes) {
+        checkNonZeros(bytes, 0, bytes.length);
+    }
+
+    private void checkNonZeros(byte[] bytes, int i, int j) {
+        for (int k = i; k < j; ++k) {
+            Assert.assertNotSame((byte) 0, bytes[k]);
+        }
+    }
 }

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/ca0fae40/eagle-core/eagle-common/src/test/java/org/apache/eagle/common/TestCircularArrayList.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-common/src/test/java/org/apache/eagle/common/TestCircularArrayList.java b/eagle-core/eagle-common/src/test/java/org/apache/eagle/common/TestCircularArrayList.java
index 3642635..91389d6 100644
--- a/eagle-core/eagle-common/src/test/java/org/apache/eagle/common/TestCircularArrayList.java
+++ b/eagle-core/eagle-common/src/test/java/org/apache/eagle/common/TestCircularArrayList.java
@@ -21,54 +21,54 @@ import org.junit.Test;
 
 public class TestCircularArrayList {
 
-	@Test
-	public void testAddAndRemove() {
-		Long[] array = new Long[5];
-		CircularArrayList<Long> list = new CircularArrayList<Long>(array);
-		
-		for (long i = 0 ; i < 5; ++i) {
-			list.add(i);
-			Assert.assertEquals((Long)i, array[(int) i]);
-			Assert.assertTrue(list.contains(i));
-			Assert.assertEquals(i, list.find(i));
-		}
-		Assert.assertFalse(list.contains(6L));
-		Exception e = null;
-		try {
-			list.add((long)5);
-		} catch (Exception ex) {
-			e = ex;
-		}
-		Assert.assertNotNull(e);
-		Assert.assertEquals(0, list.tail());
-		Assert.assertEquals(0, list.head());
-		Assert.assertEquals(5, list.size());
-		Assert.assertTrue(list.isFull());
-		Long v = list.remove(1);
-		Assert.assertEquals((Long)1L, v);
-		Assert.assertEquals(4, list.size());
-		Assert.assertEquals(1, list.head());
-		Assert.assertEquals(0, list.tail());
-		list.add((long)5);
-		Assert.assertEquals(5, list.size());
-		Assert.assertEquals(1, list.head());
-		Assert.assertEquals(1, list.tail());
-		Assert.assertEquals((Long)0L, list.remove(0));
-		Assert.assertEquals(2, list.head());
-		Assert.assertEquals(1, list.tail());
-		Assert.assertEquals((Long)2L, list.remove(0));
-		Assert.assertEquals(3, list.head());
-		Assert.assertEquals(1, list.tail());
-		Assert.assertEquals((Long)3L, list.remove(0));
-		Assert.assertEquals(4, list.head());
-		Assert.assertEquals(1, list.tail());
-		Assert.assertEquals((Long)4L, list.remove(0));
-		Assert.assertEquals(0, list.head());
-		Assert.assertEquals(1, list.tail());
-		Assert.assertEquals((Long)5L, list.remove(0));
-		Assert.assertEquals(1, list.head());
-		Assert.assertEquals(1, list.tail());
-		Assert.assertTrue(list.isEmpty());
-		Assert.assertFalse(list.isFull());
-	}
+    @Test
+    public void testAddAndRemove() {
+        Long[] array = new Long[5];
+        CircularArrayList<Long> list = new CircularArrayList<Long>(array);
+
+        for (long i = 0; i < 5; ++i) {
+            list.add(i);
+            Assert.assertEquals((Long) i, array[(int) i]);
+            Assert.assertTrue(list.contains(i));
+            Assert.assertEquals(i, list.find(i));
+        }
+        Assert.assertFalse(list.contains(6L));
+        Exception e = null;
+        try {
+            list.add((long) 5);
+        } catch (Exception ex) {
+            e = ex;
+        }
+        Assert.assertNotNull(e);
+        Assert.assertEquals(0, list.tail());
+        Assert.assertEquals(0, list.head());
+        Assert.assertEquals(5, list.size());
+        Assert.assertTrue(list.isFull());
+        Long v = list.remove(1);
+        Assert.assertEquals((Long) 1L, v);
+        Assert.assertEquals(4, list.size());
+        Assert.assertEquals(1, list.head());
+        Assert.assertEquals(0, list.tail());
+        list.add((long) 5);
+        Assert.assertEquals(5, list.size());
+        Assert.assertEquals(1, list.head());
+        Assert.assertEquals(1, list.tail());
+        Assert.assertEquals((Long) 0L, list.remove(0));
+        Assert.assertEquals(2, list.head());
+        Assert.assertEquals(1, list.tail());
+        Assert.assertEquals((Long) 2L, list.remove(0));
+        Assert.assertEquals(3, list.head());
+        Assert.assertEquals(1, list.tail());
+        Assert.assertEquals((Long) 3L, list.remove(0));
+        Assert.assertEquals(4, list.head());
+        Assert.assertEquals(1, list.tail());
+        Assert.assertEquals((Long) 4L, list.remove(0));
+        Assert.assertEquals(0, list.head());
+        Assert.assertEquals(1, list.tail());
+        Assert.assertEquals((Long) 5L, list.remove(0));
+        Assert.assertEquals(1, list.head());
+        Assert.assertEquals(1, list.tail());
+        Assert.assertTrue(list.isEmpty());
+        Assert.assertFalse(list.isFull());
+    }
 }

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/ca0fae40/eagle-core/eagle-common/src/test/java/org/apache/eagle/common/TestCircularArrayListSortedSet.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-common/src/test/java/org/apache/eagle/common/TestCircularArrayListSortedSet.java b/eagle-core/eagle-common/src/test/java/org/apache/eagle/common/TestCircularArrayListSortedSet.java
index e4fbb18..aab5d6f 100644
--- a/eagle-core/eagle-common/src/test/java/org/apache/eagle/common/TestCircularArrayListSortedSet.java
+++ b/eagle-core/eagle-common/src/test/java/org/apache/eagle/common/TestCircularArrayListSortedSet.java
@@ -21,38 +21,38 @@ import org.junit.Test;
 
 public class TestCircularArrayListSortedSet {
 
-	@Test
-	public void testInsertAndRemove() {
-		Long[] array = new Long[5];
-		CircularArrayListSortedSet<Long> set = new CircularArrayListSortedSet<Long>(array);
-		
-		set.insert(3L);
-		set.insert(2L);
-		set.insert(1L);
-		set.insert(5L);
-		set.insert(4L);
-		
-		for (int i = 0; i < 5; ++i) {
-			Assert.assertEquals((Long)(long)(i + 1),set.get(i));
-			Assert.assertEquals(i, set.binarySearch((Long)(long)(i + 1)));
-		}
-		Assert.assertEquals(0, set.head());
-		Assert.assertEquals(0, set.tail());
-		Assert.assertTrue(set.isFull());
-		Assert.assertEquals(-(5 + 1), set.binarySearch(6L));
-		
-		Assert.assertEquals(2, set.remove(3L));
-		Assert.assertEquals(2, set.remove(4L));
-		Assert.assertEquals(-(2 + 1), set.binarySearch(3L));
-		set.insert(3L);
-		set.insert(4L);
-		
-		for (int i = 0; i < 5; ++i) {
-			Assert.assertEquals((Long)(long)(i + 1),set.get(i));
-			Assert.assertEquals(i, set.binarySearch((Long)(long)(i + 1)));
-		}
-		Assert.assertEquals(2, set.head());
-		Assert.assertEquals(2, set.tail());
-		Assert.assertTrue(set.isFull());
-	}
+    @Test
+    public void testInsertAndRemove() {
+        Long[] array = new Long[5];
+        CircularArrayListSortedSet<Long> set = new CircularArrayListSortedSet<Long>(array);
+
+        set.insert(3L);
+        set.insert(2L);
+        set.insert(1L);
+        set.insert(5L);
+        set.insert(4L);
+
+        for (int i = 0; i < 5; ++i) {
+            Assert.assertEquals((Long) (long) (i + 1), set.get(i));
+            Assert.assertEquals(i, set.binarySearch((Long) (long) (i + 1)));
+        }
+        Assert.assertEquals(0, set.head());
+        Assert.assertEquals(0, set.tail());
+        Assert.assertTrue(set.isFull());
+        Assert.assertEquals(-(5 + 1), set.binarySearch(6L));
+
+        Assert.assertEquals(2, set.remove(3L));
+        Assert.assertEquals(2, set.remove(4L));
+        Assert.assertEquals(-(2 + 1), set.binarySearch(3L));
+        set.insert(3L);
+        set.insert(4L);
+
+        for (int i = 0; i < 5; ++i) {
+            Assert.assertEquals((Long) (long) (i + 1), set.get(i));
+            Assert.assertEquals(i, set.binarySearch((Long) (long) (i + 1)));
+        }
+        Assert.assertEquals(2, set.head());
+        Assert.assertEquals(2, set.tail());
+        Assert.assertTrue(set.isFull());
+    }
 }

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/ca0fae40/eagle-core/eagle-common/src/test/java/org/apache/eagle/common/TestDateTimeUtil.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-common/src/test/java/org/apache/eagle/common/TestDateTimeUtil.java b/eagle-core/eagle-common/src/test/java/org/apache/eagle/common/TestDateTimeUtil.java
index 062d44a..a008723 100755
--- a/eagle-core/eagle-common/src/test/java/org/apache/eagle/common/TestDateTimeUtil.java
+++ b/eagle-core/eagle-common/src/test/java/org/apache/eagle/common/TestDateTimeUtil.java
@@ -16,72 +16,72 @@
  */
 package org.apache.eagle.common;
 
-import java.util.Calendar;
-import java.util.GregorianCalendar;
-
 import org.junit.Assert;
 import org.junit.Test;
 
+import java.util.Calendar;
+import java.util.GregorianCalendar;
+
 public class TestDateTimeUtil {
-	@Test
-	public void testRound1(){
-		long tsInMS = 1397016731576L;
-		long tsInMin = DateTimeUtil.roundDown(Calendar.MINUTE, tsInMS);
-		Assert.assertEquals(1397016720000L, tsInMin);
-		
-		GregorianCalendar cal = new GregorianCalendar();
-		cal.setTimeInMillis(tsInMS);
-		cal.set(Calendar.SECOND, 0);
-		cal.set(Calendar.MILLISECOND, 0);
-		Assert.assertEquals(tsInMin, cal.getTimeInMillis());
-	}
-	
-	@Test
-	public void testRound2(){
-		long tsInMS = 1397016731576L;
-		long tsInHour = DateTimeUtil.roundDown(Calendar.HOUR, tsInMS);
-		Assert.assertEquals(1397016000000L, tsInHour);
-		
-		GregorianCalendar cal = new GregorianCalendar();
-		cal.setTimeInMillis(tsInMS);
-		cal.set(Calendar.MINUTE, 0);
-		cal.set(Calendar.SECOND, 0);
-		cal.set(Calendar.MILLISECOND, 0);
-		Assert.assertEquals(tsInHour, cal.getTimeInMillis());
-	}
-	
-	@Test
-	public void testRound3(){
-		long tsInMS = 1L;
-		long tsInDay = DateTimeUtil.roundDown(Calendar.DATE, tsInMS);
-		Assert.assertEquals(0L, tsInDay);
+    @Test
+    public void testRound1() {
+        long tsInMS = 1397016731576L;
+        long tsInMin = DateTimeUtil.roundDown(Calendar.MINUTE, tsInMS);
+        Assert.assertEquals(1397016720000L, tsInMin);
+
+        GregorianCalendar cal = new GregorianCalendar();
+        cal.setTimeInMillis(tsInMS);
+        cal.set(Calendar.SECOND, 0);
+        cal.set(Calendar.MILLISECOND, 0);
+        Assert.assertEquals(tsInMin, cal.getTimeInMillis());
+    }
+
+    @Test
+    public void testRound2() {
+        long tsInMS = 1397016731576L;
+        long tsInHour = DateTimeUtil.roundDown(Calendar.HOUR, tsInMS);
+        Assert.assertEquals(1397016000000L, tsInHour);
+
+        GregorianCalendar cal = new GregorianCalendar();
+        cal.setTimeInMillis(tsInMS);
+        cal.set(Calendar.MINUTE, 0);
+        cal.set(Calendar.SECOND, 0);
+        cal.set(Calendar.MILLISECOND, 0);
+        Assert.assertEquals(tsInHour, cal.getTimeInMillis());
+    }
+
+    @Test
+    public void testRound3() {
+        long tsInMS = 1L;
+        long tsInDay = DateTimeUtil.roundDown(Calendar.DATE, tsInMS);
+        Assert.assertEquals(0L, tsInDay);
 //		Assert.assertEquals("1970-01-01 08:00:00", DateTimeUtil.millisecondsToHumanDateWithSeconds(tsInDay));
-	}
-	
-	@Test
-	public void testRound4(){
-		long tsInMS = 0L;
-		long tsInDay = DateTimeUtil.roundDown(Calendar.DATE, tsInMS);
-		Assert.assertEquals(0L, tsInDay);
-		String str = DateTimeUtil.millisecondsToHumanDateWithSeconds(tsInMS);
-		System.out.println(str);
-	}
-	
-	@Test
-	public void testRound5(){
-		long tsInMS = 8*3600*1000L;
-		long tsInDay = DateTimeUtil.roundDown(Calendar.DATE, tsInMS);
-		Assert.assertEquals(0L, tsInDay);
-		String str = DateTimeUtil.millisecondsToHumanDateWithSeconds(tsInDay);
-		System.out.println(str);
-	}
-	
-	@Test
-	public void testDayOfWeek() {
-		GregorianCalendar cal = new GregorianCalendar();
-		long tsInMS = 0L;
-		cal.setTimeInMillis(tsInMS);
-		//cal.setTimeInMillis(System.currentTimeMillis());
-		System.out.println(cal.get(Calendar.DAY_OF_WEEK));
-	}
+    }
+
+    @Test
+    public void testRound4() {
+        long tsInMS = 0L;
+        long tsInDay = DateTimeUtil.roundDown(Calendar.DATE, tsInMS);
+        Assert.assertEquals(0L, tsInDay);
+        String str = DateTimeUtil.millisecondsToHumanDateWithSeconds(tsInMS);
+        System.out.println(str);
+    }
+
+    @Test
+    public void testRound5() {
+        long tsInMS = 8 * 3600 * 1000L;
+        long tsInDay = DateTimeUtil.roundDown(Calendar.DATE, tsInMS);
+        Assert.assertEquals(0L, tsInDay);
+        String str = DateTimeUtil.millisecondsToHumanDateWithSeconds(tsInDay);
+        System.out.println(str);
+    }
+
+    @Test
+    public void testDayOfWeek() {
+        GregorianCalendar cal = new GregorianCalendar();
+        long tsInMS = 0L;
+        cal.setTimeInMillis(tsInMS);
+        //cal.setTimeInMillis(System.currentTimeMillis());
+        System.out.println(cal.get(Calendar.DAY_OF_WEEK));
+    }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/ca0fae40/eagle-core/eagle-common/src/test/java/org/apache/eagle/common/TestEagleBase64Wrapper.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-common/src/test/java/org/apache/eagle/common/TestEagleBase64Wrapper.java b/eagle-core/eagle-common/src/test/java/org/apache/eagle/common/TestEagleBase64Wrapper.java
index 384c274..40e0e5b 100755
--- a/eagle-core/eagle-common/src/test/java/org/apache/eagle/common/TestEagleBase64Wrapper.java
+++ b/eagle-core/eagle-common/src/test/java/org/apache/eagle/common/TestEagleBase64Wrapper.java
@@ -19,20 +19,20 @@ package org.apache.eagle.common;
 import org.junit.Test;
 
 public class TestEagleBase64Wrapper {
-	@Test
-	public void test(){
-		byte[] b = EagleBase64Wrapper.decode("BgVz-6vkdM8AAbGAf__-trtos5aqSGPod4Q1GwA268vF50iNBgmpmAxLXKkGbxkREWcmOzT3YIx3hDUb");
-		byte[] c = EagleBase64Wrapper.decode("BgVz-6vkdM8AAbGAf__-trtos5aqSGPod4Q1G6pLeJcAATVuADbry8XnSI0GCamYDEtcqQZvGRERZyY7NPdgjHeENRs");
-		
-		System.out.println(new String(b));
-		System.out.println(new String(c));
-		
-		int hash = "jobType".hashCode();
-		byte b1 = (byte)((hash >> 24) & 0xff);
-		byte b2 = (byte)(((hash << 8) >> 24) & 0xff);
-		byte b3 = (byte)(((hash << 16) >> 24) & 0xff);
-		byte b4 = (byte)(((hash << 24) >> 24) & 0xff);
-		
-		System.out.println(b1 + "," + b2 + "," + b3 + "," + b4);
-	}
+    @Test
+    public void test() {
+        byte[] b = EagleBase64Wrapper.decode("BgVz-6vkdM8AAbGAf__-trtos5aqSGPod4Q1GwA268vF50iNBgmpmAxLXKkGbxkREWcmOzT3YIx3hDUb");
+        byte[] c = EagleBase64Wrapper.decode("BgVz-6vkdM8AAbGAf__-trtos5aqSGPod4Q1G6pLeJcAATVuADbry8XnSI0GCamYDEtcqQZvGRERZyY7NPdgjHeENRs");
+
+        System.out.println(new String(b));
+        System.out.println(new String(c));
+
+        int hash = "jobType".hashCode();
+        byte b1 = (byte) ((hash >> 24) & 0xff);
+        byte b2 = (byte) (((hash << 8) >> 24) & 0xff);
+        byte b3 = (byte) (((hash << 16) >> 24) & 0xff);
+        byte b4 = (byte) (((hash << 24) >> 24) & 0xff);
+
+        System.out.println(b1 + "," + b2 + "," + b3 + "," + b4);
+    }
 }

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/ca0fae40/eagle-core/eagle-common/src/test/java/org/apache/eagle/common/TestSerializableUtils.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-common/src/test/java/org/apache/eagle/common/TestSerializableUtils.java b/eagle-core/eagle-common/src/test/java/org/apache/eagle/common/TestSerializableUtils.java
index 4404258..0016086 100644
--- a/eagle-core/eagle-common/src/test/java/org/apache/eagle/common/TestSerializableUtils.java
+++ b/eagle-core/eagle-common/src/test/java/org/apache/eagle/common/TestSerializableUtils.java
@@ -23,27 +23,28 @@ import java.io.Serializable;
 
 public class TestSerializableUtils {
     @Test
-    public void testSerializeObject(){
+    public void testSerializeObject() {
         SerializableUtils.ensureSerializable(0.5);
         byte[] bytes = SerializableUtils.serializeToByteArray(0.5);
         Assert.assertNotNull(bytes);
-        Assert.assertEquals(0.5,SerializableUtils.deserializeFromByteArray(bytes,"0.5"));
+        Assert.assertEquals(0.5, SerializableUtils.deserializeFromByteArray(bytes, "0.5"));
     }
+
     @Test
-    public void testSerializeObjectWithCompression(){
+    public void testSerializeObjectWithCompression() {
         SerializableUtils.ensureSerializable(0.5);
         byte[] bytes = SerializableUtils.serializeToCompressedByteArray(0.5);
         Assert.assertNotNull(bytes);
-        Assert.assertEquals(0.5,SerializableUtils.deserializeFromCompressedByteArray(bytes,"0.5"));
+        Assert.assertEquals(0.5, SerializableUtils.deserializeFromCompressedByteArray(bytes, "0.5"));
     }
 
     @Test(expected = IllegalArgumentException.class)
-    public void testUnserializableObject(){
+    public void testUnserializableObject() {
         SerializableUtils.serializeToByteArray(new Object());
     }
 
     @Test(expected = IllegalArgumentException.class)
-    public void testEnsureUnserializableObject(){
+    public void testEnsureUnserializableObject() {
         SerializableUtils.ensureSerializable(new UnserializablePOJO());
     }
 

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/ca0fae40/eagle-core/eagle-common/src/test/java/org/apache/eagle/common/TestSiddhiAggregator.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-common/src/test/java/org/apache/eagle/common/TestSiddhiAggregator.java b/eagle-core/eagle-common/src/test/java/org/apache/eagle/common/TestSiddhiAggregator.java
index 86d6016..d12ff87 100644
--- a/eagle-core/eagle-common/src/test/java/org/apache/eagle/common/TestSiddhiAggregator.java
+++ b/eagle-core/eagle-common/src/test/java/org/apache/eagle/common/TestSiddhiAggregator.java
@@ -31,10 +31,10 @@ import java.util.concurrent.atomic.AtomicInteger;
  */
 public class TestSiddhiAggregator {
     @Test
-    public void testSiddhi() throws Exception{
+    public void testSiddhi() throws Exception {
         String ql = "define stream s (host string, timestamp long, metric string, site string, value double);" +
-                " @info(name='query') " +
-                " from s[metric == \"missingblocks\"]#window.externalTimeBatch(timestamp, 1 min, 0) select host, count(value) as avg group by host insert into tmp; ";
+            " @info(name='query') " +
+            " from s[metric == \"missingblocks\"]#window.externalTimeBatch(timestamp, 1 min, 0) select host, count(value) as avg group by host insert into tmp; ";
         SiddhiManager sm = new SiddhiManager();
         ExecutionPlanRuntime runtime = sm.createExecutionPlanRuntime(ql);
 
@@ -43,30 +43,30 @@ public class TestSiddhiAggregator {
         AtomicInteger index = new AtomicInteger(0);
 
         runtime.addCallback("query", new QueryCallback() {
-                @Override
-                public void receive(long timeStamp, Event[] inEvents, Event[] removeEvents) {
-                    printEvents(inEvents);
-                    if(index.get() == 0){
-                        Assert.assertEquals(3, inEvents.length);
-                        Assert.assertEquals("host1", inEvents[0].getData()[0]);
-                        Assert.assertEquals(3L, inEvents[0].getData()[1]);
-                        Assert.assertEquals("host2", inEvents[1].getData()[0]);
-                        Assert.assertEquals(4L, inEvents[1].getData()[1]);
-                        Assert.assertEquals("host3", inEvents[2].getData()[0]);
-                        Assert.assertEquals(2L, inEvents[2].getData()[1]);
-                        index.incrementAndGet();
-                    }else if(index.get() == 1){
-                        Assert.assertEquals(3, inEvents.length);
-                        Assert.assertEquals("host1", inEvents[0].getData()[0]);
-                        Assert.assertEquals(1L, inEvents[0].getData()[1]);
-                        Assert.assertEquals("host2", inEvents[1].getData()[0]);
-                        Assert.assertEquals(2L, inEvents[1].getData()[1]);
-                        Assert.assertEquals("host3", inEvents[2].getData()[0]);
-                        Assert.assertEquals(2L, inEvents[2].getData()[1]);
-                        index.incrementAndGet();
-                    }
+            @Override
+            public void receive(long timeStamp, Event[] inEvents, Event[] removeEvents) {
+                printEvents(inEvents);
+                if (index.get() == 0) {
+                    Assert.assertEquals(3, inEvents.length);
+                    Assert.assertEquals("host1", inEvents[0].getData()[0]);
+                    Assert.assertEquals(3L, inEvents[0].getData()[1]);
+                    Assert.assertEquals("host2", inEvents[1].getData()[0]);
+                    Assert.assertEquals(4L, inEvents[1].getData()[1]);
+                    Assert.assertEquals("host3", inEvents[2].getData()[0]);
+                    Assert.assertEquals(2L, inEvents[2].getData()[1]);
+                    index.incrementAndGet();
+                } else if (index.get() == 1) {
+                    Assert.assertEquals(3, inEvents.length);
+                    Assert.assertEquals("host1", inEvents[0].getData()[0]);
+                    Assert.assertEquals(1L, inEvents[0].getData()[1]);
+                    Assert.assertEquals("host2", inEvents[1].getData()[0]);
+                    Assert.assertEquals(2L, inEvents[1].getData()[1]);
+                    Assert.assertEquals("host3", inEvents[2].getData()[0]);
+                    Assert.assertEquals(2L, inEvents[2].getData()[1]);
+                    index.incrementAndGet();
                 }
-            });
+            }
+        });
         runtime.start();
 
         sendEvents(3, 4, 2, input, 1000L);
@@ -78,34 +78,35 @@ public class TestSiddhiAggregator {
         Thread.sleep(1000);
     }
 
-    void sendEvents(int countHost1, int countHost2, int countHost3, InputHandler input, long startTime) throws Exception{
-        for(int i=0; i<countHost1; i++){
-            Event e = createEvent("host1", startTime + i*100);
+    void sendEvents(int countHost1, int countHost2, int countHost3, InputHandler input, long startTime) throws Exception {
+        for (int i = 0; i < countHost1; i++) {
+            Event e = createEvent("host1", startTime + i * 100);
             input.send(e);
         }
         startTime += 2000;
-        for(int i=0; i<countHost2; i++){
-            Event e = createEvent("host2", startTime + i*100);
+        for (int i = 0; i < countHost2; i++) {
+            Event e = createEvent("host2", startTime + i * 100);
             input.send(e);
         }
         startTime += 4000;
-       for(int i=0; i<countHost3; i++){
-            Event e = createEvent("host3", startTime + i*100);
+        for (int i = 0; i < countHost3; i++) {
+            Event e = createEvent("host3", startTime + i * 100);
             input.send(e);
         }
     }
 
-    void printEvents(Event[] inEvents){
-        for(Event e : inEvents) {
+    void printEvents(Event[] inEvents) {
+        for (Event e : inEvents) {
             System.out.print(e);
             System.out.print(",");
         }
         System.out.println();
     }
-    Event createEvent(String host, long timestamp){
+
+    Event createEvent(String host, long timestamp) {
         Event e = new Event();
         e.setTimestamp(timestamp);
-        e.setData(new Object[]{host, timestamp, "missingblocks", "site1", 14.0});
+        e.setData(new Object[] {host, timestamp, "missingblocks", "site1", 14.0});
         return e;
     }
 }

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/ca0fae40/eagle-core/eagle-common/src/test/java/org/apache/eagle/common/agg/TestSiddhiAggregator.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-common/src/test/java/org/apache/eagle/common/agg/TestSiddhiAggregator.java b/eagle-core/eagle-common/src/test/java/org/apache/eagle/common/agg/TestSiddhiAggregator.java
index 75b50ea..b8a6d3b 100644
--- a/eagle-core/eagle-common/src/test/java/org/apache/eagle/common/agg/TestSiddhiAggregator.java
+++ b/eagle-core/eagle-common/src/test/java/org/apache/eagle/common/agg/TestSiddhiAggregator.java
@@ -30,7 +30,7 @@ import java.util.List;
  */
 public class TestSiddhiAggregator {
     @Test
-    public void test() throws Exception{
+    public void test() throws Exception {
         TimeBatchWindowSpec spec = new TimeBatchWindowSpec();
         Agg agg = new Agg();
         agg.field = "value";
@@ -76,18 +76,18 @@ public class TestSiddhiAggregator {
             }
         });
 
-        aggregator.add(new Object[]{"host1", 1000L, "missingblocks", "site1", 10.0});
-        aggregator.add(new Object[]{"host2", 2000L, "missingblocks", "site1", 16.0});
-        aggregator.add(new Object[]{"host3", 2000L, "missingblocks", "site1", 11.0});
-        aggregator.add(new Object[]{"host1", 21000L, "missingblocks", "site1", 20.0});
+        aggregator.add(new Object[] {"host1", 1000L, "missingblocks", "site1", 10.0});
+        aggregator.add(new Object[] {"host2", 2000L, "missingblocks", "site1", 16.0});
+        aggregator.add(new Object[] {"host3", 2000L, "missingblocks", "site1", 11.0});
+        aggregator.add(new Object[] {"host1", 21000L, "missingblocks", "site1", 20.0});
 
-        aggregator.add(new Object[]{"host1", 61000L, "missingblocks", "site1", 14.0});
-        aggregator.add(new Object[]{"host2", 61500L, "missingblocks", "site1", 14.0});
-        aggregator.add(new Object[]{"host3", 62000L, "missingblocks", "site1", 13.0});
-        aggregator.add(new Object[]{"host2", 63500L, "missingblocks", "site1", 19.0});
+        aggregator.add(new Object[] {"host1", 61000L, "missingblocks", "site1", 14.0});
+        aggregator.add(new Object[] {"host2", 61500L, "missingblocks", "site1", 14.0});
+        aggregator.add(new Object[] {"host3", 62000L, "missingblocks", "site1", 13.0});
+        aggregator.add(new Object[] {"host2", 63500L, "missingblocks", "site1", 19.0});
 
-        aggregator.add(new Object[]{"host1", 121000L, "missingblocks", "site1", 14.0});
-        aggregator.add(new Object[]{"host2", 121000L, "missingblocks", "site1", 14.0});
-        aggregator.add(new Object[]{"host3", 122000L, "missingblocks", "site1", 13.0});
+        aggregator.add(new Object[] {"host1", 121000L, "missingblocks", "site1", 14.0});
+        aggregator.add(new Object[] {"host2", 121000L, "missingblocks", "site1", 14.0});
+        aggregator.add(new Object[] {"host3", 122000L, "missingblocks", "site1", 13.0});
     }
 }

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/ca0fae40/eagle-core/eagle-common/src/test/java/org/apache/eagle/common/agg/TestSiddhiExternalTimeBatch.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-common/src/test/java/org/apache/eagle/common/agg/TestSiddhiExternalTimeBatch.java b/eagle-core/eagle-common/src/test/java/org/apache/eagle/common/agg/TestSiddhiExternalTimeBatch.java
index d664ab3..6d03c70 100644
--- a/eagle-core/eagle-common/src/test/java/org/apache/eagle/common/agg/TestSiddhiExternalTimeBatch.java
+++ b/eagle-core/eagle-common/src/test/java/org/apache/eagle/common/agg/TestSiddhiExternalTimeBatch.java
@@ -25,8 +25,6 @@ import org.wso2.siddhi.core.SiddhiManager;
 import org.wso2.siddhi.core.event.Event;
 import org.wso2.siddhi.core.query.output.callback.QueryCallback;
 import org.wso2.siddhi.core.stream.input.InputHandler;
-import org.wso2.siddhi.core.stream.output.StreamCallback;
-import org.wso2.siddhi.core.util.EventPrinter;
 
 import java.util.concurrent.atomic.AtomicInteger;
 
@@ -35,10 +33,10 @@ import java.util.concurrent.atomic.AtomicInteger;
  */
 public class TestSiddhiExternalTimeBatch {
     @Test
-    public void testSiddhi() throws Exception{
+    public void testSiddhi() throws Exception {
         String ql = "define stream s (host string, timestamp long, metric string, site string, value double);" +
-                " @info(name='query') " +
-                " from s[metric == \"missingblocks\"]#window.externalTimeBatch(timestamp, 1 min, 0) select host, count(value) as avg group by host insert into tmp; ";
+            " @info(name='query') " +
+            " from s[metric == \"missingblocks\"]#window.externalTimeBatch(timestamp, 1 min, 0) select host, count(value) as avg group by host insert into tmp; ";
         System.out.println("query: " + ql);
         SiddhiManager sm = new SiddhiManager();
         ExecutionPlanRuntime runtime = sm.createExecutionPlanRuntime(ql);
@@ -48,30 +46,30 @@ public class TestSiddhiExternalTimeBatch {
         AtomicInteger index = new AtomicInteger(0);
 
         runtime.addCallback("query", new QueryCallback() {
-                @Override
-                public void receive(long timeStamp, Event[] inEvents, Event[] removeEvents) {
-                    printEvents(inEvents);
-                    if(index.get() == 0){
-                        Assert.assertEquals(3, inEvents.length);
-                        Assert.assertEquals("host1", inEvents[0].getData()[0]);
-                        Assert.assertEquals(3L, inEvents[0].getData()[1]);
-                        Assert.assertEquals("host2", inEvents[1].getData()[0]);
-                        Assert.assertEquals(4L, inEvents[1].getData()[1]);
-                        Assert.assertEquals("host3", inEvents[2].getData()[0]);
-                        Assert.assertEquals(2L, inEvents[2].getData()[1]);
-                        index.incrementAndGet();
-                    }else if(index.get() == 1){
-                        Assert.assertEquals(3, inEvents.length);
-                        Assert.assertEquals("host1", inEvents[0].getData()[0]);
-                        Assert.assertEquals(1L, inEvents[0].getData()[1]);
-                        Assert.assertEquals("host2", inEvents[1].getData()[0]);
-                        Assert.assertEquals(2L, inEvents[1].getData()[1]);
-                        Assert.assertEquals("host3", inEvents[2].getData()[0]);
-                        Assert.assertEquals(2L, inEvents[2].getData()[1]);
-                        index.incrementAndGet();
-                    }
+            @Override
+            public void receive(long timeStamp, Event[] inEvents, Event[] removeEvents) {
+                printEvents(inEvents);
+                if (index.get() == 0) {
+                    Assert.assertEquals(3, inEvents.length);
+                    Assert.assertEquals("host1", inEvents[0].getData()[0]);
+                    Assert.assertEquals(3L, inEvents[0].getData()[1]);
+                    Assert.assertEquals("host2", inEvents[1].getData()[0]);
+                    Assert.assertEquals(4L, inEvents[1].getData()[1]);
+                    Assert.assertEquals("host3", inEvents[2].getData()[0]);
+                    Assert.assertEquals(2L, inEvents[2].getData()[1]);
+                    index.incrementAndGet();
+                } else if (index.get() == 1) {
+                    Assert.assertEquals(3, inEvents.length);
+                    Assert.assertEquals("host1", inEvents[0].getData()[0]);
+                    Assert.assertEquals(1L, inEvents[0].getData()[1]);
+                    Assert.assertEquals("host2", inEvents[1].getData()[0]);
+                    Assert.assertEquals(2L, inEvents[1].getData()[1]);
+                    Assert.assertEquals("host3", inEvents[2].getData()[0]);
+                    Assert.assertEquals(2L, inEvents[2].getData()[1]);
+                    index.incrementAndGet();
                 }
-            });
+            }
+        });
         runtime.start();
 
         sendEvents(3, 4, 2, input, 1000L);
@@ -83,34 +81,35 @@ public class TestSiddhiExternalTimeBatch {
         Thread.sleep(1000);
     }
 
-    void sendEvents(int countHost1, int countHost2, int countHost3, InputHandler input, long startTime) throws Exception{
-        for(int i=0; i<countHost1; i++){
-            Event e = createEvent("host1", startTime + i*100);
+    void sendEvents(int countHost1, int countHost2, int countHost3, InputHandler input, long startTime) throws Exception {
+        for (int i = 0; i < countHost1; i++) {
+            Event e = createEvent("host1", startTime + i * 100);
             input.send(e);
         }
         startTime += 2000;
-        for(int i=0; i<countHost2; i++){
-            Event e = createEvent("host2", startTime + i*100);
+        for (int i = 0; i < countHost2; i++) {
+            Event e = createEvent("host2", startTime + i * 100);
             input.send(e);
         }
         startTime += 4000;
-       for(int i=0; i<countHost3; i++){
-            Event e = createEvent("host3", startTime + i*100);
+        for (int i = 0; i < countHost3; i++) {
+            Event e = createEvent("host3", startTime + i * 100);
             input.send(e);
         }
     }
 
-    void printEvents(Event[] inEvents){
-        for(Event e : inEvents) {
+    void printEvents(Event[] inEvents) {
+        for (Event e : inEvents) {
             System.out.print(e);
             System.out.print(",");
         }
         System.out.println();
     }
-    Event createEvent(String host, long timestamp){
+
+    Event createEvent(String host, long timestamp) {
         Event e = new Event();
         e.setTimestamp(timestamp);
-        e.setData(new Object[]{host, timestamp, "missingblocks", "site1", 14.0});
+        e.setData(new Object[] {host, timestamp, "missingblocks", "site1", 14.0});
         return e;
     }
 

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/ca0fae40/eagle-core/eagle-common/src/test/java/org/apache/eagle/common/agg/TestStreamAggregator.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-common/src/test/java/org/apache/eagle/common/agg/TestStreamAggregator.java b/eagle-core/eagle-common/src/test/java/org/apache/eagle/common/agg/TestStreamAggregator.java
index 76b2264..b298823 100644
--- a/eagle-core/eagle-common/src/test/java/org/apache/eagle/common/agg/TestStreamAggregator.java
+++ b/eagle-core/eagle-common/src/test/java/org/apache/eagle/common/agg/TestStreamAggregator.java
@@ -28,38 +28,38 @@ import java.util.List;
  */
 public class TestStreamAggregator {
     @Test
-    public void test() throws Exception{
+    public void test() throws Exception {
         SiddhiAggregator aggregator = StreamAggregator.builder()
-                .columnDef("host", "string")
-                .columnDef("timestamp", "long")
-                .columnDef("metric", "string")
-                .columnDef("site", "string")
-                .columnDef("value", "double")
-                .filter("metric==\"missingblocks\"")
-                .groupby("host")
-                .agg("avg", "value", "avg")
-                .timeColumn("timestamp")
-                .window("1 min", 0)
-                .aggregateHandler(new AggregateHandler() {
-                    @Override
-                    public void onAggregate(List<AggregateResult> result) {
-                        System.out.println(result);
-                    }
-                })
-                .build();
+            .columnDef("host", "string")
+            .columnDef("timestamp", "long")
+            .columnDef("metric", "string")
+            .columnDef("site", "string")
+            .columnDef("value", "double")
+            .filter("metric==\"missingblocks\"")
+            .groupby("host")
+            .agg("avg", "value", "avg")
+            .timeColumn("timestamp")
+            .window("1 min", 0)
+            .aggregateHandler(new AggregateHandler() {
+                @Override
+                public void onAggregate(List<AggregateResult> result) {
+                    System.out.println(result);
+                }
+            })
+            .build();
 
-        aggregator.add(new Object[]{"host1", 1000L, "missingblocks", "site1", 10.0});
-        aggregator.add(new Object[]{"host2", 2000L, "missingblocks", "site1", 16.0});
-        aggregator.add(new Object[]{"host3", 2000L, "missingblocks", "site1", 11.0});
-        aggregator.add(new Object[]{"host1", 21000L, "missingblocks", "site1", 20.0});
+        aggregator.add(new Object[] {"host1", 1000L, "missingblocks", "site1", 10.0});
+        aggregator.add(new Object[] {"host2", 2000L, "missingblocks", "site1", 16.0});
+        aggregator.add(new Object[] {"host3", 2000L, "missingblocks", "site1", 11.0});
+        aggregator.add(new Object[] {"host1", 21000L, "missingblocks", "site1", 20.0});
 
-        aggregator.add(new Object[]{"host1", 61000L, "missingblocks", "site1", 14.0});
-        aggregator.add(new Object[]{"host2", 61500L, "missingblocks", "site1", 14.0});
-        aggregator.add(new Object[]{"host3", 62000L, "missingblocks", "site1", 13.0});
-        aggregator.add(new Object[]{"host2", 63500L, "missingblocks", "site1", 19.0});
+        aggregator.add(new Object[] {"host1", 61000L, "missingblocks", "site1", 14.0});
+        aggregator.add(new Object[] {"host2", 61500L, "missingblocks", "site1", 14.0});
+        aggregator.add(new Object[] {"host3", 62000L, "missingblocks", "site1", 13.0});
+        aggregator.add(new Object[] {"host2", 63500L, "missingblocks", "site1", 19.0});
 
-        aggregator.add(new Object[]{"host1", 121000L, "missingblocks", "site1", 14.0});
-        aggregator.add(new Object[]{"host2", 121000L, "missingblocks", "site1", 14.0});
-        aggregator.add(new Object[]{"host3", 122000L, "missingblocks", "site1", 13.0});
+        aggregator.add(new Object[] {"host1", 121000L, "missingblocks", "site1", 14.0});
+        aggregator.add(new Object[] {"host2", 121000L, "missingblocks", "site1", 14.0});
+        aggregator.add(new Object[] {"host3", 122000L, "missingblocks", "site1", 13.0});
     }
 }

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/ca0fae40/eagle-core/eagle-common/src/test/java/org/apache/eagle/common/config/TestEagleConfig.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-common/src/test/java/org/apache/eagle/common/config/TestEagleConfig.java b/eagle-core/eagle-common/src/test/java/org/apache/eagle/common/config/TestEagleConfig.java
index 7e96433..9bd3c55 100644
--- a/eagle-core/eagle-common/src/test/java/org/apache/eagle/common/config/TestEagleConfig.java
+++ b/eagle-core/eagle-common/src/test/java/org/apache/eagle/common/config/TestEagleConfig.java
@@ -27,16 +27,16 @@ import java.util.TimeZone;
 public class TestEagleConfig {
 
     @Test
-    public void testLoadConfig(){
+    public void testLoadConfig() {
         System.setProperty("config.resource", "application-test.conf");
         EagleConfig config = EagleConfigFactory.load();
-        Assert.assertEquals("test",config.getEnv());
-        Assert.assertEquals("localhost-for-test",config.getZKQuorum());
-        Assert.assertEquals("1234",config.getZKPort());
-        Assert.assertEquals("hbase",config.getStorageType());
-        Assert.assertEquals(true,config.isCoprocessorEnabled());
-        Assert.assertEquals(9090,config.getServicePort());
-        Assert.assertEquals("localhost",config.getServiceHost());
-        Assert.assertEquals(TimeZone.getTimeZone("UTC"),config.getTimeZone());
+        Assert.assertEquals("test", config.getEnv());
+        Assert.assertEquals("localhost-for-test", config.getZKQuorum());
+        Assert.assertEquals("1234", config.getZKPort());
+        Assert.assertEquals("hbase", config.getStorageType());
+        Assert.assertEquals(true, config.isCoprocessorEnabled());
+        Assert.assertEquals(9090, config.getServicePort());
+        Assert.assertEquals("localhost", config.getServiceHost());
+        Assert.assertEquals(TimeZone.getTimeZone("UTC"), config.getTimeZone());
     }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/ca0fae40/eagle-core/eagle-common/src/test/java/org/apache/eagle/common/metric/TestAlertContext.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-common/src/test/java/org/apache/eagle/common/metric/TestAlertContext.java b/eagle-core/eagle-common/src/test/java/org/apache/eagle/common/metric/TestAlertContext.java
index 894961b..ab13628 100644
--- a/eagle-core/eagle-common/src/test/java/org/apache/eagle/common/metric/TestAlertContext.java
+++ b/eagle-core/eagle-common/src/test/java/org/apache/eagle/common/metric/TestAlertContext.java
@@ -26,7 +26,7 @@ import java.util.HashMap;
  */
 public class TestAlertContext {
     @Test
-    public void test(){
+    public void test() {
         HashMap<String, String> map = new HashMap<String, String>();
         map.put("key1", "value1");
         map.put("key2", "value2");


Mime
View raw message