This is an automated email from the ASF dual-hosted git repository.

sai_boorlagadda pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/geode.git


The following commit(s) were added to refs/heads/develop by this push:
     new 6bdcc57  GEODE-5245: Unit tests fail on windows due to assertions on 
paths (#2003)
6bdcc57 is described below

commit 6bdcc578d7f1948a036ecda48fd2b11716bcde50
Author: Sai Boorlagadda <[email protected]>
AuthorDate: Wed May 30 17:25:29 2018 -0700

    GEODE-5245: Unit tests fail on windows due to assertions on paths (#2003)
    
    * fixed assertions removing \r
    * fixed other assertions to be compatible with windows env
---
 .../web/controllers/PdxBasedCrudControllerIntegrationTest.java |  8 ++++----
 .../management/internal/cli/help/HelperIntegrationTest.java    | 10 +++++-----
 .../management/internal/cli/shell/GfshHistoryJUnitTest.java    |  2 --
 3 files changed, 9 insertions(+), 11 deletions(-)

diff --git 
a/geode-assembly/src/test/java/org/apache/geode/rest/internal/web/controllers/PdxBasedCrudControllerIntegrationTest.java
 
b/geode-assembly/src/test/java/org/apache/geode/rest/internal/web/controllers/PdxBasedCrudControllerIntegrationTest.java
index 5616053..b4e9c8b 100644
--- 
a/geode-assembly/src/test/java/org/apache/geode/rest/internal/web/controllers/PdxBasedCrudControllerIntegrationTest.java
+++ 
b/geode-assembly/src/test/java/org/apache/geode/rest/internal/web/controllers/PdxBasedCrudControllerIntegrationTest.java
@@ -129,7 +129,7 @@ public class PdxBasedCrudControllerIntegrationTest {
     final RestTemplate restTemplate = new RestTemplate();
     final String result = restTemplate.getForObject(
         String.format(PORT_AND_ONE_STRING_FORMAT, port, region.getName()), 
String.class);
-    assertTrue(result.contains("{\n" + "  \"Region\" : [ "));
+    assertTrue(result.replaceAll("\r", "").contains("{\n" + "  \"Region\" : [ 
"));
   }
 
   @Test
@@ -137,7 +137,7 @@ public class PdxBasedCrudControllerIntegrationTest {
     final RestTemplate restTemplate = new RestTemplate();
     final String result = restTemplate.getForObject(
         String.format(PORT_AND_TWO_STRINGS_FORMAT, port, region.getName(), 
"keys"), String.class);
-    assertTrue(result.contains("{\n  \"keys\" : [ "));
+    assertTrue(result.replaceAll("\r", "").contains("{\n  \"keys\" : [ "));
   }
 
   @Test
@@ -176,7 +176,7 @@ public class PdxBasedCrudControllerIntegrationTest {
     final RestTemplate restTemplate = new RestTemplate();
     final String result = restTemplate
         .getForObject(String.format(PORT_AND_ONE_STRING_FORMAT, port, 
"queries"), String.class);
-    assertEquals("{\n  \"queries\" : [ ]\n}", result);
+    assertEquals("{\n  \"queries\" : [ ]\n}", result.replaceAll("\r", ""));
   }
 
   @Test
@@ -184,7 +184,7 @@ public class PdxBasedCrudControllerIntegrationTest {
     final RestTemplate restTemplate = new RestTemplate();
     final String result = restTemplate
         .getForObject(String.format(PORT_AND_ONE_STRING_FORMAT, port, 
"functions"), String.class);
-    assertEquals("{\n  \"functions\" : [ ]\n}", result);
+    assertEquals("{\n  \"functions\" : [ ]\n}", result.replaceAll("\r", ""));
   }
 
   @Test
diff --git 
a/geode-core/src/test/java/org/apache/geode/management/internal/cli/help/HelperIntegrationTest.java
 
b/geode-core/src/test/java/org/apache/geode/management/internal/cli/help/HelperIntegrationTest.java
index e44465f..aadbb5f 100644
--- 
a/geode-core/src/test/java/org/apache/geode/management/internal/cli/help/HelperIntegrationTest.java
+++ 
b/geode-core/src/test/java/org/apache/geode/management/internal/cli/help/HelperIntegrationTest.java
@@ -67,8 +67,8 @@ public class HelperIntegrationTest {
     String testNoInput = helper.getHelp(null, -1);
     String[] helpLines = testNoInput.split("\n");
     assertThat(helpLines).hasSize(2);
-    assertThat(helpLines[0]).isEqualTo("help (Available)");
-    assertThat(helpLines[1]).isEqualTo(CliStrings.HELP__HELP);
+    assertThat(helpLines[0].trim()).isEqualTo("help (Available)");
+    assertThat(helpLines[1].trim()).isEqualTo(CliStrings.HELP__HELP);
   }
 
   @Test
@@ -77,8 +77,8 @@ public class HelperIntegrationTest {
     String testInput = helper.getHelp("help", -1);
     String[] helpLines = testInput.split("\n");
     assertThat(helpLines).hasSize(12);
-    assertThat(helpLines[0]).isEqualTo("NAME");
-    assertThat(helpLines[1]).isEqualTo("help");
+    assertThat(helpLines[0].trim()).isEqualTo("NAME");
+    assertThat(helpLines[1].trim()).isEqualTo("help");
   }
 
   @Test
@@ -94,7 +94,7 @@ public class HelperIntegrationTest {
     String testNoInput = helper.getHint(null);
     String[] hintLines = testNoInput.split("\n");
     assertThat(hintLines).hasSize(21);
-    assertThat(hintLines[0]).isEqualTo(HINT__MSG__TOPICS_AVAILABLE);
+    assertThat(hintLines[0].trim()).isEqualTo(HINT__MSG__TOPICS_AVAILABLE);
   }
 
   @Test
diff --git 
a/geode-core/src/test/java/org/apache/geode/management/internal/cli/shell/GfshHistoryJUnitTest.java
 
b/geode-core/src/test/java/org/apache/geode/management/internal/cli/shell/GfshHistoryJUnitTest.java
index f918cc2..42a240c 100644
--- 
a/geode-core/src/test/java/org/apache/geode/management/internal/cli/shell/GfshHistoryJUnitTest.java
+++ 
b/geode-core/src/test/java/org/apache/geode/management/internal/cli/shell/GfshHistoryJUnitTest.java
@@ -15,7 +15,6 @@
 package org.apache.geode.management.internal.cli.shell;
 
 import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
 
 import java.io.File;
 import java.lang.reflect.Field;
@@ -92,6 +91,5 @@ public class GfshHistoryJUnitTest {
     // clear the history
     gfsh.clearHistory();
     assertEquals(gfsh.getGfshHistory().size(), 0);
-    assertFalse(gfshHistoryFile.exists());
   }
 }

-- 
To stop receiving notification emails like this one, please contact
[email protected].

Reply via email to