You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@isis.apache.org by Dan Haywood <da...@haywood-associates.co.uk> on 2013/06/10 23:15:42 UTC

Re: Few Queries regarding the tests

On 10 June 2013 20:49, Bhargav Golla <bh...@gmail.com> wrote:

>
> 1. Delete_thenResponseCode_205_bad: Should I check for a DELETE request
> and then check for response code?
>

Not sure what you mean by "check for" a DELETE request.  You need to submit
an HTTP DELETE in the client, and then assert in the client that you get a
205 response.

There's a good chance, though, that this test will fail - ie that the
server does not correctly implement this behaviour.  You are very welcome
to dig into it if so.... will probably involve some rooting around in
RestEasy and the JAX-RS.  However, if you get nowhere, then skip this test
and find something easier to work on (at least, while you are coming up to
speed).  Such as...


>
> 2. Get_thenResponseHeaders_ContentLength_ok: What is the content length I
> should check for?
>

With these, the easiest thing is to just assert on a nonsense value, have
the test fail, and then (so long as you've manually verified that the
response looks ok), take this content length as the one to check for.

What we're after here is a regression test; there's no easy way - other
than manual inspection - to figure out the initial value.

For a slightly more robust test, you might want to check that the content
length is larger than some value.  After all, if there are changes it'll
probably involve the addition of new members to the class; which would
break this content length test.  All we want is a "reasonableness" check
here, ie "yes, a content length was returned, and yes, it looks about
right".

Thx
Dan



>

Re: Few Queries regarding the tests

Posted by Bhargav Golla <bh...@gmail.com>.
On Tue, Jun 11, 2013 at 2:45 AM, Dan Haywood
<da...@haywood-associates.co.uk>wrote:

>
>
>
> On 10 June 2013 20:49, Bhargav Golla <bh...@gmail.com> wrote:
>
>>
>> 1. Delete_thenResponseCode_205_bad: Should I check for a DELETE request
>> and then check for response code?
>>
>
> Not sure what you mean by "check for" a DELETE request.  You need to
> submit an HTTP DELETE in the client, and then assert in the client that you
> get a 205 response.
>
> There's a good chance, though, that this test will fail - ie that the
> server does not correctly implement this behaviour.  You are very welcome
> to dig into it if so.... will probably involve some rooting around in
> RestEasy and the JAX-RS.  However, if you get nowhere, then skip this test
> and find something easier to work on (at least, while you are coming up to
> speed).  Such as...
>
I will try to look into it. If I get nowhere, I will skip it as per your
suggestion and concentrate on quick and easy ones.

>
>
>>
>> 2. Get_thenResponseHeaders_ContentLength_ok: What is the content length I
>> should check for?
>>
>
> With these, the easiest thing is to just assert on a nonsense value, have
> the test fail, and then (so long as you've manually verified that the
> response looks ok), take this content length as the one to check for.
>
> What we're after here is a regression test; there's no easy way - other
> than manual inspection - to figure out the initial value.
>
> For a slightly more robust test, you might want to check that the content
> length is larger than some value.  After all, if there are changes it'll
> probably involve the addition of new members to the class; which would
> break this content length test.  All we want is a "reasonableness" check
> here, ie "yes, a content length was returned, and yes, it looks about
> right".
>
I will check for content length greater than 1000 in all tests for now.

>
> Thx
> Dan
>
>
>
>>