From 5b4d97c18445d95d8ee376e753b15aad733c6492 Mon Sep 17 00:00:00 2001 From: Sharang Gupta Date: Wed, 21 Oct 2026 19:04:41 +0100 Subject: [PATCH] Restore @Test on ClusterConfigParserTest.testShellOutputMain 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. --- .../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 fac6a50a3ad..2be59bfdcba 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 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 void testShellOutput() throws Exception { }); } + @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); } });