You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@accumulo.apache.org by dl...@apache.org on 2026/10/23 16:06:09 UTC

(accumulo) branch main updated: Restore @Test on ClusterConfigParserTest.testShellOutputMain (#6604)

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

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


The following commit(s) were added to refs/heads/main by this push:
     new a706526529 Restore @Test on ClusterConfigParserTest.testShellOutputMain (#6604)
a706526529 is described below

commit a706526529e0dc6acb9f37ac55e7b6046a73c613
Author: Sharang Gupta <sh...@sharanggupta.dev>
AuthorDate: Fri Oct 23 17:06:02 2026 +0100

    Restore @Test on ClusterConfigParserTest.testShellOutputMain (#6604)
    
    The test was moved to the server module in #5749 and moved back to core
    in #5865. When it was restored, the @Test annotation was left off, so
    JUnit has not run it since. Put the annotation back so the main()
    output-file path of ClusterConfigParser is covered again, and pass the
    configuration file as Path.of(URL.toURI()) like the other tests, since
    URL.getFile() is URL-encoded.
---
 .../accumulo/core/conf/cluster/ClusterConfigParserTest.java    | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/core/src/test/java/org/apache/accumulo/core/conf/cluster/ClusterConfigParserTest.java b/core/src/test/java/org/apache/accumulo/core/conf/cluster/ClusterConfigParserTest.java
index fac6a50a3a..2be59bfdcb 100644
--- a/core/src/test/java/org/apache/accumulo/core/conf/cluster/ClusterConfigParserTest.java
+++ b/core/src/test/java/org/apache/accumulo/core/conf/cluster/ClusterConfigParserTest.java
@@ -26,7 +26,6 @@ import static org.junit.jupiter.api.Assertions.assertTrue;
 
 import java.io.BufferedReader;
 import java.io.ByteArrayOutputStream;
-import java.io.IOException;
 import java.io.PrintStream;
 import java.net.URL;
 import java.nio.file.Files;
@@ -133,18 +132,19 @@ public class ClusterConfigParserTest extends WithTestNames {
     });
   }
 
+  @Test
   public void testShellOutputMain() throws Exception {
 
     // Test that the main method in ClusterConfigParser properly parses the configuration
     // and outputs to a given file instead of System.out when provided
     testShellOutput(configFile -> {
       try {
-        Path outputFile = tempDir.resolve(testName());
-        ClusterConfigParser
-            .main(new String[] {configFile.getFile(), outputFile.toAbsolutePath().toString()});
+        final Path outputFile = tempDir.resolve(testName());
+        ClusterConfigParser.main(new String[] {Path.of(configFile.toURI()).toString(),
+            outputFile.toAbsolutePath().toString()});
 
         return outputFile;
-      } catch (IOException e) {
+      } catch (Exception e) {
         throw new RuntimeException(e.getMessage(), e);
       }
     });