test_class.declarator: outBack
test_class.modifier: private
test_class.original_string: private PrintStream outBack, errBack;
test_class.type: PrintStream
test_class.var_name: outBack
test_class.declarator: outStream
test_class.modifier: private
test_class.original_string: private ByteArrayOutputStream outStream,errStream;
test_class.type: ByteArrayOutputStream
test_class.var_name: outStream
test_class.file: agent/jvm/src/test/java/org/jolokia/jvmagent/client/command/CommandDispatcherTest.java
test_class.identifier: CommandDispatcherTest
test_case.body: @Test
      public void descriptionWithPattern() throws AgentInitializationException, InvocationTargetException, IOException, NoSuchMethodException, AgentLoadException, IllegalAccessException {
          CommandDispatcher d = new CommandDispatcher(opts("start","blub"));
  
          VirtualMachineHandler vmh = createMock(VirtualMachineHandler.class);
          VirtualMachine vm = createMock(VirtualMachine.class);
          expect(vm.getSystemProperties()).andReturn(getProperties(false));
          expect(vm.getSystemProperties()).andReturn(getProperties(true));
          // Agent should be loaded for successful switch
          vm.loadAgent(EasyMock.<String>anyObject(), EasyMock.<String>anyObject());
  
          expect(vmh.findProcess(patternMatcher("blub"))).andReturn(new ProcessDescription("18", "bla blub blie"));
          replay(vm, vmh);
  
          int rc = d.dispatchCommand(vm, vmh);
  
          assertEquals(rc, 0);
          verify(vm, vmh);
      }
test_case.class_method_signature: CommandDispatcherTest.descriptionWithPattern()
test_case.full_signature: @Test public void descriptionWithPattern()
test_case.identifier: descriptionWithPattern
test_case.invocations: opts createMock createMock andReturn expect getSystemProperties getProperties andReturn expect getSystemProperties getProperties loadAgent anyObject anyObject andReturn expect findProcess patternMatcher replay dispatchCommand assertEquals verify
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void descriptionWithPattern()
focal_class.declarator: options
focal_class.modifier: private
focal_class.original_string: private OptionsAndArgs options;
focal_class.type: OptionsAndArgs
focal_class.var_name: options
focal_class.declarator: COMMANDS = new HashMap<String, AbstractBaseCommand>()
focal_class.modifier: private static final
focal_class.original_string: private static final Map<String,AbstractBaseCommand> COMMANDS = new HashMap<String, AbstractBaseCommand>();
focal_class.type: Map<String,AbstractBaseCommand>
focal_class.var_name: COMMANDS
focal_class.file: agent/jvm/src/main/java/org/jolokia/jvmagent/client/command/CommandDispatcher.java
focal_class.identifier: CommandDispatcher
focal_class.class_method_signature: CommandDispatcher.CommandDispatcher(OptionsAndArgs pOptions)
focal_class.full_signature: public  CommandDispatcher(OptionsAndArgs pOptions)
focal_class.identifier: CommandDispatcher
focal_class.modifiers: public
focal_class.parameters: (OptionsAndArgs pOptions)
focal_class.signature:  CommandDispatcher(OptionsAndArgs pOptions)
focal_class.class_method_signature: CommandDispatcher.dispatchCommand(Object pVm,VirtualMachineHandler pHandler)
focal_class.full_signature: public int dispatchCommand(Object pVm,VirtualMachineHandler pHandler)
focal_class.identifier: dispatchCommand
focal_class.modifiers: public
focal_class.parameters: (Object pVm,VirtualMachineHandler pHandler)
focal_class.return: int
focal_class.signature: int dispatchCommand(Object pVm,VirtualMachineHandler pHandler)
focal_class.class_method_signature: CommandDispatcher.getAvailableCommands()
focal_class.full_signature: public static Set<String> getAvailableCommands()
focal_class.identifier: getAvailableCommands
focal_class.modifiers: public static
focal_class.parameters: ()
focal_class.return: Set<String>
focal_class.signature: Set<String> getAvailableCommands()
focal_class.class_method_signature: CommandDispatcher.printHelp()
focal_class.full_signature: public static void printHelp()
focal_class.identifier: printHelp
focal_class.modifiers: public static
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void printHelp()
focal_method.body: public int dispatchCommand(Object pVm,VirtualMachineHandler pHandler) throws InvocationTargetException, NoSuchMethodException, IllegalAccessException {
          String commandName = options.getCommand();
          AbstractBaseCommand command = COMMANDS.get(commandName);
          if (command == null) {
              throw new IllegalArgumentException("Unknown command '" + commandName + "'");
          }
          return command.execute(options,pVm,pHandler);
      }
focal_method.class_method_signature: CommandDispatcher.dispatchCommand(Object pVm,VirtualMachineHandler pHandler)
focal_method.full_signature: public int dispatchCommand(Object pVm,VirtualMachineHandler pHandler)
focal_method.identifier: dispatchCommand
focal_method.invocations: getCommand get execute
focal_method.modifiers: public
focal_method.parameters: (Object pVm,VirtualMachineHandler pHandler)
focal_method.return: int
focal_method.signature: int dispatchCommand(Object pVm,VirtualMachineHandler pHandler)