@Test public void testHandlerDisabledFunction() throws Exception { Pattern regex = Pattern.compile("^Simple test$", Pattern.MULTILINE); LogManager logManager = agent.getLogManager(); HandlerCommand handlerCommand = new HandlerCommand(agent); logManager.setEchoMode(EchoMode.simple); logManager.setLogLevel(LogLevel.trace); logManager.setActive(true); handlerCommand.execute(DefaultSoarCommandContext.empty(), new String[]{"handler", "--enable", "log"}); agent.getProductions().loadProduction("test (state <s> ^superstate nil) --> (log info |Simple test|)"); clearBuffer(); agent.runFor(1, RunType.DECISIONS); assertTrue(regex.matcher(outputWriter.toString()).find()); handlerCommand.execute(DefaultSoarCommandContext.empty(), new String[]{"handler", "--disable", "log"}); agent.getProductions().loadProduction("test2 (state <s> ^superstate nil) --> (log info |Simple test|)"); clearBuffer(); agent.runFor(1, RunType.DECISIONS); assertFalse(regex.matcher(outputWriter.toString()).find()); handlerCommand.execute(DefaultSoarCommandContext.empty(), new String[]{"handler", "--enable", "log"}); agent.getProductions().loadProduction("test3 (state <s> ^superstate nil) --> (log info |Simple test|)"); clearBuffer(); agent.runFor(1, RunType.DECISIONS); assertTrue(regex.matcher(outputWriter.toString()).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();  }