Community
Participate
Working Groups
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.
Created attachment 197765 [details] GitConfigHandlerV1.handleGet(...) with source code annot's
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.
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.
Ok, updated (the same branch).
Next update, fixed issues mentioned in the comments at github. https://github.com/pjanik/orion.server/commits/bug349014
See my comments here: https://github.com/pjanik/orion.server/commit/3e3844a617ebdedd2b40c6c3b6556fc3e73df92f#bundles/org.eclipse.orion.server.git/src/org/eclipse/orion/server/git/servlets/GitConfigHandlerV1.java-P3
Updated. https://github.com/pjanik/orion.server/commits/bug349014
Fixed with http://git.eclipse.org/c/e4/org.eclipse.orion.server.git/commit/?id=6808ca00abde5f7df9c6c3c09f8c0921833107a5.