quality@glassfish.java.net

Re: [ANN] v3 QL tests are now 24 in number ...

From: Kedar Mhaswade <Kedar.Mhaswade_at_Sun.COM>
Date: Sat, 30 Aug 2008 18:38:13 -0700

Judy Tang wrote:
> Fist feedback is thank you so much Kedar :-)
You are welcome.
>
> Would like to know how do you test if command is pass or fail, do you
> look for
> return code or return message paten match, or both ?

The asadmin protocol is based on Manifests (java.util.jar fame) and what is
written into them.

Whenever a command fails, it should set the Manifest (main) attribute named
"exit-code" to "FAILURE". When this is true, usually another Manifest
(main) attribute named "cause" should contain the message. Thus, whether a
command succeeds is determined by the "exit-code" Manifest attribute which can
one of the following three values: "SUCCESS", "FAILURE", "WARNING" (not sure
what "WARNING" means). This is the gist of the programmatic asadmin API.

This is how command developers (like me) are supposed to write commands.

For better or for worse, the values that we (developers) put into Manifest
attributes named ("exit-code", "cause", "children", "message") have become
the public interface of GlassFish v3. These strings have some restrictions, for
example, the value of "children" is supposed to be a list of items delimited by
';', they can't contain new-line character etc.

I don't think this is likely to change soon, although this is rather risky and
fragile. I hope all command developers and users are aware of this fact.

-Kedar

>
> Thanks,
> Judy
>
> Kedar Mhaswade wrote:
>
>> I have increased the coverage of v3 QL test suite by 60%! :-P
>>
>> No kidding, but now the number of tests is (only) 24 in number (from
>> an earlier 15). All these tests are written to test asadmin commands.
>> So, if you have written an AdminCommand, consider adding a test
>> to test it out. IMO, adding an asadmin command test is easier than
>> ever before and is documented at [1]. This is because I ended up
>> writing a small framework to write tests for remote asadmin commands.
>> It's
>> still being improved to handle some corner cases, but you should be
>> able to test your asadmin command out.
>>
>> I am looking for feedback.
>>
>> See https://glassfish.dev.java.net/issues/show_bug.cgi?id=5760 for
>> details.
>>
>> Regards,
>> Kedar
>>
>> 1- http://tinyurl.com/5q3pzh
>>
>> PS - Sorry if you received multiple copies of this message.
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: admin-unsubscribe_at_glassfish.dev.java.net
>> For additional commands, e-mail: admin-help_at_glassfish.dev.java.net
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: admin-unsubscribe_at_glassfish.dev.java.net
> For additional commands, e-mail: admin-help_at_glassfish.dev.java.net
>