Skip to content

Commit 7b746cd

Browse files
committed
Fix KeywordStartIT broken by apache#5073
* Remove main method and move implementation to the execute method in the new CheckAccumuloProperties command * Add the new KeywordExecutable class to the IT
1 parent 79d972f commit 7b746cd

File tree

2 files changed

+12
-13
lines changed

2 files changed

+12
-13
lines changed

server/base/src/main/java/org/apache/accumulo/server/conf/CheckAccumuloProperties.java

+10-13
Original file line numberDiff line numberDiff line change
@@ -35,17 +35,6 @@
3535
@AutoService(KeywordExecutable.class)
3636
public class CheckAccumuloProperties implements KeywordExecutable {
3737

38-
@SuppressFBWarnings(value = "PATH_TRAVERSAL_IN", justification = "intentional user-provided path")
39-
public static void main(String[] args) throws IOException {
40-
Preconditions.checkArgument(args.length == 1,
41-
"Expected 1 argument (the properties file path), got " + args.length);
42-
var hadoopConfig = new Configuration();
43-
var siteConfig = SiteConfiguration.fromFile(new File(args[0])).build();
44-
45-
VolumeManagerImpl.get(siteConfig, hadoopConfig);
46-
new ServerDirs(siteConfig, hadoopConfig);
47-
}
48-
4938
@Override
5039
public String keyword() {
5140
return "check-accumulo-properties";
@@ -59,8 +48,16 @@ public String description() {
5948
+ (new CheckServerConfig().keyword());
6049
}
6150

51+
@SuppressFBWarnings(value = "PATH_TRAVERSAL_IN", justification = "intentional user-provided path")
6252
@Override
63-
public void execute(String[] args) throws Exception {
64-
main(args);
53+
public void execute(String[] args) throws IOException {
54+
Preconditions.checkArgument(args.length == 1,
55+
"Expected 1 argument (the properties file path), got " + args.length);
56+
var hadoopConfig = new Configuration();
57+
var siteConfig = SiteConfiguration.fromFile(new File(args[0])).build();
58+
59+
VolumeManagerImpl.get(siteConfig, hadoopConfig);
60+
new ServerDirs(siteConfig, hadoopConfig);
6561
}
62+
6663
}

test/src/main/java/org/apache/accumulo/test/start/KeywordStartIT.java

+2
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@
5353
import org.apache.accumulo.miniclusterImpl.MiniClusterExecutable;
5454
import org.apache.accumulo.monitor.Monitor;
5555
import org.apache.accumulo.monitor.MonitorExecutable;
56+
import org.apache.accumulo.server.conf.CheckAccumuloProperties;
5657
import org.apache.accumulo.server.conf.CheckCompactionConfig;
5758
import org.apache.accumulo.server.conf.CheckServerConfig;
5859
import org.apache.accumulo.server.conf.util.ConfigPropertyUpgrader;
@@ -131,6 +132,7 @@ public void testExpectedClasses() {
131132
expectSet.put("admin", Admin.class);
132133
expectSet.put("check-compaction-config", CheckCompactionConfig.class);
133134
expectSet.put("check-server-config", CheckServerConfig.class);
135+
expectSet.put("check-accumulo-properties", CheckAccumuloProperties.class);
134136
expectSet.put("compaction-coordinator", CoordinatorExecutable.class);
135137
expectSet.put("compactor", CompactorExecutable.class);
136138
expectSet.put("config-upgrade", ConfigPropertyUpgrader.class);

0 commit comments

Comments
 (0)