@Override protected InstructionResult executeInternal(InstructionExecutor executor) throws SlimException { throw new SlimException(operation, SlimServer.MALFORMED_INSTRUCTION, true); } }
@Override protected InstructionResult executeInternal(InstructionExecutor executor) throws SlimException { throw new SlimException(operation, SlimServer.MALFORMED_INSTRUCTION, true); } }
private <T> T getWithTimeout(Future<T> submit) throws SlimException { try { return submit.get(timeout, SECONDS); } catch (TimeoutException e) { throw new SlimException(Integer.toString(timeout), SlimServer.TIMED_OUT, true); } catch (InterruptedException e) { Thread.currentThread().interrupt(); throw new SlimError("Statement execution was interrupted", e); } catch (ExecutionException e) { Throwable cause = e.getCause(); if (cause instanceof SlimException) { throw (SlimException) cause; } else { throw new SlimException(e.getCause()); } } } }
private <T> T getWithTimeout(Future<T> submit) throws SlimException { try { return submit.get(timeout, SECONDS); } catch (TimeoutException e) { throw new SlimException(Integer.toString(timeout), SlimServer.TIMED_OUT, true); } catch (InterruptedException e) { Thread.currentThread().interrupt(); throw new SlimError("Statement execution was interrupted", e); } catch (ExecutionException e) { Throwable cause = e.getCause(); if (cause instanceof SlimException) { throw (SlimException) cause; } else { throw new SlimException(e.getCause()); } } } }
@Override public void create(String instanceName, String className, Object... args) throws SlimException { try { context.create(instanceName, className, args); // TODO Hack for supporting SlimHelperLibrary, please remove. Object newInstance = context.getInstance(instanceName); if (newInstance instanceof StatementExecutorConsumer) { ((StatementExecutorConsumer) newInstance).setStatementExecutor(this); } } catch (SlimError e) { throw new SlimException(format("%s[%d]", className, args.length), e, SlimServer.COULD_NOT_INVOKE_CONSTRUCTOR, true); } catch (IllegalArgumentException e) { throw new SlimException(format("%s[%d]", className, args.length), e, SlimServer.COULD_NOT_INVOKE_CONSTRUCTOR, true); } catch (InvocationTargetException e) { checkExceptionForStop(e.getTargetException()); throw new SlimException(e.getTargetException(), true); } catch (Throwable e) { // NOSONAR checkExceptionForStop(e); throw new SlimException(e); } }
@Override public void create(String instanceName, String className, Object... args) throws SlimException { try { context.create(instanceName, className, args); // TODO Hack for supporting SlimHelperLibrary, please remove. Object newInstance = context.getInstance(instanceName); if (newInstance instanceof StatementExecutorConsumer) { ((StatementExecutorConsumer) newInstance).setStatementExecutor(this); } } catch (SlimError e) { throw new SlimException(format("%s[%d]", className, args.length), e, SlimServer.COULD_NOT_INVOKE_CONSTRUCTOR, true); } catch (IllegalArgumentException e) { throw new SlimException(format("%s[%d]", className, args.length), e, SlimServer.COULD_NOT_INVOKE_CONSTRUCTOR, true); } catch (InvocationTargetException e) { checkExceptionForStop(e.getTargetException()); throw new SlimException(e.getTargetException(), true); } catch (Throwable e) { // NOSONAR checkExceptionForStop(e); throw new SlimException(e); } }
@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 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 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); } }
@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); } }