accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ctubb...@apache.org
Subject [2/6] accumulo git commit: ACCUMULO-4305 Fix ShellUtilTest
Date Mon, 09 May 2016 22:44:28 GMT
ACCUMULO-4305 Fix ShellUtilTest

Fix ShellUtilTest base64 decoding test


Project: http://git-wip-us.apache.org/repos/asf/accumulo/repo
Commit: http://git-wip-us.apache.org/repos/asf/accumulo/commit/04d0c19b
Tree: http://git-wip-us.apache.org/repos/asf/accumulo/tree/04d0c19b
Diff: http://git-wip-us.apache.org/repos/asf/accumulo/diff/04d0c19b

Branch: refs/heads/1.8
Commit: 04d0c19bb9d035128564beaec2cf60585aa3eab1
Parents: 160e2c7
Author: Christopher Tubbs <ctubbsii@apache.org>
Authored: Mon May 9 18:09:24 2016 -0400
Committer: Christopher Tubbs <ctubbsii@apache.org>
Committed: Mon May 9 18:09:24 2016 -0400

----------------------------------------------------------------------
 .../src/test/java/org/apache/accumulo/shell/ShellUtilTest.java  | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/accumulo/blob/04d0c19b/shell/src/test/java/org/apache/accumulo/shell/ShellUtilTest.java
----------------------------------------------------------------------
diff --git a/shell/src/test/java/org/apache/accumulo/shell/ShellUtilTest.java b/shell/src/test/java/org/apache/accumulo/shell/ShellUtilTest.java
index 9b3be51..28e56ab 100644
--- a/shell/src/test/java/org/apache/accumulo/shell/ShellUtilTest.java
+++ b/shell/src/test/java/org/apache/accumulo/shell/ShellUtilTest.java
@@ -40,6 +40,7 @@ public class ShellUtilTest {
 
   // String with 3 lines, with one empty line
   private static final String FILEDATA = "line1\n\nline2";
+  private static final String B64_FILEDATA = Base64.encodeBase64String("line1".getBytes(UTF_8))
+ "\n\n" + Base64.encodeBase64String("line2".getBytes(UTF_8));
 
   @Test
   public void testWithoutDecode() throws IOException {
@@ -52,9 +53,9 @@ public class ShellUtilTest {
   @Test
   public void testWithDecode() throws IOException {
     File testFile = new File(folder.getRoot(), "testFileWithDecode.txt");
-    FileUtils.writeStringToFile(testFile, FILEDATA);
+    FileUtils.writeStringToFile(testFile, B64_FILEDATA);
     List<Text> output = ShellUtil.scanFile(testFile.getAbsolutePath(), true);
-    assertEquals(ImmutableList.of(new Text(Base64.decodeBase64("line1".getBytes(UTF_8))),
new Text(Base64.decodeBase64("line2".getBytes(UTF_8)))), output);
+    assertEquals(ImmutableList.of(new Text("line1"), new Text("line2")), output);
   }
 
   @Test(expected = FileNotFoundException.class)


Mime
View raw message