@Test public void testRegisterHandler() throws Exception { final AtomicBoolean added = new AtomicBoolean(); final AtomicBoolean removed = new AtomicBoolean(); final OutputCommandHandler handler = new OutputCommandHandler() { @Override public void onCommandRemoved(String commandName, Identifier commandId) { assertEquals("jump-high", commandName); removed.set(true); } @Override public void onCommandAdded(String commandName, Identifier commandId) { assertEquals("jump-high", commandName); Iterator<Wme> wmes = commandId.getWmes(); assertTrue(wmes.hasNext()); Wme wme = wmes.next(); assertEquals("how-high", wme.getAttribute().asString().toString()); assertEquals(5, wme.getValue().asInteger().getValue()); added.set(true); } }; outputManager.registerHandler("jump-high", handler); agent.getProductions().loadProduction("testRegisterHandler\n" + "(state <s> ^superstate nil ^io.output-link <ol> -^remove)" + "-->\n" + "(<ol> ^jump-high <jh>)\n" + "(<jh> ^how-high 5)\n" + ""); agent.runFor(1, RunType.DECISIONS); assertTrue(added.get()); assertFalse(removed.get()); agent.getProductions().loadProduction("testRemove\n" + "(state <s> ^superstate nil)" + "-->\n" + "(<s> ^remove <id>)\n" + ""); agent.runFor(1, RunType.DECISIONS); assertTrue(removed.get()); }
public void registerHandler(String commandName, OutputCommandHandler commandHandler) { commandHandlers.put(commandName, commandHandler); }
OutputCommandManager { public void registerHandler(String commandName, OutputCommandHandler commandHandler) { commandHandlers.put(commandName, commandHandler); } }
OutputCommandManager { public void registerHandler(String commandName, OutputCommandHandler commandHandler) { commandHandlers.put(commandName, commandHandler); } OutputCommandManager(SoarEventManager eventManager); }
OutputCommandManager { public void registerHandler(String commandName, OutputCommandHandler commandHandler) { commandHandlers.put(commandName, commandHandler); } OutputCommandManager(SoarEventManager eventManager); void registerHandler(String commandName,
            OutputCommandHandler commandHandler); void dispose(); }
OutputCommandManager { public void registerHandler(String commandName, OutputCommandHandler commandHandler) { commandHandlers.put(commandName, commandHandler); } OutputCommandManager(SoarEventManager eventManager); void registerHandler(String commandName,
            OutputCommandHandler commandHandler); void dispose();  }