You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@accumulo.apache.org by "ctubbsii (via GitHub)" <gi...@apache.org> on 2023/06/12 17:25:14 UTC

[GitHub] [accumulo] ctubbsii commented on a diff in pull request #3481: Remove redundant main from zoo-info-viewer tool

ctubbsii commented on code in PR #3481:
URL: https://github.com/apache/accumulo/pull/3481#discussion_r1226999267


##########
test/src/main/java/org/apache/accumulo/test/start/KeywordStartIT.java:
##########
@@ -135,7 +137,7 @@ public void testExpectedClasses() {
     expectSet.put("init", Initialize.class);
     expectSet.put("login-info", LoginProperties.class);
     expectSet.put("manager", ManagerExecutable.class);
-    expectSet.put("master", org.apache.accumulo.manager.MasterExecutable.class);
+    expectSet.put("master", MasterExecutable.class);

Review Comment:
   This previously used the fully qualified class name because you can't suppress the deprecation warning in the imports. It should be changed back.
   
   ```suggestion
       expectSet.put("master", MasterExecutable.class);
   ```



##########
test/src/main/java/org/apache/accumulo/test/start/KeywordStartIT.java:
##########
@@ -203,10 +208,41 @@ public void checkHasMain() {
     expectSet.add(TabletServer.class);
     expectSet.add(ZooKeeperMain.class);
 
+    expectSet.add(ConvertConfig.class);
+    expectSet.add(ConfigPropertyUpgrader.class);
+    expectSet.add(CheckServerConfig.class);
+    expectSet.add(CreateEmpty.class);
+    expectSet.add(ECAdmin.class);
+    expectSet.add(GenerateSplits.class);
+    expectSet.add(SplitLarge.class);
+    expectSet.add(ZooZap.class);
+
+    // check that classes in the expected set contain a main
     for (Class<?> c : expectSet) {
       assertTrue(hasMain(c), "Class " + c.getName() + " is missing a main method!");
     }
 
+    // build a list of all classed that implement KeywordExecutable
+    TreeMap<String,KeywordExecutable> foundExecutables =
+        new TreeMap<>(Main.getExecutables(getClass().getClassLoader()));

Review Comment:
   This only checks for KeywordExecutables that have a main method that we didn't expect. My comment was to check all classes, not just KeywordExecutable classes. So, this is a start, but incomplete (relative to the 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-unsubscribe@accumulo.apache.org

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