@Test public void testHandlerList() throws Exception { Pattern regex = Pattern.compile("^\\s*log\\s*$", Pattern.MULTILINE); HandlerCommand handlerCommand = new HandlerCommand(agent); String result; handlerCommand.execute(DefaultSoarCommandContext.empty(), new String[]{"handler", "--enable", "log"}); result = handlerCommand.execute(DefaultSoarCommandContext.empty(), new String[]{"handler"}); assertFalse(regex.matcher(result).find()); handlerCommand.execute(DefaultSoarCommandContext.empty(), new String[]{"handler", "--disable", "log"}); result = handlerCommand.execute(DefaultSoarCommandContext.empty(), new String[]{"handler"}); assertTrue(regex.matcher(result).find()); handlerCommand.execute(DefaultSoarCommandContext.empty(), new String[]{"handler", "--enable", "log"}); result = handlerCommand.execute(DefaultSoarCommandContext.empty(), new String[]{"handler"}); assertFalse(regex.matcher(result).find()); }
@Override public String execute(SoarCommandContext context, String[] args) throws SoarException { return Utils.parseAndRun(new Handler(agent), args); }
HandlerCommand extends PicocliSoarCommand { @Override public String execute(SoarCommandContext context, String[] args) throws SoarException { return Utils.parseAndRun(new Handler(agent), args); } }
HandlerCommand extends PicocliSoarCommand { @Override public String execute(SoarCommandContext context, String[] args) throws SoarException { return Utils.parseAndRun(new Handler(agent), args); } HandlerCommand(Agent agent); }
HandlerCommand extends PicocliSoarCommand { @Override public String execute(SoarCommandContext context, String[] args) throws SoarException { return Utils.parseAndRun(new Handler(agent), args); } HandlerCommand(Agent agent); @Override String execute(SoarCommandContext context, String[] args); @Override Object getCommand(); }
HandlerCommand extends PicocliSoarCommand { @Override public String execute(SoarCommandContext context, String[] args) throws SoarException { return Utils.parseAndRun(new Handler(agent), args); } HandlerCommand(Agent agent); @Override String execute(SoarCommandContext context, String[] args); @Override Object getCommand();  }