DefaultStellarShellExecutor implements StellarShellExecutor { @Override public void assign(String variableName, Object value, Optional<String> expression) { VariableResult varResult = VariableResult.withExpression(value, expression); this.variables.put(variableName, varResult); notifyVariableListeners(variableName, varResult); } 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 testAssign() { { executor.assign("x", 10, Optional.empty()); } { StellarResult result = executor.execute("x + 2"); assertTrue(result.isSuccess()); assertTrue(result.getValue().isPresent()); assertEquals(12, result.getValue().get()); } }