Re: How to test a class that is started via a Servlet.



mike wrote:
Hi,

I have the following class MessageManager ( which sends messages in
different formats).
In weblogic 8.1 I use a servelet to call start() and stop() to
activate/deactivate my MessageManager.

How can I activate the 'public void onRecMsg(String msg)'-method when
server is up and running?
Can I use a junit test and execute it in runtime or do I need a
Servlet that calls this method with a message?

JUnit is for testing, and should NOT be used in production code to do anything. By activating, do you mean invoking/calling? You could using logging to show that its happening, or you could just assume that it works because you've tested it appropriately.

--
Daniel Pitts' Tech Blog: <http://virtualinfinity.net/wordpress/>
.