DefaultStellarShellExecutor implements StellarShellExecutor { private void notifySpecialListeners(SpecialCommand specialCommand) { for(SpecialDefinedListener listener : specialListeners) { listener.whenSpecialDefined(specialCommand); } } DefaultStellarShellExecutor(
          FunctionResolver functionResolver,
          Properties properties,
          Optional<String> zookeeperUrl,
          List<SpecialCommand> specials);  DefaultStellarShellExecutor(
          FunctionResolver functionResolver,
          Properties properties,
          Optional<String> zookeeperUrl);  DefaultStellarShellExecutor(
          Properties properties,
          Optional<String> zookeeperUrl); static List<SpecialCommand> defaultSpecials(); @Override void init(); @Override void addFunctionListener(FunctionDefinedListener listener); @Override void addVariableListener(VariableDefinedListener listener); @Override void addSpecialListener(SpecialDefinedListener listener); @Override StellarResult execute(String expression); @Override @SuppressWarnings("unchecked") Map<String, Object> getGlobalConfig(); @Override void assign(String variableName, Object value, Optional<String> expression); @Override FunctionResolver getFunctionResolver(); @Override @SuppressWarnings("unchecked") Map<String, VariableResult> getState(); Map<String, Object> getVariables(); @Override Context getContext(); static final String SHELL_VARIABLES; }
@Test public void testNotifySpecialListeners() throws Exception { notified = false; Properties props = new Properties(); DefaultStellarShellExecutor executor = new DefaultStellarShellExecutor(props, Optional.empty()); notified = false; executor.addSpecialListener((magic) -> { assertNotNull(magic); assertNotNull(magic.getCommand()); notified = true; }); executor.init(); assertTrue(notified); }