I use the mockrunner package from http://mockrunner.sourceforge.net/ to set up a false queue for JUnit testing an XML filter, which works as follows
- sets recognized properties for the ftp server to host and receive xml input and the jms queue server that monitors jobs. Remotely there is a server waiting, which actually parses the xml after receiving a queue message.
- creates a remote directory using ftp and starts a connection in the queue using mqconnectionfactory for the specified queue server address.
- after entering a new entry in 2), the filter waits for a new queue message to appear, meaning that the job was completed by the remote server. The filter then captures the modified XML file from ftp and passes it to the next filter.
The JUnit test I'm working on just needs to emulate this environment by running the local ftp server and mock queue to connect the filter, then waiting for the filter to connect to the queue and place the new xml input file on the local directory through the local ftp server, wait queue messages and change the xml input a little, put the changed xml in a new directory and post another message in the queue, which means that the task is completed.
All the tutorials I found on the network used EJB and JNDI to find the queue server after it was created. If possible, I would like to get around this route by simply creating a false queue on my local machine and connecting to it in the easiest way, without using EJB and JNDI.
Thanks in advance!
source share