test_class.file: dubbo-plugin/dubbo-qos/src/test/java/org/apache/dubbo/qos/command/impl/HelpTest.java
test_class.identifier: HelpTest
test_case.body: @Test
      public void testMainHelp() throws Exception {
          Help help = new Help();
          String output = help.execute(Mockito.mock(CommandContext.class), null);
          assertThat(output, containsString("greeting"));
          assertThat(output, containsString("help"));
          assertThat(output, containsString("ls"));
          assertThat(output, containsString("online"));
          assertThat(output, containsString("offline"));
          assertThat(output, containsString("quit"));
      }
test_case.class_method_signature: HelpTest.testMainHelp()
test_case.full_signature: @Test public void testMainHelp()
test_case.identifier: testMainHelp
test_case.invocations: execute mock assertThat containsString assertThat containsString assertThat containsString assertThat containsString assertThat containsString assertThat containsString
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testMainHelp()
focal_class.file: dubbo-plugin/dubbo-qos/src/main/java/org/apache/dubbo/qos/command/impl/Help.java
focal_class.identifier: Help
focal_class.interfaces: implements BaseCommand
focal_class.class_method_signature: Help.execute(CommandContext commandContext, String[] args)
focal_class.full_signature: @Override public String execute(CommandContext commandContext, String[] args)
focal_class.identifier: execute
focal_class.modifiers: @Override public
focal_class.parameters: (CommandContext commandContext, String[] args)
focal_class.return: String
focal_class.signature: String execute(CommandContext commandContext, String[] args)
focal_class.class_method_signature: Help.commandHelp(String commandName)
focal_class.full_signature: private String commandHelp(String commandName)
focal_class.identifier: commandHelp
focal_class.modifiers: private
focal_class.parameters: (String commandName)
focal_class.return: String
focal_class.signature: String commandHelp(String commandName)
focal_class.class_method_signature: Help.drawExample(Cmd cmd)
focal_class.full_signature: private String drawExample(Cmd cmd)
focal_class.identifier: drawExample
focal_class.modifiers: private
focal_class.parameters: (Cmd cmd)
focal_class.return: String
focal_class.signature: String drawExample(Cmd cmd)
focal_class.class_method_signature: Help.mainHelp()
focal_class.full_signature: private String mainHelp()
focal_class.identifier: mainHelp
focal_class.modifiers: private
focal_class.parameters: ()
focal_class.return: String
focal_class.signature: String mainHelp()
focal_method.body: private String mainHelp() {
  
          final TTable tTable = new TTable(new TTable.ColumnDefine[]{
                  new TTable.ColumnDefine(TTable.Align.RIGHT),
                  new TTable.ColumnDefine(80, false, TTable.Align.LEFT)
          });
  
          final List<Class<?>> classes = CommandHelper.getAllCommandClass();
  
          Collections.sort(classes, new Comparator<Class<?>>() {
  
              @Override
              public int compare(Class<?> o1, Class<?> o2) {
                  final Integer o1s = o1.getAnnotation(Cmd.class).sort();
                  final Integer o2s = o2.getAnnotation(Cmd.class).sort();
                  return o1s.compareTo(o2s);
              }
  
          });
          for (Class<?> clazz : classes) {
  
              if (clazz.isAnnotationPresent(Cmd.class)) {
                  final Cmd cmd = clazz.getAnnotation(Cmd.class);
                  tTable.addRow(cmd.name(), cmd.summary());
              }
  
          }
  
          return tTable.padding(1).rendering();
      }
focal_method.class_method_signature: Help.mainHelp()
focal_method.full_signature: private String mainHelp()
focal_method.identifier: mainHelp
focal_method.invocations: getAllCommandClass sort sort getAnnotation sort getAnnotation compareTo isAnnotationPresent getAnnotation addRow name summary rendering padding
focal_method.modifiers: private
focal_method.parameters: ()
focal_method.return: String
focal_method.signature: String mainHelp()