TorqueCommandLineEvaluation implements CommandLineEvaluation { @Override public void state(CommandLineArguments arguments) { new StateCommand(this).execute(arguments); } TorqueCommandLineEvaluation(TorqueNodeManager nodeManager, CommandLineHandle handle, RmiServerForApi rmiServerForApi); @Override void state(CommandLineArguments arguments); @Override void shutdown(CommandLineArguments arguments); @Override void handleCommand(String command, CommandLineArguments arguments); @Override CommandLineHandle getCommandLineHandle(); TorqueNodeManager getNodeManager(); RmiServerForApi getRmiServerForApi();  }
@Test public void state() { Collection<NodeInformation> allNodes = new LinkedList<NodeInformation>(); allNodes.add(new NodeInformationImpl("1", createSystemInformation())); allNodes.add(new NodeInformationImpl("2", createSystemInformation())); when(rmiServerForApi.getAllNodes()).thenReturn(allNodes); commandLineEvaluation.state(null); assertThat(commandLineHandle.getPrintOutput(), containsString("running nodes: 2")); assertThat(commandLineHandle.getPrintOutput(), containsString("node 1: ")); assertThat(commandLineHandle.getPrintOutput(), containsString("node 2: ")); }