geode-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jinmeil...@apache.org
Subject [45/50] [abbrv] incubator-geode git commit: GEODE-17: enhance the GeodeSecurityUtil and review changes
Date Fri, 29 Apr 2016 19:23:55 GMT
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/7c38f0d8/geode-pulse/src/test/java/com/vmware/gemfire/tools/pulse/tests/PulseAbstractTest.java
----------------------------------------------------------------------
diff --git a/geode-pulse/src/test/java/com/vmware/gemfire/tools/pulse/tests/PulseAbstractTest.java b/geode-pulse/src/test/java/com/vmware/gemfire/tools/pulse/tests/PulseAbstractTest.java
index 392de4c..09bb7d7 100644
--- a/geode-pulse/src/test/java/com/vmware/gemfire/tools/pulse/tests/PulseAbstractTest.java
+++ b/geode-pulse/src/test/java/com/vmware/gemfire/tools/pulse/tests/PulseAbstractTest.java
@@ -16,11 +16,24 @@
  * limitations under the License.
  *
  */
+
 package com.vmware.gemfire.tools.pulse.tests;
 
+import java.io.BufferedReader;
+import java.io.FileReader;
+import java.io.IOException;
+import java.io.InputStream;
+import java.text.DecimalFormat;
+import java.util.List;
+import java.util.Properties;
+import java.util.concurrent.TimeUnit;
+
+import junit.framework.Assert;
+
 import com.gemstone.gemfire.management.internal.JettyHelper;
+import com.jayway.awaitility.Awaitility;
 import com.vmware.gemfire.tools.pulse.internal.data.PulseConstants;
-import junit.framework.Assert;
+
 import org.junit.AfterClass;
 import org.junit.Before;
 import org.junit.Ignore;
@@ -35,16 +48,8 @@ import org.openqa.selenium.support.ui.ExpectedCondition;
 import org.openqa.selenium.support.ui.ExpectedConditions;
 import org.openqa.selenium.support.ui.WebDriverWait;
 
-import java.io.BufferedReader;
-import java.io.FileReader;
-import java.io.IOException;
-import java.io.InputStream;
-import java.text.DecimalFormat;
-import java.util.List;
-import java.util.Properties;
-import java.util.concurrent.TimeUnit;
-
 public abstract class PulseAbstractTest extends PulseBaseTest {
+
   private static String jmxPropertiesFile;
   private static String path;
 
@@ -107,7 +112,7 @@ public abstract class PulseAbstractTest extends PulseBaseTest {
   private static final String REGION_PERSISTENCE_LABEL = "regionPersistence";
   private static final String DATA_VIEW_USEDMEMORY = "memoryUsed";
   private static final String DATA_VIEW_TOTALMEMORY = "totalMemory";
-  
+
   private static final String DATA_BROWSER_LABEL = "Data Browser";
   private static final String DATA_BROWSER_REGIONName1 = "treeDemo_1_span";
   private static final String DATA_BROWSER_REGIONName2 = "treeDemo_2_span";
@@ -132,11 +137,12 @@ public abstract class PulseAbstractTest extends PulseBaseTest {
 
   public static void setUpServer(String username, String password, String jsonAuthFile) throws Exception {
     ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
+
     jmxPropertiesFile = classLoader.getResource("test.properties").getPath();
     path = getPulseWarPath();
     server = Server.createServer(9999, jmxPropertiesFile, jsonAuthFile);
 
-    String host = "localhost";// InetAddress.getLocalHost().getHostAddress();
+    String host = "localhost";
     int port = 8080;
     String context = "/pulse";
 
@@ -146,7 +152,7 @@ public abstract class PulseAbstractTest extends PulseBaseTest {
 
     pulseURL = "http://" + host + ":" + port + context;
 
-    Thread.sleep(5000); // wait till the container settles down
+    Awaitility.await().until(()->jetty.isStarted());
 
     driver = new FirefoxDriver();
     driver.manage().window().maximize();
@@ -160,12 +166,12 @@ public abstract class PulseAbstractTest extends PulseBaseTest {
 
     Thread.sleep(3000);
     WebElement userNameOnPulsePage = (new WebDriverWait(driver, 10))
-        .until(new ExpectedCondition<WebElement>() {
-          @Override
-          public WebElement apply(WebDriver d) {
-            return d.findElement(By.id("userName"));
-          }
-        });
+      .until(new ExpectedCondition<WebElement>() {
+        @Override
+        public WebElement apply(WebDriver d) {
+          return d.findElement(By.id("userName"));
+        }
+      });
     Assert.assertNotNull(userNameOnPulsePage);
     driver.navigate().refresh();
     Thread.sleep(7000);
@@ -215,44 +221,42 @@ public abstract class PulseAbstractTest extends PulseBaseTest {
   }
 
   protected void searchByXPathAndClick(String xpath) {
-	WebElement element = driver.findElement(By.xpath(xpath));
-     Assert.assertNotNull(element);
+    WebElement element = driver.findElement(By.xpath(xpath));
+    Assert.assertNotNull(element);
     element.click();
   }
 
   protected void waitForElementByClassName(final String className, int seconds) {
     WebElement linkTextOnPulsePage1 = (new WebDriverWait(driver, seconds))
-        .until(new ExpectedCondition<WebElement>() {
-          @Override
-          public WebElement apply(WebDriver d) {
-            return d.findElement(By.className(className));
-          }
-        });
+      .until(new ExpectedCondition<WebElement>() {
+        @Override
+        public WebElement apply(WebDriver d) {
+          return d.findElement(By.className(className));
+        }
+      });
     Assert.assertNotNull(linkTextOnPulsePage1);
   }
 
   protected void waitForElementById(final String id, int seconds) {
     WebElement element = (new WebDriverWait(driver, 10))
-        .until(new ExpectedCondition<WebElement>() {
-          @Override
-          public WebElement apply(WebDriver d) {
-            return d.findElement(By.id(id));
-          }
-        });
+      .until(new ExpectedCondition<WebElement>() {
+        @Override
+        public WebElement apply(WebDriver d) {
+          return d.findElement(By.id(id));
+        }
+      });
     Assert.assertNotNull(element);
   }
-  
+
   protected void scrollbarVerticalDownScroll() {
     JavascriptExecutor js = (JavascriptExecutor) driver;
     js.executeScript("javascript:window.scrollBy(250,700)");
     WebElement pickerScroll = driver.findElement(By.className("jspDrag"));
     WebElement pickerScrollCorner = driver.findElement(By
-        .className("jspCorner"));
+      .className("jspCorner"));
     Actions builder = new Actions(driver);
-    Actions movePicker = builder.dragAndDrop(pickerScroll, pickerScrollCorner); // pickerscroll
-                                                                                // is
-                                                                                // the
-                                                                                // webelement
+    Actions movePicker = builder.dragAndDrop(pickerScroll, pickerScrollCorner);
+    // pickerscroll is the web element
     movePicker.perform();
   }
 
@@ -260,147 +264,144 @@ public abstract class PulseAbstractTest extends PulseBaseTest {
     JavascriptExecutor js = (JavascriptExecutor) driver;
     js.executeScript("javascript:window.scrollBy(250,700)");
     WebElement pickerScroll = driver
-        .findElement(By
-            .xpath("//div[@id='gview_queryStatisticsList']/div[3]/div/div[3]/div[2]/div"));
+      .findElement(By
+        .xpath("//div[@id='gview_queryStatisticsList']/div[3]/div/div[3]/div[2]/div"));
     WebElement pickerScrollCorner = driver.findElement(By
-        .className("jspCorner"));
+      .className("jspCorner"));
     Actions builder = new Actions(driver);
-    Actions movePicker = builder.dragAndDrop(pickerScroll, pickerScrollCorner); // pickerscroll
-                                                                                // is
-                                                                                // the
-                                                                                // webelement
+    Actions movePicker = builder.dragAndDrop(pickerScroll, pickerScrollCorner);
+    // pickerscroll is the web element
     movePicker.perform();
   }
 
-  
-  
+
   @Test
   public void testClusterLocatorCount() throws IOException {
     String clusterLocators = driver
-        .findElement(By.id(CLUSTER_VIEW_LOCATORS_ID)).getText();
-   
-    String totallocators = JMXProperties.getInstance().getProperty("server.S1.locatorCount");  
+      .findElement(By.id(CLUSTER_VIEW_LOCATORS_ID)).getText();
+
+    String totallocators = JMXProperties.getInstance().getProperty("server.S1.locatorCount");
     Assert.assertEquals(totallocators, clusterLocators);
   }
 
- @Test
+  @Test
   public void testClusterRegionCount() {
     String clusterRegions = driver.findElement(By.id(CLUSTER_VIEW_REGIONS_ID))
-        .getText();
+      .getText();
     String totalregions = JMXProperties.getInstance().getProperty(
-        "server.S1.totalRegionCount");
+      "server.S1.totalRegionCount");
     Assert.assertEquals(totalregions, clusterRegions);
   }
 
- @Test
+  @Test
   public void testClusterMemberCount() {
-   String clusterMembers = driver.findElement(By.id(CLUSTER_VIEW_MEMBERS_ID)).getText();
-   String totalMembers = JMXProperties.getInstance().getProperty("server.S1.memberCount");
-   Assert.assertEquals(totalMembers, clusterMembers);
- }
+    String clusterMembers = driver.findElement(By.id(CLUSTER_VIEW_MEMBERS_ID)).getText();
+    String totalMembers = JMXProperties.getInstance().getProperty("server.S1.memberCount");
+    Assert.assertEquals(totalMembers, clusterMembers);
+  }
 
- @Test
+  @Test
   public void testClusterNumClient() {
     String clusterClients = driver.findElement(By.id(CLUSTER_CLIENTS_ID))
-        .getText();
+      .getText();
     String totalclients = JMXProperties.getInstance().getProperty(
-        "server.S1.numClients");
+      "server.S1.numClients");
     Assert.assertEquals(totalclients, clusterClients);
   }
 
   @Test
   public void testClusterNumRunningFunction() {
     String clusterFunctions = driver.findElement(By.id(CLUSTER_FUNCTIONS_ID))
-        .getText();
+      .getText();
     String totalfunctions = JMXProperties.getInstance().getProperty(
-        "server.S1.numRunningFunctions");
+      "server.S1.numRunningFunctions");
     Assert.assertEquals(totalfunctions, clusterFunctions);
   }
 
   @Test
   public void testClusterRegisteredCQCount() {
     String clusterUniqueCQs = driver.findElement(By.id(CLUSTER_UNIQUECQS_ID))
-        .getText();
+      .getText();
     String totaluniqueCQs = JMXProperties.getInstance().getProperty(
-        "server.S1.registeredCQCount");
+      "server.S1.registeredCQCount");
     Assert.assertEquals(totaluniqueCQs, clusterUniqueCQs);
   }
 
- @Test
+  @Test
   public void testClusterNumSubscriptions() {
     String clusterSubscriptions = driver.findElement(
-        By.id(CLUSTER_SUBSCRIPTION_ID)).getText();
+      By.id(CLUSTER_SUBSCRIPTION_ID)).getText();
     String totalSubscriptions = JMXProperties.getInstance().getProperty(
-        "server.S1.numSubscriptions");
+      "server.S1.numSubscriptions");
     Assert.assertEquals(totalSubscriptions, clusterSubscriptions);
   }
 
- @Test
+  @Test
   public void testClusterJVMPausesWidget() {
     String clusterJVMPauses = driver.findElement(By.id(CLUSTER_GCPAUSES_ID))
-        .getText();
+      .getText();
     String totalgcpauses = JMXProperties.getInstance().getProperty(
-        "server.S1.jvmPauses");
+      "server.S1.jvmPauses");
     Assert.assertEquals(totalgcpauses, clusterJVMPauses);
   }
 
   @Test
   public void testClusterAverageWritesWidget() {
     String clusterWritePerSec = driver.findElement(
-        By.id(CLUSTER_WRITEPERSEC_ID)).getText();
+      By.id(CLUSTER_WRITEPERSEC_ID)).getText();
     String totalwritepersec = JMXProperties.getInstance().getProperty(
-        "server.S1.averageWrites");
+      "server.S1.averageWrites");
     Assert.assertEquals(totalwritepersec, clusterWritePerSec);
   }
 
   @Test
   public void testClusterAverageReadsWidget() {
     String clusterReadPerSec = driver.findElement(By.id(CLUSTER_READPERSEC_ID))
-        .getText();
+      .getText();
     String totalreadpersec = JMXProperties.getInstance().getProperty(
-        "server.S1.averageReads");
+      "server.S1.averageReads");
     Assert.assertEquals(totalreadpersec, clusterReadPerSec);
   }
 
   @Test
   public void testClusterQuerRequestRateWidget() {
     String clusterQueriesPerSec = driver.findElement(
-        By.id(CLUSTER_QUERIESPERSEC_ID)).getText();
+      By.id(CLUSTER_QUERIESPERSEC_ID)).getText();
     String totalqueriespersec = JMXProperties.getInstance().getProperty(
-        "server.S1.queryRequestRate");
+      "server.S1.queryRequestRate");
     Assert.assertEquals(totalqueriespersec, clusterQueriesPerSec);
   }
-  
+
   @Test
   public void testClusterGridViewMemberID() throws InterruptedException {
-	 searchByIdAndClick("default_grid_button");
-	 List<WebElement> elements = driver.findElements(By.xpath("//table[@id='memberList']/tbody/tr")); //gives me 11 rows
-	 
-	 for(int memberCount = 1; memberCount<elements.size(); memberCount++){		  
-		  String memberId = driver.findElement(By.xpath("//table[@id='memberList']/tbody/tr[" + (memberCount + 1) + "]/td")).getText();		  
-		  String propertMemeberId= JMXProperties.getInstance().getProperty("member.M" + memberCount + ".id");		  
-		  Assert.assertEquals(memberId, propertMemeberId);
-	  }	 
+    searchByIdAndClick("default_grid_button");
+    List<WebElement> elements = driver.findElements(By.xpath("//table[@id='memberList']/tbody/tr")); //gives me 11 rows
+
+    for (int memberCount = 1; memberCount < elements.size(); memberCount++) {
+      String memberId = driver.findElement(By.xpath("//table[@id='memberList']/tbody/tr[" + (memberCount + 1) + "]/td")).getText();
+      String propertMemeberId = JMXProperties.getInstance().getProperty("member.M" + memberCount + ".id");
+      Assert.assertEquals(memberId, propertMemeberId);
+    }
   }
 
   @Test
   public void testClusterGridViewMemberName() {
-	  searchByIdAndClick("default_grid_button"); 
-	  List<WebElement> elements = driver.findElements(By.xpath("//table[@id='memberList']/tbody/tr"));  	  
-	  for (int memberNameCount = 1; memberNameCount < elements.size(); memberNameCount++) {
-		  String gridMemberName = driver.findElement(By.xpath("//table[@id='memberList']/tbody/tr[" + (memberNameCount + 1) + "]/td[2]")).getText();
-		  String memberName = JMXProperties.getInstance().getProperty("member.M" + memberNameCount + ".member");
-		  Assert.assertEquals(gridMemberName, memberName);
+    searchByIdAndClick("default_grid_button");
+    List<WebElement> elements = driver.findElements(By.xpath("//table[@id='memberList']/tbody/tr"));
+    for (int memberNameCount = 1; memberNameCount < elements.size(); memberNameCount++) {
+      String gridMemberName = driver.findElement(By.xpath("//table[@id='memberList']/tbody/tr[" + (memberNameCount + 1) + "]/td[2]")).getText();
+      String memberName = JMXProperties.getInstance().getProperty("member.M" + memberNameCount + ".member");
+      Assert.assertEquals(gridMemberName, memberName);
     }
   }
-  
+
 
   @Test
   public void testClusterGridViewMemberHost() {
-	  searchByIdAndClick("default_grid_button"); 
-	  List<WebElement> elements = driver.findElements(By.xpath("//table[@id='memberList']/tbody/tr")); 	  
+    searchByIdAndClick("default_grid_button");
+    List<WebElement> elements = driver.findElements(By.xpath("//table[@id='memberList']/tbody/tr"));
     for (int memberHostCount = 1; memberHostCount < elements.size(); memberHostCount++) {
-      String MemberHost = driver.findElement(By.xpath("//table[@id='memberList']/tbody/tr[" + (memberHostCount + 1) + "]/td[3]")).getText();     
+      String MemberHost = driver.findElement(By.xpath("//table[@id='memberList']/tbody/tr[" + (memberHostCount + 1) + "]/td[3]")).getText();
       String gridMemberHost = JMXProperties.getInstance().getProperty("member.M" + memberHostCount + ".host");
       Assert.assertEquals(gridMemberHost, MemberHost);
     }
@@ -408,14 +409,14 @@ public abstract class PulseAbstractTest extends PulseBaseTest {
 
   @Test
   public void testClusterGridViewHeapUsage() {
-	searchByIdAndClick("default_grid_button"); 
+    searchByIdAndClick("default_grid_button");
     for (int i = 1; i <= 3; i++) {
       Float HeapUsage = Float.parseFloat(driver
-          .findElement(
-              By.xpath("//table[@id='memberList']/tbody/tr[" + (i + 1) + "]/td[5]")).getText());
+        .findElement(
+          By.xpath("//table[@id='memberList']/tbody/tr[" + (i + 1) + "]/td[5]")).getText());
       Float gridHeapUsagestring = Float.parseFloat(JMXProperties.getInstance()
-          .getProperty("member.M" + i + ".UsedMemory"));
-     Assert.assertEquals(gridHeapUsagestring, HeapUsage);
+        .getProperty("member.M" + i + ".UsedMemory"));
+      Assert.assertEquals(gridHeapUsagestring, HeapUsage);
     }
   }
 
@@ -424,7 +425,7 @@ public abstract class PulseAbstractTest extends PulseBaseTest {
     searchByIdAndClick("default_grid_button");
     for (int i = 1; i <= 3; i++) {
       String CPUUsage = driver.findElement(By.xpath("//table[@id='memberList']/tbody/tr[" + (i + 1) + "]/td[6]"))
-          .getText();
+        .getText();
       String gridCPUUsage = JMXProperties.getInstance().getProperty("member.M" + i + ".cpuUsage");
       gridCPUUsage = gridCPUUsage.trim();
       Assert.assertEquals(gridCPUUsage, CPUUsage);
@@ -439,19 +440,19 @@ public abstract class PulseAbstractTest extends PulseBaseTest {
   }
 
   @Test  // region count in properties file is 2 and UI is 1
-  public void testMemberTotalRegionCount() throws InterruptedException{
-	testRgraphWidget();
-    String RegionCount = driver.findElement(By.id(MEMBER_VIEW_REGION_ID)).getText();  
+  public void testMemberTotalRegionCount() throws InterruptedException {
+    testRgraphWidget();
+    String RegionCount = driver.findElement(By.id(MEMBER_VIEW_REGION_ID)).getText();
     String memberRegionCount = JMXProperties.getInstance().getProperty("member.M1.totalRegionCount");
     Assert.assertEquals(memberRegionCount, RegionCount);
   }
 
   @Test
-  public void testMemberNumThread()throws InterruptedException {
+  public void testMemberNumThread() throws InterruptedException {
     searchByIdAndClick("default_grid_button");
     searchByIdAndClick("M1&M1");
     String ThreadCount = driver.findElement(By.id(MEMBER_VIEW_THREAD_ID)).getText();
-    String memberThreadCount = JMXProperties.getInstance().getProperty("member.M1.numThreads");   
+    String memberThreadCount = JMXProperties.getInstance().getProperty("member.M1.numThreads");
     Assert.assertEquals(memberThreadCount, ThreadCount);
   }
 
@@ -460,69 +461,73 @@ public abstract class PulseAbstractTest extends PulseBaseTest {
     searchByIdAndClick("default_grid_button");
     searchByIdAndClick("M1&M1");
     String SocketCount = driver.findElement(By.id(MEMBER_VIEW_SOCKETS_ID))
-        .getText();
+      .getText();
     String memberSocketCount = JMXProperties.getInstance().getProperty(
-        "member.M1.totalFileDescriptorOpen");
+      "member.M1.totalFileDescriptorOpen");
     Assert.assertEquals(memberSocketCount, SocketCount);
   }
 
- @Test
+  @Test
   public void testMemberLoadAverage() throws InterruptedException {
     searchByIdAndClick("default_grid_button");
     searchByIdAndClick("M1&M1");
     String LoadAvg = driver.findElement(By.id(MEMBER_VIEW_LOADAVG_ID))
-        .getText();
+      .getText();
     String memberLoadAvg = JMXProperties.getInstance().getProperty(
-        "member.M1.loadAverage");
+      "member.M1.loadAverage");
     Assert.assertEquals(df2.format(Double.valueOf(memberLoadAvg)), LoadAvg);
   }
 
   @Ignore("WIP") // May be useful in near future
   @Test
-  public void testOffHeapFreeSize(){	  
-	  
+  public void testOffHeapFreeSize() {
+
     String OffHeapFreeSizeString = driver.findElement(
-        By.id(MEMBER_VIEW_OFFHEAPFREESIZE_ID)).getText();
+      By.id(MEMBER_VIEW_OFFHEAPFREESIZE_ID)).getText();
     String OffHeapFreeSizetemp = OffHeapFreeSizeString.replaceAll("[a-zA-Z]",
-        "");
+      "");
     float OffHeapFreeSize = Float.parseFloat(OffHeapFreeSizetemp);
     float memberOffHeapFreeSize = Float.parseFloat(JMXProperties.getInstance()
-        .getProperty("member.M1.OffHeapFreeSize"));
+      .getProperty("member.M1.OffHeapFreeSize"));
     if (memberOffHeapFreeSize < 1048576) {
       memberOffHeapFreeSize = memberOffHeapFreeSize / 1024;
 
-    } else if (memberOffHeapFreeSize < 1073741824) {
+    }
+    else if (memberOffHeapFreeSize < 1073741824) {
       memberOffHeapFreeSize = memberOffHeapFreeSize / 1024 / 1024;
-    } else {
+    }
+    else {
       memberOffHeapFreeSize = memberOffHeapFreeSize / 1024 / 1024 / 1024;
     }
     memberOffHeapFreeSize = Float.parseFloat(new DecimalFormat("##.##")
-        .format(memberOffHeapFreeSize));
-    Assert.assertEquals(memberOffHeapFreeSize, OffHeapFreeSize); 
- 
+      .format(memberOffHeapFreeSize));
+    Assert.assertEquals(memberOffHeapFreeSize, OffHeapFreeSize);
+
   }
 
   @Ignore("WIP") // May be useful in near future
   @Test
   public void testOffHeapUsedSize() throws InterruptedException {
-	 
+
     String OffHeapUsedSizeString = driver.findElement(
-        By.id(MEMBER_VIEW_OFFHEAPUSEDSIZE_ID)).getText();
+      By.id(MEMBER_VIEW_OFFHEAPUSEDSIZE_ID)).getText();
     String OffHeapUsedSizetemp = OffHeapUsedSizeString.replaceAll("[a-zA-Z]",
-        "");
+      "");
     float OffHeapUsedSize = Float.parseFloat(OffHeapUsedSizetemp);
     float memberOffHeapUsedSize = Float.parseFloat(JMXProperties.getInstance()
-        .getProperty("member.M1.OffHeapUsedSize"));
+      .getProperty("member.M1.OffHeapUsedSize"));
     if (memberOffHeapUsedSize < 1048576) {
       memberOffHeapUsedSize = memberOffHeapUsedSize / 1024;
 
-    } else if (memberOffHeapUsedSize < 1073741824) {
+    }
+    else if (memberOffHeapUsedSize < 1073741824) {
       memberOffHeapUsedSize = memberOffHeapUsedSize / 1024 / 1024;
-    } else {
+    }
+    else {
       memberOffHeapUsedSize = memberOffHeapUsedSize / 1024 / 1024 / 1024;
     }
     memberOffHeapUsedSize = Float.parseFloat(new DecimalFormat("##.##")
-        .format(memberOffHeapUsedSize));
+      .format(memberOffHeapUsedSize));
     Assert.assertEquals(memberOffHeapUsedSize, OffHeapUsedSize);
   }
 
@@ -531,9 +536,9 @@ public abstract class PulseAbstractTest extends PulseBaseTest {
     searchByIdAndClick("default_grid_button");
     searchByIdAndClick("M1&M1");
     String JVMPauses = driver.findElement(By.id(MEMBER_VIEW_JVMPAUSES_ID))
-        .getText();
+      .getText();
     String memberGcPausesAvg = JMXProperties.getInstance().getProperty(
-        "member.M1.JVMPauses");
+      "member.M1.JVMPauses");
     Assert.assertEquals(memberGcPausesAvg, JVMPauses);
   }
 
@@ -542,9 +547,9 @@ public abstract class PulseAbstractTest extends PulseBaseTest {
     searchByIdAndClick("default_grid_button");
     searchByIdAndClick("M1&M1");
     String CPUUsagevalue = driver.findElement(By.id(MEMBER_VIEW_CPUUSAGE_ID))
-        .getText();
+      .getText();
     String memberCPUUsage = JMXProperties.getInstance().getProperty(
-        "member.M1.cpuUsage");
+      "member.M1.cpuUsage");
     Assert.assertEquals(memberCPUUsage, CPUUsagevalue);
   }
 
@@ -555,27 +560,27 @@ public abstract class PulseAbstractTest extends PulseBaseTest {
     float ReadPerSec = Float.parseFloat(driver.findElement(By.id(MEMBER_VIEW_READPERSEC_ID)).getText());
     float memberReadPerSec = Float.parseFloat(JMXProperties.getInstance().getProperty("member.M1.averageReads"));
     memberReadPerSec = Float.parseFloat(new DecimalFormat("##.##")
-    .format(memberReadPerSec));
+      .format(memberReadPerSec));
     Assert.assertEquals(memberReadPerSec, ReadPerSec);
   }
 
- @Test
+  @Test
   public void testMemberAverageWrites() throws InterruptedException {
     testRgraphWidget();
     String WritePerSec = driver.findElement(By.id(MEMBER_VIEW_WRITEPERSEC_ID))
-        .getText();
+      .getText();
     String memberWritePerSec = JMXProperties.getInstance().getProperty(
-        "member.M1.averageWrites");
+      "member.M1.averageWrites");
     Assert.assertEquals(memberWritePerSec, WritePerSec);
   }
- 
+
 
   @Test
   public void testMemberGridViewData() throws InterruptedException {
     testRgraphWidget();
     searchByXPathAndClick(PulseTestLocators.MemberDetailsView.gridButtonXpath);
     // get the number of rows on the grid
-    List<WebElement> noOfRows = driver.findElements(By.xpath("//table[@id='memberRegionsList']/tbody/tr"));    
+    List<WebElement> noOfRows = driver.findElements(By.xpath("//table[@id='memberRegionsList']/tbody/tr"));
     String MemberRegionName = driver.findElement(By.xpath("//table[@id='memberRegionsList']/tbody/tr[2]/td[1]")).getText();
     String memberRegionName = JMXProperties.getInstance().getProperty("region.R1.name");
     Assert.assertEquals(memberRegionName, MemberRegionName);
@@ -583,7 +588,7 @@ public abstract class PulseAbstractTest extends PulseBaseTest {
     String MemberRegionType = driver.findElement(By.xpath("//table[@id='memberRegionsList']/tbody/tr[2]/td[2]")).getText();
     String memberRegionType = JMXProperties.getInstance().getProperty("region.R1.regionType");
     Assert.assertEquals(memberRegionType, MemberRegionType);
-    
+
     String MemberRegionEntryCount = driver.findElement(By.xpath("//table[@id='memberRegionsList']/tbody/tr[2]/td[3]")).getText();
     String memberRegionEntryCount = JMXProperties.getInstance().getProperty("regionOnMember./R1.M1.entryCount");
     Assert.assertEquals(memberRegionEntryCount, MemberRegionEntryCount);
@@ -593,7 +598,7 @@ public abstract class PulseAbstractTest extends PulseBaseTest {
   public void testDropDownList() throws InterruptedException {
     searchByIdAndClick("default_grid_button");
     searchByIdAndClick("M1&M1");
-  	searchByIdAndClick("memberName");
+    searchByIdAndClick("memberName");
     searchByLinkAndClick("M3");
     searchByIdAndClick("memberName");
     searchByLinkAndClick("M2");
@@ -615,7 +620,7 @@ public abstract class PulseAbstractTest extends PulseBaseTest {
   public void testDataViewRegionPath() {
     String regionPath = driver.findElement(By.id(REGION_PATH_LABEL)).getText();
     String dataviewregionpath = JMXProperties.getInstance().getProperty(
-        "region.R1.fullPath");
+      "region.R1.fullPath");
     Assert.assertEquals(dataviewregionpath, regionPath);
   }
 
@@ -624,7 +629,7 @@ public abstract class PulseAbstractTest extends PulseBaseTest {
   public void testDataViewRegionType() {
     String regionType = driver.findElement(By.id(REGION_TYPE_LABEL)).getText();
     String dataviewregiontype = JMXProperties.getInstance().getProperty(
-        "region.R1.regionType");
+      "region.R1.regionType");
     Assert.assertEquals(dataviewregiontype, regionType);
   }
 
@@ -632,9 +637,9 @@ public abstract class PulseAbstractTest extends PulseBaseTest {
   @Test
   public void testDataViewEmptyNodes() {
     String regionEmptyNodes = driver.findElement(By.id(DATA_VIEW_EMPTYNODES))
-        .getText();
+      .getText();
     String dataviewEmptyNodes = JMXProperties.getInstance().getProperty(
-        "region.R1.emptyNodes");
+      "region.R1.emptyNodes");
     Assert.assertEquals(dataviewEmptyNodes, regionEmptyNodes);
   }
 
@@ -642,9 +647,9 @@ public abstract class PulseAbstractTest extends PulseBaseTest {
   @Test
   public void testDataViewSystemRegionEntryCount() {
     String regionEntryCount = driver.findElement(By.id(DATA_VIEW_ENTRYCOUNT))
-        .getText();
+      .getText();
     String dataviewEntryCount = JMXProperties.getInstance().getProperty(
-        "region.R1.systemRegionEntryCount");
+      "region.R1.systemRegionEntryCount");
     Assert.assertEquals(dataviewEntryCount, regionEntryCount);
   }
 
@@ -652,9 +657,9 @@ public abstract class PulseAbstractTest extends PulseBaseTest {
   @Test
   public void testDataViewPersistentEnabled() {
     String regionPersistence = driver.findElement(
-        By.id(REGION_PERSISTENCE_LABEL)).getText();
+      By.id(REGION_PERSISTENCE_LABEL)).getText();
     String dataviewregionpersistence = JMXProperties.getInstance().getProperty(
-        "region.R1.persistentEnabled");
+      "region.R1.persistentEnabled");
     Assert.assertEquals(dataviewregionpersistence, regionPersistence);
   }
 
@@ -662,9 +667,9 @@ public abstract class PulseAbstractTest extends PulseBaseTest {
   @Test
   public void testDataViewDiskWritesRate() {
     String regionWrites = driver.findElement(By.id(DATA_VIEW_WRITEPERSEC))
-        .getText();
+      .getText();
     String dataviewRegionWrites = JMXProperties.getInstance().getProperty(
-        "region.R1.diskWritesRate");
+      "region.R1.diskWritesRate");
     Assert.assertEquals(dataviewRegionWrites, regionWrites);
   }
 
@@ -672,9 +677,9 @@ public abstract class PulseAbstractTest extends PulseBaseTest {
   @Test
   public void testDataViewDiskReadsRate() {
     String regionReads = driver.findElement(By.id(DATA_VIEW_READPERSEC))
-        .getText();
+      .getText();
     String dataviewRegionReads = JMXProperties.getInstance().getProperty(
-        "region.R1.diskReadsRate");
+      "region.R1.diskReadsRate");
     Assert.assertEquals(dataviewRegionReads, regionReads);
   }
 
@@ -682,9 +687,9 @@ public abstract class PulseAbstractTest extends PulseBaseTest {
   @Test
   public void testDataViewDiskUsage() {
     String regionMemoryUsed = driver.findElement(By.id(DATA_VIEW_USEDMEMORY))
-        .getText();
+      .getText();
     String dataviewMemoryUsed = JMXProperties.getInstance().getProperty(
-        "region.R1.diskUsage");
+      "region.R1.diskUsage");
     Assert.assertEquals(dataviewMemoryUsed, regionMemoryUsed);
     searchByLinkAndClick(QUERY_STATISTICS_LABEL);
   }
@@ -693,351 +698,350 @@ public abstract class PulseAbstractTest extends PulseBaseTest {
   @Test
   public void testDataViewGridValue() {
     String DataViewRegionName = driver.findElement(
-        By.xpath("//*[id('6')/x:td[1]]")).getText();
+      By.xpath("//*[id('6')/x:td[1]]")).getText();
     String dataViewRegionName = JMXProperties.getInstance().getProperty(
-        "region.R1.name");
+      "region.R1.name");
     Assert.assertEquals(dataViewRegionName, DataViewRegionName);
 
     String DataViewRegionType = driver.findElement(
-        By.xpath("//*[id('6')/x:td[2]")).getText();
+      By.xpath("//*[id('6')/x:td[2]")).getText();
     String dataViewRegionType = JMXProperties.getInstance().getProperty(
-        "region.R2.regionType");
+      "region.R2.regionType");
     Assert.assertEquals(dataViewRegionType, DataViewRegionType);
 
     String DataViewEntryCount = driver.findElement(
-        By.xpath("//*[id('6')/x:td[3]")).getText();
+      By.xpath("//*[id('6')/x:td[3]")).getText();
     String dataViewEntryCount = JMXProperties.getInstance().getProperty(
-        "region.R2.systemRegionEntryCount");
+      "region.R2.systemRegionEntryCount");
     Assert.assertEquals(dataViewEntryCount, DataViewEntryCount);
 
     String DataViewEntrySize = driver.findElement(
-        By.xpath("//*[id('6')/x:td[4]")).getText();
+      By.xpath("//*[id('6')/x:td[4]")).getText();
     String dataViewEntrySize = JMXProperties.getInstance().getProperty(
-        "region.R2.entrySize");
+      "region.R2.entrySize");
     Assert.assertEquals(dataViewEntrySize, DataViewEntrySize);
 
   }
-  
-  
+
+
   public void loadDataBrowserpage() {
-	  searchByLinkAndClick(DATA_BROWSER_LABEL);
-	  //Thread.sleep(7000);
+    searchByLinkAndClick(DATA_BROWSER_LABEL);
+    //Thread.sleep(7000);
   }
-  
+
   @Test
   public void testDataBrowserRegionName() throws InterruptedException {
-	  loadDataBrowserpage();
-	  String DataBrowserRegionName1 = driver.findElement(By.id(DATA_BROWSER_REGIONName1))
-			  .getText();
-	  String databrowserRegionNametemp1 = JMXProperties.getInstance().getProperty(
-		        "region.R1.name");
-	  String databrowserRegionName1 = databrowserRegionNametemp1.replaceAll("[\\/]", "");
-	  Assert.assertEquals(databrowserRegionName1, DataBrowserRegionName1);
-	  
-	  String DataBrowserRegionName2 = driver.findElement(By.id(DATA_BROWSER_REGIONName2))
-			  .getText();
-	  String databrowserRegionNametemp2 = JMXProperties.getInstance().getProperty(
-		        "region.R2.name");
-	  String databrowserRegionName2 = databrowserRegionNametemp2.replaceAll("[\\/]", "");
-	  Assert.assertEquals(databrowserRegionName2, DataBrowserRegionName2);
-	  
-	  String DataBrowserRegionName3 = driver.findElement(By.id(DATA_BROWSER_REGIONName3))
-			  .getText();
-	  String databrowserRegionNametemp3 = JMXProperties.getInstance().getProperty(
-		        "region.R3.name");
-	  String databrowserRegionName3 = databrowserRegionNametemp3.replaceAll("[\\/]", "");
-	  Assert.assertEquals(databrowserRegionName3, DataBrowserRegionName3);
-	        
+    loadDataBrowserpage();
+    String DataBrowserRegionName1 = driver.findElement(By.id(DATA_BROWSER_REGIONName1))
+      .getText();
+    String databrowserRegionNametemp1 = JMXProperties.getInstance().getProperty(
+      "region.R1.name");
+    String databrowserRegionName1 = databrowserRegionNametemp1.replaceAll("[\\/]", "");
+    Assert.assertEquals(databrowserRegionName1, DataBrowserRegionName1);
+
+    String DataBrowserRegionName2 = driver.findElement(By.id(DATA_BROWSER_REGIONName2))
+      .getText();
+    String databrowserRegionNametemp2 = JMXProperties.getInstance().getProperty(
+      "region.R2.name");
+    String databrowserRegionName2 = databrowserRegionNametemp2.replaceAll("[\\/]", "");
+    Assert.assertEquals(databrowserRegionName2, DataBrowserRegionName2);
+
+    String DataBrowserRegionName3 = driver.findElement(By.id(DATA_BROWSER_REGIONName3))
+      .getText();
+    String databrowserRegionNametemp3 = JMXProperties.getInstance().getProperty(
+      "region.R3.name");
+    String databrowserRegionName3 = databrowserRegionNametemp3.replaceAll("[\\/]", "");
+    Assert.assertEquals(databrowserRegionName3, DataBrowserRegionName3);
+
   }
-  
+
   @Test
   public void testDataBrowserRegionMembersVerificaition() throws InterruptedException {
-	  loadDataBrowserpage();
-	  searchByIdAndClick(DATA_BROWSER_REGION1_CHECKBOX);
-	  String DataBrowserMember1Name1 = driver.findElement(By.xpath("//label[@for='Member0']"))
-			  .getText();
-	  String DataBrowserMember1Name2 = driver.findElement(By.xpath("//label[@for='Member1']"))
-			  .getText();
-	  String DataBrowserMember1Name3 = driver.findElement(By.xpath("//label[@for='Member2']"))
-			  .getText();
-	  String databrowserMember1Names = JMXProperties.getInstance().getProperty(
-		        "region.R1.members");
-	  
-	  String databrowserMember1Names1 = databrowserMember1Names.substring(0, 2);
-	  Assert.assertEquals(databrowserMember1Names1, DataBrowserMember1Name1);
-	  
-	  String databrowserMember1Names2 = databrowserMember1Names.substring(3, 5);
-	  Assert.assertEquals(databrowserMember1Names2, DataBrowserMember1Name2);
-	  
-	  String databrowserMember1Names3 = databrowserMember1Names.substring(6, 8);
-	  Assert.assertEquals(databrowserMember1Names3, DataBrowserMember1Name3);
-	  searchByIdAndClick(DATA_BROWSER_REGION1_CHECKBOX);
-	  
-	  searchByIdAndClick(DATA_BROWSER_REGION2_CHECKBOX);
-	  String DataBrowserMember2Name1 = driver.findElement(By.xpath("//label[@for='Member0']"))
-			  .getText();
-	  String DataBrowserMember2Name2 = driver.findElement(By.xpath("//label[@for='Member1']"))
-			  .getText();
-	  String databrowserMember2Names = JMXProperties.getInstance().getProperty(
-		        "region.R2.members");
-	  
-	  String databrowserMember2Names1 = databrowserMember2Names.substring(0, 2);
-	  Assert.assertEquals(databrowserMember2Names1, DataBrowserMember2Name1);
-	  
-	  String databrowserMember2Names2 = databrowserMember2Names.substring(3, 5);
-	  Assert.assertEquals(databrowserMember2Names2, DataBrowserMember2Name2);
-	  searchByIdAndClick(DATA_BROWSER_REGION2_CHECKBOX);
-	  
-	  searchByIdAndClick(DATA_BROWSER_REGION3_CHECKBOX);
-	  String DataBrowserMember3Name1 = driver.findElement(By.xpath("//label[@for='Member0']"))
-			  .getText();
-	  String DataBrowserMember3Name2 = driver.findElement(By.xpath("//label[@for='Member1']"))
-			  .getText();
-	  String databrowserMember3Names = JMXProperties.getInstance().getProperty(
-		        "region.R3.members");
-	  
-	  String databrowserMember3Names1 = databrowserMember3Names.substring(0, 2);
-	  Assert.assertEquals(databrowserMember3Names1, DataBrowserMember3Name1);
-	  
-	  String databrowserMember3Names2 = databrowserMember3Names.substring(3, 5);
-	  Assert.assertEquals(databrowserMember3Names2, DataBrowserMember3Name2);
-	  searchByIdAndClick(DATA_BROWSER_REGION3_CHECKBOX);
+    loadDataBrowserpage();
+    searchByIdAndClick(DATA_BROWSER_REGION1_CHECKBOX);
+    String DataBrowserMember1Name1 = driver.findElement(By.xpath("//label[@for='Member0']"))
+      .getText();
+    String DataBrowserMember1Name2 = driver.findElement(By.xpath("//label[@for='Member1']"))
+      .getText();
+    String DataBrowserMember1Name3 = driver.findElement(By.xpath("//label[@for='Member2']"))
+      .getText();
+    String databrowserMember1Names = JMXProperties.getInstance().getProperty(
+      "region.R1.members");
+
+    String databrowserMember1Names1 = databrowserMember1Names.substring(0, 2);
+    Assert.assertEquals(databrowserMember1Names1, DataBrowserMember1Name1);
+
+    String databrowserMember1Names2 = databrowserMember1Names.substring(3, 5);
+    Assert.assertEquals(databrowserMember1Names2, DataBrowserMember1Name2);
+
+    String databrowserMember1Names3 = databrowserMember1Names.substring(6, 8);
+    Assert.assertEquals(databrowserMember1Names3, DataBrowserMember1Name3);
+    searchByIdAndClick(DATA_BROWSER_REGION1_CHECKBOX);
+
+    searchByIdAndClick(DATA_BROWSER_REGION2_CHECKBOX);
+    String DataBrowserMember2Name1 = driver.findElement(By.xpath("//label[@for='Member0']"))
+      .getText();
+    String DataBrowserMember2Name2 = driver.findElement(By.xpath("//label[@for='Member1']"))
+      .getText();
+    String databrowserMember2Names = JMXProperties.getInstance().getProperty(
+      "region.R2.members");
+
+    String databrowserMember2Names1 = databrowserMember2Names.substring(0, 2);
+    Assert.assertEquals(databrowserMember2Names1, DataBrowserMember2Name1);
+
+    String databrowserMember2Names2 = databrowserMember2Names.substring(3, 5);
+    Assert.assertEquals(databrowserMember2Names2, DataBrowserMember2Name2);
+    searchByIdAndClick(DATA_BROWSER_REGION2_CHECKBOX);
+
+    searchByIdAndClick(DATA_BROWSER_REGION3_CHECKBOX);
+    String DataBrowserMember3Name1 = driver.findElement(By.xpath("//label[@for='Member0']"))
+      .getText();
+    String DataBrowserMember3Name2 = driver.findElement(By.xpath("//label[@for='Member1']"))
+      .getText();
+    String databrowserMember3Names = JMXProperties.getInstance().getProperty(
+      "region.R3.members");
+
+    String databrowserMember3Names1 = databrowserMember3Names.substring(0, 2);
+    Assert.assertEquals(databrowserMember3Names1, DataBrowserMember3Name1);
+
+    String databrowserMember3Names2 = databrowserMember3Names.substring(3, 5);
+    Assert.assertEquals(databrowserMember3Names2, DataBrowserMember3Name2);
+    searchByIdAndClick(DATA_BROWSER_REGION3_CHECKBOX);
   }
-  
+
   @Test
   public void testDataBrowserColocatedRegions() throws InterruptedException {
-	  loadDataBrowserpage();
-	  String databrowserMemberNames1 = JMXProperties.getInstance().getProperty(
-		        "region.R1.members");
-	  String databrowserMemberNames2 = JMXProperties.getInstance().getProperty(
-		        "region.R2.members");
-	  String databrowserMemberNames3 = JMXProperties.getInstance().getProperty(
-		        "region.R3.members");
-	  
-	  if((databrowserMemberNames1.matches(databrowserMemberNames2+"(.*)"))) {
-		  if((databrowserMemberNames1.matches(databrowserMemberNames3+"(.*)"))) {
-			  if((databrowserMemberNames2.matches(databrowserMemberNames3+"(.*)"))) {
-				  System.out.println("R1, R2 and R3 are colocated regions");
-			  }   
-		  }
-	  }
-	  searchByIdAndClick(DATA_BROWSER_REGION1_CHECKBOX);
-	  searchByLinkAndClick(DATA_BROWSER_COLOCATED_REGION);
-	  String DataBrowserColocatedRegion1 = driver.findElement(By.id(DATA_BROWSER_COLOCATED_REGION_NAME1))
-			  .getText();
-	  String DataBrowserColocatedRegion2 = driver.findElement(By.id(DATA_BROWSER_COLOCATED_REGION_NAME2))
-			  .getText();
-	  String DataBrowserColocatedRegion3 = driver.findElement(By.id(DATA_BROWSER_COLOCATED_REGION_NAME3))
-			  .getText();
-	  
-	  String databrowserColocatedRegiontemp1 = JMXProperties.getInstance().getProperty(
-		        "region.R1.name");
-	  String databrowserColocatedRegion1 = databrowserColocatedRegiontemp1.replaceAll("[\\/]", "");
-	  
-	  String databrowserColocatedRegiontemp2 = JMXProperties.getInstance().getProperty(
-		        "region.R2.name");
-	  String databrowserColocatedRegion2 = databrowserColocatedRegiontemp2.replaceAll("[\\/]", "");
-	  
-	  String databrowserColocatedRegiontemp3 = JMXProperties.getInstance().getProperty(
-		        "region.R3.name");
-	  String databrowserColocatedRegion3 = databrowserColocatedRegiontemp3.replaceAll("[\\/]", "");
-	  
-	  Assert.assertEquals(databrowserColocatedRegion1, DataBrowserColocatedRegion1);
-	  Assert.assertEquals(databrowserColocatedRegion2, DataBrowserColocatedRegion2);
-	  Assert.assertEquals(databrowserColocatedRegion3, DataBrowserColocatedRegion3);
-	  
+    loadDataBrowserpage();
+    String databrowserMemberNames1 = JMXProperties.getInstance().getProperty(
+      "region.R1.members");
+    String databrowserMemberNames2 = JMXProperties.getInstance().getProperty(
+      "region.R2.members");
+    String databrowserMemberNames3 = JMXProperties.getInstance().getProperty(
+      "region.R3.members");
+
+    if ((databrowserMemberNames1.matches(databrowserMemberNames2 + "(.*)"))) {
+      if ((databrowserMemberNames1.matches(databrowserMemberNames3 + "(.*)"))) {
+        if ((databrowserMemberNames2.matches(databrowserMemberNames3 + "(.*)"))) {
+          System.out.println("R1, R2 and R3 are colocated regions");
+        }
+      }
+    }
+    searchByIdAndClick(DATA_BROWSER_REGION1_CHECKBOX);
+    searchByLinkAndClick(DATA_BROWSER_COLOCATED_REGION);
+    String DataBrowserColocatedRegion1 = driver.findElement(By.id(DATA_BROWSER_COLOCATED_REGION_NAME1))
+      .getText();
+    String DataBrowserColocatedRegion2 = driver.findElement(By.id(DATA_BROWSER_COLOCATED_REGION_NAME2))
+      .getText();
+    String DataBrowserColocatedRegion3 = driver.findElement(By.id(DATA_BROWSER_COLOCATED_REGION_NAME3))
+      .getText();
+
+    String databrowserColocatedRegiontemp1 = JMXProperties.getInstance().getProperty(
+      "region.R1.name");
+    String databrowserColocatedRegion1 = databrowserColocatedRegiontemp1.replaceAll("[\\/]", "");
+
+    String databrowserColocatedRegiontemp2 = JMXProperties.getInstance().getProperty(
+      "region.R2.name");
+    String databrowserColocatedRegion2 = databrowserColocatedRegiontemp2.replaceAll("[\\/]", "");
+
+    String databrowserColocatedRegiontemp3 = JMXProperties.getInstance().getProperty(
+      "region.R3.name");
+    String databrowserColocatedRegion3 = databrowserColocatedRegiontemp3.replaceAll("[\\/]", "");
+
+    Assert.assertEquals(databrowserColocatedRegion1, DataBrowserColocatedRegion1);
+    Assert.assertEquals(databrowserColocatedRegion2, DataBrowserColocatedRegion2);
+    Assert.assertEquals(databrowserColocatedRegion3, DataBrowserColocatedRegion3);
+
   }
 
   @Ignore("WIP") // clusterDetails element not found on Data Browser page. No assertions in test
   @Test
   public void testDataBrowserQueryValidation() throws IOException, InterruptedException {
-	  loadDataBrowserpage();
-	  WebElement textArea = driver.findElement(By.id("dataBrowserQueryText"));
-	  textArea.sendKeys("query1");
-	  WebElement executeButton = driver.findElement(By.id("btnExecuteQuery"));
-	  executeButton.click();
-	  String QueryResultHeader1 = driver.findElement(By.xpath("//div[@id='clusterDetails']/div/div/span[@class='n-title']")).getText();
-	  double count = 0,countBuffer=0,countLine=0;
-	  String lineNumber = "";
-	  String filePath = "E:\\springsource\\springsourceWS\\Pulse-Cedar\\src\\main\\resources\\testQueryResultSmall.txt";
-	  BufferedReader br;
-	  String line = "";
-	  br = new BufferedReader(new FileReader(filePath));
-	  while((line = br.readLine()) != null)
-	  {
-		  countLine++;
-          String[] words = line.split(" ");
-
-          for (String word : words) {
-            if (word.equals(QueryResultHeader1)) {
-              count++;
-              countBuffer++;
-            }
-          }
-	  }  
+    loadDataBrowserpage();
+    WebElement textArea = driver.findElement(By.id("dataBrowserQueryText"));
+    textArea.sendKeys("query1");
+    WebElement executeButton = driver.findElement(By.id("btnExecuteQuery"));
+    executeButton.click();
+    String QueryResultHeader1 = driver.findElement(By.xpath("//div[@id='clusterDetails']/div/div/span[@class='n-title']")).getText();
+    double count = 0, countBuffer = 0, countLine = 0;
+    String lineNumber = "";
+    String filePath = "E:\\springsource\\springsourceWS\\Pulse-Cedar\\src\\main\\resources\\testQueryResultSmall.txt";
+    BufferedReader br;
+    String line = "";
+    br = new BufferedReader(new FileReader(filePath));
+    while ((line = br.readLine()) != null) {
+      countLine++;
+      String[] words = line.split(" ");
+
+      for (String word : words) {
+        if (word.equals(QueryResultHeader1)) {
+          count++;
+          countBuffer++;
+        }
+      }
+    }
   }
-  
- public void testTreeMapPopUpData(String S1, String gridIcon) {
-	  for (int i = 1; i <=3; i++) {
-		  searchByLinkAndClick(CLUSTER_VIEW_LABEL);
-		  if (gridIcon.equals(SERVER_GROUP_GRID_ID)) {
-			  WebElement ServerGroupRadio = driver.findElement(By.xpath("//label[@for='radio-servergroups']"));
-			  ServerGroupRadio.click();
-		  }
-		  if (gridIcon.equals(REDUNDANCY_GRID_ID)) {
-			  WebElement ServerGroupRadio = driver.findElement(By.xpath("//label[@for='radio-redundancyzones']"));
-			  ServerGroupRadio.click();
-		  }
-		  searchByIdAndClick(gridIcon);
-		  WebElement TreeMapMember = driver.findElement(By.xpath("//div[@id='" + S1 + "M"+ (i) + "']/div"));
-		  Actions builder = new Actions(driver);
-		  builder.clickAndHold(TreeMapMember).perform();
-		  int j = 1;
-		  String CPUUsageM1temp = driver.findElement(By.xpath("//div[@id='_tooltip']/div/div/div[2]/div/div[2]/div"))
-				  .getText();
-		  String CPUUsageM1 = CPUUsageM1temp.replaceAll("[\\%]", "");
-		  String cpuUsageM1 = JMXProperties.getInstance().getProperty(
-			        "member.M" + (i) + ".cpuUsage");
-		  Assert.assertEquals(cpuUsageM1, CPUUsageM1);
-			  
-		  String MemoryUsageM1temp = driver.findElement(By.xpath("//div[@id='_tooltip']/div/div/div[2]/div[" + (j + 1) + "]/div[2]/div"))
-				  .getText();
-		  String MemoryUsageM1 = MemoryUsageM1temp.replaceAll("MB", "");
-		  String memoryUsageM1 = JMXProperties.getInstance().getProperty(
-				  "member.M" + (i) + ".UsedMemory");
-		  Assert.assertEquals(memoryUsageM1, MemoryUsageM1);
-		  
-		  String LoadAvgM1 = driver.findElement(By.xpath("//div[@id='_tooltip']/div/div/div[2]/div[" + (j + 2) + "]/div[2]/div"))
-				  .getText();
-		  String loadAvgM1 = JMXProperties.getInstance().getProperty(
-				  "member.M" + (i) + ".loadAverage");
-		  Assert.assertEquals(df2.format(Double.valueOf(loadAvgM1)), LoadAvgM1);
-		  
-		  
-		  String ThreadsM1 = driver.findElement(By.xpath("//div[@id='_tooltip']/div/div/div[2]/div[" + (j + 3) + "]/div[2]/div"))
-				  .getText();
-		  String threadsM1 = JMXProperties.getInstance().getProperty(
-				  "member.M" + (i) + ".numThreads");
-		  Assert.assertEquals(threadsM1, ThreadsM1);
-		  
-		  String SocketsM1 = driver.findElement(By.xpath("//div[@id='_tooltip']/div/div/div[2]/div[" + (j + 4) + "]/div[2]/div"))
-				  .getText();
-		  String socketsM1 = JMXProperties.getInstance().getProperty(
-				  "member.M" + (i) + ".totalFileDescriptorOpen");
-		  Assert.assertEquals(socketsM1, SocketsM1);
-          builder.moveToElement(TreeMapMember).release().perform();
-		  }
-	  }
-  
+
+  public void testTreeMapPopUpData(String S1, String gridIcon) {
+    for (int i = 1; i <= 3; i++) {
+      searchByLinkAndClick(CLUSTER_VIEW_LABEL);
+      if (gridIcon.equals(SERVER_GROUP_GRID_ID)) {
+        WebElement ServerGroupRadio = driver.findElement(By.xpath("//label[@for='radio-servergroups']"));
+        ServerGroupRadio.click();
+      }
+      if (gridIcon.equals(REDUNDANCY_GRID_ID)) {
+        WebElement ServerGroupRadio = driver.findElement(By.xpath("//label[@for='radio-redundancyzones']"));
+        ServerGroupRadio.click();
+      }
+      searchByIdAndClick(gridIcon);
+      WebElement TreeMapMember = driver.findElement(By.xpath("//div[@id='" + S1 + "M" + (i) + "']/div"));
+      Actions builder = new Actions(driver);
+      builder.clickAndHold(TreeMapMember).perform();
+      int j = 1;
+      String CPUUsageM1temp = driver.findElement(By.xpath("//div[@id='_tooltip']/div/div/div[2]/div/div[2]/div"))
+        .getText();
+      String CPUUsageM1 = CPUUsageM1temp.replaceAll("[\\%]", "");
+      String cpuUsageM1 = JMXProperties.getInstance().getProperty(
+        "member.M" + (i) + ".cpuUsage");
+      Assert.assertEquals(cpuUsageM1, CPUUsageM1);
+
+      String MemoryUsageM1temp = driver.findElement(By.xpath("//div[@id='_tooltip']/div/div/div[2]/div[" + (j + 1) + "]/div[2]/div"))
+        .getText();
+      String MemoryUsageM1 = MemoryUsageM1temp.replaceAll("MB", "");
+      String memoryUsageM1 = JMXProperties.getInstance().getProperty(
+        "member.M" + (i) + ".UsedMemory");
+      Assert.assertEquals(memoryUsageM1, MemoryUsageM1);
+
+      String LoadAvgM1 = driver.findElement(By.xpath("//div[@id='_tooltip']/div/div/div[2]/div[" + (j + 2) + "]/div[2]/div"))
+        .getText();
+      String loadAvgM1 = JMXProperties.getInstance().getProperty(
+        "member.M" + (i) + ".loadAverage");
+      Assert.assertEquals(df2.format(Double.valueOf(loadAvgM1)), LoadAvgM1);
+
+
+      String ThreadsM1 = driver.findElement(By.xpath("//div[@id='_tooltip']/div/div/div[2]/div[" + (j + 3) + "]/div[2]/div"))
+        .getText();
+      String threadsM1 = JMXProperties.getInstance().getProperty(
+        "member.M" + (i) + ".numThreads");
+      Assert.assertEquals(threadsM1, ThreadsM1);
+
+      String SocketsM1 = driver.findElement(By.xpath("//div[@id='_tooltip']/div/div/div[2]/div[" + (j + 4) + "]/div[2]/div"))
+        .getText();
+      String socketsM1 = JMXProperties.getInstance().getProperty(
+        "member.M" + (i) + ".totalFileDescriptorOpen");
+      Assert.assertEquals(socketsM1, SocketsM1);
+      builder.moveToElement(TreeMapMember).release().perform();
+    }
+  }
+
   @Test
   public void testTopologyPopUpData() {
-	  testTreeMapPopUpData("", CLUSTER_VIEW_GRID_ID); 
+    testTreeMapPopUpData("", CLUSTER_VIEW_GRID_ID);
   }
-  
+
   @Test
   public void testServerGroupTreeMapPopUpData() {
-	  testTreeMapPopUpData("SG1(!)", SERVER_GROUP_GRID_ID);
+    testTreeMapPopUpData("SG1(!)", SERVER_GROUP_GRID_ID);
   }
-  
+
   @Test
   public void testDataViewTreeMapPopUpData() {
-	  searchByLinkAndClick(CLUSTER_VIEW_LABEL);
-	  searchByLinkAndClick(DATA_DROPDOWN_ID);
-	  WebElement TreeMapMember = driver.findElement(By.id("GraphTreeMapClusterData-canvas"));
-	  Actions builder = new Actions(driver);
-	  builder.clickAndHold(TreeMapMember).perform();
-	  String RegionType = driver.findElement(By.xpath("//div[@id='_tooltip']/div/div/div[2]/div/div[2]/div"))
-			  .getText();
-	  String regionType = JMXProperties.getInstance().getProperty(
-			  "region.R2.regionType");
-	  Assert.assertEquals(regionType, RegionType);
-	  
-	  String EntryCount = driver.findElement(By.xpath("//div[@id='_tooltip']/div/div/div[2]/div[2]/div[2]/div"))
-			  .getText();
-	  String entryCount = JMXProperties.getInstance().getProperty(
-			  "region.R2.systemRegionEntryCount");
-	  Assert.assertEquals(entryCount, EntryCount);
-	  
-	  String EntrySizetemp = driver.findElement(By.xpath("//div[@id='_tooltip']/div/div/div[2]/div[3]/div[2]/div"))
-			  .getText();
-	  float EntrySize = Float.parseFloat(EntrySizetemp);
-	  float entrySize = Float.parseFloat(JMXProperties.getInstance().getProperty(
-			  "region.R2.entrySize"));
-	  entrySize = entrySize / 1024 / 1024;
-	  entrySize = Float.parseFloat(new DecimalFormat("##.####")
+    searchByLinkAndClick(CLUSTER_VIEW_LABEL);
+    searchByLinkAndClick(DATA_DROPDOWN_ID);
+    WebElement TreeMapMember = driver.findElement(By.id("GraphTreeMapClusterData-canvas"));
+    Actions builder = new Actions(driver);
+    builder.clickAndHold(TreeMapMember).perform();
+    String RegionType = driver.findElement(By.xpath("//div[@id='_tooltip']/div/div/div[2]/div/div[2]/div"))
+      .getText();
+    String regionType = JMXProperties.getInstance().getProperty(
+      "region.R2.regionType");
+    Assert.assertEquals(regionType, RegionType);
+
+    String EntryCount = driver.findElement(By.xpath("//div[@id='_tooltip']/div/div/div[2]/div[2]/div[2]/div"))
+      .getText();
+    String entryCount = JMXProperties.getInstance().getProperty(
+      "region.R2.systemRegionEntryCount");
+    Assert.assertEquals(entryCount, EntryCount);
+
+    String EntrySizetemp = driver.findElement(By.xpath("//div[@id='_tooltip']/div/div/div[2]/div[3]/div[2]/div"))
+      .getText();
+    float EntrySize = Float.parseFloat(EntrySizetemp);
+    float entrySize = Float.parseFloat(JMXProperties.getInstance().getProperty(
+      "region.R2.entrySize"));
+    entrySize = entrySize / 1024 / 1024;
+    entrySize = Float.parseFloat(new DecimalFormat("##.####")
       .format(entrySize));
-	  Assert.assertEquals(entrySize, EntrySize);  
-	  builder.moveToElement(TreeMapMember).release().perform();
+    Assert.assertEquals(entrySize, EntrySize);
+    builder.moveToElement(TreeMapMember).release().perform();
   }
-  
+
   @Test
   public void testRegionViewTreeMapPopUpData() {
-	  searchByLinkAndClick(CLUSTER_VIEW_LABEL);
-	  searchByLinkAndClick(DATA_DROPDOWN_ID);
-	  WebElement TreeMapMember = driver.findElement(By.id("GraphTreeMapClusterData-canvas"));
-	  TreeMapMember.click();
+    searchByLinkAndClick(CLUSTER_VIEW_LABEL);
+    searchByLinkAndClick(DATA_DROPDOWN_ID);
+    WebElement TreeMapMember = driver.findElement(By.id("GraphTreeMapClusterData-canvas"));
+    TreeMapMember.click();
   }
 
   @Ignore("WIP")
   @Test
-  public void testNumberOfRegions() throws InterruptedException{
-	  
-		driver.findElement(By.xpath("//a[text()='Data Browser']")).click();
-		
-		 Thread.sleep(1000);
-		 List<WebElement> regionList = driver.findElements(By.xpath("//ul[@id='treeDemo']/li"));		 
-		 String regions = JMXProperties.getInstance().getProperty("regions");
-		 String []regionName = regions.split(" ");
-		 for (String string : regionName) {
-		}
-		 //JMXProperties.getInstance().getProperty("region.R1.regionType");
-		int i=1; 
-		for (WebElement webElement : regionList) {
-			//webElement.getAttribute(arg0)
-			i++;
-		}
-		
-		driver.findElement(By.id("treeDemo_1_check")).click();		
-		
-		List<WebElement> memeberList = driver.findElements(By.xpath("//ul[@id='membersList']/li"));
-		int j=0;
-		for (WebElement webElement : memeberList) {
-			j++;
-		}  
+  public void testNumberOfRegions() throws InterruptedException {
+
+    driver.findElement(By.xpath("//a[text()='Data Browser']")).click();
+
+    Thread.sleep(1000);
+    List<WebElement> regionList = driver.findElements(By.xpath("//ul[@id='treeDemo']/li"));
+    String regions = JMXProperties.getInstance().getProperty("regions");
+    String[] regionName = regions.split(" ");
+    for (String string : regionName) {
+    }
+    //JMXProperties.getInstance().getProperty("region.R1.regionType");
+    int i = 1;
+    for (WebElement webElement : regionList) {
+      //webElement.getAttribute(arg0)
+      i++;
+    }
+
+    driver.findElement(By.id("treeDemo_1_check")).click();
+
+    List<WebElement> memeberList = driver.findElements(By.xpath("//ul[@id='membersList']/li"));
+    int j = 0;
+    for (WebElement webElement : memeberList) {
+      j++;
+    }
   }
 
   @Ignore("WIP")
   @Test
-  public void testDataBrowser(){
-	  
-	  driver.findElement(By.linkText("Data Browser")).click();
-	 // WebElement dataBrowserLabel = driver.findElement(By.xpath(""));
-	  WebDriverWait wait = new WebDriverWait(driver, 20);
-	  wait.until(ExpectedConditions.visibilityOf(driver.findElement(By.xpath("//label[text()='Data Browser']"))));
-	  
-	
-	// Verify all elements must be displayed on data browser screen 
-	  Assert.assertTrue(driver.findElement(By.xpath("//a[text()='Data Regions']")).isDisplayed());	
-	  Assert.assertTrue(driver.findElement(By.id("linkColocatedRegions")).isDisplayed());	  
-	  Assert.assertTrue(driver.findElement(By.linkText("All Regions")).isDisplayed());
-	  
-	  Assert.assertTrue(driver.findElement(By.xpath("//a[text()='Region Members']")).isDisplayed());
-	  
-	  Assert.assertTrue(driver.findElement(By.xpath("//a[text()='Queries']")).isDisplayed());
-	  Assert.assertTrue(driver.findElement(By.xpath("//label[text()='Query Editor']")).isDisplayed());
-	  Assert.assertTrue(driver.findElement(By.xpath("//label[text()='Result']")).isDisplayed());
-	  Assert.assertTrue(driver.findElement(By.xpath("//input[@value='Export Result']")).isDisplayed());
-	  Assert.assertTrue(driver.findElement(By.id("btnExecuteQuery")).isDisplayed());
-	  Assert.assertTrue(driver.findElement(By.xpath("//input[@value='Clear']")).isDisplayed());
-	  Assert.assertTrue(driver.findElement(By.id("dataBrowserQueryText")).isDisplayed());
-	  
-	  Assert.assertTrue(driver.findElement(By.id("historyIcon")).isDisplayed());
-	  
-	  //Actual query execution
-	  
-	  driver.findElement(By.id("dataBrowserQueryText")).sendKeys("Query1");
-
-	  // Assert data regions are displayed 
-	  Assert.assertTrue(driver.findElement(By.id("treeDemo_1")).isDisplayed());
+  public void testDataBrowser() {
+
+    driver.findElement(By.linkText("Data Browser")).click();
+    // WebElement dataBrowserLabel = driver.findElement(By.xpath(""));
+    WebDriverWait wait = new WebDriverWait(driver, 20);
+    wait.until(ExpectedConditions.visibilityOf(driver.findElement(By.xpath("//label[text()='Data Browser']"))));
+
+
+    // Verify all elements must be displayed on data browser screen
+    Assert.assertTrue(driver.findElement(By.xpath("//a[text()='Data Regions']")).isDisplayed());
+    Assert.assertTrue(driver.findElement(By.id("linkColocatedRegions")).isDisplayed());
+    Assert.assertTrue(driver.findElement(By.linkText("All Regions")).isDisplayed());
+
+    Assert.assertTrue(driver.findElement(By.xpath("//a[text()='Region Members']")).isDisplayed());
+
+    Assert.assertTrue(driver.findElement(By.xpath("//a[text()='Queries']")).isDisplayed());
+    Assert.assertTrue(driver.findElement(By.xpath("//label[text()='Query Editor']")).isDisplayed());
+    Assert.assertTrue(driver.findElement(By.xpath("//label[text()='Result']")).isDisplayed());
+    Assert.assertTrue(driver.findElement(By.xpath("//input[@value='Export Result']")).isDisplayed());
+    Assert.assertTrue(driver.findElement(By.id("btnExecuteQuery")).isDisplayed());
+    Assert.assertTrue(driver.findElement(By.xpath("//input[@value='Clear']")).isDisplayed());
+    Assert.assertTrue(driver.findElement(By.id("dataBrowserQueryText")).isDisplayed());
+
+    Assert.assertTrue(driver.findElement(By.id("historyIcon")).isDisplayed());
+
+    //Actual query execution
+
+    driver.findElement(By.id("dataBrowserQueryText")).sendKeys("Query1");
+
+    // Assert data regions are displayed
+    Assert.assertTrue(driver.findElement(By.id("treeDemo_1")).isDisplayed());
   }
 }

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/7c38f0d8/geode-pulse/src/test/java/com/vmware/gemfire/tools/pulse/tests/Region.java
----------------------------------------------------------------------
diff --git a/geode-pulse/src/test/java/com/vmware/gemfire/tools/pulse/tests/Region.java b/geode-pulse/src/test/java/com/vmware/gemfire/tools/pulse/tests/Region.java
index 1770dd5..ae8cc92 100644
--- a/geode-pulse/src/test/java/com/vmware/gemfire/tools/pulse/tests/Region.java
+++ b/geode-pulse/src/test/java/com/vmware/gemfire/tools/pulse/tests/Region.java
@@ -38,7 +38,7 @@ public class Region extends JMXBaseBean implements RegionMBean {
     "enableOffHeapMemory", "scope", "diskStoreName",
     "diskSynchronous" };
   private static OpenType[] regAttItemTypes = { SimpleType.STRING,
-    SimpleType.BOOLEAN, SimpleType.BOOLEAN, SimpleType.STRING, 
+    SimpleType.BOOLEAN, SimpleType.STRING,
     SimpleType.STRING, SimpleType.BOOLEAN };
   private static CompositeType listRegionAttributesCompData = null;
 

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/7c38f0d8/geode-web/src/main/webapp/WEB-INF/gemfire-servlet.xml
----------------------------------------------------------------------
diff --git a/geode-web/src/main/webapp/WEB-INF/gemfire-servlet.xml b/geode-web/src/main/webapp/WEB-INF/gemfire-servlet.xml
index eb1a533..ce65933 100644
--- a/geode-web/src/main/webapp/WEB-INF/gemfire-servlet.xml
+++ b/geode-web/src/main/webapp/WEB-INF/gemfire-servlet.xml
@@ -53,7 +53,7 @@ limitations under the License.
   </mvc:annotation-driven>
 
   <mvc:interceptors>
-    <bean class="com.gemstone.gemfire.management.internal.web.controllers.support.EnvironmentVariablesHandlerInterceptor"/>
+    <bean class="com.gemstone.gemfire.management.internal.web.controllers.support.LoginHandlerInterceptor"/>
   </mvc:interceptors>
 
 </beans>

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/7c38f0d8/geode-web/src/test/java/com/gemstone/gemfire/management/internal/web/controllers/support/EnvironmentVariablesHandlerInterceptorJUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-web/src/test/java/com/gemstone/gemfire/management/internal/web/controllers/support/EnvironmentVariablesHandlerInterceptorJUnitTest.java b/geode-web/src/test/java/com/gemstone/gemfire/management/internal/web/controllers/support/EnvironmentVariablesHandlerInterceptorJUnitTest.java
deleted file mode 100644
index 4b9e303..0000000
--- a/geode-web/src/test/java/com/gemstone/gemfire/management/internal/web/controllers/support/EnvironmentVariablesHandlerInterceptorJUnitTest.java
+++ /dev/null
@@ -1,272 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package com.gemstone.gemfire.management.internal.web.controllers.support;
-
-import com.gemstone.gemfire.test.junit.categories.UnitTest;
-import edu.umd.cs.mtc.MultithreadedTestCase;
-import edu.umd.cs.mtc.TestFramework;
-import org.jmock.Expectations;
-import org.jmock.Mockery;
-import org.jmock.lib.concurrent.Synchroniser;
-import org.jmock.lib.legacy.ClassImposteriser;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.experimental.categories.Category;
-
-import javax.servlet.http.HttpServletRequest;
-import java.util.Enumeration;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.Map;
-
-import static org.junit.Assert.*;
-
-/**
- * The EnvironmentVariablesHandlerInterceptorJUnitTest class is a test suite of test cases to test the contract
- * and functionality of the Spring HandlerInterceptor, EnvironmentVariablesHandlerInterceptor class.
- * 
- * @see org.jmock.Mockery
- * @see org.junit.Assert
- * @see org.junit.Test
- * @since 8.0
- */
-@Category(UnitTest.class)
-public class EnvironmentVariablesHandlerInterceptorJUnitTest {
-
-  private Mockery mockContext;
-
-  @Before
-  public void setUp() {
-    mockContext = new Mockery();
-    mockContext.setImposteriser(ClassImposteriser.INSTANCE);
-    mockContext.setThreadingPolicy(new Synchroniser());
-  }
-
-  @After
-  public void tearDown() {
-    mockContext.assertIsSatisfied();
-    mockContext = null;
-  }
-
-  protected String createEnvironmentVariable(final String name) {
-    return (EnvironmentVariablesHandlerInterceptor.ENVIRONMENT_VARIABLE_REQUEST_PARAMETER_PREFIX + name);
-  }
-
-  protected <T> Enumeration<T> enumeration(final Iterator<T> iterator) {
-    return new Enumeration<T>() {
-      public boolean hasMoreElements() {
-        return iterator.hasNext();
-      }
-      public T nextElement() {
-        return iterator.next();
-      }
-    };
-  }
-
-  @Test
-  public void testPreHandleAfterCompletion() throws Exception {
-    final Map<String, String> requestParameters = new HashMap<>(2);
-    final Map<String, String> requestHeaders = new HashMap<>();
-
-    requestParameters.put("parameter", "one");
-    requestParameters.put(createEnvironmentVariable("variable"), "two");
-
-    final HttpServletRequest mockHttpRequest = mockContext.mock(HttpServletRequest.class, "testPreHandleAfterCompletion.HttpServletRequest");
-
-    mockContext.checking(new Expectations() {{
-      oneOf(mockHttpRequest).getParameterNames();
-      will(returnValue(enumeration(requestParameters.keySet().iterator())));
-      oneOf(mockHttpRequest).getHeaderNames();
-      will(returnValue(enumeration(requestHeaders.keySet().iterator())));
-      oneOf(mockHttpRequest).getParameter(with(equal(createEnvironmentVariable("variable"))));
-      will(returnValue(requestParameters.get(createEnvironmentVariable("variable"))));
-    }});
-
-    EnvironmentVariablesHandlerInterceptor handlerInterceptor = new EnvironmentVariablesHandlerInterceptor();
-
-    Map<String, String> envBefore = EnvironmentVariablesHandlerInterceptor.getEnvironment();
-
-    assertNotNull(envBefore);
-    assertTrue(envBefore.isEmpty());
-    assertTrue(handlerInterceptor.preHandle(mockHttpRequest, null, null));
-
-    Map<String, String> envSet = EnvironmentVariablesHandlerInterceptor.getEnvironment();
-
-    assertNotNull(envSet);
-    assertNotSame(envBefore, envSet);
-    assertEquals(1, envSet.size());
-    assertTrue(envSet.containsKey("variable"));
-    assertEquals("two", envSet.get("variable"));
-
-    handlerInterceptor.afterCompletion(mockHttpRequest, null, null, null);
-
-    Map<String, String> envAfter = EnvironmentVariablesHandlerInterceptor.getEnvironment();
-
-    assertNotNull(envAfter);
-    assertTrue(envAfter.isEmpty());
-  }
-
-  @Test
-  public void testHandlerInterceptorThreadSafety() throws Throwable {
-    TestFramework.runOnce(new HandlerInterceptorThreadSafetyMultiThreadedTestCase());
-  }
-
-  protected final class HandlerInterceptorThreadSafetyMultiThreadedTestCase extends MultithreadedTestCase {
-
-    private EnvironmentVariablesHandlerInterceptor handlerInterceptor;
-
-    private HttpServletRequest mockHttpRequestOne;
-    private HttpServletRequest mockHttpRequestTwo;
-
-    @Override
-    public void initialize() {
-      super.initialize();
-
-      final Map<String, String> requestParametersOne = new HashMap<>(3);
-      final Map<String, String> requestHeaders = new HashMap<>();
-
-      requestParametersOne.put("param", "one");
-      requestParametersOne.put(createEnvironmentVariable("STAGE"), "test");
-      requestParametersOne.put(createEnvironmentVariable("GEMFIRE"), "/path/to/gemfire/700");
-
-      mockHttpRequestOne = mockContext.mock(HttpServletRequest.class, "testHandlerInterceptorThreadSafety.HttpServletRequest.1");
-
-      mockContext.checking(new Expectations() {{
-        oneOf(mockHttpRequestOne).getParameterNames();
-        will(returnValue(enumeration(requestParametersOne.keySet().iterator())));
-        oneOf(mockHttpRequestOne).getHeaderNames();
-        will(returnValue(enumeration(requestHeaders.keySet().iterator())));
-        oneOf(mockHttpRequestOne).getParameter(with(equal(createEnvironmentVariable("STAGE"))));
-        will(returnValue(requestParametersOne.get(createEnvironmentVariable("STAGE"))));
-        oneOf(mockHttpRequestOne).getParameter(with(equal(createEnvironmentVariable("GEMFIRE"))));
-        will(returnValue(requestParametersOne.get(createEnvironmentVariable("GEMFIRE"))));
-      }});
-
-      mockHttpRequestTwo = mockContext.mock(HttpServletRequest.class, "testHandlerInterceptorThreadSafety.HttpServletRequest.2");
-
-      final Map<String, String> requestParametersTwo = new HashMap<>(3);
-
-      requestParametersTwo.put("parameter", "two");
-      requestParametersTwo.put(createEnvironmentVariable("HOST"), "localhost");
-      requestParametersTwo.put(createEnvironmentVariable("GEMFIRE"), "/path/to/gemfire/75");
-
-      mockContext.checking(new Expectations() {{
-        oneOf(mockHttpRequestTwo).getParameterNames();
-        will(returnValue(enumeration(requestParametersTwo.keySet().iterator())));
-        oneOf(mockHttpRequestTwo).getHeaderNames();
-        will(returnValue(enumeration(requestHeaders.keySet().iterator())));
-        oneOf(mockHttpRequestTwo).getParameter(with(equal(createEnvironmentVariable("HOST"))));
-        will(returnValue(requestParametersTwo.get(createEnvironmentVariable("HOST"))));
-        oneOf(mockHttpRequestTwo).getParameter(with(equal(createEnvironmentVariable("GEMFIRE"))));
-        will(returnValue(requestParametersTwo.get(createEnvironmentVariable("GEMFIRE"))));
-      }});
-
-      handlerInterceptor =  new EnvironmentVariablesHandlerInterceptor();
-    }
-
-    public void thread1() throws Exception {
-      assertTick(0);
-      Thread.currentThread().setName("HTTP Request Processing Thread 1");
-
-      Map<String, String> env = EnvironmentVariablesHandlerInterceptor.getEnvironment();
-
-      assertNotNull(env);
-      assertTrue(env.isEmpty());
-      assertTrue(handlerInterceptor.preHandle(mockHttpRequestOne, null, null));
-
-      env = EnvironmentVariablesHandlerInterceptor.getEnvironment();
-
-      assertNotNull(env);
-      assertEquals(2, env.size());
-      assertFalse(env.containsKey("param"));
-      assertFalse(env.containsKey("parameter"));
-      assertFalse(env.containsKey("HOST"));
-      assertEquals("test", env.get("STAGE"));
-      assertEquals("/path/to/gemfire/700", env.get("GEMFIRE"));
-
-      waitForTick(2);
-
-      env = EnvironmentVariablesHandlerInterceptor.getEnvironment();
-
-      assertNotNull(env);
-      assertEquals(2, env.size());
-      assertFalse(env.containsKey("param"));
-      assertFalse(env.containsKey("parameter"));
-      assertFalse(env.containsKey("HOST"));
-      assertEquals("test", env.get("STAGE"));
-      assertEquals("/path/to/gemfire/700", env.get("GEMFIRE"));
-
-      waitForTick(4);
-
-      env = EnvironmentVariablesHandlerInterceptor.getEnvironment();
-
-      assertNotNull(env);
-      assertEquals(2, env.size());
-      assertFalse(env.containsKey("param"));
-      assertFalse(env.containsKey("parameter"));
-      assertFalse(env.containsKey("HOST"));
-      assertEquals("test", env.get("STAGE"));
-      assertEquals("/path/to/gemfire/700", env.get("GEMFIRE"));
-
-      handlerInterceptor.afterCompletion(mockHttpRequestOne, null, null, null);
-
-      env = EnvironmentVariablesHandlerInterceptor.getEnvironment();
-
-      assertNotNull(env);
-      assertTrue(env.isEmpty());
-    }
-
-    public void thread2() throws Exception {
-      assertTick(0);
-      Thread.currentThread().setName("HTTP Request Processing Thread 2");
-      waitForTick(1);
-
-      Map<String, String> env = EnvironmentVariablesHandlerInterceptor.getEnvironment();
-
-      assertNotNull(env);
-      assertTrue(env.isEmpty());
-      assertTrue(handlerInterceptor.preHandle(mockHttpRequestTwo, null, null));
-
-      env = EnvironmentVariablesHandlerInterceptor.getEnvironment();
-
-      assertNotNull(env);
-      assertEquals(2, env.size());
-      assertFalse(env.containsKey("parameter"));
-      assertFalse(env.containsKey("param"));
-      assertFalse(env.containsKey("STAGE"));
-      assertEquals("localhost", env.get("HOST"));
-      assertEquals("/path/to/gemfire/75", env.get("GEMFIRE"));
-
-      waitForTick(3);
-
-      handlerInterceptor.afterCompletion(mockHttpRequestTwo, null, null, null);
-
-      env = EnvironmentVariablesHandlerInterceptor.getEnvironment();
-
-      assertNotNull(env);
-      assertTrue(env.isEmpty());
-    }
-
-    @Override
-    public void finish() {
-      super.finish();
-      handlerInterceptor = null;
-    }
-  }
-
-}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/7c38f0d8/geode-web/src/test/java/com/gemstone/gemfire/management/internal/web/controllers/support/LoginHandlerInterceptorJUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-web/src/test/java/com/gemstone/gemfire/management/internal/web/controllers/support/LoginHandlerInterceptorJUnitTest.java b/geode-web/src/test/java/com/gemstone/gemfire/management/internal/web/controllers/support/LoginHandlerInterceptorJUnitTest.java
new file mode 100644
index 0000000..ef405db
--- /dev/null
+++ b/geode-web/src/test/java/com/gemstone/gemfire/management/internal/web/controllers/support/LoginHandlerInterceptorJUnitTest.java
@@ -0,0 +1,274 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.gemstone.gemfire.management.internal.web.controllers.support;
+
+import static org.junit.Assert.*;
+
+import java.util.Enumeration;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.Map;
+import javax.servlet.http.HttpServletRequest;
+
+import com.gemstone.gemfire.test.junit.categories.UnitTest;
+
+import edu.umd.cs.mtc.MultithreadedTestCase;
+import edu.umd.cs.mtc.TestFramework;
+
+import org.jmock.Expectations;
+import org.jmock.Mockery;
+import org.jmock.lib.concurrent.Synchroniser;
+import org.jmock.lib.legacy.ClassImposteriser;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+
+/**
+ * The LoginHandlerInterceptorJUnitTest class is a test suite of test cases to test the contract
+ * and functionality of the Spring HandlerInterceptor, LoginHandlerInterceptor class.
+ * 
+ * @see org.jmock.Mockery
+ * @see org.junit.Assert
+ * @see org.junit.Test
+ * @since 8.0
+ */
+@Category(UnitTest.class)
+public class LoginHandlerInterceptorJUnitTest {
+
+  private Mockery mockContext;
+
+  @Before
+  public void setUp() {
+    mockContext = new Mockery();
+    mockContext.setImposteriser(ClassImposteriser.INSTANCE);
+    mockContext.setThreadingPolicy(new Synchroniser());
+  }
+
+  @After
+  public void tearDown() {
+    mockContext.assertIsSatisfied();
+    mockContext = null;
+  }
+
+  protected String createEnvironmentVariable(final String name) {
+    return (LoginHandlerInterceptor.ENVIRONMENT_VARIABLE_REQUEST_PARAMETER_PREFIX + name);
+  }
+
+  protected <T> Enumeration<T> enumeration(final Iterator<T> iterator) {
+    return new Enumeration<T>() {
+      public boolean hasMoreElements() {
+        return iterator.hasNext();
+      }
+      public T nextElement() {
+        return iterator.next();
+      }
+    };
+  }
+
+  @Test
+  public void testPreHandleAfterCompletion() throws Exception {
+    final Map<String, String> requestParameters = new HashMap<>(2);
+    final Map<String, String> requestHeaders = new HashMap<>();
+
+    requestParameters.put("parameter", "one");
+    requestParameters.put(createEnvironmentVariable("variable"), "two");
+
+    final HttpServletRequest mockHttpRequest = mockContext.mock(HttpServletRequest.class, "testPreHandleAfterCompletion.HttpServletRequest");
+
+    mockContext.checking(new Expectations() {{
+      oneOf(mockHttpRequest).getParameterNames();
+      will(returnValue(enumeration(requestParameters.keySet().iterator())));
+      oneOf(mockHttpRequest).getHeaderNames();
+      will(returnValue(enumeration(requestHeaders.keySet().iterator())));
+      oneOf(mockHttpRequest).getParameter(with(equal(createEnvironmentVariable("variable"))));
+      will(returnValue(requestParameters.get(createEnvironmentVariable("variable"))));
+    }});
+
+    LoginHandlerInterceptor handlerInterceptor = new LoginHandlerInterceptor();
+
+    Map<String, String> envBefore = LoginHandlerInterceptor.getEnvironment();
+
+    assertNotNull(envBefore);
+    assertTrue(envBefore.isEmpty());
+    assertTrue(handlerInterceptor.preHandle(mockHttpRequest, null, null));
+
+    Map<String, String> envSet = LoginHandlerInterceptor.getEnvironment();
+
+    assertNotNull(envSet);
+    assertNotSame(envBefore, envSet);
+    assertEquals(1, envSet.size());
+    assertTrue(envSet.containsKey("variable"));
+    assertEquals("two", envSet.get("variable"));
+
+    handlerInterceptor.afterCompletion(mockHttpRequest, null, null, null);
+
+    Map<String, String> envAfter = LoginHandlerInterceptor.getEnvironment();
+
+    assertNotNull(envAfter);
+    assertTrue(envAfter.isEmpty());
+  }
+
+  @Test
+  public void testHandlerInterceptorThreadSafety() throws Throwable {
+    TestFramework.runOnce(new HandlerInterceptorThreadSafetyMultiThreadedTestCase());
+  }
+
+  protected final class HandlerInterceptorThreadSafetyMultiThreadedTestCase extends MultithreadedTestCase {
+
+    private LoginHandlerInterceptor handlerInterceptor;
+
+    private HttpServletRequest mockHttpRequestOne;
+    private HttpServletRequest mockHttpRequestTwo;
+
+    @Override
+    public void initialize() {
+      super.initialize();
+
+      final Map<String, String> requestParametersOne = new HashMap<>(3);
+      final Map<String, String> requestHeaders = new HashMap<>();
+
+      requestParametersOne.put("param", "one");
+      requestParametersOne.put(createEnvironmentVariable("STAGE"), "test");
+      requestParametersOne.put(createEnvironmentVariable("GEMFIRE"), "/path/to/gemfire/700");
+
+      mockHttpRequestOne = mockContext.mock(HttpServletRequest.class, "testHandlerInterceptorThreadSafety.HttpServletRequest.1");
+
+      mockContext.checking(new Expectations() {{
+        oneOf(mockHttpRequestOne).getParameterNames();
+        will(returnValue(enumeration(requestParametersOne.keySet().iterator())));
+        oneOf(mockHttpRequestOne).getHeaderNames();
+        will(returnValue(enumeration(requestHeaders.keySet().iterator())));
+        oneOf(mockHttpRequestOne).getParameter(with(equal(createEnvironmentVariable("STAGE"))));
+        will(returnValue(requestParametersOne.get(createEnvironmentVariable("STAGE"))));
+        oneOf(mockHttpRequestOne).getParameter(with(equal(createEnvironmentVariable("GEMFIRE"))));
+        will(returnValue(requestParametersOne.get(createEnvironmentVariable("GEMFIRE"))));
+      }});
+
+      mockHttpRequestTwo = mockContext.mock(HttpServletRequest.class, "testHandlerInterceptorThreadSafety.HttpServletRequest.2");
+
+      final Map<String, String> requestParametersTwo = new HashMap<>(3);
+
+      requestParametersTwo.put("parameter", "two");
+      requestParametersTwo.put(createEnvironmentVariable("HOST"), "localhost");
+      requestParametersTwo.put(createEnvironmentVariable("GEMFIRE"), "/path/to/gemfire/75");
+
+      mockContext.checking(new Expectations() {{
+        oneOf(mockHttpRequestTwo).getParameterNames();
+        will(returnValue(enumeration(requestParametersTwo.keySet().iterator())));
+        oneOf(mockHttpRequestTwo).getHeaderNames();
+        will(returnValue(enumeration(requestHeaders.keySet().iterator())));
+        oneOf(mockHttpRequestTwo).getParameter(with(equal(createEnvironmentVariable("HOST"))));
+        will(returnValue(requestParametersTwo.get(createEnvironmentVariable("HOST"))));
+        oneOf(mockHttpRequestTwo).getParameter(with(equal(createEnvironmentVariable("GEMFIRE"))));
+        will(returnValue(requestParametersTwo.get(createEnvironmentVariable("GEMFIRE"))));
+      }});
+
+      handlerInterceptor =  new LoginHandlerInterceptor();
+    }
+
+    public void thread1() throws Exception {
+      assertTick(0);
+      Thread.currentThread().setName("HTTP Request Processing Thread 1");
+
+      Map<String, String> env = LoginHandlerInterceptor.getEnvironment();
+
+      assertNotNull(env);
+      assertTrue(env.isEmpty());
+      assertTrue(handlerInterceptor.preHandle(mockHttpRequestOne, null, null));
+
+      env = LoginHandlerInterceptor.getEnvironment();
+
+      assertNotNull(env);
+      assertEquals(2, env.size());
+      assertFalse(env.containsKey("param"));
+      assertFalse(env.containsKey("parameter"));
+      assertFalse(env.containsKey("HOST"));
+      assertEquals("test", env.get("STAGE"));
+      assertEquals("/path/to/gemfire/700", env.get("GEMFIRE"));
+
+      waitForTick(2);
+
+      env = LoginHandlerInterceptor.getEnvironment();
+
+      assertNotNull(env);
+      assertEquals(2, env.size());
+      assertFalse(env.containsKey("param"));
+      assertFalse(env.containsKey("parameter"));
+      assertFalse(env.containsKey("HOST"));
+      assertEquals("test", env.get("STAGE"));
+      assertEquals("/path/to/gemfire/700", env.get("GEMFIRE"));
+
+      waitForTick(4);
+
+      env = LoginHandlerInterceptor.getEnvironment();
+
+      assertNotNull(env);
+      assertEquals(2, env.size());
+      assertFalse(env.containsKey("param"));
+      assertFalse(env.containsKey("parameter"));
+      assertFalse(env.containsKey("HOST"));
+      assertEquals("test", env.get("STAGE"));
+      assertEquals("/path/to/gemfire/700", env.get("GEMFIRE"));
+
+      handlerInterceptor.afterCompletion(mockHttpRequestOne, null, null, null);
+
+      env = LoginHandlerInterceptor.getEnvironment();
+
+      assertNotNull(env);
+      assertTrue(env.isEmpty());
+    }
+
+    public void thread2() throws Exception {
+      assertTick(0);
+      Thread.currentThread().setName("HTTP Request Processing Thread 2");
+      waitForTick(1);
+
+      Map<String, String> env = LoginHandlerInterceptor.getEnvironment();
+
+      assertNotNull(env);
+      assertTrue(env.isEmpty());
+      assertTrue(handlerInterceptor.preHandle(mockHttpRequestTwo, null, null));
+
+      env = LoginHandlerInterceptor.getEnvironment();
+
+      assertNotNull(env);
+      assertEquals(2, env.size());
+      assertFalse(env.containsKey("parameter"));
+      assertFalse(env.containsKey("param"));
+      assertFalse(env.containsKey("STAGE"));
+      assertEquals("localhost", env.get("HOST"));
+      assertEquals("/path/to/gemfire/75", env.get("GEMFIRE"));
+
+      waitForTick(3);
+
+      handlerInterceptor.afterCompletion(mockHttpRequestTwo, null, null, null);
+
+      env = LoginHandlerInterceptor.getEnvironment();
+
+      assertNotNull(env);
+      assertTrue(env.isEmpty());
+    }
+
+    @Override
+    public void finish() {
+      super.finish();
+      handlerInterceptor = null;
+    }
+  }
+
+}


Mime
View raw message