ddanielr commented on code in PR #4096:
URL: https://github.com/apache/accumulo/pull/4096#discussion_r1446594161


##########
test/src/main/java/org/apache/accumulo/test/shell/ShellIT.java:
##########
@@ -557,6 +560,42 @@ public void execFileTest() throws IOException {
     assertGoodExit("Unknown command", false);
   }
 
+  @TempDir
+  private static File tempDir;
+
+  @Test
+  public void propFileNotFoundTest() throws IOException {
+    String fileName = new File(tempDir, "propFile.shellit").getAbsolutePath();
+
+    Shell.log.debug("Starting prop file not found test 
--------------------------");
+    exec("config --propFile " + fileName, false,
+        "FileNotFoundException: " + fileName + "(No such file or directory)");
+  }
+
+  @Test
+  public void setpropsViaFile() throws Exception {
+
+    File file = File.createTempFile("propFile", ".conf",
+        new File("src/main/resources/org/apache/accumulo/test/"));
+    PrintWriter writer = new PrintWriter(file.getAbsolutePath());
+    writer.println(COMPACTION_WARN_TIME.getKey() + "=11m");
+    writer.close();
+    exec("config --propFile " + file.getAbsolutePath(), true);
+    file.deleteOnExit();
+  }
+
+  @Test
+  public void invalidPropFileTest() throws Exception {
+    File file = File.createTempFile("invalidPropFile", ".conf",
+        new File("src/main/resources/org/apache/accumulo/test/"));
+    PrintWriter writer = new PrintWriter(file.getAbsolutePath());
+    writer.println("this is not a valid property file");
+    writer.close();
+    exec("config --propFile " + file.getAbsolutePath(), false,
+        "InvalidPropertyFile: " + file.getAbsolutePath());
+    file.deleteOnExit();

Review Comment:
   ```suggestion
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscr...@accumulo.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to