@Test(expected = CoreException.class) public void testScriptCondition_WrongFunction() throws Exception { ConditionFunction condition = new ConditionFunction("function wrongFunctionName(message) {return true;}"); try { LifecycleHelper.initAndStart(condition); condition.evaluate(createMessage()); } finally { LifecycleHelper.stopAndClose(condition); } }
@Override public boolean evaluate(AdaptrisMessage msg) throws ServiceException { try { Object o = ((Invocable) engine).invokeFunction("evaluateScript", msg); return BooleanUtils.toBoolean(o.toString()); } catch (Exception e) { throw ExceptionHelper.wrapServiceException(e); } }
ConditionFunction extends ConditionImpl { @Override public boolean evaluate(AdaptrisMessage msg) throws ServiceException { try { Object o = ((Invocable) engine).invokeFunction("evaluateScript", msg); return BooleanUtils.toBoolean(o.toString()); } catch (Exception e) { throw ExceptionHelper.wrapServiceException(e); } } }
ConditionFunction extends ConditionImpl { @Override public boolean evaluate(AdaptrisMessage msg) throws ServiceException { try { Object o = ((Invocable) engine).invokeFunction("evaluateScript", msg); return BooleanUtils.toBoolean(o.toString()); } catch (Exception e) { throw ExceptionHelper.wrapServiceException(e); } } ConditionFunction();  ConditionFunction(String func); }
ConditionFunction extends ConditionImpl { @Override public boolean evaluate(AdaptrisMessage msg) throws ServiceException { try { Object o = ((Invocable) engine).invokeFunction("evaluateScript", msg); return BooleanUtils.toBoolean(o.toString()); } catch (Exception e) { throw ExceptionHelper.wrapServiceException(e); } } ConditionFunction();  ConditionFunction(String func); @Override boolean evaluate(AdaptrisMessage msg); @Override void init(); String getDefinition(); void setDefinition(String f); }
ConditionFunction extends ConditionImpl { @Override public boolean evaluate(AdaptrisMessage msg) throws ServiceException { try { Object o = ((Invocable) engine).invokeFunction("evaluateScript", msg); return BooleanUtils.toBoolean(o.toString()); } catch (Exception e) { throw ExceptionHelper.wrapServiceException(e); } } ConditionFunction();  ConditionFunction(String func); @Override boolean evaluate(AdaptrisMessage msg); @Override void init(); String getDefinition(); void setDefinition(String f);  }