@Override public Object callAndAssign(String variable, String instanceName, String methodName, Object... args) throws SlimException { try { MethodExecutionResult result = getMethodExecutionResult(instanceName, methodName, args); context.setVariable(variable, result); checkForPatternOfFixturesHandlingSymbols(variable); return result.returnValue(); } catch (Throwable e) { // NOSONAR checkExceptionForStop(e); throw new SlimException(e); } }
private void addSlimHelperLibraryToLibraries() { SlimHelperLibrary slimHelperLibrary = new SlimHelperLibrary(); slimHelperLibrary.setStatementExecutor(this); context.addLibrary(new Library(SLIM_HELPER_LIBRARY_INSTANCE_NAME, slimHelperLibrary)); }
@Override public MethodExecutionResult execute(String instanceName, String methodName, Object[] args) throws Throwable { Object instance; try { instance = context.getInstance(instanceName); } catch (SlimError e) { return MethodExecutionResult.noInstance(instanceName + "." + methodName); } return findAndInvoke(methodName, args, instance); } }
public List<Object> execute(List<Object> statements) { Executive e = verbose ? new LoggingExecutive() : new Executive(); e.prepareToExecute(); List<Object> result = e.executeStatements(statements); e.finalizeExecution(); return result; }
@Override public Object call(String instanceName, String methodName, Object... args) throws SlimException { try { return getMethodExecutionResult(instanceName, methodName, args).returnValue(); } catch (Throwable e) { // NOSONAR checkExceptionForStop(e); throw new SlimException(e); } }
private void tryProcessInstructions(SlimStreamReader reader, OutputStream writer) throws IOException { ListExecutor executor = slimFactory.getListExecutor(); String header = SlimVersion.SLIM_HEADER + SlimVersion.VERSION + "\n"; SlimStreamReader.sendSlimHeader(writer, header); boolean more = true; while (more) more = processOneSetOfInstructions(reader, writer, executor); }
@Override public StatementExecutorInterface getStatementExecutor() { StatementExecutorInterface statementExecutor = new StatementExecutor(new SlimExecutionContext(interaction)); if (timeout != null) { statementExecutor = StatementTimeoutExecutor.decorate(statementExecutor, timeout); } return statementExecutor; }
protected Object callMethod(String method, Object... args) { try { return bridge.invokeMethod(getStatementExecutorProxy(), method, args); } catch (Throwable e) { // NOSONAR return exceptionToString(e); } }
public String replaceSymbolsInString(String arg) { // Symbol assignments are not done by the fixture code so remove them and // return an empty string if (SlimSymbol.isSymbolAssignment(arg) != null) return ""; return new SlimSymbol() { @Override protected String getSymbolValue(String symbolName) { return getStoreSymbolValue(symbolName); } }.replace(arg); }
@Override public void assign(String name, Object value) { context.setVariable(name, value); checkForPatternOfFixturesHandlingSymbols(name); }
@Override public Object getSymbol(String symbolName) { MethodExecutionResult result = context.getVariable(symbolName); if (result == null) { return null; } return result.returnValue(); }
@Override public Object getSymbolObject(String symbolName) { MethodExecutionResult result = context.getVariable(symbolName); if (result == null) { return null; } return result.getObject(); }
@Override public Object callAndAssign(String variable, String instanceName, String methodName, Object... args) throws SlimException { try { MethodExecutionResult result = getMethodExecutionResult(instanceName, methodName, args); context.setVariable(variable, result); checkForPatternOfFixturesHandlingSymbols(variable); return result.returnValue(); } catch (Throwable e) { // NOSONAR checkExceptionForStop(e); throw new SlimException(e); } }
private void addSlimHelperLibraryToLibraries() { SlimHelperLibrary slimHelperLibrary = new SlimHelperLibrary(); slimHelperLibrary.setStatementExecutor(this); context.addLibrary(new Library(SLIM_HELPER_LIBRARY_INSTANCE_NAME, slimHelperLibrary)); }
@Override public Object call(String instanceName, String methodName, Object... args) throws SlimException { try { return getMethodExecutionResult(instanceName, methodName, args).returnValue(); } catch (Throwable e) { // NOSONAR checkExceptionForStop(e); throw new SlimException(e); } }
@Override public MethodExecutionResult execute(String instanceName, String methodName, Object[] args) throws Throwable { Object instance; try { instance = context.getInstance(instanceName); } catch (SlimError e) { return MethodExecutionResult.noInstance(instanceName + "." + methodName); } return findAndInvoke(methodName, args, instance); } }
private void tryProcessInstructions(SlimStreamReader reader, OutputStream writer) throws IOException { ListExecutor executor = slimFactory.getListExecutor(); String header = SlimVersion.SLIM_HEADER + SlimVersion.VERSION + "\n"; SlimStreamReader.sendSlimHeader(writer, header); boolean more = true; while (more) more = processOneSetOfInstructions(reader, writer, executor); }
@Override public StatementExecutorInterface getStatementExecutor() { StatementExecutorInterface statementExecutor = new StatementExecutor(new SlimExecutionContext(interaction)); if (timeout != null) { statementExecutor = StatementTimeoutExecutor.decorate(statementExecutor, timeout); } return statementExecutor; }
@Override public void assign(String name, Object value) { context.setVariable(name, value); checkForPatternOfFixturesHandlingSymbols(name); }
@Override public Object getSymbol(String symbolName) { MethodExecutionResult result = context.getVariable(symbolName); if (result == null) { return null; } return result.returnValue(); }