Thanks.  I'll check it out. 

>Sam Bao | Software Engineer | Cerner Corporation | 816.201.8242 | [EMAIL 
>PROTECTED] | www.cerner.com

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
Sent: Friday, April 11, 2008 6:07 AM
To: discuss@restlet.tigris.org
Subject: Re: Unit testing code coverage

Hi Sam,

it is available in the Restlet SVN trunk, module org.restlet.test, class 
org.restlet.test.jaxrs.services.tests.JaxRsTestCase together with the classes 
in package org.restlet.test.jaxrs.server

you can call e.g. Applicaton.handle(Request, Response). You must ensure that 
the Reference in the request with its baseRef is correct (same as if it somes 
from the net). If you need the host header, you have to set it manually before 
calling the application.

I hope that I can refactor this to have a class independent of JAX-RS today 
afternoon or on monday.

best regards
   Stephan

Bao,Sam schrieb:
> I had thought about not using the client, and just calling the methods on the 
> resources directly, but I was wanting to test as if going through a browser.  
> Is your JAX-RS test classes available for studying somewhere?
>
> I'm not just checking to make sure all code is covered, but rather I'd like 
> to see how much is covered, and how much is not by my current tests.  It's a 
> practice we try to promote so that there's not a lot of wasteful code.
>
> If I wanted to run the app as a server, and test using a client, is there any 
> good methods for doing that?
>
> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
> Sent: Thursday, April 10, 2008 5:18 PM
> To: discuss@restlet.tigris.org
> Subject: Re: Unit testing code coverage
>
> Hi Sam,
>
> as you perhaps know, I'm implementing the JAX-RS extension and wrote a lot of 
> unit tests. But I do not check, if all code is covered.
>
> BTW: It's not required that you use a real TCP client for testing: You can 
> give the application directly your requests. So you save a LOT of time, 
> because you save the time to start the TCP-ServerSocket, serializing requests 
> and so on.
> I should refactor that out of my JAX-RS test case class, because it is 
> combined with services for JAX-RS testing.
>
> best regards
>    Stephan
>
> Bao,Sam schrieb:
>   
>> I was wondering how are you guys unit testing for code coverage with restlet 
>> applications and resources?  I ask this because, I've tried using a couple 
>> of different code coverage eclipse plugins, and using restlet Client over 
>> Http, I can unit test my application, but I can not achieve any kind of code 
>> coverage.  I've googled around on this topic and did not see anything 
>> helpful.  So, what are you guys doing?
>>   
>>     
>
> ----------------------------------------------------------------------
> CONFIDENTIALITY NOTICE This message and any included attachments are from 
> Cerner Corporation and are intended only for the addressee. The information 
> contained in this message is confidential and may constitute inside or 
> non-public information under international, federal, or state securities 
> laws. Unauthorized forwarding, printing, copying, distribution, or use of 
> such information is strictly prohibited and may be unlawful. If you are not 
> the addressee, please promptly delete this message and notify the sender of 
> the delivery error by e-mail or you may call Cerner's corporate offices in 
> Kansas City, Missouri, U.S.A at (+1) (816)221-1024.
>   

----------------------------------------------------------------------
CONFIDENTIALITY NOTICE This message and any included attachments are from 
Cerner Corporation and are intended only for the addressee. The information 
contained in this message is confidential and may constitute inside or 
non-public information under international, federal, or state securities laws. 
Unauthorized forwarding, printing, copying, distribution, or use of such 
information is strictly prohibited and may be unlawful. If you are not the 
addressee, please promptly delete this message and notify the sender of the 
delivery error by e-mail or you may call Cerner's corporate offices in Kansas 
City, Missouri, U.S.A at (+1) (816)221-1024.

Reply via email to