accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ctubb...@apache.org
Subject [accumulo] branch 1.9 updated: Clean up importDirectory IT (remove unneeded method)
Date Fri, 16 Aug 2019 19:48:03 GMT
This is an automated email from the ASF dual-hosted git repository.

ctubbsii pushed a commit to branch 1.9
in repository https://gitbox.apache.org/repos/asf/accumulo.git


The following commit(s) were added to refs/heads/1.9 by this push:
     new c0b94a2  Clean up importDirectory IT (remove unneeded method)
c0b94a2 is described below

commit c0b94a2f59e0aeb34376e0c9e2a6113ffc26435e
Author: Christopher Tubbs <ctubbsii@apache.org>
AuthorDate: Fri Aug 16 15:09:55 2019 -0400

    Clean up importDirectory IT (remove unneeded method)
---
 .../org/apache/accumulo/test/ShellServerIT.java    | 30 +++++-----------------
 1 file changed, 7 insertions(+), 23 deletions(-)

diff --git a/test/src/main/java/org/apache/accumulo/test/ShellServerIT.java b/test/src/main/java/org/apache/accumulo/test/ShellServerIT.java
index 9b377fb..beea4b8 100644
--- a/test/src/main/java/org/apache/accumulo/test/ShellServerIT.java
+++ b/test/src/main/java/org/apache/accumulo/test/ShellServerIT.java
@@ -1899,7 +1899,7 @@ public class ShellServerIT extends SharedMiniClusterBase {
   }
 
   /**
-   * Validate importdirectory command accepts addinig -t tablename option or the accepts
original
+   * Validate importdirectory command accepts adding -t tablename option or the accepts original
    * format that uses the current working table. Currently this test does not validate the
actual
    * import - only the command syntax.
    *
@@ -1916,11 +1916,10 @@ public class ShellServerIT extends SharedMiniClusterBase {
     assertTrue(errorsDir.mkdir());
 
     // expect fail - table does not exist.
-    ts.exec(String.format("importdirectory -t %s %s %s false", table, importDir, errorsDir),
false);
-    assertTrue(checkErrorMsg("TableNotFoundException", ts.output.get().split("\n")));
+    ts.exec(String.format("importdirectory -t %s %s %s false", table, importDir, errorsDir),
false,
+        "TableNotFoundException");
 
-    ts.exec(String.format("table %s", table), false);
-    assertTrue(checkErrorMsg("TableNotFoundException", ts.output.get().split("\n")));
+    ts.exec(String.format("table %s", table), false, "TableNotFoundException");
 
     ts.exec("createtable " + table, true);
 
@@ -1932,27 +1931,12 @@ public class ShellServerIT extends SharedMiniClusterBase {
     ts.exec(String.format("importdirectory %s %s false", importDir, errorsDir), true);
 
     // expect fail - invalid command,
-    ts.exec(String.format("importdirectory false"), false);
-    assertTrue(checkErrorMsg("Expected 3 arguments. There was 1.", ts.output.get().split("\n")));
+    ts.exec("importdirectory false", false, "Expected 3 arguments. There was 1.");
 
     // expect fail - original cmd without a table.
     ts.exec("notable", true);
-    ts.exec(String.format("importdirectory %s %s false", importDir, errorsDir), false);
-
-    assertTrue(checkErrorMsg("java.lang.IllegalStateException: Not in a table context.",
-        ts.output.get().split("\n")));
-  }
-
-  private boolean checkErrorMsg(final String expectedText, final String[] lines) {
-    boolean foundText = false;
-
-    for (String line : lines) {
-      if (line.contains(expectedText)) {
-        foundText = true;
-      }
-      log.trace("shell output>: \'{}\'", line);
-    }
-    return foundText;
+    ts.exec(String.format("importdirectory %s %s false", importDir, errorsDir), false,
+        "java.lang.IllegalStateException: Not in a table context.");
   }
 
   private static final String FAKE_CONTEXT = "FAKE";


Mime
View raw message