> Hi,
>
[quoted text clipped - 7 lines]
> 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.

Signature
Daniel Pitts' Tech Blog: <http://virtualinfinity.net/wordpress/>
Kenneth P. Turvey - 31 Oct 2007 20:57 GMT
> 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.
I'm not sure I understood the initial question.
I'm having a problem testing some servlet code using JUnit as well and he
might be having the same issue. In my code I've had to separate the code
that uses the HttpServletRequest and HttpServletResponse classes to a
separate class, that remains untested, because JUnit always caused an
error when trying to test the class that contained these methods.
It would be nice to be able to test the servlet code as well. In my case
these are just thin wrappers around code that is tested, but it really
shouldn't have to be.

Signature
Kenneth P. Turvey <kt-usenet@squeakydolphin.com>
Lew - 01 Nov 2007 00:10 GMT
> I'm not sure I understood the initial question.
>
[quoted text clipped - 7 lines]
> these are just thin wrappers around code that is tested, but it really
> shouldn't have to be.
<http://jakarta.apache.org/cactus/>

Signature
Lew
mike - 01 Nov 2007 08:49 GMT
On 31 Okt, 18:06, Daniel Pitts
<newsgroup.spamfil...@virtualinfinity.net> wrote:
> > Hi,
>
[quoted text clipped - 10 lines]
> JUnit is for testing, and should NOT be used in production code to do
> anything.
I am looking for something that is similair to junit. I cannot unit
test my stuff since I have
problems to stub MBeanServer and I did not think it was necessary
since I really only need something
that invokes my onMsgRec(String msg)-method in runtime.
By activating, do you mean invoking/calling?
Today a servlet with init() and destroy() automatically called by WLS
at start and stop calls my start() and stop() in
MessageManager. Maybe I can add a doGet() that calls onMsgRec(String
msg)-method?
You could using
> logging to show that its happening, or you could just assume that it
> works because you've tested it appropriately.
I have to trigger onMsgRec(String msg) since this is called when the
system finds a problem ( not very often).
Since a customer will be looking at the solution I must be able to
trigger the condition.
cheers,
//mikael
> --
> Daniel Pitts' Tech Blog: <http://virtualinfinity.net/wordpress/>