public AbstractPartner getPartner() { return fPartnerTrack.getPartner(); }
public ActivityContext(TestCaseRunner runner, PartnerTrack track) { fRunner= runner; fTrack= track; fSimulatedURL= fTrack.getPartner().getSimulatedURL(); }
public String getRawName() { return getPartner().getName(); }
public String getName() { return "Partner Track " + getPartner().getName(); }
/** * Creates a new partner track-wide Velocity context. It collects * information from the test suite, the test case and this partner track. * This context is isolated from all the following partner tracks: any * changes done to the test suite and test case variables will be lost in * the next partner track. * * This method obtains and caches the VelocityContext of the test case, so * it only needs to be produced once for every partner track. * * @return Base VelocityContext for the partner track. * @throws DataSourceException */ public Context createVelocityContext() throws DataSourceException { if (fTestCaseVelocityContext == null) { fTestCaseVelocityContext = fRunner.createVelocityContext(); } Context ctx = CLONER.deepClone(fTestCaseVelocityContext); ctx.put("partnerTrackName", getRawName()); if(getPartner() instanceof Partner) { ctx.put("partnerTrackURL", ((Partner)getPartner()).getSimulatedURL()); } if (fActivityContext != null) { ctx.put("request", fActivityContext.getLastRequest()); ctx.put("partnerTrackReceived", fActivityContext.getReceivedMessages()); ctx.put("partnerTrackSent", fActivityContext.getSentMessages()); } return ctx; }