public LocalHTTPServer getLocalServer() { // We use lazy initialization so the user can change programmatically // the base URL (and thus the port BPELUnit listens on) after creating // the TestSuite but before calling #setUp. if (fLocalServer == null) { fLocalServer = new LocalHTTPServer( getBaseURL().getPort(), getBaseURL().getPath()); } return fLocalServer; }
/** * Creates a new VelocityContext with information about this test suite. * If necessary, it will initialize Velocity. * * NOTE: to keep test cases and activities isolated, this context should * not be wrapped, but rather be cloned and then extended. */ public Context createVelocityContext() { try { Velocity.init(); } catch(Exception e) { // XXX DL: This is stupid but it seems that the logger // cannot be initialized on the first try when running // under Eclipse and ATM I don't know a better solution Velocity.init(); } Context ctx = toolManager.createContext(); ctx.put("baseURL", getBaseURL().toString()); ctx.put("collections", java.util.Collections.class); ctx.put("putName", fProcessUnderTest.getName()); ctx.put("testSuiteName", this.getRawName()); ctx.put("testCaseCount", this.getTestCaseCount()); if (fSetUpVelocityScript != null) { StringWriter sW = new StringWriter(); Velocity.evaluate(ctx, sW, "setUpTestSuite", fSetUpVelocityScript); } return ctx; }