geode-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jinmeil...@apache.org
Subject incubator-geode git commit: GEODE-17: fix EnvironmentVariablesHandlerInterceptorJUnitTest
Date Wed, 16 Mar 2016 20:33:40 GMT
Repository: incubator-geode
Updated Branches:
  refs/heads/feature/GEODE-17-2 d73606c8e -> c979b3aaf


GEODE-17:  fix EnvironmentVariablesHandlerInterceptorJUnitTest


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

Branch: refs/heads/feature/GEODE-17-2
Commit: c979b3aaff96d1e719bb604179044db030f51cbc
Parents: d73606c
Author: Jinmei Liao <jiliao@pivotal.io>
Authored: Wed Mar 16 13:33:15 2016 -0700
Committer: Jinmei Liao <jiliao@pivotal.io>
Committed: Wed Mar 16 13:33:15 2016 -0700

----------------------------------------------------------------------
 ...entVariablesHandlerInterceptorJUnitTest.java | 27 ++++++++++++--------
 1 file changed, 16 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/c979b3aa/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
index 6d52a02..ac7e210 100644
--- 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
@@ -16,18 +16,9 @@
  */
 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;
@@ -37,7 +28,13 @@ import org.junit.Before;
 import org.junit.Test;
 import org.junit.experimental.categories.Category;
 
-import com.gemstone.gemfire.test.junit.categories.UnitTest;
+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
@@ -85,6 +82,7 @@ public class EnvironmentVariablesHandlerInterceptorJUnitTest {
   @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");
@@ -94,6 +92,8 @@ public class EnvironmentVariablesHandlerInterceptorJUnitTest {
     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"))));
     }});
@@ -139,6 +139,7 @@ public class EnvironmentVariablesHandlerInterceptorJUnitTest {
       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");
@@ -149,6 +150,8 @@ public class EnvironmentVariablesHandlerInterceptorJUnitTest {
       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"))));
@@ -166,6 +169,8 @@ public class EnvironmentVariablesHandlerInterceptorJUnitTest {
       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"))));


Mime
View raw message