mehandih / grails-jaxrs

Automatically exported from code.google.com/p/grails-jaxrs
0 stars 0 forks source link

Ease development of integration tests #34

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
It would be useful if we could produce integration tests for jaxrs resources.

They should ease the development and increase the effectiveness of tests trying 
to simulate the behavior of the jaxrs runtime, mainly:
* supporting the registration of resources and providers through the usual 
annotations (@Provider, @Produces, @GET and so on)
* exposing them to a REST client driven to "send" requests

The main goal should be to let the developer write tests focused on stressing 
the resources logic AND THEIR BEHAVIOR INTEGRATED WITH THE NEEDED companions 
(providers, writers, and so on). This could not necessarily mean to use tools 
that needs a real server listening on a port.

I have no great experience with grails and Spring mocking, but here you are 
some questions that arise soon in my mind:
* maybe the registration of resources could be somewhat selectively disabled, 
to separately stress them?
* maybe the REST client could only simulate a real HTTP request, using some 
mocking?

I have followed a thread that discussed about something (that seems to me) 
similar:  
http://groups.google.com/group/grails-jaxrs-discuss/browse_thread/thread/f75ea06
cab0c2284 . The only code I've developed in this direction so far was to find 
workarounds to troubles discussed there (with no remarkable results).
I've took a look at controller tests at 
https://github.com/krasserm/grails-jaxrs/tree/master/test/integration , but 
they do manual wiring of beans (even converting the spring xml to bean builder 
DSL has not worked). But the main idea is: the automatic detection/injection of 
resources instance is preferable.

Original issue reported on code.google.com by davide.cavestro on 21 Mar 2011 at 9:51

GoogleCodeExporter commented 8 years ago

Original comment by krass...@googlemail.com on 21 Mar 2011 at 10:14

GoogleCodeExporter commented 8 years ago
See 
http://code.google.com/p/grails-jaxrs/wiki/AdvancedFeatures#Integration_testing

Original comment by krass...@googlemail.com on 23 Mar 2011 at 11:51