EmbeddedScriptingService extends ScriptingServiceImp { public void setScript(String s) { script = s; } EmbeddedScriptingService();  EmbeddedScriptingService(String uniqueId); String getScript(); void setScript(String s); EmbeddedScriptingService withScript(String lang, String script);  }
@Test public void testDoServiceWithEmptyScript() throws Exception { EmbeddedScriptingService service = new EmbeddedScriptingService(); service.setLanguage("jruby"); AdaptrisMessage msg = AdaptrisMessageFactory.getDefaultInstance().newMessage(); execute(service, msg); service.setScript(""); execute(service, msg); }
@Test public void testDoServiceWithFailingScript() throws Exception { EmbeddedScriptingService service = createService(getName()); service.setScript("This Really Should Fail"); AdaptrisMessage msg = AdaptrisMessageFactory.getDefaultInstance().newMessage(); try { execute(service, msg); fail("Service failure expected"); } catch (ServiceException expected) { } }