dev@ws-test-harness.java.net

Re: CVS update: /ws-test-harness/test-harness/src/com/sun/xml/ws/test/exec/

From: Kohsuke Kawaguchi <Kohsuke.Kawaguchi_at_Sun.COM>
Date: Mon, 31 Jul 2006 10:12:07 -0700

Bhakti Mehta wrote:
> Kohsuke,
> We were not getting the client code stacktrace. It used to show the
> stack trace with the ClientExecutor and its line numbers but I could not
> see the actual stack trace of the code .

I think we need to debug the code to see who's eating the exception
then. As we all know, if a JUnit test throws an exception, JUnit report
will show the stack trace. If it's not happening, then someone is
catching the exception and eating it.

> This seems to work fine now
> with this change so please let me know if there is a better way of doing it

As I wrote, this simply does not work, because even if the script fails,
  the harness (more precisely JUnit) will not recognize it as an error.
It simply produces a stack trace, then happily goes on. The net effect
is, it masks a failure. That is not acceptable.

So please check the code to see who's catching it and eating it.

> Regards,
> Bhakti
>
> Kohsuke Kawaguchi wrote:
>
>> This change is no good. If you don't propagate the exception up to
>> JUnit, JUnit won't learn that there was a failure.
>>
>> At the very least you have to rethrow the exception. I actually
>> believe this whole "e.printStackTrace()" is pointless, because once
>> JUnit catches the exception, it will print that out anyway.
>>
>> What was the motivation for this change?
>>
>> bhaktimehta_at_dev.java.net wrote:
>>
>>> @@ -58,7 +57,10 @@
>>> Reader r = client.script.read();
>>> try {
>>> engine.eval(r, engine.getNameSpace(),
>>> client.script.getName() );
>>> - } finally {
>>> + }catch (Exception e ) {
>>> + e.printStackTrace();
>>> + }
>>> + finally {
>>> r.close();
>>> }
>>> } finally {
>>
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe_at_ws-test-harness.dev.java.net
> For additional commands, e-mail: dev-help_at_ws-test-harness.dev.java.net
>
>


-- 
Kohsuke Kawaguchi
Sun Microsystems                   kohsuke.kawaguchi_at_sun.com