if (!(theTestInstance instanceof JmsTestCase))
{
return;
}
JmsTestCase jmsInstance = (JmsTestCase) theTestInstance;
// Sets the request field of the test case class
// ---------------------------------------------
// Extract from the JMS request the queue to simulate (if any)
JmsRequest request =
mdbImplicitObjects.getRequest();
String nameOfQueue = request.getQueueName();
QueueConnectionFactory qcf = ((QueueConnectionFactory)
((InitialContext)mdbImplicitObjects.getMessageDrivenBeanContext()).lookup(nameOfQueue));
Method respondMethod = jmsInstance.getClass().getMethod("getJMSReplyTo", new Class[]{});
Field requestField = jmsInstance.getClass().getField("request"); //TODO find the appropriate field names here.
//requestField.set(jmsInstance,
// AbstractHttpServletRequestWrapper.newInstance(request, url));
// Set the response queue field of the test case class
// ---------------------------------------------
Field responseQueueField = jmsInstance.getClass().getField("jMSReplyTo"); //TODO find the appropriate field names here.
//responseQueueField.set(jmsInstance,
// mdbImplicitObjects.getHttpServletResponse());
// Set the config field of the test case class
// -------------------------------------------
Field configField = jmsInstance.getClass().getField("config");
//configField.set(jmsInstance, AbstractServletConfigWrapper.
// newInstance(mdbImplicitObjects.getServletConfig()));
// Set the session field of the test case class