geode-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kl...@apache.org
Subject [07/20] incubator-geode git commit: GEODE-907: Added tests to support impending refactor
Date Wed, 24 Feb 2016 22:07:26 GMT
GEODE-907: Added tests to support impending refactor


Project: http://git-wip-us.apache.org/repos/asf/incubator-geode/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-geode/commit/0f272db0
Tree: http://git-wip-us.apache.org/repos/asf/incubator-geode/tree/0f272db0
Diff: http://git-wip-us.apache.org/repos/asf/incubator-geode/diff/0f272db0

Branch: refs/heads/feature/GEODE-953
Commit: 0f272db088857c09709c1bedd7afe5ba0050d103
Parents: 6e1b05c
Author: Jens Deppe <jdeppe@pivotal.io>
Authored: Thu Feb 18 06:18:35 2016 -0800
Committer: Jens Deppe <jdeppe@pivotal.io>
Committed: Tue Feb 23 14:04:50 2016 -0800

----------------------------------------------------------------------
 geode-pulse/build.gradle                        |  56 +-
 .../internal/controllers/PulseController.java   |   6 +-
 .../tools/pulse/internal/data/Cluster.java      |   6 +
 .../tools/pulse/internal/data/DataBrowser.java  |   8 +-
 .../tools/pulse/internal/data/PulseConfig.java  |  14 +
 .../controllers/PulseControllerJUnitTest.java   | 756 +++++++++++++++++++
 gradle/dependency-versions.properties           |   3 +-
 7 files changed, 813 insertions(+), 36 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/0f272db0/geode-pulse/build.gradle
----------------------------------------------------------------------
diff --git a/geode-pulse/build.gradle b/geode-pulse/build.gradle
index ebd851a..cd3a744 100755
--- a/geode-pulse/build.gradle
+++ b/geode-pulse/build.gradle
@@ -26,35 +26,39 @@ sourceSets {
 }
 
 dependencies {
-  compile 'commons-beanutils:commons-beanutils:'+project.'commons-beanutils.version'
-  compile 'commons-collections:commons-collections:'+project.'commons-collections.version'
-  compile 'commons-digester:commons-digester:'+project.'commons-digester.version'
-  compile 'commons-lang:commons-lang:'+project.'commons-lang.version'
-  compile 'org.springframework.ldap:spring-ldap-core:'+project.'spring-ldap-core.version'
-  compile 'org.springframework.security:spring-security-config:'+project.'spring-security.version'
-  compile 'org.springframework.security:spring-security-core:'+project.'spring-security.version'
-  compile 'org.springframework.security:spring-security-ldap:'+project.'spring-security.version'
-  compile 'org.springframework.security:spring-security-web:'+project.'spring-security.version'
-  compile 'org.springframework:spring-tx:'+project.'spring-tx.version'
-
-  providedCompile 'commons-logging:commons-logging:'+project.'commons-logging.version'
-
-  provided 'org.mortbay.jetty:servlet-api:'+project.'mortbay-jetty-servlet-api.version'
-  provided 'com.google.guava:guava:'+project.'guava.version'
+  compile 'commons-beanutils:commons-beanutils:' + project.'commons-beanutils.version'
+  compile 'commons-collections:commons-collections:' + project.'commons-collections.version'
+  compile 'commons-digester:commons-digester:' + project.'commons-digester.version'
+  compile 'commons-lang:commons-lang:' + project.'commons-lang.version'
+  compile 'org.springframework.ldap:spring-ldap-core:' + project.'spring-ldap-core.version'
+  compile 'org.springframework.security:spring-security-config:' + project.'spring-security.version'
+  compile 'org.springframework.security:spring-security-core:' + project.'spring-security.version'
+  compile 'org.springframework.security:spring-security-ldap:' + project.'spring-security.version'
+  compile 'org.springframework.security:spring-security-web:' + project.'spring-security.version'
+  compile 'org.springframework:spring-tx:' + project.'spring-tx.version'
+
+  providedCompile 'commons-logging:commons-logging:' + project.'commons-logging.version'
+
+  provided 'org.mortbay.jetty:servlet-api:' + project.'mortbay-jetty-servlet-api.version'
+  provided 'com.google.guava:guava:' + project.'guava.version'
 
   testCompile project(':geode-junit')
 
-  testCompile 'org.apache.tomcat.embed:tomcat-embed-core:'+project.'tomcat7.version'
-  testCompile 'org.apache.tomcat.embed:tomcat-embed-jasper:'+project.'tomcat7.version'
-  testCompile 'org.apache.tomcat.embed:tomcat-embed-logging-juli:'+project.'tomcat7.version'
-  testCompile 'org.seleniumhq.selenium:selenium-firefox-driver:'+project.'selenium.version'
-  testCompile 'org.seleniumhq.selenium:selenium-api:'+project.'selenium.version'
-  testCompile 'org.seleniumhq.selenium:selenium-remote-driver:'+project.'selenium.version'
-  testCompile 'org.seleniumhq.selenium:selenium-support:'+project.'selenium.version'
-
-  testRuntime 'com.google.code.gson:gson:'+project.'google-gson.version'
-  testRuntime 'org.apache.commons:commons-exec:'+project.'commons-exec.version'
-
+  testCompile 'org.apache.tomcat.embed:tomcat-embed-core:' + project.'tomcat7.version'
+  testCompile 'org.apache.tomcat.embed:tomcat-embed-jasper:' + project.'tomcat7.version'
+  testCompile 'org.apache.tomcat.embed:tomcat-embed-logging-juli:' + project.'tomcat7.version'
+  testCompile 'org.seleniumhq.selenium:selenium-firefox-driver:' + project.'selenium.version'
+  testCompile 'org.seleniumhq.selenium:selenium-api:' + project.'selenium.version'
+  testCompile 'org.seleniumhq.selenium:selenium-remote-driver:' + project.'selenium.version'
+  testCompile 'org.seleniumhq.selenium:selenium-support:' + project.'selenium.version'
+  testCompile 'org.springframework:spring-test:' + project.'springframework.version'
+  testCompile 'org.powermock:powermock-core:' + project.'powermock.version'
+  testCompile 'org.powermock:powermock-module-junit4:' + project.'powermock.version'
+  testCompile 'org.powermock:powermock-api-mockito:' + project.'powermock.version'
+
+  testRuntime 'com.google.code.gson:gson:' + project.'google-gson.version'
+  testRuntime 'org.apache.commons:commons-exec:' + project.'commons-exec.version'
+  testRuntime 'com.jayway.jsonpath:json-path:' + project.'json-path.version'
 }
 
 def generatedResources = "$buildDir/generated-resources/main"

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/0f272db0/geode-pulse/src/main/java/com/vmware/gemfire/tools/pulse/internal/controllers/PulseController.java
----------------------------------------------------------------------
diff --git a/geode-pulse/src/main/java/com/vmware/gemfire/tools/pulse/internal/controllers/PulseController.java b/geode-pulse/src/main/java/com/vmware/gemfire/tools/pulse/internal/controllers/PulseController.java
index c8737ce..6abb2de 100644
--- a/geode-pulse/src/main/java/com/vmware/gemfire/tools/pulse/internal/controllers/PulseController.java
+++ b/geode-pulse/src/main/java/com/vmware/gemfire/tools/pulse/internal/controllers/PulseController.java
@@ -117,7 +117,7 @@ public class PulseController {
               + ((requestMap == null) ? "" : requestMap) });
     } catch (Exception e) {
       if (LOGGER.fineEnabled()) {
-        LOGGER.fine("Exception Occured : " + e.getMessage());
+        LOGGER.fine("Exception Occurred : " + e.getMessage());
       }
     }
 
@@ -140,7 +140,7 @@ public class PulseController {
       LOGGER.logJSONError(eJSON, null);
     } catch (Exception e) {
       if (LOGGER.fineEnabled()) {
-        LOGGER.fine("Exception Occured : " + e.getMessage());
+        LOGGER.fine("Exception Occurred : " + e.getMessage());
       }
     }
   }
@@ -253,7 +253,7 @@ public class PulseController {
       LOGGER.logJSONError(eJSON, null);
     } catch (Exception e) {
       if (LOGGER.fineEnabled()) {
-        LOGGER.fine("Exception Occured : " + e.getMessage());
+        LOGGER.fine("Exception Occurred : " + e.getMessage());
       }
     }
 

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/0f272db0/geode-pulse/src/main/java/com/vmware/gemfire/tools/pulse/internal/data/Cluster.java
----------------------------------------------------------------------
diff --git a/geode-pulse/src/main/java/com/vmware/gemfire/tools/pulse/internal/data/Cluster.java b/geode-pulse/src/main/java/com/vmware/gemfire/tools/pulse/internal/data/Cluster.java
index 732a1b0..309fdf7 100644
--- a/geode-pulse/src/main/java/com/vmware/gemfire/tools/pulse/internal/data/Cluster.java
+++ b/geode-pulse/src/main/java/com/vmware/gemfire/tools/pulse/internal/data/Cluster.java
@@ -2337,6 +2337,12 @@ public class Cluster extends Thread {
     }
   }
 
+  /**
+   * Default constructor only used for testing
+   */
+  public Cluster() {
+  }
+
 
   /**
    * This function is used for calling getUpdator function of ClusterDataFactory

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/0f272db0/geode-pulse/src/main/java/com/vmware/gemfire/tools/pulse/internal/data/DataBrowser.java
----------------------------------------------------------------------
diff --git a/geode-pulse/src/main/java/com/vmware/gemfire/tools/pulse/internal/data/DataBrowser.java b/geode-pulse/src/main/java/com/vmware/gemfire/tools/pulse/internal/data/DataBrowser.java
index dbad2df..f3b4493 100644
--- a/geode-pulse/src/main/java/com/vmware/gemfire/tools/pulse/internal/data/DataBrowser.java
+++ b/geode-pulse/src/main/java/com/vmware/gemfire/tools/pulse/internal/data/DataBrowser.java
@@ -49,10 +49,6 @@ public class DataBrowser {
   private final ResourceBundle resourceBundle = Repository.get()
       .getResourceBundle();
 
-  private final String queryHistoryFile = PulseConstants.PULSE_QUERY_HISTORY_FILE_LOCATION
-      + System.getProperty("file.separator")
-      + PulseConstants.PULSE_QUERY_HISTORY_FILE_NAME;
-
   private SimpleDateFormat simpleDateFormat = new SimpleDateFormat(
       PulseConstants.PULSE_QUERY_HISTORY_DATE_PATTERN);
 
@@ -198,7 +194,7 @@ public class DataBrowser {
     JSONObject queriesJSON = new JSONObject();
 
     try {
-      inputStream = new FileInputStream(queryHistoryFile);
+      inputStream = new FileInputStream(Repository.get().getPulseConfig().getQueryHistoryFileName());
       String inputStreamString = new Scanner(inputStream, "UTF-8")
           .useDelimiter("\\A").next();
       queriesJSON = new JSONObject(inputStreamString);
@@ -237,7 +233,7 @@ public class DataBrowser {
     boolean operationStatus = false;
     FileOutputStream fileOut = null;
 
-    File file = new File(queryHistoryFile);
+    File file = new File(Repository.get().getPulseConfig().getQueryHistoryFileName());
     try {
       fileOut = new FileOutputStream(file);
 

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/0f272db0/geode-pulse/src/main/java/com/vmware/gemfire/tools/pulse/internal/data/PulseConfig.java
----------------------------------------------------------------------
diff --git a/geode-pulse/src/main/java/com/vmware/gemfire/tools/pulse/internal/data/PulseConfig.java b/geode-pulse/src/main/java/com/vmware/gemfire/tools/pulse/internal/data/PulseConfig.java
index 627e37c..4470f7f 100644
--- a/geode-pulse/src/main/java/com/vmware/gemfire/tools/pulse/internal/data/PulseConfig.java
+++ b/geode-pulse/src/main/java/com/vmware/gemfire/tools/pulse/internal/data/PulseConfig.java
@@ -53,6 +53,9 @@ public class PulseConfig {
   // Flag for appending log messages
   private Boolean logAppend;
 
+  // Query history log file
+  private String queryHistoryFileName;
+
   public PulseConfig() {
     this.setLogFileName(PulseConstants.PULSE_LOG_FILE_NAME);
     this.LogFileLocation = PulseConstants.PULSE_LOG_FILE_LOCATION;
@@ -61,6 +64,10 @@ public class PulseConfig {
     this.logDatePattern = PulseConstants.PULSE_LOG_MESSAGE_DATE_PATTERN;
     this.logLevel = PulseConstants.PULSE_LOG_LEVEL;
     this.logAppend = PulseConstants.PULSE_LOG_APPEND;
+    this.queryHistoryFileName = PulseConstants.PULSE_QUERY_HISTORY_FILE_LOCATION
+      + System.getProperty("file.separator")
+      + PulseConstants.PULSE_QUERY_HISTORY_FILE_NAME;
+
   }
 
   public String getLogFileName() {
@@ -123,4 +130,11 @@ public class PulseConfig {
     this.logAppend = logAppend;
   }
 
+  public String getQueryHistoryFileName() {
+    return queryHistoryFileName;
+  }
+
+  public void setQueryHistoryFileName(String queryHistoryFileName) {
+    this.queryHistoryFileName = queryHistoryFileName;
+  }
 }

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/0f272db0/geode-pulse/src/test/java/com/vmware/gemfire/tools/pulse/controllers/PulseControllerJUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-pulse/src/test/java/com/vmware/gemfire/tools/pulse/controllers/PulseControllerJUnitTest.java b/geode-pulse/src/test/java/com/vmware/gemfire/tools/pulse/controllers/PulseControllerJUnitTest.java
new file mode 100644
index 0000000..c4f7a49
--- /dev/null
+++ b/geode-pulse/src/test/java/com/vmware/gemfire/tools/pulse/controllers/PulseControllerJUnitTest.java
@@ -0,0 +1,756 @@
+package com.vmware.gemfire.tools.pulse.controllers;
+
+import com.gemstone.gemfire.test.junit.categories.IntegrationTest;
+import com.vmware.gemfire.tools.pulse.internal.PulseAppListener;
+import com.vmware.gemfire.tools.pulse.internal.data.Cluster;
+import com.vmware.gemfire.tools.pulse.internal.data.PulseConfig;
+import com.vmware.gemfire.tools.pulse.internal.data.Repository;
+import com.vmware.gemfire.tools.pulse.internal.json.JSONObject;
+import org.apache.commons.collections.buffer.CircularFifoBuffer;
+import org.junit.Before;
+import org.junit.Rule;
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+import org.junit.rules.TemporaryFolder;
+import org.junit.runner.RunWith;
+import org.mockito.Mockito;
+import org.powermock.core.classloader.annotations.PowerMockIgnore;
+import org.powermock.core.classloader.annotations.PrepareForTest;
+import org.powermock.modules.junit4.PowerMockRunner;
+import org.powermock.modules.junit4.PowerMockRunnerDelegate;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.MediaType;
+import org.springframework.mock.web.MockHttpSession;
+import org.springframework.test.context.ContextConfiguration;
+import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
+import org.springframework.test.context.web.WebAppConfiguration;
+import org.springframework.test.web.servlet.MockMvc;
+import org.springframework.test.web.servlet.setup.MockMvcBuilders;
+import org.springframework.web.context.WebApplicationContext;
+
+import javax.servlet.ServletContextListener;
+import java.io.File;
+import java.security.Principal;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.UUID;
+
+import static org.hamcrest.Matchers.containsInAnyOrder;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+import static org.mockito.Matchers.anyInt;
+import static org.mockito.Matchers.anyString;
+import static org.mockito.Mockito.doReturn;
+import static org.powermock.api.mockito.PowerMockito.spy;
+import static org.powermock.api.mockito.PowerMockito.when;
+import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get;
+import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.post;
+import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.*;
+
+/**
+ * @author Jens Deppe
+ */
+@Category(IntegrationTest.class)
+@PrepareForTest(Repository.class)
+@RunWith(PowerMockRunner.class)
+@PowerMockRunnerDelegate(SpringJUnit4ClassRunner.class)
+@WebAppConfiguration
+@ContextConfiguration("classpath*:mvc-dispatcher-servlet.xml")
+@PowerMockIgnore("*.IntegrationTest")
+public class PulseControllerJUnitTest {
+
+  @Autowired
+  private WebApplicationContext wac;
+
+  private MockMvc mockMvc;
+
+  private Cluster cluster;
+
+  @Rule
+  public TemporaryFolder tempFolder = new TemporaryFolder();
+
+  private static final String PRINCIPAL_USER = "test-user";
+
+  private static final String MEMBER_ID = "member1";
+  private static final String MEMBER_NAME = "localhost-server";
+  private static final String CLUSTER_NAME = "mock-cluster";
+  private static final String REGION_NAME = "mock-region";
+  private static final String REGION_PATH = "/" + REGION_NAME;
+  private static final String REGION_TYPE = "PARTITION";
+  private static final String AEQ_LISTENER = "async-event-listener";
+  private static final String CLIENT_NAME = "client-1";
+
+  private static final Principal principal;
+
+  static {
+    principal = () -> PRINCIPAL_USER;
+  }
+
+  @Before
+  public void setup() throws Exception {
+    this.mockMvc = MockMvcBuilders.webAppContextSetup(this.wac).build();
+
+    cluster = Mockito.spy(Cluster.class);
+
+    Cluster.Region region = new Cluster.Region();
+    region.setName(REGION_NAME);
+    region.setFullPath(REGION_PATH);
+    region.setRegionType(REGION_TYPE);
+    region.setMemberCount(1);
+    region.setMemberName(new ArrayList<String>() {{
+      add(MEMBER_NAME);
+    }});
+    Cluster.RegionOnMember regionOnMember = new Cluster.RegionOnMember();
+    regionOnMember.setRegionFullPath(REGION_PATH);
+    regionOnMember.setMemberName(MEMBER_NAME);
+    region.setRegionOnMembers(new ArrayList<Cluster.RegionOnMember>() {{
+      add(regionOnMember);
+    }});
+    cluster.addClusterRegion("/mock-region", region);
+
+    Cluster.Member member = new Cluster.Member();
+    member.setId(MEMBER_ID);
+    member.setName(MEMBER_NAME);
+    member.setUptime(1L);
+
+    member.setMemberRegions(new HashMap<String, Cluster.Region>() {{
+      put(REGION_NAME, region);
+    }});
+
+    Cluster.AsyncEventQueue aeq = new Cluster.AsyncEventQueue();
+    aeq.setAsyncEventListener(AEQ_LISTENER);
+    member.setAsyncEventQueueList(new ArrayList() {{
+      add(aeq);
+    }});
+
+    Cluster.Client client = new Cluster.Client();
+    client.setId("100");
+    client.setName(CLIENT_NAME);
+    client.setUptime(1L);
+    member.setMemberClientsHMap(new HashMap<String, Cluster.Client>() {{
+      put(CLIENT_NAME, client);
+    }});
+
+    cluster.setMembersHMap(new HashMap() {{put(MEMBER_NAME, member);}});
+    cluster.setServerName(CLUSTER_NAME);
+    cluster.setMemoryUsageTrend(new CircularFifoBuffer() {{
+      add(1);
+      add(2);
+      add(3);
+    }});
+
+    Repository repo = Mockito.spy(Repository.class);
+
+    // Set up a partial mock for some static methods
+    spy(Repository.class);
+    when(Repository.class, "get").thenReturn(repo);
+    doReturn(cluster).when(repo).getCluster();
+
+    PulseConfig config = new PulseConfig();
+    File tempQueryLog = tempFolder.newFile("query_history.log");
+    config.setQueryHistoryFileName(tempQueryLog.toString());
+    doReturn(config).when(repo).getPulseConfig();
+  }
+
+  @Test
+  public void pulseUpdateForClusterDetails() throws Exception {
+    this.mockMvc.perform(post("/pulseUpdate")
+        .param("pulseData", "{\"ClusterDetails\":\"{}\"}")
+        .principal(principal)
+        .accept(MediaType.parseMediaType(MediaType.APPLICATION_JSON_UTF8_VALUE)))
+        .andExpect(status().isOk())
+        .andExpect(jsonPath("$.ClusterDetails.userName").value(PRINCIPAL_USER))
+        .andExpect(jsonPath("$.ClusterDetails.totalHeap").value(0))
+        .andExpect(jsonPath("$.ClusterDetails.clusterName").value(CLUSTER_NAME))
+    ;
+  }
+
+  @Test
+  public void pulseUpdateForClusterDiskThroughput() throws Exception {
+    this.mockMvc.perform(post("/pulseUpdate")
+        .param("pulseData", "{\"ClusterDiskThroughput\":\"{}\"}")
+        .principal(principal)
+        .accept(MediaType.parseMediaType(MediaType.APPLICATION_JSON_UTF8_VALUE)))
+        .andExpect(status().isOk())
+        .andExpect(jsonPath("$.ClusterDiskThroughput.currentThroughputWrites").value(0))
+        .andExpect(jsonPath("$.ClusterDiskThroughput.throughputReads").isEmpty())
+        .andExpect(jsonPath("$.ClusterDiskThroughput.currentThroughputReads").value(0))
+        .andExpect(jsonPath("$.ClusterDiskThroughput.throughputWrites").isEmpty())
+    ;
+  }
+
+  @Test
+  public void pulseUpdateForClusterGCPauses() throws Exception {
+    this.mockMvc.perform(post("/pulseUpdate")
+        .param("pulseData", "{\"ClusterJVMPauses\":\"{}\"}")
+        .principal(principal)
+        .accept(MediaType.parseMediaType(MediaType.APPLICATION_JSON_UTF8_VALUE)))
+        .andExpect(status().isOk())
+        .andExpect(jsonPath("$.ClusterJVMPauses.currentGCPauses").value(0))
+        .andExpect(jsonPath("$.ClusterJVMPauses.gCPausesTrend").isEmpty())
+    ;
+  }
+
+  @Test
+  public void pulseUpdateForClusterKeyStatistics() throws Exception {
+    this.mockMvc.perform(post("/pulseUpdate")
+        .param("pulseData", "{\"ClusterKeyStatistics\":\"{}\"}")
+        .principal(principal)
+        .accept(MediaType.parseMediaType(MediaType.APPLICATION_JSON_UTF8_VALUE)))
+        .andExpect(status().isOk())
+        .andExpect(jsonPath("$.ClusterKeyStatistics.readPerSecTrend").isEmpty())
+        .andExpect(jsonPath("$.ClusterKeyStatistics.queriesPerSecTrend").isEmpty())
+        .andExpect(jsonPath("$.ClusterKeyStatistics.writePerSecTrend").isEmpty())
+    ;
+  }
+
+  @Test
+  public void pulseUpdateForClusterMember() throws Exception {
+    this.mockMvc.perform(post("/pulseUpdate")
+        .param("pulseData", "{\"ClusterMembers\":\"{}\"}")
+        .principal(principal)
+        .accept(MediaType.parseMediaType(MediaType.APPLICATION_JSON_UTF8_VALUE)))
+        .andExpect(status().isOk())
+        .andExpect(jsonPath("$.ClusterMembers.members[0].serverGroups[0]").value("Default"))
+        .andExpect(jsonPath("$.ClusterMembers.members[0].cpuUsage").value(0))
+        .andExpect(jsonPath("$.ClusterMembers.members[0].clients").value(1))
+        .andExpect(jsonPath("$.ClusterMembers.members[0].heapUsage").value(0))
+        .andExpect(jsonPath("$.ClusterMembers.members[0].name").value(MEMBER_NAME))
+        .andExpect(jsonPath("$.ClusterMembers.members[0].currentHeapUsage").value(0))
+        .andExpect(jsonPath("$.ClusterMembers.members[0].isManager").value(false))
+        .andExpect(jsonPath("$.ClusterMembers.members[0].threads").value(0))
+        .andExpect(jsonPath("$.ClusterMembers.members[0].memberId").value(MEMBER_ID))
+        .andExpect(jsonPath("$.ClusterMembers.members[0].redundancyZones[0]").value("Default"))
+    ;
+  }
+
+  @Test
+  public void pulseUpdateForClusterMembersRGraph() throws Exception {
+    this.mockMvc.perform(post("/pulseUpdate")
+        .param("pulseData", "{\"ClusterMembersRGraph\":\"{}\"}")
+        .principal(principal)
+        .accept(MediaType.parseMediaType(MediaType.APPLICATION_JSON_UTF8_VALUE)))
+        .andExpect(status().isOk())
+        .andExpect(jsonPath("$.ClusterMembersRGraph.memberCount").value(0))
+        .andExpect(jsonPath("$.ClusterMembersRGraph.clustor.data").isEmpty())
+        .andExpect(jsonPath("$.ClusterMembersRGraph.clustor.children").isEmpty())
+        .andExpect(jsonPath("$.ClusterMembersRGraph.clustor.name").value(0))
+        .andExpect(jsonPath("$.ClusterMembersRGraph.clustor.id").value(0))
+    ;
+  }
+
+  @Test
+  public void pulseUpdateForClusterMemoryUsage() throws Exception {
+    this.mockMvc.perform(post("/pulseUpdate")
+        .param("pulseData", "{\"ClusterMemoryUsage\":\"{}\"}")
+        .principal(principal)
+        .accept(MediaType.parseMediaType(MediaType.APPLICATION_JSON_UTF8_VALUE)))
+        .andExpect(status().isOk())
+        .andExpect(jsonPath("$.ClusterMemoryUsage.currentMemoryUsage").value(0))
+        .andExpect(jsonPath("$.ClusterMemoryUsage.memoryUsageTrend", containsInAnyOrder(1, 2, 3)))
+    ;
+  }
+
+  @Test
+  public void pulseUpdateForClusterRegion() throws Exception {
+    this.mockMvc.perform(post("/pulseUpdate")
+        .param("pulseData", "{\"ClusterRegion\":\"{}\"}")
+        .principal(principal)
+        .accept(MediaType.parseMediaType(MediaType.APPLICATION_JSON_UTF8_VALUE)))
+        .andExpect(status().isOk())
+        .andExpect(jsonPath("$.ClusterRegion.clusterName").value(CLUSTER_NAME))
+        .andExpect(jsonPath("$.ClusterRegion.userName").value(PRINCIPAL_USER))
+        .andExpect(jsonPath("$.ClusterRegion.region[0].regionPath").value(REGION_PATH))
+        .andExpect(jsonPath("$.ClusterRegion.region[0].diskReadsTrend").isEmpty())
+        .andExpect(jsonPath("$.ClusterRegion.region[0].memoryUsage").value("0.0000"))
+        .andExpect(jsonPath("$.ClusterRegion.region[0].getsRate").value(0))
+        .andExpect(jsonPath("$.ClusterRegion.region[0].wanEnabled").value(false))
+        .andExpect(jsonPath("$.ClusterRegion.region[0].memberCount").value(1))
+        .andExpect(jsonPath("$.ClusterRegion.region[0].isHDFSWriteOnly").value("NA"))
+        .andExpect(jsonPath("$.ClusterRegion.region[0].memberNames[0].name").value(MEMBER_NAME))
+        .andExpect(jsonPath("$.ClusterRegion.region[0].memberNames[0].id").value(MEMBER_ID))
+        .andExpect(jsonPath("$.ClusterRegion.region[0].emptyNodes").value(0))
+        .andExpect(jsonPath("$.ClusterRegion.region[0].type").value(REGION_TYPE))
+        .andExpect(jsonPath("$.ClusterRegion.region[0].isEnableOffHeapMemory").value("OFF"))
+        .andExpect(jsonPath("$.ClusterRegion.region[0].putsRate").value(0))
+        .andExpect(jsonPath("$.ClusterRegion.region[0].totalMemory").value(0))
+        .andExpect(jsonPath("$.ClusterRegion.region[0].entryCount").value(0))
+        .andExpect(jsonPath("$.ClusterRegion.region[0].compressionCodec").value("NA"))
+        .andExpect(jsonPath("$.ClusterRegion.region[0].name").value(REGION_NAME))
+        .andExpect(jsonPath("$.ClusterRegion.region[0].systemRegionEntryCount").value(0))
+        .andExpect(jsonPath("$.ClusterRegion.region[0].persistence").value("OFF"))
+        .andExpect(jsonPath("$.ClusterRegion.region[0].memoryReadsTrend").isEmpty())
+        .andExpect(jsonPath("$.ClusterRegion.region[0].diskWritesTrend").isEmpty())
+        .andExpect(jsonPath("$.ClusterRegion.region[0].memoryWritesTrend").isEmpty())
+        .andExpect(jsonPath("$.ClusterRegion.region[0].dataUsage").value(0))
+        .andExpect(jsonPath("$.ClusterRegion.region[0].entrySize").value("0.0000"))
+    ;
+  }
+
+  @Test
+  public void pulseUpdateForClusterRegions() throws Exception {
+    this.mockMvc.perform(post("/pulseUpdate")
+        .param("pulseData", "{\"ClusterRegions\":\"{}\"}")
+        .principal(principal)
+        .accept(MediaType.parseMediaType(MediaType.APPLICATION_JSON_UTF8_VALUE)))
+        .andExpect(status().isOk())
+        .andExpect(jsonPath("$.ClusterRegions.regions[0].regionPath").value(REGION_PATH))
+        .andExpect(jsonPath("$.ClusterRegions.regions[0].diskReadsTrend").isEmpty())
+        .andExpect(jsonPath("$.ClusterRegions.regions[0].memoryUsage").value("0.0000"))
+        .andExpect(jsonPath("$.ClusterRegions.regions[0].getsRate").value(0))
+        .andExpect(jsonPath("$.ClusterRegions.regions[0].wanEnabled").value(false))
+        .andExpect(jsonPath("$.ClusterRegions.regions[0].memberCount").value(1))
+        .andExpect(jsonPath("$.ClusterRegions.regions[0].isHDFSWriteOnly").value("NA"))
+        .andExpect(jsonPath("$.ClusterRegions.regions[0].memberNames[0].name").value(MEMBER_NAME))
+        .andExpect(jsonPath("$.ClusterRegions.regions[0].memberNames[0].id").value(MEMBER_ID))
+        .andExpect(jsonPath("$.ClusterRegions.regions[0].emptyNodes").value(0))
+        .andExpect(jsonPath("$.ClusterRegions.regions[0].type").value(REGION_TYPE))
+        .andExpect(jsonPath("$.ClusterRegions.regions[0].isEnableOffHeapMemory").value("OFF"))
+        .andExpect(jsonPath("$.ClusterRegions.regions[0].putsRate").value(0))
+        .andExpect(jsonPath("$.ClusterRegions.regions[0].totalMemory").value(0))
+        .andExpect(jsonPath("$.ClusterRegions.regions[0].entryCount").value(0))
+        .andExpect(jsonPath("$.ClusterRegions.regions[0].compressionCodec").value("NA"))
+        .andExpect(jsonPath("$.ClusterRegions.regions[0].name").value(REGION_NAME))
+        .andExpect(jsonPath("$.ClusterRegions.regions[0].systemRegionEntryCount").value(0))
+        .andExpect(jsonPath("$.ClusterRegions.regions[0].persistence").value("OFF"))
+        .andExpect(jsonPath("$.ClusterRegions.regions[0].memoryReadsTrend").isEmpty())
+        .andExpect(jsonPath("$.ClusterRegions.regions[0].diskWritesTrend").isEmpty())
+        .andExpect(jsonPath("$.ClusterRegions.regions[0].memoryWritesTrend").isEmpty())
+        .andExpect(jsonPath("$.ClusterRegions.regions[0].dataUsage").value(0))
+        .andExpect(jsonPath("$.ClusterRegions.regions[0].entrySize").value("0.0000"))
+    ;
+  }
+
+  @Test
+  public void pulseUpdateForClusterSelectedRegion() throws Exception {
+    this.mockMvc.perform(post("/pulseUpdate")
+        .param("pulseData", "{\"ClusterSelectedRegion\":{\"regionFullPath\":\"" + REGION_PATH + "\"}}")
+        .principal(principal)
+        .accept(MediaType.parseMediaType(MediaType.APPLICATION_JSON_UTF8_VALUE)))
+        .andExpect(status().isOk())
+        .andExpect(jsonPath("$.ClusterSelectedRegion.selectedRegion.lruEvictionRate").value(0))
+        .andExpect(jsonPath("$.ClusterSelectedRegion.selectedRegion.getsRate").value(0))
+        .andExpect(jsonPath("$.ClusterSelectedRegion.selectedRegion.emptyNodes").value(0))
+        .andExpect(jsonPath("$.ClusterSelectedRegion.selectedRegion.type").value(REGION_TYPE))
+        .andExpect(jsonPath("$.ClusterSelectedRegion.selectedRegion.isEnableOffHeapMemory").value("OFF"))
+        .andExpect(jsonPath("$.ClusterSelectedRegion.selectedRegion.path").value(REGION_PATH))
+        .andExpect(jsonPath("$.ClusterSelectedRegion.selectedRegion.members[0].cpuUsage").value(0))
+        .andExpect(jsonPath("$.ClusterSelectedRegion.selectedRegion.members[0].clients").value(1))
+        .andExpect(jsonPath("$.ClusterSelectedRegion.selectedRegion.members[0].heapUsage").value(0))
+        .andExpect(jsonPath("$.ClusterSelectedRegion.selectedRegion.members[0].name").value(MEMBER_NAME))
+        .andExpect(jsonPath("$.ClusterSelectedRegion.selectedRegion.members[0].currentHeapUsage").value(0))
+        .andExpect(jsonPath("$.ClusterSelectedRegion.selectedRegion.members[0].isManager").value(false))
+        .andExpect(jsonPath("$.ClusterSelectedRegion.selectedRegion.members[0].threads").value(0))
+        .andExpect(jsonPath("$.ClusterSelectedRegion.selectedRegion.members[0].memberId").value(MEMBER_ID))
+        .andExpect(jsonPath("$.ClusterSelectedRegion.selectedRegion.members[0].uptime").value("0 Hours 0 Mins 1 Secs"))
+        .andExpect(jsonPath("$.ClusterSelectedRegion.selectedRegion.memoryReadsTrend").isEmpty())
+        .andExpect(jsonPath("$.ClusterSelectedRegion.selectedRegion.diskWritesTrend").isEmpty())
+        .andExpect(jsonPath("$.ClusterSelectedRegion.selectedRegion.dataUsage").value(0))
+        .andExpect(jsonPath("$.ClusterSelectedRegion.selectedRegion.regionPath").value(REGION_PATH))
+        .andExpect(jsonPath("$.ClusterSelectedRegion.selectedRegion.diskReadsTrend").isEmpty())
+        .andExpect(jsonPath("$.ClusterSelectedRegion.selectedRegion.memoryUsage").value("0.0000"))
+        .andExpect(jsonPath("$.ClusterSelectedRegion.selectedRegion.wanEnabled").value(false))
+        .andExpect(jsonPath("$.ClusterSelectedRegion.selectedRegion.memberCount").value(1))
+        .andExpect(jsonPath("$.ClusterSelectedRegion.selectedRegion.isHDFSWriteOnly").value("NA"))
+        .andExpect(jsonPath("$.ClusterSelectedRegion.selectedRegion.putsRate").value(0))
+        .andExpect(jsonPath("$.ClusterSelectedRegion.selectedRegion.totalMemory").value(0))
+        .andExpect(jsonPath("$.ClusterSelectedRegion.selectedRegion.entryCount").value(0))
+        .andExpect(jsonPath("$.ClusterSelectedRegion.selectedRegion.compressionCodec").value("NA"))
+        .andExpect(jsonPath("$.ClusterSelectedRegion.selectedRegion.name").value(REGION_NAME))
+        .andExpect(jsonPath("$.ClusterSelectedRegion.selectedRegion.systemRegionEntryCount").value(0))
+        .andExpect(jsonPath("$.ClusterSelectedRegion.selectedRegion.persistence").value("OFF"))
+        .andExpect(jsonPath("$.ClusterSelectedRegion.selectedRegion.memoryWritesTrend").isEmpty())
+        .andExpect(jsonPath("$.ClusterSelectedRegion.selectedRegion.entrySize").value("0.0000"))
+    ;
+  }
+
+  @Test
+  public void pulseUpdateForClusterSelectedRegionsMember() throws Exception {
+    this.mockMvc.perform(post("/pulseUpdate")
+        .param("pulseData", "{\"ClusterSelectedRegionsMember\":{\"regionFullPath\":\"" + REGION_PATH + "\"}}")
+        .principal(principal)
+        .accept(MediaType.parseMediaType(MediaType.APPLICATION_JSON_UTF8_VALUE)))
+        .andExpect(status().isOk())
+        .andExpect(jsonPath("$.ClusterSelectedRegionsMember.selectedRegionsMembers.%s.diskReadsTrend", MEMBER_NAME).isEmpty())
+        .andExpect(jsonPath("$.ClusterSelectedRegionsMember.selectedRegionsMembers.%s.regionFullPath", MEMBER_NAME).value(REGION_PATH))
+        .andExpect(jsonPath("$.ClusterSelectedRegionsMember.selectedRegionsMembers.%s.entryCount", MEMBER_NAME).value(0))
+        .andExpect(jsonPath("$.ClusterSelectedRegionsMember.selectedRegionsMembers.%s.accessor", MEMBER_NAME).value("True"))
+        .andExpect(jsonPath("$.ClusterSelectedRegionsMember.selectedRegionsMembers.%s.memberName", MEMBER_NAME).value(MEMBER_NAME))
+        .andExpect(jsonPath("$.ClusterSelectedRegionsMember.selectedRegionsMembers.%s.memoryReadsTrend", MEMBER_NAME).isEmpty())
+        .andExpect(jsonPath("$.ClusterSelectedRegionsMember.selectedRegionsMembers.%s.diskWritesTrend", MEMBER_NAME).isEmpty())
+        .andExpect(jsonPath("$.ClusterSelectedRegionsMember.selectedRegionsMembers.%s.memoryWritesTrend", MEMBER_NAME).isEmpty())
+        .andExpect(jsonPath("$.ClusterSelectedRegionsMember.selectedRegionsMembers.%s.entrySize", MEMBER_NAME).value(0))
+        .andExpect(jsonPath("$.ClusterSelectedRegionsMember.clusterName").value(CLUSTER_NAME))
+        .andExpect(jsonPath("$.ClusterSelectedRegionsMember.userName").value(PRINCIPAL_USER))
+    ;
+  }
+
+  @Test
+  public void pulseUpdateForClusterWANInfo() throws Exception {
+    this.mockMvc.perform(post("/pulseUpdate")
+        .param("pulseData", "{\"ClusterWANInfo\":\"{}\"}")
+        .principal(principal)
+        .accept(MediaType.parseMediaType(MediaType.APPLICATION_JSON_UTF8_VALUE)))
+        .andExpect(status().isOk())
+        .andExpect(jsonPath("$.ClusterWANInfo.connectedClusters").isEmpty())
+    ;
+  }
+
+  @Test
+  public void pulseUpdateForMemberAsynchEventQueues() throws Exception {
+    this.mockMvc.perform(post("/pulseUpdate")
+        .param("pulseData", "{\"MemberAsynchEventQueues\":{\"memberName\":\"" + MEMBER_NAME + "\"}}")
+        .principal(principal)
+        .accept(MediaType.parseMediaType(MediaType.APPLICATION_JSON_UTF8_VALUE)))
+        .andExpect(status().isOk())
+        .andExpect(jsonPath("$.MemberAsynchEventQueues.isAsyncEventQueuesPresent").value(true))
+        .andExpect(jsonPath("$.MemberAsynchEventQueues.asyncEventQueues[0].batchTimeInterval").value(0))
+        .andExpect(jsonPath("$.MemberAsynchEventQueues.asyncEventQueues[0].batchConflationEnabled").value(false))
+        .andExpect(jsonPath("$.MemberAsynchEventQueues.asyncEventQueues[0].queueSize").value(0))
+        .andExpect(jsonPath("$.MemberAsynchEventQueues.asyncEventQueues[0].senderType").value(false))
+        .andExpect(jsonPath("$.MemberAsynchEventQueues.asyncEventQueues[0].asyncEventListener").value(AEQ_LISTENER))
+        .andExpect(jsonPath("$.MemberAsynchEventQueues.asyncEventQueues[0].batchSize").value(0))
+        .andExpect(jsonPath("$.MemberAsynchEventQueues.asyncEventQueues[0].primary").value(false))
+    ;
+  }
+
+  @Test
+  public void pulseUpdateForMemberClients() throws Exception {
+    this.mockMvc.perform(post("/pulseUpdate")
+        .param("pulseData", "{\"MemberClients\":{\"memberName\":\"" + MEMBER_NAME + "\"}}")
+        .principal(principal)
+        .accept(MediaType.parseMediaType(MediaType.APPLICATION_JSON_UTF8_VALUE)))
+        .andExpect(status().isOk())
+        .andExpect(jsonPath("$.MemberClients.name").value(MEMBER_NAME))
+        .andExpect(jsonPath("$.MemberClients.memberClients[0].puts").value(0))
+        .andExpect(jsonPath("$.MemberClients.memberClients[0].cpuUsage").value("0.0000"))
+        .andExpect(jsonPath("$.MemberClients.memberClients[0].clientId").value("100"))
+        .andExpect(jsonPath("$.MemberClients.memberClients[0].queueSize").value(0))
+        .andExpect(jsonPath("$.MemberClients.memberClients[0].clientCQCount").value(0))
+        .andExpect(jsonPath("$.MemberClients.memberClients[0].name").value(CLIENT_NAME))
+        .andExpect(jsonPath("$.MemberClients.memberClients[0].isConnected").value("No"))
+        .andExpect(jsonPath("$.MemberClients.memberClients[0].threads").value(0))
+        .andExpect(jsonPath("$.MemberClients.memberClients[0].isSubscriptionEnabled").value("No"))
+        .andExpect(jsonPath("$.MemberClients.memberClients[0].gets").value(0))
+        .andExpect(jsonPath("$.MemberClients.memberClients[0].uptime").value("0 Hours 0 Mins 1 Secs"))
+    ;
+  }
+
+  @Test
+  public void pulseUpdateForMemberDetails() throws Exception {
+    this.mockMvc.perform(post("/pulseUpdate")
+        .param("pulseData", "{\"MemberDetails\":{\"memberName\":\"" + MEMBER_NAME + "\"}}")
+        .principal(principal)
+        .accept(MediaType.parseMediaType(MediaType.APPLICATION_JSON_UTF8_VALUE)))
+        .andExpect(status().isOk())
+        .andExpect(jsonPath("$.MemberDetails.name").value(MEMBER_NAME))
+        .andExpect(jsonPath("$.MemberDetails.offHeapUsedSize").value(0))
+        .andExpect(jsonPath("$.MemberDetails.diskStorageUsed").value(0))
+        .andExpect(jsonPath("$.MemberDetails.regionsCount").value(1))
+        .andExpect(jsonPath("$.MemberDetails.clusterName").value(CLUSTER_NAME))
+        .andExpect(jsonPath("$.MemberDetails.name").value(MEMBER_NAME))
+        .andExpect(jsonPath("$.MemberDetails.threads").value(0))
+        .andExpect(jsonPath("$.MemberDetails.clusterId").isNotEmpty())
+        .andExpect(jsonPath("$.MemberDetails.numClients").value(1))
+        .andExpect(jsonPath("$.MemberDetails.userName").value(PRINCIPAL_USER))
+        .andExpect(jsonPath("$.MemberDetails.offHeapFreeSize").value(0))
+        .andExpect(jsonPath("$.MemberDetails.memberId").value(MEMBER_ID))
+        .andExpect(jsonPath("$.MemberDetails.status").value("Normal"))
+    ;
+  }
+
+  @Test
+  public void pulseUpdateForMemberDiskThroughput() throws Exception {
+    this.mockMvc.perform(post("/pulseUpdate")
+        .param("pulseData", "{\"MemberDiskThroughput\":{\"memberName\":\"" + MEMBER_NAME + "\"}}")
+        .principal(principal)
+        .accept(MediaType.parseMediaType(MediaType.APPLICATION_JSON_UTF8_VALUE)))
+        .andExpect(status().isOk())
+        .andExpect(jsonPath("$.MemberDiskThroughput.throughputWritesTrend").isEmpty())
+        .andExpect(jsonPath("$.MemberDiskThroughput.throughputReadsTrend").isEmpty())
+        .andExpect(jsonPath("$.MemberDiskThroughput.throughputWrites").value(0))
+        .andExpect(jsonPath("$.MemberDiskThroughput.throughputReads").value(0))
+    ;
+  }
+
+  @Test
+  public void pulseUpdateForMemberGatewayHub() throws Exception {
+    this.mockMvc.perform(post("/pulseUpdate")
+        .param("pulseData", "{\"MemberGatewayHub\":{\"memberName\":\"" + MEMBER_NAME + "\"}}")
+        .principal(principal)
+        .accept(MediaType.parseMediaType(MediaType.APPLICATION_JSON_UTF8_VALUE)))
+        .andExpect(status().isOk())
+        .andExpect(jsonPath("$.MemberGatewayHub.isGatewayReceiver").value(false))
+        .andExpect(jsonPath("$.MemberGatewayHub.asyncEventQueues[0].batchTimeInterval").value(0))
+        .andExpect(jsonPath("$.MemberGatewayHub.asyncEventQueues[0].batchConflationEnabled").value(false))
+        .andExpect(jsonPath("$.MemberGatewayHub.asyncEventQueues[0].queueSize").value(0))
+        .andExpect(jsonPath("$.MemberGatewayHub.asyncEventQueues[0].senderType").value(false))
+        .andExpect(jsonPath("$.MemberGatewayHub.asyncEventQueues[0].asyncEventListener").value(AEQ_LISTENER))
+        .andExpect(jsonPath("$.MemberGatewayHub.asyncEventQueues[0].batchSize").value(0))
+        .andExpect(jsonPath("$.MemberGatewayHub.asyncEventQueues[0].primary").value(false))
+        .andExpect(jsonPath("$.MemberGatewayHub.isGatewaySender").value(false))
+        .andExpect(jsonPath("$.MemberGatewayHub.regionsInvolved").isEmpty())
+        .andExpect(jsonPath("$.MemberGatewayHub.gatewaySenders").isEmpty())
+    ;
+  }
+
+  @Test
+  public void pulseUpdateForMemberGCPauses() throws Exception {
+    this.mockMvc.perform(post("/pulseUpdate")
+        .param("pulseData", "{\"MemberGCPauses\":{\"memberName\":\"" + MEMBER_NAME + "\"}}")
+        .principal(principal)
+        .accept(MediaType.parseMediaType(MediaType.APPLICATION_JSON_UTF8_VALUE)))
+        .andExpect(status().isOk())
+        .andExpect(jsonPath("$.MemberGCPauses.gcPausesCount").value(0))
+        .andExpect(jsonPath("$.MemberGCPauses.gcPausesTrend").isEmpty())
+    ;
+  }
+
+  @Test
+  public void pulseUpdateForMemberHeapUsage() throws Exception {
+    this.mockMvc.perform(post("/pulseUpdate")
+        .param("pulseData", "{\"MemberHeapUsage\":{\"memberName\":\"" + MEMBER_NAME + "\"}}")
+        .principal(principal)
+        .accept(MediaType.parseMediaType(MediaType.APPLICATION_JSON_UTF8_VALUE)))
+        .andExpect(status().isOk())
+        .andExpect(jsonPath("$.MemberHeapUsage.heapUsageTrend").isEmpty())
+        .andExpect(jsonPath("$.MemberHeapUsage.currentHeapUsage").value(0))
+    ;
+  }
+
+  @Test
+  public void pulseUpdateForMemberKeyStatistics() throws Exception {
+    this.mockMvc.perform(post("/pulseUpdate")
+        .param("pulseData", "{\"MemberKeyStatistics\":{\"memberName\":\"" + MEMBER_NAME + "\"}}")
+        .principal(principal)
+        .accept(MediaType.parseMediaType(MediaType.APPLICATION_JSON_UTF8_VALUE)))
+        .andExpect(status().isOk())
+        .andExpect(jsonPath("$.MemberKeyStatistics.readPerSecTrend").isEmpty())
+        .andExpect(jsonPath("$.MemberKeyStatistics.cpuUsageTrend").isEmpty())
+        .andExpect(jsonPath("$.MemberKeyStatistics.memoryUsageTrend").isEmpty())
+        .andExpect(jsonPath("$.MemberKeyStatistics.writePerSecTrend").isEmpty())
+    ;
+  }
+
+  @Test
+  public void pulseUpdateForMemberRegions() throws Exception {
+    this.mockMvc.perform(post("/pulseUpdate")
+        .param("pulseData", "{\"MemberRegions\":{\"memberName\":\"" + MEMBER_NAME + "\"}}")
+        .principal(principal)
+        .accept(MediaType.parseMediaType(MediaType.APPLICATION_JSON_UTF8_VALUE)))
+        .andExpect(status().isOk())
+        .andExpect(jsonPath("$.MemberRegions.name").value(MEMBER_NAME))
+        .andExpect(jsonPath("$.MemberRegions.memberRegions[0].fullPath").value(REGION_PATH))
+        .andExpect(jsonPath("$.MemberRegions.memberRegions[0].entryCount").value(0))
+        .andExpect(jsonPath("$.MemberRegions.memberRegions[0].name").value(REGION_NAME))
+        .andExpect(jsonPath("$.MemberRegions.memberRegions[0].diskStoreName").value(""))
+        .andExpect(jsonPath("$.MemberRegions.memberRegions[0].gatewayEnabled").value(false))
+        .andExpect(jsonPath("$.MemberRegions.memberRegions[0].entrySize").value("0.0000"))
+        .andExpect(jsonPath("$.MemberRegions.memberId").value(MEMBER_ID))
+        .andExpect(jsonPath("$.MemberRegions.status").value("Normal"))
+    ;
+  }
+
+  @Test
+  public void pulseUpdateForMembersList() throws Exception {
+    this.mockMvc.perform(post("/pulseUpdate")
+        .param("pulseData", "{\"MembersList\":{\"memberName\":\"" + MEMBER_NAME + "\"}}")
+        .principal(principal)
+        .accept(MediaType.parseMediaType(MediaType.APPLICATION_JSON_UTF8_VALUE)))
+        .andExpect(status().isOk())
+        .andExpect(jsonPath("$.MembersList.clusterMembers[0].name").value(MEMBER_NAME))
+        .andExpect(jsonPath("$.MembersList.clusterMembers[0].memberId").value(MEMBER_ID))
+        .andExpect(jsonPath("$.MembersList.clusterName").value(CLUSTER_NAME))
+    ;
+  }
+
+  @Test
+  public void pulseUpdateForPulseVersion() throws Exception {
+    this.mockMvc.perform(post("/pulseUpdate")
+        .param("pulseData", "{\"PulseVersion\":\"{}\"}")
+        .principal(principal)
+        .accept(MediaType.parseMediaType(MediaType.APPLICATION_JSON_UTF8_VALUE)))
+        .andExpect(status().isOk())
+        .andExpect(jsonPath("$.PulseVersion.sourceDate").isNotEmpty())
+        .andExpect(jsonPath("$.PulseVersion.sourceRepository").isNotEmpty())
+        .andExpect(jsonPath("$.PulseVersion.pulseVersion").isNotEmpty())
+        .andExpect(jsonPath("$.PulseVersion.sourceRevision").isNotEmpty())
+        .andExpect(jsonPath("$.PulseVersion.buildId").isNotEmpty())
+        .andExpect(jsonPath("$.PulseVersion.buildDate").isNotEmpty())
+    ;
+  }
+
+  @Test
+  public void pulseUpdateForQueryStatistics() throws Exception {
+    this.mockMvc.perform(post("/pulseUpdate")
+        .param("pulseData", "{\"QueryStatistics\":\"{}\"}")
+        .principal(principal)
+        .accept(MediaType.parseMediaType(MediaType.APPLICATION_JSON_UTF8_VALUE)))
+        .andExpect(status().isOk())
+        .andExpect(jsonPath("$.QueryStatistics.queriesList").isEmpty())
+        .andExpect(jsonPath("$.QueryStatistics.connectedFlag").value(false))
+        .andExpect(jsonPath("$.QueryStatistics.connectedErrorMsg").value(""))
+    ;
+  }
+
+  @Test
+  public void pulseUpdateForSystemAlerts() throws Exception {
+    this.mockMvc.perform(post("/pulseUpdate")
+        .param("pulseData", "{\"SystemAlerts\":{\"pageNumber\":\"1\"}}")
+        .principal(principal)
+        .accept(MediaType.parseMediaType(MediaType.APPLICATION_JSON_UTF8_VALUE)))
+        .andExpect(status().isOk())
+        .andExpect(jsonPath("$.SystemAlerts.pageNumber").value(1))
+        .andExpect(jsonPath("$.SystemAlerts.connectedFlag").value(false))
+        .andExpect(jsonPath("$.SystemAlerts.connectedErrorMsg").value(""))
+        .andExpect(jsonPath("$.SystemAlerts.systemAlerts").isEmpty())
+    ;
+  }
+
+  @Test
+  public void authenticateUserNotLoggedIn() throws Exception {
+    this.mockMvc.perform(get("/authenticateUser")
+        .accept(MediaType.parseMediaType(MediaType.APPLICATION_JSON_UTF8_VALUE)))
+        .andExpect(status().isOk())
+        .andExpect(jsonPath("$.isUserLoggedIn").value(false));
+  }
+
+  @Test
+  public void authenticateUserLoggedIn() throws Exception {
+    this.mockMvc.perform(get("/authenticateUser")
+        .principal(principal)
+        .accept(MediaType.parseMediaType(MediaType.APPLICATION_JSON_UTF8_VALUE)))
+        .andExpect(status().isOk())
+        .andExpect(jsonPath("$.isUserLoggedIn").value(true));
+  }
+
+  @Test
+  public void clusterLogout() throws Exception {
+    MockHttpSession mockSession = new MockHttpSession(wac.getServletContext(), UUID.randomUUID().toString());
+    assertFalse(mockSession.isInvalid());
+
+    this.mockMvc.perform(get("/clusterLogout").principal(principal)
+        .session(mockSession)
+        .accept(MediaType.parseMediaType(MediaType.APPLICATION_JSON_UTF8_VALUE)))
+        .andExpect(status().is3xxRedirection())
+        .andExpect(redirectedUrl("../Login.html"));
+
+    assertTrue(mockSession.isInvalid());
+  }
+
+  @Test
+  public void pulseVersion() throws Exception {
+    ServletContextListener listener = new PulseAppListener();
+    listener.contextInitialized(null);
+
+    this.mockMvc.perform(get("/pulseVersion")
+        .accept(MediaType.parseMediaType(MediaType.APPLICATION_JSON_UTF8_VALUE)))
+        .andExpect(status().isOk())
+        .andExpect(jsonPath("$.pulseVersion").isNotEmpty())
+        .andExpect(jsonPath("$.buildId").isNotEmpty())
+        .andExpect(jsonPath("$.buildDate").isNotEmpty())
+        .andExpect(jsonPath("$.sourceDate").isNotEmpty())
+        .andExpect(jsonPath("$.sourceRevision").isNotEmpty())
+        .andExpect(jsonPath("$.sourceRepository").isNotEmpty())
+    ;
+  }
+
+  @Test
+  public void clearAlerts() throws Exception {
+    this.mockMvc.perform(get("/clearAlerts")
+        .param("alertType", "1")
+        .accept(MediaType.parseMediaType(MediaType.APPLICATION_JSON_UTF8_VALUE)))
+        .andExpect(status().isOk())
+        .andExpect(jsonPath("$.pageNumber").value(1))
+        .andExpect(jsonPath("$.systemAlerts").isEmpty())
+        .andExpect(jsonPath("$.connectedFlag").value(false))
+        .andExpect(jsonPath("$.status").value("deleted"))
+    ;
+  }
+
+  @Test
+  public void acknowledgeAlert() throws Exception {
+    this.mockMvc.perform(get("/acknowledgeAlert")
+        .param("alertId", "1")
+        .accept(MediaType.parseMediaType(MediaType.APPLICATION_JSON_UTF8_VALUE)))
+        .andExpect(status().isOk())
+        .andExpect(jsonPath("$.status").value("deleted"));
+  }
+
+  @Test
+  public void dataBrowserRegions() throws Exception {
+    this.mockMvc.perform(get("/dataBrowserRegions")
+        .accept(MediaType.parseMediaType(MediaType.APPLICATION_JSON_UTF8_VALUE)))
+        .andExpect(status().isOk())
+        .andExpect(jsonPath("$.clusterName").value(CLUSTER_NAME))
+        .andExpect(jsonPath("$.connectedFlag").value(false))
+        .andExpect(jsonPath("$.clusterRegions[0].fullPath").value(REGION_PATH))
+        .andExpect(jsonPath("$.clusterRegions[0].regionType").value(REGION_TYPE))
+    ;
+  }
+
+  @Test
+  public void dataBrowserQuery() throws Exception {
+    doReturn(new JSONObject().put("foo", "bar")).when(cluster).executeQuery(anyString(), anyString(), anyInt());
+
+    this.mockMvc.perform(get("/dataBrowserQuery")
+        .param("query", "SELECT * FROM " + REGION_PATH)
+        .param("members", MEMBER_NAME)
+        .principal(principal)
+        .accept(MediaType.parseMediaType(MediaType.APPLICATION_JSON_UTF8_VALUE)))
+        .andExpect(status().isOk())
+        .andExpect(jsonPath("$.foo").value("bar"))
+    ;
+  }
+
+  @Test
+  public void dataBrowserQueryHistory() throws Exception {
+    dataBrowserQuery();
+
+    this.mockMvc.perform(get("/dataBrowserQueryHistory")
+        .param("action", "view")
+        .principal(principal)
+        .accept(MediaType.parseMediaType(MediaType.APPLICATION_JSON_UTF8_VALUE)))
+        .andExpect(status().isOk())
+        .andExpect(jsonPath("$.queryHistory[0].queryText").value("SELECT * FROM " + REGION_PATH))
+    ;
+  }
+
+  @Test
+  public void pulseProductSupport() throws Exception {
+    this.mockMvc.perform(get("/pulseProductSupport")
+        .accept(MediaType.parseMediaType(MediaType.APPLICATION_JSON_UTF8_VALUE)))
+        .andExpect(status().isOk())
+        .andExpect(jsonPath("$.product").value("gemfire"))
+    ;
+  }
+
+  @Test
+  public void getQueryStatisticsGridModel() throws Exception {
+    this.mockMvc.perform(get("/getQueryStatisticsGridModel")
+        .principal(principal)
+        .accept(MediaType.parseMediaType(MediaType.APPLICATION_JSON_UTF8_VALUE)))
+        .andExpect(status().isOk())
+        .andExpect(jsonPath("$.columnNames", containsInAnyOrder("Query",
+            "NumExecution",
+            "TotalExecutionTime(ns)",
+            "NumExecutionsInProgress",
+            "NumTimesCompiled",
+            "NumTimesGlobalIndexLookup",
+            "NumRowsModified",
+            "ParseTime(ms)",
+            "BindTime(ms)",
+            "OptimizeTime(ms)",
+            "RoutingInfoTime(ms)",
+            "GenerateTime(ms)",
+            "TotalCompilationTime(ms)",
+            "ExecutionTime(ns)",
+            "ProjectionTime(ns)",
+            "RowsModificationTime(ns)",
+            "QNNumRowsSeen",
+            "QNMsgSendTime(ns)",
+            "QNMsgSerTime(ns)",
+            "QNRespDeSerTime(ns)")))
+    ;
+  }
+}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/0f272db0/gradle/dependency-versions.properties
----------------------------------------------------------------------
diff --git a/gradle/dependency-versions.properties b/gradle/dependency-versions.properties
index 611ee7a..5012608 100644
--- a/gradle/dependency-versions.properties
+++ b/gradle/dependency-versions.properties
@@ -63,6 +63,7 @@ jetty.version = 9.3.6.v20151106
 jline.version = 2.12
 jmock.version = 2.8.1
 jna.version = 4.0.0
+json-path.version = 1.2.0
 json4s.version = 3.2.4
 jsr305.version = 3.0.1
 junit.version = 4.12
@@ -100,4 +101,4 @@ tomcat6.version = 6.0.37
 tomcat7.version = 7.0.30
 mortbay-jetty-servlet-api.version=2.5-20081211
 selenium.version=2.52.0
-google-gson.version=2.3.1
\ No newline at end of file
+google-gson.version=2.3.1


Mime
View raw message