I ran into exactly this scenario in a Java project. I did what Drew suggests here - I created my own abstraction on top of the queue.
(Actually when I started writing it was still up in the air as to exactly which package we were going to use for message queueing - we had to connect a Java system to a Windows system, and there are various different ways of doing that with MoM. So the abstraction was a necessity even ignoring the benefits it offers for testing.) I went for as simple as abstraction as could possibly work. It was pretty simple. This meant it wasn't hard to write a mock queue for testing. -- Ian Griffiths DevelopMentor ----- Original Message ----- From: "Justin Rudd" <[EMAIL PROTECTED]> > Hi Drew, > > > Lots of people do this, it's a well-known testing > > pattern referred to as Mock Objects[1]. > > I'm very familiar with Mock Objects (http://abstractadonet.sourceforge.net/mock.html). > > My question was really a request for comments. I was > wondering HOW people are approaching the problem. > As you state, there are no IMessageQueue or IMessage > interfaces. So you either spend a lot of time writing > wrapper objects that use interfaces or you have to try > to test by isolating the physical aspects (i.e. queues) to > be exactly what you want. You can read messages from the DOTNET archive, unsubscribe from DOTNET, or subscribe to other DevelopMentor lists at http://discuss.develop.com.