Currently i have a Java EE App host by Weblogic 10R3, i am interested to get 1 Message Driven Bean tested. The problem is that i don't have access to the foreign JMS server that Bean is listening to, here is MDB code:
import static com.citi.primefinance.utils.jms.ForeignJMSConstants.Queue.INCOMING_QUEUE_SWIFT_FX;
@MessageDriven(name = "IncomingSwiftFxProcessorMDB", mappedName = INCOMING_QUEUE_SWIFT_FX)
public class IncomingSwiftFxProcessorMDB extends AbstractMessageDrivenBean {
@Override
protected void processMessage(Serializable obj) throws Exception{
debug(this.getClass().getName() + ".processMessage()");
if (obj instanceof String) {
info(this.getClass().getName() + ": received on Message object");
processSwiftFxTradeMessage((String)obj);
} else {
error(this.getClass().getName() + ": received an object " + obj + " which is not a TextMessage");
}
}
My Plan is since the Bean will look-up the queue by JNDI, and i do have access to Weblogic hosting server. So i could delete the foreign JMS server, then add a local jms queue and connectionFactory holding the exact JNDI name. therefore isolate external dependence.
Do people think it is plausible? or anyone has alternative ideas? i was also thinking of using Mocking to isolate the dependency on JMS all together.
Any help is much appreciated, thanks
Here is some Weblogic log indicating Message Bean can't handle "Hot" swap?
incomingSwiftFxProcessorMDB is unable to connect to the JMS destination: IncomingSwiftFxQueue. The Error was: The Message-Driven EJB attempted to connect to the JMS connection factory with the JNDI name: SwiftConnectionFactory. However, the object with the JNDI name: SwiftConnectionFactory is not a JMS connection factory. NestedException Message is :weblogic.jms.client.JMSConnectionFactory>