Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 349014

Summary: [server] Add test for GET /gitapi/config/{key}/clone/file/{path}
Product: [ECD] Orion Reporter: Tomasz Zarna <tomasz.zarna>
Component: ClientAssignee: Tomasz Zarna <tomasz.zarna>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: janikpiotrek, Szymon.Brandys
Version: 0.2Keywords: test
Target Milestone: 0.2Flags: tomasz.zarna: review+
malgorzata.tomczyk: review+
Hardware: PC   
OS: Windows XP   
Whiteboard: gsoc2011
Bug Depends on:    
Bug Blocks: 345399    
Attachments:
Description Flags
GitConfigHandlerV1.handleGet(...) with source code annot's none

Description Tomasz Zarna CLA 2011-06-10 07:53:50 EDT
Running EclEmma against org.eclipse.orion.server.git proved that the code coverage is pretty good. These are few places where the coverage could be improved, one of them is org.eclipse.orion.server.git.servlets.GitConfigHandlerV1.handleGet(HttpServletRequest, HttpServletResponse, String). See the attached screenshot for details.
Comment 1 Tomasz Zarna CLA 2011-06-10 07:55:05 EDT
Created attachment 197765 [details]
GitConfigHandlerV1.handleGet(...) with source code annot's
Comment 2 Piotr Janik CLA 2011-06-10 10:21:22 EDT
Right. Simple fix: https://github.com/pjanik/orion.server/tree/bug349014

I wrote all this code and have the rights to contribute it to Eclipse under the eclipse.org web site terms of use.
Comment 3 Tomasz Zarna CLA 2011-06-13 07:17:42 EDT
First of all, I would split the testSetAndUnsetConfigValues method into separate test cases, just like we're trying to do in other tests. For example, I would extract tests for:
* getting list of options
* getting a single option
* adding/setting values with POST
* updating values with PUT
* removing/unsetting options with DELETE
* trying to set a value for non-existing option
* and so on...

Don't get me wrong, the code is fine, but having a separate test method for each scenario makes the results clearer in case of a failure.
Comment 4 Piotr Janik CLA 2011-06-13 08:42:54 EDT
Ok, updated (the same branch).
Comment 5 Piotr Janik CLA 2011-06-13 11:35:07 EDT
Next update, fixed issues mentioned in the comments at github.

https://github.com/pjanik/orion.server/commits/bug349014
Comment 7 Piotr Janik CLA 2011-06-15 12:19:02 EDT
Updated.
https://github.com/pjanik/orion.server/commits/bug349014