You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cxf.apache.org by Daniel Kulp <dk...@apache.org> on 2012/05/14 19:17:59 UTC

JAXRSClientServerBookTest.testGetBookXmlWildcard failures...

Sergey,

The JAXRSClientServerBookTest.testGetBookXmlWildcard test seems to randomly 
fail for me.   Looking into the test, it looks like the URL it's getting can 
match either:

    @GET
    @Path("/books/{bookId}/")
    @Produces("application/xml")
    public Book getBook(@PathParam("bookId") String id) throws 
BookNotFoundFault {
        return doGetBook(id);
    }

or:
    
    @GET
    @Path("/books/{bookId}/")
    @Produces("text/xml")
    public Book getBookTextXml(@PathParam("bookId") String id) throws 
BookNotFoundFault {
        return doGetBook(id);
    }


And thus either of the two return content types would be valid, right?


Can you look into that test a bit?

Thanks!


-- 
Daniel Kulp
dkulp@apache.org - http://dankulp.com/blog
Talend Community Coder - http://coders.talend.com




Re: JAXRSClientServerBookTest.testGetBookXmlWildcard failures...

Posted by Sergey Beryozkin <sb...@gmail.com>.
Hi Dan
On 14/05/12 18:17, Daniel Kulp wrote:
>
> Sergey,
>
> The JAXRSClientServerBookTest.testGetBookXmlWildcard test seems to randomly
> fail for me.   Looking into the test, it looks like the URL it's getting can
> match either:
>
>      @GET
>      @Path("/books/{bookId}/")
>      @Produces("application/xml")
>      public Book getBook(@PathParam("bookId") String id) throws
> BookNotFoundFault {
>          return doGetBook(id);
>      }
>
> or:
>
>      @GET
>      @Path("/books/{bookId}/")
>      @Produces("text/xml")
>      public Book getBookTextXml(@PathParam("bookId") String id) throws
> BookNotFoundFault {
>          return doGetBook(id);
>      }
>
>
> And thus either of the two return content types would be valid, right?
>
Indeed, in fact, one more method matches the request,
@GET
     @Path("/books/{bookId}/")
     @Produces("application/json;q=0.9")
     public Book getBookAsJSON() throws BookNotFoundFault {
         return doGetBook(currentBookId);
     }
As far as I recall the idea was to test that when the wildcard was 
Accepted, the default would be 'application/xml', and perhaps I added a 
text/xml producing method to test that the first matching method 
(application/xml) would be chosen, it might be that even one of the TCK 
tests was testing a similar expectation. But obviously it breaks when 
the order of methods at the runtime is not necessarily in the order they 
are declared in the source.

Now, as it happens, the method producing application/xml and text/xml 
are also invoked from one of the other tests, so I'm just updating the 
path for the method producing text/xml. That should do it...

Please ping me if you'd like me to investigate some other failures you 
might be seeing

Thanks, Sergey

>
> Can you look into that test a bit?
>
> Thanks!
>
>


-- 
Sergey Beryozkin

Talend Community Coders
http://coders.talend.com/

Blog: http://sberyozkin.blogspot.com