]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-5382 Drop Java WS client library
authorSimon Brandhof <simon.brandhof@sonarsource.com>
Thu, 21 May 2015 07:50:35 +0000 (09:50 +0200)
committerSimon Brandhof <simon.brandhof@sonarsource.com>
Thu, 21 May 2015 07:50:35 +0000 (09:50 +0200)
274 files changed:
server/pom.xml
server/sonar-server/pom.xml
server/sonar-ws-client/pom.xml [deleted file]
server/sonar-ws-client/src/main/java/org/sonar/wsclient/Host.java [deleted file]
server/sonar-ws-client/src/main/java/org/sonar/wsclient/JdkUtils.java [deleted file]
server/sonar-ws-client/src/main/java/org/sonar/wsclient/Sonar.java [deleted file]
server/sonar-ws-client/src/main/java/org/sonar/wsclient/SonarClient.java [deleted file]
server/sonar-ws-client/src/main/java/org/sonar/wsclient/base/HttpException.java [deleted file]
server/sonar-ws-client/src/main/java/org/sonar/wsclient/base/Paging.java [deleted file]
server/sonar-ws-client/src/main/java/org/sonar/wsclient/base/package-info.java [deleted file]
server/sonar-ws-client/src/main/java/org/sonar/wsclient/component/Component.java [deleted file]
server/sonar-ws-client/src/main/java/org/sonar/wsclient/component/package-info.java [deleted file]
server/sonar-ws-client/src/main/java/org/sonar/wsclient/connectors/ConnectionException.java [deleted file]
server/sonar-ws-client/src/main/java/org/sonar/wsclient/connectors/Connector.java [deleted file]
server/sonar-ws-client/src/main/java/org/sonar/wsclient/connectors/ConnectorFactory.java [deleted file]
server/sonar-ws-client/src/main/java/org/sonar/wsclient/connectors/HttpClient3Connector.java [deleted file]
server/sonar-ws-client/src/main/java/org/sonar/wsclient/connectors/HttpClient4Connector.java [deleted file]
server/sonar-ws-client/src/main/java/org/sonar/wsclient/connectors/package-info.java [deleted file]
server/sonar-ws-client/src/main/java/org/sonar/wsclient/internal/EncodingUtils.java [deleted file]
server/sonar-ws-client/src/main/java/org/sonar/wsclient/internal/HttpRequestFactory.java [deleted file]
server/sonar-ws-client/src/main/java/org/sonar/wsclient/internal/package-info.java [deleted file]
server/sonar-ws-client/src/main/java/org/sonar/wsclient/issue/ActionPlan.java [deleted file]
server/sonar-ws-client/src/main/java/org/sonar/wsclient/issue/ActionPlanClient.java [deleted file]
server/sonar-ws-client/src/main/java/org/sonar/wsclient/issue/ActionPlanQuery.java [deleted file]
server/sonar-ws-client/src/main/java/org/sonar/wsclient/issue/BulkChange.java [deleted file]
server/sonar-ws-client/src/main/java/org/sonar/wsclient/issue/BulkChangeQuery.java [deleted file]
server/sonar-ws-client/src/main/java/org/sonar/wsclient/issue/Issue.java [deleted file]
server/sonar-ws-client/src/main/java/org/sonar/wsclient/issue/IssueChange.java [deleted file]
server/sonar-ws-client/src/main/java/org/sonar/wsclient/issue/IssueChangeDiff.java [deleted file]
server/sonar-ws-client/src/main/java/org/sonar/wsclient/issue/IssueClient.java [deleted file]
server/sonar-ws-client/src/main/java/org/sonar/wsclient/issue/IssueComment.java [deleted file]
server/sonar-ws-client/src/main/java/org/sonar/wsclient/issue/IssueQuery.java [deleted file]
server/sonar-ws-client/src/main/java/org/sonar/wsclient/issue/Issues.java [deleted file]
server/sonar-ws-client/src/main/java/org/sonar/wsclient/issue/NewActionPlan.java [deleted file]
server/sonar-ws-client/src/main/java/org/sonar/wsclient/issue/NewIssue.java [deleted file]
server/sonar-ws-client/src/main/java/org/sonar/wsclient/issue/UpdateActionPlan.java [deleted file]
server/sonar-ws-client/src/main/java/org/sonar/wsclient/issue/internal/DefaultActionPlan.java [deleted file]
server/sonar-ws-client/src/main/java/org/sonar/wsclient/issue/internal/DefaultActionPlanClient.java [deleted file]
server/sonar-ws-client/src/main/java/org/sonar/wsclient/issue/internal/DefaultBulkChange.java [deleted file]
server/sonar-ws-client/src/main/java/org/sonar/wsclient/issue/internal/DefaultIssue.java [deleted file]
server/sonar-ws-client/src/main/java/org/sonar/wsclient/issue/internal/DefaultIssueChange.java [deleted file]
server/sonar-ws-client/src/main/java/org/sonar/wsclient/issue/internal/DefaultIssueChangeDiff.java [deleted file]
server/sonar-ws-client/src/main/java/org/sonar/wsclient/issue/internal/DefaultIssueClient.java [deleted file]
server/sonar-ws-client/src/main/java/org/sonar/wsclient/issue/internal/DefaultIssueComment.java [deleted file]
server/sonar-ws-client/src/main/java/org/sonar/wsclient/issue/internal/DefaultIssues.java [deleted file]
server/sonar-ws-client/src/main/java/org/sonar/wsclient/issue/internal/IssueJsonParser.java [deleted file]
server/sonar-ws-client/src/main/java/org/sonar/wsclient/issue/internal/package-info.java [deleted file]
server/sonar-ws-client/src/main/java/org/sonar/wsclient/issue/package-info.java [deleted file]
server/sonar-ws-client/src/main/java/org/sonar/wsclient/package-info.java [deleted file]
server/sonar-ws-client/src/main/java/org/sonar/wsclient/permissions/PermissionClient.java [deleted file]
server/sonar-ws-client/src/main/java/org/sonar/wsclient/permissions/PermissionParameters.java [deleted file]
server/sonar-ws-client/src/main/java/org/sonar/wsclient/permissions/internal/DefaultPermissionClient.java [deleted file]
server/sonar-ws-client/src/main/java/org/sonar/wsclient/permissions/internal/package-info.java [deleted file]
server/sonar-ws-client/src/main/java/org/sonar/wsclient/permissions/package-info.java [deleted file]
server/sonar-ws-client/src/main/java/org/sonar/wsclient/project/NewProject.java [deleted file]
server/sonar-ws-client/src/main/java/org/sonar/wsclient/project/Project.java [deleted file]
server/sonar-ws-client/src/main/java/org/sonar/wsclient/project/ProjectClient.java [deleted file]
server/sonar-ws-client/src/main/java/org/sonar/wsclient/project/internal/DefaultProject.java [deleted file]
server/sonar-ws-client/src/main/java/org/sonar/wsclient/project/internal/DefaultProjectClient.java [deleted file]
server/sonar-ws-client/src/main/java/org/sonar/wsclient/project/internal/package-info.java [deleted file]
server/sonar-ws-client/src/main/java/org/sonar/wsclient/project/package-info.java [deleted file]
server/sonar-ws-client/src/main/java/org/sonar/wsclient/qprofile/QProfileClient.java [deleted file]
server/sonar-ws-client/src/main/java/org/sonar/wsclient/qprofile/QProfileResult.java [deleted file]
server/sonar-ws-client/src/main/java/org/sonar/wsclient/qprofile/internal/DefaultQProfileClient.java [deleted file]
server/sonar-ws-client/src/main/java/org/sonar/wsclient/qprofile/internal/DefaultQProfileResult.java [deleted file]
server/sonar-ws-client/src/main/java/org/sonar/wsclient/qualitygate/NewCondition.java [deleted file]
server/sonar-ws-client/src/main/java/org/sonar/wsclient/qualitygate/QualityGate.java [deleted file]
server/sonar-ws-client/src/main/java/org/sonar/wsclient/qualitygate/QualityGateClient.java [deleted file]
server/sonar-ws-client/src/main/java/org/sonar/wsclient/qualitygate/QualityGateCondition.java [deleted file]
server/sonar-ws-client/src/main/java/org/sonar/wsclient/qualitygate/QualityGateDetails.java [deleted file]
server/sonar-ws-client/src/main/java/org/sonar/wsclient/qualitygate/QualityGates.java [deleted file]
server/sonar-ws-client/src/main/java/org/sonar/wsclient/qualitygate/UpdateCondition.java [deleted file]
server/sonar-ws-client/src/main/java/org/sonar/wsclient/qualitygate/internal/DefaultQualityGate.java [deleted file]
server/sonar-ws-client/src/main/java/org/sonar/wsclient/qualitygate/internal/DefaultQualityGateClient.java [deleted file]
server/sonar-ws-client/src/main/java/org/sonar/wsclient/qualitygate/internal/DefaultQualityGateCondition.java [deleted file]
server/sonar-ws-client/src/main/java/org/sonar/wsclient/qualitygate/internal/DefaultQualityGateDetails.java [deleted file]
server/sonar-ws-client/src/main/java/org/sonar/wsclient/qualitygate/internal/DefaultQualityGates.java [deleted file]
server/sonar-ws-client/src/main/java/org/sonar/wsclient/rule/Rule.java [deleted file]
server/sonar-ws-client/src/main/java/org/sonar/wsclient/rule/package-info.java [deleted file]
server/sonar-ws-client/src/main/java/org/sonar/wsclient/services/AbstractQuery.java [deleted file]
server/sonar-ws-client/src/main/java/org/sonar/wsclient/services/Authentication.java [deleted file]
server/sonar-ws-client/src/main/java/org/sonar/wsclient/services/AuthenticationQuery.java [deleted file]
server/sonar-ws-client/src/main/java/org/sonar/wsclient/services/CreateQuery.java [deleted file]
server/sonar-ws-client/src/main/java/org/sonar/wsclient/services/DeleteQuery.java [deleted file]
server/sonar-ws-client/src/main/java/org/sonar/wsclient/services/Event.java [deleted file]
server/sonar-ws-client/src/main/java/org/sonar/wsclient/services/EventCreateQuery.java [deleted file]
server/sonar-ws-client/src/main/java/org/sonar/wsclient/services/EventQuery.java [deleted file]
server/sonar-ws-client/src/main/java/org/sonar/wsclient/services/Favourite.java [deleted file]
server/sonar-ws-client/src/main/java/org/sonar/wsclient/services/FavouriteCreateQuery.java [deleted file]
server/sonar-ws-client/src/main/java/org/sonar/wsclient/services/FavouriteDeleteQuery.java [deleted file]
server/sonar-ws-client/src/main/java/org/sonar/wsclient/services/FavouriteQuery.java [deleted file]
server/sonar-ws-client/src/main/java/org/sonar/wsclient/services/ManualMeasure.java [deleted file]
server/sonar-ws-client/src/main/java/org/sonar/wsclient/services/ManualMeasureCreateQuery.java [deleted file]
server/sonar-ws-client/src/main/java/org/sonar/wsclient/services/ManualMeasureDeleteQuery.java [deleted file]
server/sonar-ws-client/src/main/java/org/sonar/wsclient/services/ManualMeasureQuery.java [deleted file]
server/sonar-ws-client/src/main/java/org/sonar/wsclient/services/Measure.java [deleted file]
server/sonar-ws-client/src/main/java/org/sonar/wsclient/services/Metric.java [deleted file]
server/sonar-ws-client/src/main/java/org/sonar/wsclient/services/MetricCreateQuery.java [deleted file]
server/sonar-ws-client/src/main/java/org/sonar/wsclient/services/MetricDeleteQuery.java [deleted file]
server/sonar-ws-client/src/main/java/org/sonar/wsclient/services/MetricQuery.java [deleted file]
server/sonar-ws-client/src/main/java/org/sonar/wsclient/services/MetricUpdateQuery.java [deleted file]
server/sonar-ws-client/src/main/java/org/sonar/wsclient/services/Model.java [deleted file]
server/sonar-ws-client/src/main/java/org/sonar/wsclient/services/Plugin.java [deleted file]
server/sonar-ws-client/src/main/java/org/sonar/wsclient/services/Profile.java [deleted file]
server/sonar-ws-client/src/main/java/org/sonar/wsclient/services/ProfileQuery.java [deleted file]
server/sonar-ws-client/src/main/java/org/sonar/wsclient/services/Property.java [deleted file]
server/sonar-ws-client/src/main/java/org/sonar/wsclient/services/PropertyCreateQuery.java [deleted file]
server/sonar-ws-client/src/main/java/org/sonar/wsclient/services/PropertyDeleteQuery.java [deleted file]
server/sonar-ws-client/src/main/java/org/sonar/wsclient/services/PropertyQuery.java [deleted file]
server/sonar-ws-client/src/main/java/org/sonar/wsclient/services/PropertyUpdateQuery.java [deleted file]
server/sonar-ws-client/src/main/java/org/sonar/wsclient/services/Query.java [deleted file]
server/sonar-ws-client/src/main/java/org/sonar/wsclient/services/Resource.java [deleted file]
server/sonar-ws-client/src/main/java/org/sonar/wsclient/services/ResourceQuery.java [deleted file]
server/sonar-ws-client/src/main/java/org/sonar/wsclient/services/ResourceSearchQuery.java [deleted file]
server/sonar-ws-client/src/main/java/org/sonar/wsclient/services/ResourceSearchResult.java [deleted file]
server/sonar-ws-client/src/main/java/org/sonar/wsclient/services/Server.java [deleted file]
server/sonar-ws-client/src/main/java/org/sonar/wsclient/services/ServerQuery.java [deleted file]
server/sonar-ws-client/src/main/java/org/sonar/wsclient/services/ServerSetup.java [deleted file]
server/sonar-ws-client/src/main/java/org/sonar/wsclient/services/ServerSetupQuery.java [deleted file]
server/sonar-ws-client/src/main/java/org/sonar/wsclient/services/Source.java [deleted file]
server/sonar-ws-client/src/main/java/org/sonar/wsclient/services/SourceQuery.java [deleted file]
server/sonar-ws-client/src/main/java/org/sonar/wsclient/services/TimeMachine.java [deleted file]
server/sonar-ws-client/src/main/java/org/sonar/wsclient/services/TimeMachineCell.java [deleted file]
server/sonar-ws-client/src/main/java/org/sonar/wsclient/services/TimeMachineColumn.java [deleted file]
server/sonar-ws-client/src/main/java/org/sonar/wsclient/services/TimeMachineQuery.java [deleted file]
server/sonar-ws-client/src/main/java/org/sonar/wsclient/services/UpdateCenterQuery.java [deleted file]
server/sonar-ws-client/src/main/java/org/sonar/wsclient/services/UpdateQuery.java [deleted file]
server/sonar-ws-client/src/main/java/org/sonar/wsclient/services/UserPropertyCreateQuery.java [deleted file]
server/sonar-ws-client/src/main/java/org/sonar/wsclient/services/UserPropertyDeleteQuery.java [deleted file]
server/sonar-ws-client/src/main/java/org/sonar/wsclient/services/UserPropertyQuery.java [deleted file]
server/sonar-ws-client/src/main/java/org/sonar/wsclient/services/WSUtils.java [deleted file]
server/sonar-ws-client/src/main/java/org/sonar/wsclient/services/package-info.java [deleted file]
server/sonar-ws-client/src/main/java/org/sonar/wsclient/system/Migration.java [deleted file]
server/sonar-ws-client/src/main/java/org/sonar/wsclient/system/SystemClient.java [deleted file]
server/sonar-ws-client/src/main/java/org/sonar/wsclient/system/internal/DefaultMigration.java [deleted file]
server/sonar-ws-client/src/main/java/org/sonar/wsclient/system/internal/DefaultSystemClient.java [deleted file]
server/sonar-ws-client/src/main/java/org/sonar/wsclient/system/internal/package-info.java [deleted file]
server/sonar-ws-client/src/main/java/org/sonar/wsclient/system/package-info.java [deleted file]
server/sonar-ws-client/src/main/java/org/sonar/wsclient/unmarshallers/AbstractUnmarshaller.java [deleted file]
server/sonar-ws-client/src/main/java/org/sonar/wsclient/unmarshallers/AuthenticationUnmarshaller.java [deleted file]
server/sonar-ws-client/src/main/java/org/sonar/wsclient/unmarshallers/EventUnmarshaller.java [deleted file]
server/sonar-ws-client/src/main/java/org/sonar/wsclient/unmarshallers/FavouriteUnmarshaller.java [deleted file]
server/sonar-ws-client/src/main/java/org/sonar/wsclient/unmarshallers/JsonUtils.java [deleted file]
server/sonar-ws-client/src/main/java/org/sonar/wsclient/unmarshallers/ManualMeasureUnmarshaller.java [deleted file]
server/sonar-ws-client/src/main/java/org/sonar/wsclient/unmarshallers/MetricUnmarshaller.java [deleted file]
server/sonar-ws-client/src/main/java/org/sonar/wsclient/unmarshallers/PluginUnmarshaller.java [deleted file]
server/sonar-ws-client/src/main/java/org/sonar/wsclient/unmarshallers/ProfileUnmarshaller.java [deleted file]
server/sonar-ws-client/src/main/java/org/sonar/wsclient/unmarshallers/PropertyUnmarshaller.java [deleted file]
server/sonar-ws-client/src/main/java/org/sonar/wsclient/unmarshallers/ResourceSearchUnmarshaller.java [deleted file]
server/sonar-ws-client/src/main/java/org/sonar/wsclient/unmarshallers/ResourceUnmarshaller.java [deleted file]
server/sonar-ws-client/src/main/java/org/sonar/wsclient/unmarshallers/ServerSetupUnmarshaller.java [deleted file]
server/sonar-ws-client/src/main/java/org/sonar/wsclient/unmarshallers/ServerUnmarshaller.java [deleted file]
server/sonar-ws-client/src/main/java/org/sonar/wsclient/unmarshallers/SourceUnmarshaller.java [deleted file]
server/sonar-ws-client/src/main/java/org/sonar/wsclient/unmarshallers/TimeMachineUnmarshaller.java [deleted file]
server/sonar-ws-client/src/main/java/org/sonar/wsclient/unmarshallers/UnmarshalException.java [deleted file]
server/sonar-ws-client/src/main/java/org/sonar/wsclient/unmarshallers/Unmarshaller.java [deleted file]
server/sonar-ws-client/src/main/java/org/sonar/wsclient/unmarshallers/Unmarshallers.java [deleted file]
server/sonar-ws-client/src/main/java/org/sonar/wsclient/unmarshallers/package-info.java [deleted file]
server/sonar-ws-client/src/main/java/org/sonar/wsclient/user/User.java [deleted file]
server/sonar-ws-client/src/main/java/org/sonar/wsclient/user/package-info.java [deleted file]
server/sonar-ws-client/src/test/java/org/sonar/wsclient/BadRulesServlet.java [deleted file]
server/sonar-ws-client/src/test/java/org/sonar/wsclient/EmptyServlet.java [deleted file]
server/sonar-ws-client/src/test/java/org/sonar/wsclient/MetricServlet.java [deleted file]
server/sonar-ws-client/src/test/java/org/sonar/wsclient/MockHttpServer.java [deleted file]
server/sonar-ws-client/src/test/java/org/sonar/wsclient/MockHttpServerInterceptor.java [deleted file]
server/sonar-ws-client/src/test/java/org/sonar/wsclient/ServerServlet.java [deleted file]
server/sonar-ws-client/src/test/java/org/sonar/wsclient/SonarClientTest.java [deleted file]
server/sonar-ws-client/src/test/java/org/sonar/wsclient/SonarTest.java [deleted file]
server/sonar-ws-client/src/test/java/org/sonar/wsclient/base/HttpExceptionTest.java [deleted file]
server/sonar-ws-client/src/test/java/org/sonar/wsclient/internal/EncodingUtilsTest.java [deleted file]
server/sonar-ws-client/src/test/java/org/sonar/wsclient/internal/HttpRequestFactoryTest.java [deleted file]
server/sonar-ws-client/src/test/java/org/sonar/wsclient/issue/ActionPlanQueryTest.java [deleted file]
server/sonar-ws-client/src/test/java/org/sonar/wsclient/issue/BulkChangeQueryTest.java [deleted file]
server/sonar-ws-client/src/test/java/org/sonar/wsclient/issue/IssueQueryTest.java [deleted file]
server/sonar-ws-client/src/test/java/org/sonar/wsclient/issue/NewIssueTest.java [deleted file]
server/sonar-ws-client/src/test/java/org/sonar/wsclient/issue/internal/DefaultActionPlanClientTest.java [deleted file]
server/sonar-ws-client/src/test/java/org/sonar/wsclient/issue/internal/DefaultIssueClientTest.java [deleted file]
server/sonar-ws-client/src/test/java/org/sonar/wsclient/issue/internal/IssueJsonParserTest.java [deleted file]
server/sonar-ws-client/src/test/java/org/sonar/wsclient/permissions/DefaultPermissionClientTest.java [deleted file]
server/sonar-ws-client/src/test/java/org/sonar/wsclient/project/NewProjectTest.java [deleted file]
server/sonar-ws-client/src/test/java/org/sonar/wsclient/project/internal/DefaultProjectClientTest.java [deleted file]
server/sonar-ws-client/src/test/java/org/sonar/wsclient/qprofile/internal/DefaultQProfileClientTest.java [deleted file]
server/sonar-ws-client/src/test/java/org/sonar/wsclient/qualitygate/internal/DefaultQualityGateClientTest.java [deleted file]
server/sonar-ws-client/src/test/java/org/sonar/wsclient/services/AbstractQueryTest.java [deleted file]
server/sonar-ws-client/src/test/java/org/sonar/wsclient/services/AuthenticationQueryTest.java [deleted file]
server/sonar-ws-client/src/test/java/org/sonar/wsclient/services/AuthenticationTest.java [deleted file]
server/sonar-ws-client/src/test/java/org/sonar/wsclient/services/EventQueryTest.java [deleted file]
server/sonar-ws-client/src/test/java/org/sonar/wsclient/services/ManualMeasureCreateQueryTest.java [deleted file]
server/sonar-ws-client/src/test/java/org/sonar/wsclient/services/ManualMeasureDeleteQueryTest.java [deleted file]
server/sonar-ws-client/src/test/java/org/sonar/wsclient/services/ManualMeasureQueryTest.java [deleted file]
server/sonar-ws-client/src/test/java/org/sonar/wsclient/services/MeasureTest.java [deleted file]
server/sonar-ws-client/src/test/java/org/sonar/wsclient/services/MetricCreateQueryTest.java [deleted file]
server/sonar-ws-client/src/test/java/org/sonar/wsclient/services/MetricDeleteQueryTest.java [deleted file]
server/sonar-ws-client/src/test/java/org/sonar/wsclient/services/MetricQueryTest.java [deleted file]
server/sonar-ws-client/src/test/java/org/sonar/wsclient/services/MetricUpdateQueryTest.java [deleted file]
server/sonar-ws-client/src/test/java/org/sonar/wsclient/services/PropertyCreateQueryTest.java [deleted file]
server/sonar-ws-client/src/test/java/org/sonar/wsclient/services/PropertyDeleteQueryTest.java [deleted file]
server/sonar-ws-client/src/test/java/org/sonar/wsclient/services/PropertyQueryTest.java [deleted file]
server/sonar-ws-client/src/test/java/org/sonar/wsclient/services/QueryTestCase.java [deleted file]
server/sonar-ws-client/src/test/java/org/sonar/wsclient/services/ResourceQueryTest.java [deleted file]
server/sonar-ws-client/src/test/java/org/sonar/wsclient/services/ResourceSearchQueryTest.java [deleted file]
server/sonar-ws-client/src/test/java/org/sonar/wsclient/services/ResourceTest.java [deleted file]
server/sonar-ws-client/src/test/java/org/sonar/wsclient/services/ServerQueryTest.java [deleted file]
server/sonar-ws-client/src/test/java/org/sonar/wsclient/services/ServerSetupQueryTest.java [deleted file]
server/sonar-ws-client/src/test/java/org/sonar/wsclient/services/SourceQueryTest.java [deleted file]
server/sonar-ws-client/src/test/java/org/sonar/wsclient/services/TimeMachineQueryTest.java [deleted file]
server/sonar-ws-client/src/test/java/org/sonar/wsclient/services/UpdateCenterQueryTest.java [deleted file]
server/sonar-ws-client/src/test/java/org/sonar/wsclient/services/UserPropertyCreateQueryTest.java [deleted file]
server/sonar-ws-client/src/test/java/org/sonar/wsclient/services/UserPropertyDeleteQueryTest.java [deleted file]
server/sonar-ws-client/src/test/java/org/sonar/wsclient/system/internal/DefaultSystemClientTest.java [deleted file]
server/sonar-ws-client/src/test/java/org/sonar/wsclient/unmarshallers/AuthenticationUnmarshallerTest.java [deleted file]
server/sonar-ws-client/src/test/java/org/sonar/wsclient/unmarshallers/EventUnmarshallerTest.java [deleted file]
server/sonar-ws-client/src/test/java/org/sonar/wsclient/unmarshallers/JsonUtilsTest.java [deleted file]
server/sonar-ws-client/src/test/java/org/sonar/wsclient/unmarshallers/ManualMeasureUnmarshallerTest.java [deleted file]
server/sonar-ws-client/src/test/java/org/sonar/wsclient/unmarshallers/MetricUnmarshallerTest.java [deleted file]
server/sonar-ws-client/src/test/java/org/sonar/wsclient/unmarshallers/PluginUnmarshallerTest.java [deleted file]
server/sonar-ws-client/src/test/java/org/sonar/wsclient/unmarshallers/ProfileUnmarshallerTest.java [deleted file]
server/sonar-ws-client/src/test/java/org/sonar/wsclient/unmarshallers/PropertyUnmarshallerTest.java [deleted file]
server/sonar-ws-client/src/test/java/org/sonar/wsclient/unmarshallers/ResourceSearchUnmarshallerTest.java [deleted file]
server/sonar-ws-client/src/test/java/org/sonar/wsclient/unmarshallers/ResourceUnmarshallerTest.java [deleted file]
server/sonar-ws-client/src/test/java/org/sonar/wsclient/unmarshallers/ServerSetupUnmarshallerTest.java [deleted file]
server/sonar-ws-client/src/test/java/org/sonar/wsclient/unmarshallers/ServerUnmarshallerTest.java [deleted file]
server/sonar-ws-client/src/test/java/org/sonar/wsclient/unmarshallers/SourceUnmarshallerTest.java [deleted file]
server/sonar-ws-client/src/test/java/org/sonar/wsclient/unmarshallers/TimeMachineUnmarshallerTest.java [deleted file]
server/sonar-ws-client/src/test/java/org/sonar/wsclient/unmarshallers/UnmarshallerTestCase.java [deleted file]
server/sonar-ws-client/src/test/java/org/sonar/wsclient/unmarshallers/UnmarshallersTest.java [deleted file]
server/sonar-ws-client/src/test/resources/authentication/authentication_invalid.json [deleted file]
server/sonar-ws-client/src/test/resources/authentication/authentication_valid.json [deleted file]
server/sonar-ws-client/src/test/resources/dependencies/many.json [deleted file]
server/sonar-ws-client/src/test/resources/dependencies/single.json [deleted file]
server/sonar-ws-client/src/test/resources/dependency_tree/many_depths.json [deleted file]
server/sonar-ws-client/src/test/resources/dependency_tree/single_depth.json [deleted file]
server/sonar-ws-client/src/test/resources/events/events.json [deleted file]
server/sonar-ws-client/src/test/resources/manual_measures/all_measures.json [deleted file]
server/sonar-ws-client/src/test/resources/manual_measures/single_measure.json [deleted file]
server/sonar-ws-client/src/test/resources/metrics/many_metrics.json [deleted file]
server/sonar-ws-client/src/test/resources/metrics/one_metric.json [deleted file]
server/sonar-ws-client/src/test/resources/org/sonar/wsclient/issue/internal/DefaultIssueClientTest/add_comment_result.json [deleted file]
server/sonar-ws-client/src/test/resources/org/sonar/wsclient/issue/internal/IssueJsonParserTest/bulk-change.json [deleted file]
server/sonar-ws-client/src/test/resources/org/sonar/wsclient/issue/internal/IssueJsonParserTest/changelog-with-only-new-technical-debt.json [deleted file]
server/sonar-ws-client/src/test/resources/org/sonar/wsclient/issue/internal/IssueJsonParserTest/changelog-with-technical-debt.json [deleted file]
server/sonar-ws-client/src/test/resources/org/sonar/wsclient/issue/internal/IssueJsonParserTest/changelog.json [deleted file]
server/sonar-ws-client/src/test/resources/org/sonar/wsclient/issue/internal/IssueJsonParserTest/empty.json [deleted file]
server/sonar-ws-client/src/test/resources/org/sonar/wsclient/issue/internal/IssueJsonParserTest/getTransitions.json [deleted file]
server/sonar-ws-client/src/test/resources/org/sonar/wsclient/issue/internal/IssueJsonParserTest/issue-with-action-plans.json [deleted file]
server/sonar-ws-client/src/test/resources/org/sonar/wsclient/issue/internal/IssueJsonParserTest/issue-with-comments.json [deleted file]
server/sonar-ws-client/src/test/resources/org/sonar/wsclient/issue/internal/IssueJsonParserTest/issue-with-components.json [deleted file]
server/sonar-ws-client/src/test/resources/org/sonar/wsclient/issue/internal/IssueJsonParserTest/issue-with-projects.json [deleted file]
server/sonar-ws-client/src/test/resources/org/sonar/wsclient/issue/internal/IssueJsonParserTest/issue-with-technical-debt.json [deleted file]
server/sonar-ws-client/src/test/resources/org/sonar/wsclient/issue/internal/IssueJsonParserTest/issue-with-users.json [deleted file]
server/sonar-ws-client/src/test/resources/org/sonar/wsclient/issue/internal/IssueJsonParserTest/search.json [deleted file]
server/sonar-ws-client/src/test/resources/plugins/plugins.json [deleted file]
server/sonar-ws-client/src/test/resources/profiles/profile.json [deleted file]
server/sonar-ws-client/src/test/resources/properties/many.json [deleted file]
server/sonar-ws-client/src/test/resources/properties/single.json [deleted file]
server/sonar-ws-client/src/test/resources/resources/many-resources-with-measures.json [deleted file]
server/sonar-ws-client/src/test/resources/resources/many-resources.json [deleted file]
server/sonar-ws-client/src/test/resources/resources/search.json [deleted file]
server/sonar-ws-client/src/test/resources/resources/single-resource-with-measures.json [deleted file]
server/sonar-ws-client/src/test/resources/resources/single-resource.json [deleted file]
server/sonar-ws-client/src/test/resources/server/server.json [deleted file]
server/sonar-ws-client/src/test/resources/server/status_missing.json [deleted file]
server/sonar-ws-client/src/test/resources/server_setup/ko.json [deleted file]
server/sonar-ws-client/src/test/resources/server_setup/ok.json [deleted file]
server/sonar-ws-client/src/test/resources/sources/from_line_to_line.json [deleted file]
server/sonar-ws-client/src/test/resources/sources/source.json [deleted file]
server/sonar-ws-client/src/test/resources/timemachine/null-values.json [deleted file]
server/sonar-ws-client/src/test/resources/timemachine/timemachine.json [deleted file]
server/sonar-ws-client/src/test/resources/timemachine/typed-values.json [deleted file]
server/sonar-ws-client/src/test/resources/violations/false-positive.json [deleted file]
server/sonar-ws-client/src/test/resources/violations/violation-with-incorrect-line.json [deleted file]
server/sonar-ws-client/src/test/resources/violations/violation-without-optional-fields.json [deleted file]
server/sonar-ws-client/src/test/resources/violations/violations.json [deleted file]
sonar-core/pom.xml

index b198220c6b3a351f0ef7bc281d7a102a5539b5ed..e7b1d8c88f042c968500ded73d480e1d055acf69 100644 (file)
@@ -16,7 +16,6 @@
     <module>sonar-search</module>
     <module>sonar-server</module>
     <module>sonar-web</module>
-    <module>sonar-ws-client</module>
     <module>sonar-server-benchmarks</module>
   </modules>
 </project>
index 5f34c60c1b7c9d16a87e6eecbdd6b28c679262f4..d7eee268b0c4a89e5f3283ab049ec55a45d5dcba 100644 (file)
       <groupId>org.codehaus.sonar</groupId>
       <artifactId>sonar-core</artifactId>
     </dependency>
-    <dependency>
-      <!--
-      This dependency of sonar-core must be repeated, even if it's not directly
-      used by sonar-server. For an unknown reason it conflicts with sonar-testing-harness
-      and is removed from distribution.
-      -->
-      <groupId>com.googlecode.json-simple</groupId>
-      <artifactId>json-simple</artifactId>
-    </dependency>
     <dependency>
       <groupId>org.codehaus.sonar</groupId>
       <artifactId>sonar-batch-protocol</artifactId>
diff --git a/server/sonar-ws-client/pom.xml b/server/sonar-ws-client/pom.xml
deleted file mode 100644 (file)
index 7f66d5e..0000000
+++ /dev/null
@@ -1,169 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
-  <modelVersion>4.0.0</modelVersion>
-  <parent>
-    <groupId>org.codehaus.sonar</groupId>
-    <artifactId>server</artifactId>
-    <version>5.2-SNAPSHOT</version>
-    <relativePath>..</relativePath>
-  </parent>
-  <artifactId>sonar-ws-client</artifactId>
-  <packaging>jar</packaging>
-  <name>SonarQube :: Web Service Client</name>
-  <description>Java Client Library for SonarQube Web Services</description>
-
-  <properties>
-    <httpclient4.version>4.2.2</httpclient4.version>
-  </properties>
-
-  <dependencies>
-    <!-- Don't forget to update configuration of the m-bundle-p (especially Require-Bundle)
-    according to changes you make on dependencies -->
-    <dependency>
-      <groupId>com.googlecode.json-simple</groupId>
-      <artifactId>json-simple</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>commons-httpclient</groupId>
-      <artifactId>commons-httpclient</artifactId>
-      <version>3.1</version>
-      <scope>provided</scope>
-    </dependency>
-    <dependency>
-      <groupId>org.apache.httpcomponents</groupId>
-      <artifactId>httpclient</artifactId>
-      <version>${httpclient4.version}</version>
-      <scope>provided</scope>
-    </dependency>
-    <dependency>
-      <groupId>com.github.kevinsawicki</groupId>
-      <artifactId>http-request</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>com.google.code.findbugs</groupId>
-      <artifactId>jsr305</artifactId>
-      <scope>provided</scope>
-    </dependency>
-
-    <!-- unit tests -->
-    <dependency>
-      <groupId>org.codehaus.sonar</groupId>
-      <artifactId>sonar-testing-harness</artifactId>
-      <scope>test</scope>
-    </dependency>
-    <dependency>
-      <groupId>javax.servlet</groupId>
-      <artifactId>javax.servlet-api</artifactId>
-      <scope>test</scope>
-    </dependency>
-    <dependency>
-      <groupId>commons-io</groupId>
-      <artifactId>commons-io</artifactId>
-      <scope>test</scope>
-    </dependency>
-    <dependency>
-      <groupId>org.slf4j</groupId>
-      <artifactId>slf4j-api</artifactId>
-      <scope>test</scope>
-    </dependency>
-    <dependency>
-      <groupId>org.slf4j</groupId>
-      <artifactId>jcl-over-slf4j</artifactId>
-      <scope>test</scope>
-    </dependency>
-    <dependency>
-      <groupId>ch.qos.logback</groupId>
-      <artifactId>logback-classic</artifactId>
-      <scope>test</scope>
-    </dependency>
-    <dependency>
-      <groupId>org.eclipse.jetty</groupId>
-      <artifactId>test-jetty-servlet</artifactId>
-      <scope>test</scope>
-    </dependency>
-    <dependency>
-      <groupId>com.google.guava</groupId>
-      <artifactId>guava</artifactId>
-      <scope>test</scope>
-    </dependency>
-  </dependencies>
-
-  <build>
-    <plugins>
-      <plugin>
-        <groupId>org.apache.maven.plugins</groupId>
-        <artifactId>maven-shade-plugin</artifactId>
-        <executions>
-          <execution>
-            <phase>package</phase>
-            <goals>
-              <goal>shade</goal>
-            </goals>
-            <configuration>
-              <createDependencyReducedPom>true</createDependencyReducedPom>
-              <minimizeJar>true</minimizeJar>
-              <relocations>
-                <relocation>
-                  <pattern>com.github.kevinsawicki.http</pattern>
-                  <shadedPattern>org.sonar.wsclient.kevinsawicki</shadedPattern>
-                </relocation>
-                <relocation>
-                  <pattern>org.json.simple</pattern>
-                  <shadedPattern>org.sonar.wsclient.jsonsimple</shadedPattern>
-                </relocation>
-              </relocations>
-            </configuration>
-          </execution>
-        </executions>
-      </plugin>
-      <plugin>
-        <groupId>org.apache.felix</groupId>
-        <artifactId>maven-bundle-plugin</artifactId>
-        <version>2.3.7</version>
-        <extensions>true</extensions>
-        <configuration>
-          <instructions>
-            <Import-Package>!*</Import-Package>
-            <Require-Bundle>org.apache.httpcomponents.httpclient;bundle-version="${httpclient4.version}";optional="true",
-              org.apache.httpcomponents.httpcore;bundle-version="${httpclient4.version}";optional="true"
-            </Require-Bundle>
-            <Export-Package>!.,org.sonar.wsclient,
-              org.sonar.wsclient.base,
-              org.sonar.wsclient.component,
-              org.sonar.wsclient.connectors,
-              org.sonar.wsclient.issue,
-              org.sonar.wsclient.rule,
-              org.sonar.wsclient.services,
-              org.sonar.wsclient.user
-            </Export-Package>
-            <Bundle-RequiredExecutionEnvironment>JavaSE-1.6</Bundle-RequiredExecutionEnvironment>
-          </instructions>
-        </configuration>
-        <executions>
-          <execution>
-            <id>bundle-manifest</id>
-            <phase>process-classes</phase>
-            <goals>
-              <goal>manifest</goal>
-            </goals>
-          </execution>
-        </executions>
-      </plugin>
-      <plugin>
-        <artifactId>maven-jar-plugin</artifactId>
-        <configuration>
-          <archive>
-            <manifestFile>${project.build.outputDirectory}/META-INF/MANIFEST.MF</manifestFile>
-          </archive>
-        </configuration>
-      </plugin>
-      <plugin>
-        <groupId>org.apache.maven.plugins</groupId>
-        <artifactId>maven-surefire-plugin</artifactId>
-        <configuration>
-          <skipTests>${skipServerTests}</skipTests>
-        </configuration>
-      </plugin>
-    </plugins>
-  </build>
-</project>
diff --git a/server/sonar-ws-client/src/main/java/org/sonar/wsclient/Host.java b/server/sonar-ws-client/src/main/java/org/sonar/wsclient/Host.java
deleted file mode 100644 (file)
index f88861e..0000000
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
- * SonarQube, open source software quality management tool.
- * Copyright (C) 2008-2014 SonarSource
- * mailto:contact AT sonarsource DOT com
- *
- * SonarQube is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * SonarQube is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-package org.sonar.wsclient;
-
-public class Host {
-
-  private String host;
-  private String username;
-  private String password;
-
-  public Host(String host) {
-    this.host = host;
-  }
-
-  public Host(String host, String username, String password) {
-    this.host = host;
-    this.username = username;
-    this.password = password;
-  }
-
-  public String getHost() {
-    return host;
-  }
-
-  public Host setHost(String host) {
-    this.host = host;
-    return this;
-  }
-
-  public String getUsername() {
-    return username;
-  }
-
-  public Host setUsername(String username) {
-    this.username = username;
-    return this;
-  }
-
-  public String getPassword() {
-    return password;
-  }
-
-  public Host setPassword(String password) {
-    this.password = password;
-    return this;
-  }
-
-}
diff --git a/server/sonar-ws-client/src/main/java/org/sonar/wsclient/JdkUtils.java b/server/sonar-ws-client/src/main/java/org/sonar/wsclient/JdkUtils.java
deleted file mode 100644 (file)
index dc424d7..0000000
+++ /dev/null
@@ -1,114 +0,0 @@
-/*
- * SonarQube, open source software quality management tool.
- * Copyright (C) 2008-2014 SonarSource
- * mailto:contact AT sonarsource DOT com
- *
- * SonarQube is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * SonarQube is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-package org.sonar.wsclient;
-
-import org.json.simple.JSONObject;
-import org.json.simple.JSONValue;
-import org.sonar.wsclient.services.WSUtils;
-import org.sonar.wsclient.unmarshallers.JsonUtils;
-
-import javax.annotation.CheckForNull;
-
-import java.io.UnsupportedEncodingException;
-import java.net.URLEncoder;
-import java.text.SimpleDateFormat;
-import java.util.ArrayList;
-import java.util.Date;
-import java.util.Set;
-
-public final class JdkUtils extends WSUtils {
-
-  @Override
-  public String format(Date date, String format) {
-    SimpleDateFormat dateFormat = new SimpleDateFormat(format);
-    return dateFormat.format(date);
-  }
-
-  @Override
-  public String encodeUrl(String url) {
-    try {
-      return URLEncoder.encode(url, "UTF-8");
-
-    } catch (UnsupportedEncodingException e) {
-      throw new IllegalStateException("Encoding not supported", e);
-    }
-  }
-
-  @Override
-  public Object getField(Object json, String field) {
-    return ((JSONObject) json).get(field);
-  }
-
-  @Override
-  @CheckForNull
-  public String getString(Object json, String field) {
-    return JsonUtils.getString((JSONObject) json, field);
-  }
-
-  @Override
-  @CheckForNull
-  public Boolean getBoolean(Object json, String field) {
-    return JsonUtils.getBoolean((JSONObject) json, field);
-  }
-
-  @Override
-  @CheckForNull
-  public Integer getInteger(Object json, String field) {
-    return JsonUtils.getInteger((JSONObject) json, field);
-  }
-
-  @Override
-  @CheckForNull
-  public Double getDouble(Object json, String field) {
-    return JsonUtils.getDouble((JSONObject) json, field);
-  }
-
-  @Override
-  @CheckForNull
-  public Long getLong(Object json, String field) {
-    return JsonUtils.getLong((JSONObject) json, field);
-  }
-
-  @Override
-  @CheckForNull
-  public Date getDateTime(Object json, String field) {
-    return JsonUtils.getDateTime((JSONObject) json, field);
-  }
-
-  @Override
-  public int getArraySize(Object array) {
-    return ((ArrayList) array).size();
-  }
-
-  @Override
-  public Object getArrayElement(Object array, int i) {
-    return ((ArrayList) array).get(i);
-  }
-
-  @Override
-  public Object parse(String jsonStr) {
-    return JSONValue.parse(jsonStr);
-  }
-
-  @Override
-  public Set<String> getFields(Object json) {
-    return ((JSONObject) json).keySet();
-  }
-}
diff --git a/server/sonar-ws-client/src/main/java/org/sonar/wsclient/Sonar.java b/server/sonar-ws-client/src/main/java/org/sonar/wsclient/Sonar.java
deleted file mode 100644 (file)
index a6f52c7..0000000
+++ /dev/null
@@ -1,107 +0,0 @@
-/*
- * SonarQube, open source software quality management tool.
- * Copyright (C) 2008-2014 SonarSource
- * mailto:contact AT sonarsource DOT com
- *
- * SonarQube is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * SonarQube is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-package org.sonar.wsclient;
-
-import org.sonar.wsclient.connectors.Connector;
-import org.sonar.wsclient.connectors.ConnectorFactory;
-import org.sonar.wsclient.services.*;
-import org.sonar.wsclient.unmarshallers.UnmarshalException;
-import org.sonar.wsclient.unmarshallers.Unmarshaller;
-import org.sonar.wsclient.unmarshallers.Unmarshallers;
-
-import java.util.Collections;
-import java.util.List;
-
-public class Sonar {
-
-  static {
-    WSUtils.setInstance(new JdkUtils());
-  }
-
-  private Connector connector;
-
-  public Sonar(Connector connector) {
-    this.connector = connector;
-  }
-
-  public Connector getConnector() {
-    return connector;
-  }
-
-  public <M extends Model> M find(Query<M> query) {
-    String json = connector.execute(query);
-    M result = null;
-    if (json != null) {
-      try {
-        Unmarshaller<M> unmarshaller = Unmarshallers.forModel(query.getModelClass());
-        result = unmarshaller.toModel(json);
-      } catch (Exception e) {
-        throw new UnmarshalException(query, json, e);
-      }
-    }
-    return result;
-  }
-
-  public <M extends Model> List<M> findAll(Query<M> query) {
-    String json = connector.execute(query);
-    List<M> result;
-    if (json == null) {
-      result = Collections.emptyList();
-    } else {
-      try {
-        Unmarshaller<M> unmarshaller = Unmarshallers.forModel(query.getModelClass());
-        result = unmarshaller.toModels(json);
-      } catch (Exception e) {
-        throw new UnmarshalException(query, json, e);
-      }
-    }
-    return result;
-  }
-
-  public <M extends Model> M create(CreateQuery<M> query) {
-    String json = connector.execute(query);
-    M result = null;
-    if (json != null) {
-      try {
-        Unmarshaller<M> unmarshaller = Unmarshallers.forModel(query.getModelClass());
-        result = unmarshaller.toModel(json);
-      } catch (Exception e) {
-        throw new UnmarshalException(query, json, e);
-      }
-    }
-    return result;
-  }
-
-  public void update(UpdateQuery<?> query) {
-    connector.execute(query);
-  }
-
-  public void delete(DeleteQuery query) {
-    connector.execute(query);
-  }
-
-  public static Sonar create(String host) {
-    return new Sonar(ConnectorFactory.create(new Host(host)));
-  }
-
-  public static Sonar create(String host, String username, String password) {
-    return new Sonar(ConnectorFactory.create(new Host(host, username, password)));
-  }
-}
diff --git a/server/sonar-ws-client/src/main/java/org/sonar/wsclient/SonarClient.java b/server/sonar-ws-client/src/main/java/org/sonar/wsclient/SonarClient.java
deleted file mode 100644 (file)
index efd5a25..0000000
+++ /dev/null
@@ -1,284 +0,0 @@
-/*
- * SonarQube, open source software quality management tool.
- * Copyright (C) 2008-2014 SonarSource
- * mailto:contact AT sonarsource DOT com
- *
- * SonarQube is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * SonarQube is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-package org.sonar.wsclient;
-
-import org.sonar.wsclient.internal.HttpRequestFactory;
-import org.sonar.wsclient.issue.ActionPlanClient;
-import org.sonar.wsclient.issue.IssueClient;
-import org.sonar.wsclient.issue.internal.DefaultActionPlanClient;
-import org.sonar.wsclient.issue.internal.DefaultIssueClient;
-import org.sonar.wsclient.permissions.PermissionClient;
-import org.sonar.wsclient.permissions.internal.DefaultPermissionClient;
-import org.sonar.wsclient.project.ProjectClient;
-import org.sonar.wsclient.project.internal.DefaultProjectClient;
-import org.sonar.wsclient.qprofile.QProfileClient;
-import org.sonar.wsclient.qprofile.internal.DefaultQProfileClient;
-import org.sonar.wsclient.qualitygate.QualityGateClient;
-import org.sonar.wsclient.qualitygate.internal.DefaultQualityGateClient;
-import org.sonar.wsclient.system.SystemClient;
-import org.sonar.wsclient.system.internal.DefaultSystemClient;
-
-import javax.annotation.Nullable;
-
-import java.util.Arrays;
-import java.util.HashMap;
-import java.util.Map;
-
-/**
- * Entry point of the Java Client for Sonar Web Services. It does not support all web services yet.
- * <p/>
- * Example:
- * <pre>
- *   SonarClient client = SonarClient.create("http://localhost:9000");
- *   IssueClient issueClient = client.issueClient();
- * </pre>
- *
- * @since 3.6
- */
-public class SonarClient {
-
-  public static final int DEFAULT_CONNECT_TIMEOUT_MILLISECONDS = 30000;
-  public static final int DEFAULT_READ_TIMEOUT_MILLISECONDS = 60000;
-
-  /**
-   * Visibility relaxed for unit tests
-   */
-  final HttpRequestFactory requestFactory;
-
-  private SonarClient(Builder builder) {
-    this(new HttpRequestFactory(builder.url)
-      .setLogin(builder.login)
-      .setPassword(builder.password)
-      .setProxyHost(builder.proxyHost)
-      .setProxyPort(builder.proxyPort)
-      .setProxyLogin(builder.proxyLogin)
-      .setProxyPassword(builder.proxyPassword)
-      .setConnectTimeoutInMilliseconds(builder.connectTimeoutMs)
-      .setReadTimeoutInMilliseconds(builder.readTimeoutMs));
-  }
-
-  /**
-   * Visible for testing
-   */
-  SonarClient(HttpRequestFactory requestFactory) {
-    this.requestFactory = requestFactory;
-  }
-
-  /**
-   * New client to interact with web services related to issues
-   */
-  public IssueClient issueClient() {
-    return new DefaultIssueClient(requestFactory);
-  }
-
-  /**
-   * New client to interact with web services related to issue action plans
-   */
-  public ActionPlanClient actionPlanClient() {
-    return new DefaultActionPlanClient(requestFactory);
-  }
-
-  /**
-   * New client to interact with web services related to users and groups permissions
-   */
-  public PermissionClient permissionClient() {
-    return new DefaultPermissionClient(requestFactory);
-  }
-
-  /**
-   * New client to interact with web services related to projects
-   */
-  public ProjectClient projectClient() {
-    return new DefaultProjectClient(requestFactory);
-  }
-
-  /**
-   * New client to interact with web services related to quality gates
-   */
-  public QualityGateClient qualityGateClient() {
-    return new DefaultQualityGateClient(requestFactory);
-  }
-
-  /**
-   * New client to interact with web services related to quality profiles
-   */
-  public QProfileClient qProfileClient() {
-    return new DefaultQProfileClient(requestFactory);
-  }
-
-  public SystemClient systemClient() {
-    return new DefaultSystemClient(requestFactory);
-  }
-
-  /**
-   * Create a builder of {@link SonarClient}s.
-   */
-  public static Builder builder() {
-    return new Builder();
-  }
-
-  /**
-   * Create a client with default configuration. Use {@link #builder()} to define
-   * a custom configuration (credentials, HTTP proxy, HTTP timeouts).
-   */
-  public static SonarClient create(String serverUrl) {
-    return builder().url(serverUrl).build();
-  }
-
-  /**
-   * Send a POST request on the given relativeUrl, with provided parameters (can be empty).
-   * The beginning slash (/) of relativeUrl is supported but not mandatory.
-   * <p/>
-   * Example:
-   * <pre>  {@code
-   *   Map<String,Object> params = new HashMap<>();
-   *   params.put("name", "My Quality Gate");
-   *   client.post("api/qualitygates/create", params);
-   * }</pre>
-   * @since 4.5
-   * @return the response body
-   */
-  public String post(String relativeUrl, Map<String, Object> params) {
-    return requestFactory.post(relativeUrl, params);
-  }
-
-  /**
-   * Same as {@link #post(String, java.util.Map)} but parameters are defined as an array
-   * of even number of elements (key1, value1, key, value2, ...). Keys must not be null.
-   */
-  public String post(String relativeUrl, Object... params) {
-    return post(relativeUrl, paramsAsMap(params));
-  }
-
-  /**
-   * Send a GET request on the given relativeUrl, with provided parameters (can be empty).
-   * The beginning slash (/) of relativeUrl is supported but not mandatory.
-   * @since 4.5
-   * @return the response body
-   */
-  public String get(String relativeUrl, Map<String, Object> params) {
-    return requestFactory.get(relativeUrl, params);
-  }
-
-  /**
-   * Same as {@link #get(String, java.util.Map)} but parameters are defined as an array
-   * of even number of elements (key1, value1, key, value2, ...). Keys must not be null.
-   */
-  public String get(String relativeUrl, Object... params) {
-    return get(relativeUrl, paramsAsMap(params));
-  }
-
-  private Map<String, Object> paramsAsMap(Object[] params) {
-    if (params.length % 2 == 1) {
-      throw new IllegalArgumentException(String.format(
-        "Expecting even number of elements. Got %s", Arrays.toString(params)));
-    }
-    Map<String, Object> map = new HashMap<>();
-    for (int index = 0; index < params.length; index++) {
-      if (params[index] == null) {
-        throw new IllegalArgumentException(String.format(
-          "Parameter key can't be null at index %d of %s", index, Arrays.toString(params)));
-      }
-      map.put(params[index].toString(), params[index + 1]);
-      index++;
-    }
-    return map;
-  }
-
-  public static class Builder {
-    private String login, password, url, proxyHost, proxyLogin, proxyPassword;
-    private int proxyPort = 0;
-    private int connectTimeoutMs = DEFAULT_CONNECT_TIMEOUT_MILLISECONDS, readTimeoutMs = DEFAULT_READ_TIMEOUT_MILLISECONDS;
-
-    private Builder() {
-    }
-
-    /**
-     * Mandatory HTTP server URL, eg "http://localhost:9000"
-     */
-    public Builder url(String url) {
-      this.url = url;
-      return this;
-    }
-
-    /**
-     * Optional login, for example "admin"
-     */
-    public Builder login(@Nullable String login) {
-      this.login = login;
-      return this;
-    }
-
-    /**
-     * Optional password related to {@link #login(String)}, for example "admin"
-     */
-    public Builder password(@Nullable String password) {
-      this.password = password;
-      return this;
-    }
-
-    /**
-     * Host and port of the optional HTTP proxy
-     */
-    public Builder proxy(@Nullable String proxyHost, int proxyPort) {
-      this.proxyHost = proxyHost;
-      this.proxyPort = proxyPort;
-      return this;
-    }
-
-    public Builder proxyLogin(@Nullable String proxyLogin) {
-      this.proxyLogin = proxyLogin;
-      return this;
-    }
-
-    public Builder proxyPassword(@Nullable String proxyPassword) {
-      this.proxyPassword = proxyPassword;
-      return this;
-    }
-
-    /**
-     * Sets a specified timeout value, in milliseconds, to be used when opening HTTP connection.
-     * A timeout of zero is interpreted as an infinite timeout. Default value is {@link SonarClient#DEFAULT_CONNECT_TIMEOUT_MILLISECONDS}
-     */
-    public Builder connectTimeoutMilliseconds(int i) {
-      this.connectTimeoutMs = i;
-      return this;
-    }
-
-    /**
-     * Sets the read timeout to a specified timeout, in milliseconds.
-     * A timeout of zero is interpreted as an infinite timeout. Default value is {@link SonarClient#DEFAULT_READ_TIMEOUT_MILLISECONDS}
-     */
-    public Builder readTimeoutMilliseconds(int i) {
-      this.readTimeoutMs = i;
-      return this;
-    }
-
-    /**
-     * Build a new client
-     */
-    public SonarClient build() {
-      if (url == null || "".equals(url)) {
-        throw new IllegalStateException("Server URL must be set");
-      }
-      return new SonarClient(this);
-    }
-  }
-}
diff --git a/server/sonar-ws-client/src/main/java/org/sonar/wsclient/base/HttpException.java b/server/sonar-ws-client/src/main/java/org/sonar/wsclient/base/HttpException.java
deleted file mode 100644 (file)
index 840573e..0000000
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * SonarQube, open source software quality management tool.
- * Copyright (C) 2008-2014 SonarSource
- * mailto:contact AT sonarsource DOT com
- *
- * SonarQube is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * SonarQube is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-package org.sonar.wsclient.base;
-
-/**
- * @since 3.6
- */
-public class HttpException extends RuntimeException {
-
-  private final String url;
-  private final int status;
-
-  public HttpException(String url, int status, String message) {
-    super(String.format("Error %d on %s : %s", status, url, message));
-    this.url = url;
-    this.status = status;
-  }
-
-  public String url() {
-    return url;
-  }
-
-  public int status() {
-    return status;
-  }
-}
diff --git a/server/sonar-ws-client/src/main/java/org/sonar/wsclient/base/Paging.java b/server/sonar-ws-client/src/main/java/org/sonar/wsclient/base/Paging.java
deleted file mode 100644 (file)
index 654b593..0000000
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * SonarQube, open source software quality management tool.
- * Copyright (C) 2008-2014 SonarSource
- * mailto:contact AT sonarsource DOT com
- *
- * SonarQube is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * SonarQube is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-
-package org.sonar.wsclient.base;
-
-import org.sonar.wsclient.unmarshallers.JsonUtils;
-
-import java.util.Map;
-
-/**
- * @since 3.6
- */
-public class Paging {
-
-  private final Map json;
-
-  /**
-   * For internal use
-   */
-  public Paging(Map json) {
-    this.json = json;
-  }
-
-  public Integer pageSize() {
-    return JsonUtils.getInteger(json, "pageSize");
-  }
-
-  public Integer pageIndex() {
-    return JsonUtils.getInteger(json, "pageIndex");
-  }
-
-  public Integer total() {
-    return JsonUtils.getInteger(json, "total");
-  }
-
-  public Integer pages() {
-    return JsonUtils.getInteger(json, "pages");
-  }
-
-}
diff --git a/server/sonar-ws-client/src/main/java/org/sonar/wsclient/base/package-info.java b/server/sonar-ws-client/src/main/java/org/sonar/wsclient/base/package-info.java
deleted file mode 100644 (file)
index 201a7d3..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-/*
- * SonarQube, open source software quality management tool.
- * Copyright (C) 2008-2014 SonarSource
- * mailto:contact AT sonarsource DOT com
- *
- * SonarQube is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * SonarQube is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-
-@javax.annotation.ParametersAreNonnullByDefault
-package org.sonar.wsclient.base;
diff --git a/server/sonar-ws-client/src/main/java/org/sonar/wsclient/component/Component.java b/server/sonar-ws-client/src/main/java/org/sonar/wsclient/component/Component.java
deleted file mode 100644 (file)
index 686799a..0000000
+++ /dev/null
@@ -1,83 +0,0 @@
-/*
- * SonarQube, open source software quality management tool.
- * Copyright (C) 2008-2014 SonarSource
- * mailto:contact AT sonarsource DOT com
- *
- * SonarQube is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * SonarQube is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-package org.sonar.wsclient.component;
-
-import org.sonar.wsclient.unmarshallers.JsonUtils;
-
-import javax.annotation.CheckForNull;
-
-import java.util.Map;
-
-public class Component {
-  private final Map json;
-
-  public Component(Map json) {
-    this.json = json;
-  }
-
-  public String qualifier() {
-    return JsonUtils.getString(json, "qualifier");
-  }
-
-  public String key() {
-    return JsonUtils.getString(json, "key");
-  }
-
-  /**
-   * @since 4.2
-   */
-  public Long id() {
-    return JsonUtils.getLong(json, "id");
-  }
-
-  public String name() {
-    return JsonUtils.getString(json, "name");
-  }
-
-  @CheckForNull
-  public String longName() {
-    return JsonUtils.getString(json, "longName");
-  }
-
-  /**
-   * @since 4.2
-   */
-  @CheckForNull
-  public Long subProjectId() {
-    return JsonUtils.getLong(json, "subProjectId");
-  }
-
-  /**
-   * @since 4.2
-   */
-  @CheckForNull
-  public Long projectId() {
-    return JsonUtils.getLong(json, "projectId");
-  }
-
-  /**
-   * @since 4.2
-   */
-  @CheckForNull
-  public String path() {
-    return JsonUtils.getString(json, "path");
-  }
-
-}
diff --git a/server/sonar-ws-client/src/main/java/org/sonar/wsclient/component/package-info.java b/server/sonar-ws-client/src/main/java/org/sonar/wsclient/component/package-info.java
deleted file mode 100644 (file)
index 5634254..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-/*
- * SonarQube, open source software quality management tool.
- * Copyright (C) 2008-2014 SonarSource
- * mailto:contact AT sonarsource DOT com
- *
- * SonarQube is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * SonarQube is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-
-@javax.annotation.ParametersAreNonnullByDefault
-package org.sonar.wsclient.component;
diff --git a/server/sonar-ws-client/src/main/java/org/sonar/wsclient/connectors/ConnectionException.java b/server/sonar-ws-client/src/main/java/org/sonar/wsclient/connectors/ConnectionException.java
deleted file mode 100644 (file)
index 6b4a5c5..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * SonarQube, open source software quality management tool.
- * Copyright (C) 2008-2014 SonarSource
- * mailto:contact AT sonarsource DOT com
- *
- * SonarQube is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * SonarQube is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-package org.sonar.wsclient.connectors;
-
-public class ConnectionException extends RuntimeException {
-  public ConnectionException() {
-  }
-
-  public ConnectionException(String s) {
-    super(s);
-  }
-
-  public ConnectionException(String s, Throwable throwable) {
-    super(s, throwable);
-  }
-
-  public ConnectionException(Throwable throwable) {
-    super(throwable);
-  }
-}
diff --git a/server/sonar-ws-client/src/main/java/org/sonar/wsclient/connectors/Connector.java b/server/sonar-ws-client/src/main/java/org/sonar/wsclient/connectors/Connector.java
deleted file mode 100644 (file)
index d19bfa1..0000000
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * SonarQube, open source software quality management tool.
- * Copyright (C) 2008-2014 SonarSource
- * mailto:contact AT sonarsource DOT com
- *
- * SonarQube is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * SonarQube is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-package org.sonar.wsclient.connectors;
-
-import org.sonar.wsclient.services.CreateQuery;
-import org.sonar.wsclient.services.DeleteQuery;
-import org.sonar.wsclient.services.Query;
-import org.sonar.wsclient.services.UpdateQuery;
-
-/**
- * @since 2.1
- */
-public abstract class Connector {
-
-  /**
-   * @return JSON response or null if 404 NOT FOUND error
-   * @throws ConnectionException if connection error or HTTP status not in (200, 404)
-   */
-  public abstract String execute(Query<?> query);
-
-  /**
-   * @return JSON response or null if 404 NOT FOUND error
-   * @since 2.2
-   */
-  public abstract String execute(CreateQuery<?> query);
-
-  /**
-   * @return JSON response or null if 404 NOT FOUND error
-   * @since 2.2
-   */
-  public abstract String execute(DeleteQuery query);
-
-  /**
-   * @return JSON response or null if 404 NOT FOUND error
-   * @since 2.6
-   */
-  public abstract String execute(UpdateQuery<?> query);
-}
diff --git a/server/sonar-ws-client/src/main/java/org/sonar/wsclient/connectors/ConnectorFactory.java b/server/sonar-ws-client/src/main/java/org/sonar/wsclient/connectors/ConnectorFactory.java
deleted file mode 100644 (file)
index e0e0f76..0000000
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- * SonarQube, open source software quality management tool.
- * Copyright (C) 2008-2014 SonarSource
- * mailto:contact AT sonarsource DOT com
- *
- * SonarQube is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * SonarQube is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-package org.sonar.wsclient.connectors;
-
-import org.sonar.wsclient.Host;
-
-public final class ConnectorFactory {
-
-  private ConnectorFactory() {
-  }
-
-  public static Connector create(Host server) {
-    return new HttpClient3Connector(server);
-  }
-}
diff --git a/server/sonar-ws-client/src/main/java/org/sonar/wsclient/connectors/HttpClient3Connector.java b/server/sonar-ws-client/src/main/java/org/sonar/wsclient/connectors/HttpClient3Connector.java
deleted file mode 100644 (file)
index 0cec3ab..0000000
+++ /dev/null
@@ -1,195 +0,0 @@
-/*
- * SonarQube, open source software quality management tool.
- * Copyright (C) 2008-2014 SonarSource
- * mailto:contact AT sonarsource DOT com
- *
- * SonarQube is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * SonarQube is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-package org.sonar.wsclient.connectors;
-
-import org.apache.commons.httpclient.*;
-import org.apache.commons.httpclient.auth.AuthScope;
-import org.apache.commons.httpclient.methods.*;
-import org.apache.commons.httpclient.params.HttpConnectionManagerParams;
-import org.sonar.wsclient.Host;
-import org.sonar.wsclient.services.*;
-
-import java.io.*;
-
-/**
- * @since 2.1
- */
-public class HttpClient3Connector extends Connector {
-
-  private static final int MAX_TOTAL_CONNECTIONS = 40;
-  private static final int MAX_HOST_CONNECTIONS = 4;
-
-  private final Host server;
-  private HttpClient httpClient;
-
-  public HttpClient3Connector(final Host server) {
-    this.server = server;
-    createClient();
-  }
-
-  public HttpClient3Connector(Host server, HttpClient httpClient) {
-    this.httpClient = httpClient;
-    this.server = server;
-  }
-
-  private void createClient() {
-    final HttpConnectionManagerParams params = new HttpConnectionManagerParams();
-    params.setConnectionTimeout(AbstractQuery.DEFAULT_TIMEOUT_MILLISECONDS);
-    params.setSoTimeout(AbstractQuery.DEFAULT_TIMEOUT_MILLISECONDS);
-    params.setDefaultMaxConnectionsPerHost(MAX_HOST_CONNECTIONS);
-    params.setMaxTotalConnections(MAX_TOTAL_CONNECTIONS);
-    final MultiThreadedHttpConnectionManager connectionManager = new MultiThreadedHttpConnectionManager();
-    connectionManager.setParams(params);
-    this.httpClient = new HttpClient(connectionManager);
-    configureCredentials();
-  }
-
-  private void configureCredentials() {
-    if (server.getUsername() != null) {
-      httpClient.getParams().setAuthenticationPreemptive(true);
-      Credentials defaultcreds = new UsernamePasswordCredentials(server.getUsername(), server.getPassword());
-      httpClient.getState().setCredentials(AuthScope.ANY, defaultcreds);
-    }
-  }
-
-  /**
-   * @since 3.4
-   */
-  public HttpClient getHttpClient() {
-    return httpClient;
-  }
-
-  @Override
-  public String execute(Query<?> query) {
-    return executeRequest(newGetRequest(query));
-  }
-
-  @Override
-  public String execute(CreateQuery<?> query) {
-    return executeRequest(newPostRequest(query));
-  }
-
-  @Override
-  public String execute(UpdateQuery<?> query) {
-    return executeRequest(newPutRequest(query));
-  }
-
-  @Override
-  public String execute(DeleteQuery query) {
-    return executeRequest(newDeleteRequest(query));
-  }
-
-  private String executeRequest(HttpMethodBase method) {
-    String json = null;
-    try {
-      httpClient.executeMethod(method);
-
-      if (method.getStatusCode() == HttpStatus.SC_OK) {
-        json = getResponseBodyAsString(method);
-
-      } else if (method.getStatusCode() != HttpStatus.SC_NOT_FOUND) {
-        throw new ConnectionException("HTTP error: " + method.getStatusCode() + ", msg: " + method.getStatusText() + ", query: " + method);
-      }
-
-    } catch (HttpException e) {
-      throw new ConnectionException("Query: " + method, e);
-
-    } catch (IOException e) {
-      throw new ConnectionException("Query: " + method, e);
-
-    } finally {
-      if (method != null) {
-        method.releaseConnection();
-      }
-    }
-    return json;
-  }
-
-  private HttpMethodBase newGetRequest(Query<?> query) {
-    HttpMethodBase method = new GetMethod(server.getHost() + query.getUrl());
-    initRequest(method, query);
-    return method;
-  }
-
-  private HttpMethodBase newDeleteRequest(DeleteQuery query) {
-    HttpMethodBase method = new DeleteMethod(server.getHost() + query.getUrl());
-    initRequest(method, query);
-    return method;
-  }
-
-  private HttpMethodBase newPostRequest(CreateQuery<?> query) {
-    PostMethod method = new PostMethod(server.getHost() + query.getUrl());
-    initRequest(method, query);
-    setRequestEntity(method, query);
-    return method;
-  }
-
-  private HttpMethodBase newPutRequest(UpdateQuery<?> query) {
-    PutMethod method = new PutMethod(server.getHost() + query.getUrl());
-    initRequest(method, query);
-    setRequestEntity(method, query);
-    return method;
-  }
-
-  private void setRequestEntity(EntityEnclosingMethod request, AbstractQuery<?> query) {
-    if (query.getBody() != null) {
-      try {
-        request.setRequestEntity(new StringRequestEntity(query.getBody(), "text/plain; charset=UTF-8", "UTF-8"));
-      } catch (UnsupportedEncodingException e) {
-        throw new ConnectionException("Unsupported encoding", e);
-      }
-    }
-  }
-
-  private void initRequest(HttpMethodBase request, AbstractQuery query) {
-    request.setRequestHeader("Accept", "application/json");
-    if (query.getLocale() != null) {
-      request.setRequestHeader("Accept-Language", query.getLocale());
-    }
-    request.getParams().setSoTimeout(query.getTimeoutMilliseconds());
-  }
-
-  private String getResponseBodyAsString(HttpMethod method) {
-    BufferedReader reader = null;
-    try {
-      final InputStream inputStream = method.getResponseBodyAsStream();
-      reader = new BufferedReader(new InputStreamReader(inputStream));
-      final StringBuilder sb = new StringBuilder();
-      String line;
-
-      while ((line = reader.readLine()) != null) {
-        sb.append(line).append("\n");
-      }
-      return sb.toString();
-
-    } catch (IOException e) {
-      throw new ConnectionException("Can not read response", e);
-
-    } finally {
-      if (reader != null) {
-        try {
-          reader.close();
-        } catch (Exception e) {
-          // wsclient does not have logging ability -> silently ignore
-        }
-      }
-    }
-  }
-}
diff --git a/server/sonar-ws-client/src/main/java/org/sonar/wsclient/connectors/HttpClient4Connector.java b/server/sonar-ws-client/src/main/java/org/sonar/wsclient/connectors/HttpClient4Connector.java
deleted file mode 100644 (file)
index 8d3c5e8..0000000
+++ /dev/null
@@ -1,232 +0,0 @@
-/*
- * SonarQube, open source software quality management tool.
- * Copyright (C) 2008-2014 SonarSource
- * mailto:contact AT sonarsource DOT com
- *
- * SonarQube is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * SonarQube is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-package org.sonar.wsclient.connectors;
-
-import org.apache.http.HttpEntity;
-import org.apache.http.HttpException;
-import org.apache.http.HttpHost;
-import org.apache.http.HttpRequest;
-import org.apache.http.HttpRequestInterceptor;
-import org.apache.http.HttpResponse;
-import org.apache.http.HttpStatus;
-import org.apache.http.auth.AuthScheme;
-import org.apache.http.auth.AuthScope;
-import org.apache.http.auth.AuthState;
-import org.apache.http.auth.Credentials;
-import org.apache.http.auth.UsernamePasswordCredentials;
-import org.apache.http.client.CredentialsProvider;
-import org.apache.http.client.methods.HttpDelete;
-import org.apache.http.client.methods.HttpEntityEnclosingRequestBase;
-import org.apache.http.client.methods.HttpGet;
-import org.apache.http.client.methods.HttpPost;
-import org.apache.http.client.methods.HttpPut;
-import org.apache.http.client.methods.HttpRequestBase;
-import org.apache.http.client.protocol.ClientContext;
-import org.apache.http.entity.StringEntity;
-import org.apache.http.impl.auth.BasicScheme;
-import org.apache.http.impl.client.DefaultHttpClient;
-import org.apache.http.params.CoreConnectionPNames;
-import org.apache.http.params.HttpConnectionParams;
-import org.apache.http.params.HttpParams;
-import org.apache.http.protocol.BasicHttpContext;
-import org.apache.http.protocol.ExecutionContext;
-import org.apache.http.protocol.HttpContext;
-import org.apache.http.util.EntityUtils;
-import org.sonar.wsclient.Host;
-import org.sonar.wsclient.services.AbstractQuery;
-import org.sonar.wsclient.services.CreateQuery;
-import org.sonar.wsclient.services.DeleteQuery;
-import org.sonar.wsclient.services.Query;
-import org.sonar.wsclient.services.UpdateQuery;
-
-import java.io.IOException;
-import java.io.UnsupportedEncodingException;
-
-/**
- * @since 2.1
- */
-public class HttpClient4Connector extends Connector {
-
-  private Host server;
-  private DefaultHttpClient client;
-
-  public HttpClient4Connector(Host server) {
-    this.server = server;
-    initClient();
-  }
-
-  public DefaultHttpClient getHttpClient() {
-    return client;
-  }
-
-  @Override
-  public String execute(Query<?> query) {
-    return executeRequest(newGetMethod(query));
-  }
-
-  @Override
-  public String execute(CreateQuery<?> query) {
-    return executeRequest(newPostMethod(query));
-  }
-
-  @Override
-  public String execute(UpdateQuery<?> query) {
-    return executeRequest(newPutMethod(query));
-  }
-
-  @Override
-  public String execute(DeleteQuery query) {
-    return executeRequest(newDeleteMethod(query));
-  }
-
-  private String executeRequest(HttpRequestBase request) {
-    String json = null;
-    try {
-      BasicHttpContext context = createLocalContext(client);
-      HttpResponse response = client.execute(request, context);
-      HttpEntity entity = response.getEntity();
-      if (entity != null) {
-        if (response.getStatusLine().getStatusCode() == HttpStatus.SC_OK) {
-          json = EntityUtils.toString(entity);
-
-        } else if (response.getStatusLine().getStatusCode() != HttpStatus.SC_NOT_FOUND) {
-          throw new ConnectionException("HTTP error: " + response.getStatusLine().getStatusCode()
-            + ", msg: " + response.getStatusLine().getReasonPhrase()
-            + ", query: " + request.toString());
-        }
-      }
-
-    } catch (IOException e) {
-      throw new ConnectionException("Query: " + request.getURI(), e);
-
-    } finally {
-      request.releaseConnection();
-    }
-    return json;
-  }
-
-  public void close() {
-    if (client != null) {
-      client.getConnectionManager().shutdown();
-    }
-  }
-
-  private void initClient() {
-    client = new DefaultHttpClient();
-    HttpParams params = client.getParams();
-    HttpConnectionParams.setConnectionTimeout(params, AbstractQuery.DEFAULT_TIMEOUT_MILLISECONDS);
-    HttpConnectionParams.setSoTimeout(params, AbstractQuery.DEFAULT_TIMEOUT_MILLISECONDS);
-    if (server.getUsername() != null) {
-      client.getCredentialsProvider()
-        .setCredentials(AuthScope.ANY, new UsernamePasswordCredentials(server.getUsername(), server.getPassword()));
-    }
-  }
-
-  private BasicHttpContext createLocalContext(DefaultHttpClient client) {
-    BasicHttpContext localcontext = new BasicHttpContext();
-
-    if (server.getUsername() != null) {
-      // Generate BASIC scheme object and stick it to the local
-      // execution context
-      BasicScheme basicAuth = new BasicScheme();
-      localcontext.setAttribute(PreemptiveAuth.ATTRIBUTE, basicAuth);
-
-      // Add as the first request interceptor
-      client.addRequestInterceptor(new PreemptiveAuth(), 0);
-    }
-    return localcontext;
-  }
-
-  private HttpGet newGetMethod(Query<?> query) {
-    HttpGet get = new HttpGet(server.getHost() + query.getUrl());
-    initRequest(get, query);
-    return get;
-  }
-
-  private HttpDelete newDeleteMethod(DeleteQuery query) {
-    HttpDelete delete = new HttpDelete(server.getHost() + query.getUrl());
-    initRequest(delete, query);
-    return delete;
-  }
-
-  private HttpPost newPostMethod(CreateQuery<?> query) {
-    HttpPost post = new HttpPost(server.getHost() + query.getUrl());
-    initRequest(post, query);
-    setRequestEntity(post, query);
-    return post;
-  }
-
-  private HttpPut newPutMethod(UpdateQuery<?> query) {
-    HttpPut put = new HttpPut(server.getHost() + query.getUrl());
-    initRequest(put, query);
-    setRequestEntity(put, query);
-    return put;
-  }
-
-  private void setRequestEntity(HttpEntityEnclosingRequestBase request, AbstractQuery<?> query) {
-    if (query.getBody() != null) {
-      try {
-        request.setEntity(new StringEntity(query.getBody(), "UTF-8"));
-      } catch (UnsupportedEncodingException e) {
-        throw new ConnectionException("Encoding is not supported", e);
-      }
-    }
-  }
-
-  private void initRequest(HttpRequestBase request, AbstractQuery query) {
-    request.setHeader("Accept", "application/json");
-    if (query.getLocale() != null) {
-      request.setHeader("Accept-Language", query.getLocale());
-    }
-    request.getParams().setParameter(CoreConnectionPNames.CONNECTION_TIMEOUT, query.getTimeoutMilliseconds());
-    request.getParams().setParameter(CoreConnectionPNames.SO_TIMEOUT, query.getTimeoutMilliseconds());
-  }
-
-  static final class PreemptiveAuth implements HttpRequestInterceptor {
-
-    static final String ATTRIBUTE = "preemptive-auth";
-
-    @Override
-    public void process(
-      final HttpRequest request,
-      final HttpContext context) throws HttpException {
-
-      AuthState authState = (AuthState) context.getAttribute(ClientContext.TARGET_AUTH_STATE);
-
-      // If no auth scheme available yet, try to initialize it preemptively
-      if (authState.getAuthScheme() == null) {
-        AuthScheme authScheme = (AuthScheme) context.getAttribute(ATTRIBUTE);
-        CredentialsProvider credsProvider = (CredentialsProvider) context.getAttribute(ClientContext.CREDS_PROVIDER);
-        HttpHost targetHost = (HttpHost) context.getAttribute(ExecutionContext.HTTP_TARGET_HOST);
-        if (authScheme != null) {
-          Credentials creds = credsProvider.getCredentials(
-            new AuthScope(
-              targetHost.getHostName(),
-              targetHost.getPort()));
-          if (creds == null) {
-            throw new HttpException("No credentials for preemptive authentication");
-          }
-          authState.setAuthScheme(authScheme);
-          authState.setCredentials(creds);
-        }
-      }
-    }
-  }
-}
diff --git a/server/sonar-ws-client/src/main/java/org/sonar/wsclient/connectors/package-info.java b/server/sonar-ws-client/src/main/java/org/sonar/wsclient/connectors/package-info.java
deleted file mode 100644 (file)
index 06f909f..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-/*
- * SonarQube, open source software quality management tool.
- * Copyright (C) 2008-2014 SonarSource
- * mailto:contact AT sonarsource DOT com
- *
- * SonarQube is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * SonarQube is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-
-@javax.annotation.ParametersAreNonnullByDefault
-package org.sonar.wsclient.connectors;
diff --git a/server/sonar-ws-client/src/main/java/org/sonar/wsclient/internal/EncodingUtils.java b/server/sonar-ws-client/src/main/java/org/sonar/wsclient/internal/EncodingUtils.java
deleted file mode 100644 (file)
index 3111065..0000000
+++ /dev/null
@@ -1,71 +0,0 @@
-/*
- * SonarQube, open source software quality management tool.
- * Copyright (C) 2008-2014 SonarSource
- * mailto:contact AT sonarsource DOT com
- *
- * SonarQube is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * SonarQube is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-package org.sonar.wsclient.internal;
-
-import java.text.SimpleDateFormat;
-import java.util.Date;
-import java.util.LinkedHashMap;
-import java.util.Map;
-
-/**
- * Not an API. Please do not use this class, except maybe for unit tests.
- */
-public class EncodingUtils {
-
-  private static final String DATETIME_FORMAT = "yyyy-MM-dd'T'HH:mm:ssZ";
-  private static final String DATE_FORMAT = "yyyy-MM-dd";
-
-  private EncodingUtils() {
-    // only static methods
-  }
-
-  public static Map<String, Object> toMap(String... array) {
-    if (array.length%2==1) {
-      throw new IllegalArgumentException("Not an even number of arguments");
-    }
-    Map<String, Object> map = new LinkedHashMap<>();
-    for (int i = 0; i < array.length; i += 2) {
-      Object value = array[i + 1];
-      if (value != null) {
-        map.put(array[i], array[i + 1]);
-      }
-    }
-    return map;
-  }
-
-  public static String toQueryParam(String[] strings) {
-    StringBuilder sb = new StringBuilder();
-    boolean first = true;
-    for (String string : strings) {
-      if (!first) {
-        sb.append(',');
-      }
-      sb.append(string);
-      first = false;
-    }
-    return sb.toString();
-  }
-
-  public static String toQueryParam(Date d, boolean includeTime) {
-    String format = includeTime ? DATETIME_FORMAT : DATE_FORMAT;
-    SimpleDateFormat dateFormat = new SimpleDateFormat(format);
-    return dateFormat.format(d);
-  }
-}
diff --git a/server/sonar-ws-client/src/main/java/org/sonar/wsclient/internal/HttpRequestFactory.java b/server/sonar-ws-client/src/main/java/org/sonar/wsclient/internal/HttpRequestFactory.java
deleted file mode 100644 (file)
index bee47cd..0000000
+++ /dev/null
@@ -1,183 +0,0 @@
-/*
- * SonarQube, open source software quality management tool.
- * Copyright (C) 2008-2014 SonarSource
- * mailto:contact AT sonarsource DOT com
- *
- * SonarQube is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * SonarQube is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-package org.sonar.wsclient.internal;
-
-import com.github.kevinsawicki.http.HttpRequest;
-import org.sonar.wsclient.base.HttpException;
-
-import javax.annotation.Nullable;
-
-import java.util.Arrays;
-import java.util.Map;
-
-import static java.net.HttpURLConnection.*;
-
-/**
- * Not an API. Please do not use this class, except maybe for unit tests.
- */
-public class HttpRequestFactory {
-
-  private static final int[] RESPONSE_SUCCESS = {HTTP_OK, HTTP_CREATED, HTTP_NO_CONTENT};
-
-  private final String baseUrl;
-  private String login, password, proxyHost, proxyLogin, proxyPassword;
-  private int proxyPort;
-  private int connectTimeoutInMilliseconds;
-  private int readTimeoutInMilliseconds;
-
-  public HttpRequestFactory(String baseUrl) {
-    this.baseUrl = baseUrl;
-  }
-
-  public HttpRequestFactory setLogin(@Nullable String login) {
-    this.login = login;
-    return this;
-  }
-
-  public HttpRequestFactory setPassword(@Nullable String password) {
-    this.password = password;
-    return this;
-  }
-
-  public HttpRequestFactory setProxyHost(@Nullable String proxyHost) {
-    this.proxyHost = proxyHost;
-    return this;
-  }
-
-  public HttpRequestFactory setProxyLogin(@Nullable String proxyLogin) {
-    this.proxyLogin = proxyLogin;
-    return this;
-  }
-
-  public HttpRequestFactory setProxyPassword(@Nullable String proxyPassword) {
-    this.proxyPassword = proxyPassword;
-    return this;
-  }
-
-  public HttpRequestFactory setProxyPort(int proxyPort) {
-    this.proxyPort = proxyPort;
-    return this;
-  }
-
-  public HttpRequestFactory setConnectTimeoutInMilliseconds(int connectTimeoutInMilliseconds) {
-    this.connectTimeoutInMilliseconds = connectTimeoutInMilliseconds;
-    return this;
-  }
-
-  public HttpRequestFactory setReadTimeoutInMilliseconds(int readTimeoutInMilliseconds) {
-    this.readTimeoutInMilliseconds = readTimeoutInMilliseconds;
-    return this;
-  }
-
-  public String getBaseUrl() {
-    return baseUrl;
-  }
-
-  public String getLogin() {
-    return login;
-  }
-
-  public String getPassword() {
-    return password;
-  }
-
-  public String getProxyHost() {
-    return proxyHost;
-  }
-
-  public String getProxyLogin() {
-    return proxyLogin;
-  }
-
-  public String getProxyPassword() {
-    return proxyPassword;
-  }
-
-  public int getProxyPort() {
-    return proxyPort;
-  }
-
-  public int getConnectTimeoutInMilliseconds() {
-    return connectTimeoutInMilliseconds;
-  }
-
-  public int getReadTimeoutInMilliseconds() {
-    return readTimeoutInMilliseconds;
-  }
-
-  public String get(String wsUrl, Map<String, Object> queryParams) {
-    HttpRequest request = prepare(HttpRequest.get(buildUrl(wsUrl), queryParams, true));
-    return execute(request);
-  }
-
-  public String post(String wsUrl, Map<String, Object> queryParams) {
-    HttpRequest request = prepare(HttpRequest.post(buildUrl(wsUrl), true)).form(queryParams, HttpRequest.CHARSET_UTF8);
-    return execute(request);
-  }
-
-  private String buildUrl(String part) {
-    StringBuilder url = new StringBuilder();
-    url.append(baseUrl);
-    if (!part.startsWith("/")) {
-      url.append('/');
-    }
-    url.append(part);
-    return url.toString();
-  }
-
-  private String execute(HttpRequest request) {
-    try {
-      if (isSuccess(request)) {
-        return request.body(HttpRequest.CHARSET_UTF8);
-      }
-      // TODO better handle error messages
-      throw new HttpException(request.url().toString(), request.code(), request.body());
-
-    } catch (HttpRequest.HttpRequestException e) {
-      throw new IllegalStateException("Fail to request " + request.url(), e.getCause());
-    }
-  }
-
-  private boolean isSuccess(HttpRequest request) {
-    return Arrays.binarySearch(RESPONSE_SUCCESS, request.code()) >= 0;
-  }
-
-  private HttpRequest prepare(HttpRequest request) {
-    if (proxyHost != null) {
-      request.useProxy(proxyHost, proxyPort);
-      if (proxyLogin != null) {
-        request.proxyBasic(proxyLogin, proxyPassword);
-      }
-    }
-    request
-      .acceptGzipEncoding()
-      .uncompress(true)
-      .acceptJson()
-      .acceptCharset(HttpRequest.CHARSET_UTF8)
-      .connectTimeout(connectTimeoutInMilliseconds)
-      .readTimeout(readTimeoutInMilliseconds)
-      .trustAllCerts()
-      .trustAllHosts();
-    if (login != null) {
-      request.basic(login, password);
-    }
-    return request;
-  }
-}
diff --git a/server/sonar-ws-client/src/main/java/org/sonar/wsclient/internal/package-info.java b/server/sonar-ws-client/src/main/java/org/sonar/wsclient/internal/package-info.java
deleted file mode 100644 (file)
index 2bdcdd2..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-/*
- * SonarQube, open source software quality management tool.
- * Copyright (C) 2008-2014 SonarSource
- * mailto:contact AT sonarsource DOT com
- *
- * SonarQube is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * SonarQube is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-
-@javax.annotation.ParametersAreNonnullByDefault
-package org.sonar.wsclient.internal;
diff --git a/server/sonar-ws-client/src/main/java/org/sonar/wsclient/issue/ActionPlan.java b/server/sonar-ws-client/src/main/java/org/sonar/wsclient/issue/ActionPlan.java
deleted file mode 100644 (file)
index 9f00a03..0000000
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
- * SonarQube, open source software quality management tool.
- * Copyright (C) 2008-2014 SonarSource
- * mailto:contact AT sonarsource DOT com
- *
- * SonarQube is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * SonarQube is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-package org.sonar.wsclient.issue;
-
-import javax.annotation.CheckForNull;
-
-import java.util.Date;
-
-/**
- * @since 3.6
- */
-public interface ActionPlan {
-
-  /**
-   * Unique key
-   */
-  String key();
-
-  String project();
-
-  String name();
-
-  @CheckForNull
-  String description();
-
-  String status();
-
-  /**
-   * Login of the user who created the action plan.
-   */
-  String userLogin();
-
-  @CheckForNull
-  Date deadLine();
-
-  Date createdAt();
-
-  Date updatedAt();
-
-  @CheckForNull
-  Integer totalIssues();
-
-  @CheckForNull
-  Integer unresolvedIssues();
-
-}
diff --git a/server/sonar-ws-client/src/main/java/org/sonar/wsclient/issue/ActionPlanClient.java b/server/sonar-ws-client/src/main/java/org/sonar/wsclient/issue/ActionPlanClient.java
deleted file mode 100644 (file)
index a41aa40..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * SonarQube, open source software quality management tool.
- * Copyright (C) 2008-2014 SonarSource
- * mailto:contact AT sonarsource DOT com
- *
- * SonarQube is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * SonarQube is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-package org.sonar.wsclient.issue;
-
-import java.util.List;
-
-/**
- * @since 3.6
- */
-public interface ActionPlanClient {
-
-  List<ActionPlan> find(String projectKey);
-
-  ActionPlan create(NewActionPlan newActionPlan);
-
-  ActionPlan update(UpdateActionPlan updateActionPlan);
-
-  void delete(String actionPlanKey);
-
-  ActionPlan open(String actionPlanKey);
-
-  ActionPlan close(String actionPlanKey);
-
-}
diff --git a/server/sonar-ws-client/src/main/java/org/sonar/wsclient/issue/ActionPlanQuery.java b/server/sonar-ws-client/src/main/java/org/sonar/wsclient/issue/ActionPlanQuery.java
deleted file mode 100644 (file)
index b4a35dc..0000000
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * SonarQube, open source software quality management tool.
- * Copyright (C) 2008-2014 SonarSource
- * mailto:contact AT sonarsource DOT com
- *
- * SonarQube is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * SonarQube is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-package org.sonar.wsclient.issue;
-
-import java.util.HashMap;
-import java.util.Map;
-
-/**
- * @since 3.6
- */
-public class ActionPlanQuery {
-
-  public static final String BASE_URL = "/api/action_plans/search";
-
-  private final Map<String, Object> params = new HashMap<>();
-
-  private ActionPlanQuery() {
-  }
-
-  public static ActionPlanQuery create() {
-    return new ActionPlanQuery();
-  }
-
-  Map<String, Object> urlParams() {
-    return params;
-  }
-}
diff --git a/server/sonar-ws-client/src/main/java/org/sonar/wsclient/issue/BulkChange.java b/server/sonar-ws-client/src/main/java/org/sonar/wsclient/issue/BulkChange.java
deleted file mode 100644 (file)
index 268eae3..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * SonarQube, open source software quality management tool.
- * Copyright (C) 2008-2014 SonarSource
- * mailto:contact AT sonarsource DOT com
- *
- * SonarQube is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * SonarQube is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-package org.sonar.wsclient.issue;
-
-import java.util.List;
-
-/**
- * @since 3.7
- */
-public interface BulkChange {
-
-  List<String> issuesNotChangedKeys();
-
-  Integer totalIssuesChanged();
-
-  Integer totalIssuesNotChanged();
-
-}
diff --git a/server/sonar-ws-client/src/main/java/org/sonar/wsclient/issue/BulkChangeQuery.java b/server/sonar-ws-client/src/main/java/org/sonar/wsclient/issue/BulkChangeQuery.java
deleted file mode 100644 (file)
index 1e9955f..0000000
+++ /dev/null
@@ -1,78 +0,0 @@
-/*
- * SonarQube, open source software quality management tool.
- * Copyright (C) 2008-2014 SonarSource
- * mailto:contact AT sonarsource DOT com
- *
- * SonarQube is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * SonarQube is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-package org.sonar.wsclient.issue;
-
-import org.sonar.wsclient.internal.EncodingUtils;
-
-import java.util.HashMap;
-import java.util.Map;
-
-/**
- * @since 3.7
- */
-public class BulkChangeQuery {
-
-  private final Map<String, Object> params = new HashMap<>();
-
-  private BulkChangeQuery() {
-  }
-
-  public static BulkChangeQuery create() {
-    return new BulkChangeQuery();
-  }
-
-  /**
-   * URL query string, for internal use
-   */
-  public Map<String, Object> urlParams() {
-    return params;
-  }
-
-  public BulkChangeQuery issues(String... keys) {
-    return addParam("issues", keys);
-  }
-
-  public BulkChangeQuery actions(String... actions) {
-    return addParam("actions", actions);
-  }
-
-  public BulkChangeQuery actionParameter(String action, String parameter, Object value) {
-    params.put(action + "." + parameter, value);
-    return this;
-  }
-
-  public BulkChangeQuery comment(String comment) {
-    params.put("comment", comment);
-    return this;
-  }
-
-  public BulkChangeQuery sendNotifications(boolean sendNotifications) {
-    params.put("sendNotifications", String.valueOf(sendNotifications));
-    return this;
-  }
-
-  private BulkChangeQuery addParam(String key, String[] values) {
-    if (values != null) {
-      params.put(key, EncodingUtils.toQueryParam(values));
-    }
-    return this;
-  }
-
-}
diff --git a/server/sonar-ws-client/src/main/java/org/sonar/wsclient/issue/Issue.java b/server/sonar-ws-client/src/main/java/org/sonar/wsclient/issue/Issue.java
deleted file mode 100644 (file)
index 3727840..0000000
+++ /dev/null
@@ -1,103 +0,0 @@
-/*
- * SonarQube, open source software quality management tool.
- * Copyright (C) 2008-2014 SonarSource
- * mailto:contact AT sonarsource DOT com
- *
- * SonarQube is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * SonarQube is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-package org.sonar.wsclient.issue;
-
-import javax.annotation.CheckForNull;
-
-import java.util.Date;
-import java.util.List;
-import java.util.Map;
-
-/**
- * @since 3.6
- */
-public interface Issue {
-
-  /**
-   * Unique key
-   */
-  String key();
-
-  String componentKey();
-
-  /**
-   * @deprecated since 4.4. Use {@link #componentKey()} instead
-   */
-  @Deprecated
-  Long componentId();
-
-  String projectKey();
-
-  String ruleKey();
-
-  String severity();
-
-  @CheckForNull
-  String message();
-
-  @CheckForNull
-  Integer line();
-
-  @CheckForNull
-  String debt();
-
-  String status();
-
-  /**
-   * The resolution type. Null if the issue is not resolved.
-   */
-  @CheckForNull
-  String resolution();
-
-  @CheckForNull
-  String reporter();
-
-  /**
-   * Login of assignee. Null if issue is not assigned.
-   */
-  @CheckForNull
-  String assignee();
-
-  /**
-   * SCM account
-   */
-  @CheckForNull
-  String author();
-
-  @CheckForNull
-  String actionPlan();
-
-  Date creationDate();
-
-  Date updateDate();
-
-  @CheckForNull
-  Date closeDate();
-
-  @CheckForNull
-  String attribute(String key);
-
-  Map<String, String> attributes();
-
-  /**
-   * Non-null list of comments
-   */
-  List<IssueComment> comments();
-}
diff --git a/server/sonar-ws-client/src/main/java/org/sonar/wsclient/issue/IssueChange.java b/server/sonar-ws-client/src/main/java/org/sonar/wsclient/issue/IssueChange.java
deleted file mode 100644 (file)
index b36faeb..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * SonarQube, open source software quality management tool.
- * Copyright (C) 2008-2014 SonarSource
- * mailto:contact AT sonarsource DOT com
- *
- * SonarQube is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * SonarQube is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-package org.sonar.wsclient.issue;
-
-import java.util.Date;
-import java.util.List;
-
-/**
- * @since 4.1
- */
-public interface IssueChange {
-
-  String user();
-
-  Date creationDate();
-
-  List<IssueChangeDiff> diffs();
-
-}
diff --git a/server/sonar-ws-client/src/main/java/org/sonar/wsclient/issue/IssueChangeDiff.java b/server/sonar-ws-client/src/main/java/org/sonar/wsclient/issue/IssueChangeDiff.java
deleted file mode 100644 (file)
index 5bb5abd..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * SonarQube, open source software quality management tool.
- * Copyright (C) 2008-2014 SonarSource
- * mailto:contact AT sonarsource DOT com
- *
- * SonarQube is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * SonarQube is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-package org.sonar.wsclient.issue;
-
-import javax.annotation.CheckForNull;
-
-/**
- * @since 4.1
- */
-public interface IssueChangeDiff {
-
-  String key();
-
-  @CheckForNull
-  Object newValue();
-
-  @CheckForNull
-  Object oldValue();
-
-}
diff --git a/server/sonar-ws-client/src/main/java/org/sonar/wsclient/issue/IssueClient.java b/server/sonar-ws-client/src/main/java/org/sonar/wsclient/issue/IssueClient.java
deleted file mode 100644 (file)
index 5168a6f..0000000
+++ /dev/null
@@ -1,90 +0,0 @@
-/*
- * SonarQube, open source software quality management tool.
- * Copyright (C) 2008-2014 SonarSource
- * mailto:contact AT sonarsource DOT com
- *
- * SonarQube is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * SonarQube is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-package org.sonar.wsclient.issue;
-
-import javax.annotation.Nullable;
-
-import java.util.List;
-
-/**
- * This client is a wrapper over the web services related to issues
- *
- * @since 3.6
- */
-public interface IssueClient {
-
-  /**
-   * Wrap the web service /api/issues/search in order to search for issues.
-   */
-  Issues find(IssueQuery query);
-
-  /**
-   * Assign an existing issue to a user. A null assignee removes the assignee.
-   *
-   * @return the updated issue
-   */
-  Issue assign(String issueKey, @Nullable String assignee);
-
-  /**
-   * Assign an existing issue to current user.
-   *
-   * @return the updated issue
-   */
-  Issue assignToMe(String issueKey);
-
-
-  /**
-   * Change the severity of an existing issue. Supported values are "INFO", "MINOR",
-   * "MAJOR", "CRITICAL" and "BLOCKER".
-   *
-   * @return the updated issue
-   */
-  Issue setSeverity(String issueKey, String severity);
-
-  /**
-   * Link an existing issue to an action plan. A null action plan unlinks the issue.
-   */
-  Issue plan(String issueKey, @Nullable String actionPlan);
-
-  IssueComment addComment(String issueKey, String markdownText);
-
-  Issue create(NewIssue issue);
-
-  List<String> transitions(String issueKey);
-
-  Issue doTransition(String issueKey, String transition);
-
-  List<String> actions(String issueKey);
-
-  Issue doAction(String issueKey, String action);
-
-  /**
-   * Execute bulk change on a list of issues
-   */
-  BulkChange bulkChange(BulkChangeQuery query);
-
-  /**
-   * @since 4.1
-   *
-   * @return the list of changes of an issue
-   */
-  List<IssueChange> changes(String issueKey);
-
-}
diff --git a/server/sonar-ws-client/src/main/java/org/sonar/wsclient/issue/IssueComment.java b/server/sonar-ws-client/src/main/java/org/sonar/wsclient/issue/IssueComment.java
deleted file mode 100644 (file)
index b541ded..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * SonarQube, open source software quality management tool.
- * Copyright (C) 2008-2014 SonarSource
- * mailto:contact AT sonarsource DOT com
- *
- * SonarQube is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * SonarQube is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-package org.sonar.wsclient.issue;
-
-import java.util.Date;
-
-/**
- * @since 3.6
- */
-public interface IssueComment {
-  String key();
-
-  String htmlText();
-
-  String login();
-
-  Date createdAt();
-}
diff --git a/server/sonar-ws-client/src/main/java/org/sonar/wsclient/issue/IssueQuery.java b/server/sonar-ws-client/src/main/java/org/sonar/wsclient/issue/IssueQuery.java
deleted file mode 100644 (file)
index ba8878c..0000000
+++ /dev/null
@@ -1,162 +0,0 @@
-/*
- * SonarQube, open source software quality management tool.
- * Copyright (C) 2008-2014 SonarSource
- * mailto:contact AT sonarsource DOT com
- *
- * SonarQube is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * SonarQube is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-package org.sonar.wsclient.issue;
-
-import org.sonar.wsclient.internal.EncodingUtils;
-
-import java.util.Date;
-import java.util.HashMap;
-import java.util.Map;
-
-/**
- * @since 3.6
- */
-public class IssueQuery {
-
-  private final Map<String, Object> params = new HashMap<>();
-
-  private IssueQuery() {
-  }
-
-  public static IssueQuery create() {
-    return new IssueQuery();
-  }
-
-  /**
-   * URL query string, for internal use
-   */
-  public Map<String, Object> urlParams() {
-    return params;
-  }
-
-  public IssueQuery issues(String... keys) {
-    return addParam("issues", keys);
-  }
-
-  public IssueQuery severities(String... severities) {
-    return addParam("severities", severities);
-  }
-
-  public IssueQuery statuses(String... statuses) {
-    return addParam("statuses", statuses);
-  }
-
-  public IssueQuery resolutions(String... resolutions) {
-    return addParam("resolutions", resolutions);
-  }
-
-  public IssueQuery components(String... components) {
-    return addParam("components", components);
-  }
-
-  public IssueQuery onComponentOnly(boolean onComponentOnly) {
-    params.put("onComponentOnly", onComponentOnly);
-    return this;
-  }
-
-  public IssueQuery rules(String... s) {
-    return addParam("rules", s);
-  }
-
-  public IssueQuery actionPlans(String... s) {
-    return addParam("actionPlans", s);
-  }
-
-  public IssueQuery reporters(String... s) {
-    return addParam("reporters", s);
-  }
-
-  public IssueQuery assignees(String... s) {
-    return addParam("assignees", s);
-  }
-  public IssueQuery languages(String... s) {
-    return addParam("languages", s);
-  }
-
-  public IssueQuery assigned(Boolean assigned) {
-    params.put("assigned", assigned);
-    return this;
-  }
-
-  public IssueQuery planned(Boolean planned) {
-    params.put("planned", planned);
-    return this;
-  }
-
-  public IssueQuery resolved(Boolean resolved) {
-    params.put("resolved", resolved);
-    return this;
-  }
-
-  /**
-   * @since 4.2
-   */
-  public IssueQuery hideRules(Boolean hideRules) {
-    params.put("hideRules", hideRules);
-    return this;
-  }
-
-  /**
-   * Require second precision.
-   * @since 3.7
-   */
-  public IssueQuery createdAt(Date d) {
-    params.put("createdAt", EncodingUtils.toQueryParam(d, true));
-    return this;
-  }
-
-  public IssueQuery createdAfter(Date d) {
-    params.put("createdAfter", EncodingUtils.toQueryParam(d, true));
-    return this;
-  }
-
-  public IssueQuery createdBefore(Date d) {
-    params.put("createdBefore", EncodingUtils.toQueryParam(d, true));
-    return this;
-  }
-
-  public IssueQuery sort(String sort) {
-    params.put("sort", sort);
-    return this;
-  }
-
-  public IssueQuery asc(boolean asc) {
-    params.put("asc", asc);
-    return this;
-  }
-
-  public IssueQuery pageSize(int pageSize) {
-    params.put("pageSize", pageSize);
-    return this;
-  }
-
-  public IssueQuery pageIndex(int pageIndex) {
-    params.put("pageIndex", pageIndex);
-    return this;
-  }
-
-  private IssueQuery addParam(String key, String[] values) {
-    if (values != null) {
-      params.put(key, EncodingUtils.toQueryParam(values));
-    }
-    return this;
-  }
-
-}
diff --git a/server/sonar-ws-client/src/main/java/org/sonar/wsclient/issue/Issues.java b/server/sonar-ws-client/src/main/java/org/sonar/wsclient/issue/Issues.java
deleted file mode 100644 (file)
index a3baba1..0000000
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
- * SonarQube, open source software quality management tool.
- * Copyright (C) 2008-2014 SonarSource
- * mailto:contact AT sonarsource DOT com
- *
- * SonarQube is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * SonarQube is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-package org.sonar.wsclient.issue;
-
-import org.sonar.wsclient.base.Paging;
-import org.sonar.wsclient.component.Component;
-import org.sonar.wsclient.rule.Rule;
-import org.sonar.wsclient.user.User;
-
-import javax.annotation.CheckForNull;
-
-import java.util.Collection;
-import java.util.List;
-
-/**
- * @since 3.6
- */
-public interface Issues {
-  List<Issue> list();
-
-  int size();
-
-  Collection<Rule> rules();
-
-  Rule rule(Issue issue);
-
-  Collection<User> users();
-
-  @CheckForNull
-  User user(String login);
-
-  Collection<Component> components();
-
-  @CheckForNull
-  Component component(Issue issue);
-
-  @CheckForNull
-  Component componentById(long id);
-
-  @CheckForNull
-  Component componentByKey(String key);
-
-  Collection<Component> projects();
-
-  @CheckForNull
-  Component project(Issue issue);
-
-  Collection<ActionPlan> actionPlans();
-
-  @CheckForNull
-  ActionPlan actionPlans(Issue issue);
-
-  Paging paging();
-
-}
diff --git a/server/sonar-ws-client/src/main/java/org/sonar/wsclient/issue/NewActionPlan.java b/server/sonar-ws-client/src/main/java/org/sonar/wsclient/issue/NewActionPlan.java
deleted file mode 100644 (file)
index b25476f..0000000
+++ /dev/null
@@ -1,66 +0,0 @@
-/*
- * SonarQube, open source software quality management tool.
- * Copyright (C) 2008-2014 SonarSource
- * mailto:contact AT sonarsource DOT com
- *
- * SonarQube is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * SonarQube is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-package org.sonar.wsclient.issue;
-
-import org.sonar.wsclient.internal.EncodingUtils;
-
-import java.util.Date;
-import java.util.HashMap;
-import java.util.Map;
-
-/**
- * @since 3.6
- */
-public class NewActionPlan {
-
-  private final Map<String, Object> params = new HashMap<>();
-
-  private NewActionPlan() {
-  }
-
-  public static NewActionPlan create() {
-    return new NewActionPlan();
-  }
-
-  public Map<String, Object> urlParams() {
-    return params;
-  }
-
-  public NewActionPlan name(String s) {
-    params.put("name", s);
-    return this;
-  }
-
-  public NewActionPlan project(String s) {
-    params.put("project", s);
-    return this;
-  }
-
-  public NewActionPlan description(String s) {
-    params.put("description", s);
-    return this;
-  }
-
-  public NewActionPlan deadLine(Date deadLine) {
-    params.put("deadLine", EncodingUtils.toQueryParam(deadLine, false));
-    return this;
-  }
-
-}
diff --git a/server/sonar-ws-client/src/main/java/org/sonar/wsclient/issue/NewIssue.java b/server/sonar-ws-client/src/main/java/org/sonar/wsclient/issue/NewIssue.java
deleted file mode 100644 (file)
index 2eab384..0000000
+++ /dev/null
@@ -1,87 +0,0 @@
-/*
- * SonarQube, open source software quality management tool.
- * Copyright (C) 2008-2014 SonarSource
- * mailto:contact AT sonarsource DOT com
- *
- * SonarQube is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * SonarQube is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-package org.sonar.wsclient.issue;
-
-import javax.annotation.Nullable;
-import java.util.HashMap;
-import java.util.Map;
-
-/**
- * @since 3.6
- */
-public class NewIssue {
-
-  private final Map<String, Object> params = new HashMap<>();
-
-  private NewIssue() {
-  }
-
-  public static NewIssue create() {
-    return new NewIssue();
-  }
-
-  public Map<String, Object> urlParams() {
-    return params;
-  }
-
-  /**
-   * Optionally set the severity, in INFO, MINOR, MAJOR, CRITICAL or BLOCKER. Default value is MAJOR.
-   */
-  public NewIssue severity(@Nullable String s) {
-    params.put("severity", s);
-    return this;
-  }
-
-  public NewIssue component(String s) {
-    params.put("component", s);
-    return this;
-  }
-
-  /**
-   * Rule key prefixed by the repository, for example "checkstyle:AvoidCycle".
-   */
-  public NewIssue rule(String s) {
-    params.put("rule", s);
-    return this;
-  }
-
-  /**
-   * Optional line, starting from 1.
-   */
-  public NewIssue line(@Nullable Integer i) {
-    params.put("line", i);
-    return this;
-  }
-
-  public NewIssue message(@Nullable String s) {
-    params.put("message", s);
-    return this;
-  }
-
-  public NewIssue effortToFix(@Nullable Double d) {
-    params.put("effortToFix", d);
-    return this;
-  }
-
-  public NewIssue attribute(String key, String value) {
-    params.put("attr[" + key + "]", value);
-    return this;
-  }
-}
diff --git a/server/sonar-ws-client/src/main/java/org/sonar/wsclient/issue/UpdateActionPlan.java b/server/sonar-ws-client/src/main/java/org/sonar/wsclient/issue/UpdateActionPlan.java
deleted file mode 100644 (file)
index 80bf4ec..0000000
+++ /dev/null
@@ -1,66 +0,0 @@
-/*
- * SonarQube, open source software quality management tool.
- * Copyright (C) 2008-2014 SonarSource
- * mailto:contact AT sonarsource DOT com
- *
- * SonarQube is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * SonarQube is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-package org.sonar.wsclient.issue;
-
-import org.sonar.wsclient.internal.EncodingUtils;
-
-import java.util.Date;
-import java.util.HashMap;
-import java.util.Map;
-
-/**
- * @since 3.6
- */
-public class UpdateActionPlan {
-
-  private final Map<String, Object> params = new HashMap<>();
-
-  private UpdateActionPlan() {
-  }
-
-  public static UpdateActionPlan create() {
-    return new UpdateActionPlan();
-  }
-
-  public Map<String, Object> urlParams() {
-    return params;
-  }
-
-  public UpdateActionPlan key(String s) {
-    params.put("key", s);
-    return this;
-  }
-
-  public UpdateActionPlan name(String s) {
-    params.put("name", s);
-    return this;
-  }
-
-  public UpdateActionPlan description(String s) {
-    params.put("description", s);
-    return this;
-  }
-
-  public UpdateActionPlan deadLine(Date deadLine) {
-    params.put("deadLine", EncodingUtils.toQueryParam(deadLine, false));
-    return this;
-  }
-
-}
diff --git a/server/sonar-ws-client/src/main/java/org/sonar/wsclient/issue/internal/DefaultActionPlan.java b/server/sonar-ws-client/src/main/java/org/sonar/wsclient/issue/internal/DefaultActionPlan.java
deleted file mode 100644 (file)
index 26730ea..0000000
+++ /dev/null
@@ -1,105 +0,0 @@
-/*
- * SonarQube, open source software quality management tool.
- * Copyright (C) 2008-2014 SonarSource
- * mailto:contact AT sonarsource DOT com
- *
- * SonarQube is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * SonarQube is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-package org.sonar.wsclient.issue.internal;
-
-import org.sonar.wsclient.issue.ActionPlan;
-import org.sonar.wsclient.unmarshallers.JsonUtils;
-
-import javax.annotation.CheckForNull;
-import java.util.Date;
-import java.util.Map;
-
-/**
- * @since 3.6
- */
-public class DefaultActionPlan implements ActionPlan {
-
-  private final Map json;
-
-  DefaultActionPlan(Map json) {
-    this.json = json;
-  }
-
-  /**
-   * Unique key
-   */
-  @Override
-  public String key() {
-    return JsonUtils.getString(json, "key");
-  }
-
-  @Override
-  public String project() {
-    return JsonUtils.getString(json, "project");
-  }
-
-  @Override
-  public String name() {
-    return JsonUtils.getString(json, "name");
-  }
-
-  @Override
-  @CheckForNull
-  public String description() {
-    return JsonUtils.getString(json, "desc");
-  }
-
-  @Override
-  public String status() {
-    return JsonUtils.getString(json, "status");
-  }
-
-  /**
-   * Login of the user who created the action plan.
-   */
-  @Override
-  public String userLogin() {
-    return JsonUtils.getString(json, "userLogin");
-  }
-
-  @Override
-  @CheckForNull
-  public Date deadLine() {
-    return JsonUtils.getDateTime(json, "deadLine");
-  }
-
-  @Override
-  public Date createdAt() {
-    return JsonUtils.getDateTime(json, "createdAt");
-  }
-
-  @Override
-  public Date updatedAt() {
-    return JsonUtils.getDateTime(json, "updatedAt");
-  }
-
-  @Override
-  @CheckForNull
-  public Integer totalIssues() {
-    return JsonUtils.getInteger(json, "totalIssues");
-  }
-
-  @Override
-  @CheckForNull
-  public Integer unresolvedIssues() {
-    return JsonUtils.getInteger(json, "unresolvedIssues");
-  }
-
-}
diff --git a/server/sonar-ws-client/src/main/java/org/sonar/wsclient/issue/internal/DefaultActionPlanClient.java b/server/sonar-ws-client/src/main/java/org/sonar/wsclient/issue/internal/DefaultActionPlanClient.java
deleted file mode 100644 (file)
index 6820982..0000000
+++ /dev/null
@@ -1,97 +0,0 @@
-/*
- * SonarQube, open source software quality management tool.
- * Copyright (C) 2008-2014 SonarSource
- * mailto:contact AT sonarsource DOT com
- *
- * SonarQube is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * SonarQube is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-package org.sonar.wsclient.issue.internal;
-
-import org.json.simple.JSONValue;
-import org.sonar.wsclient.internal.EncodingUtils;
-import org.sonar.wsclient.internal.HttpRequestFactory;
-import org.sonar.wsclient.issue.*;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Map;
-
-/**
- * Do not instantiate this class, but use {@link org.sonar.wsclient.SonarClient#actionPlanClient()}.
- */
-public class DefaultActionPlanClient implements ActionPlanClient {
-
-  private final HttpRequestFactory requestFactory;
-
-  /**
-   * For internal use. Use {@link org.sonar.wsclient.SonarClient} to get an instance.
-   */
-  public DefaultActionPlanClient(HttpRequestFactory requestFactory) {
-    this.requestFactory = requestFactory;
-  }
-
-  @Override
-  public List<ActionPlan> find(String projectKey) {
-    String json = requestFactory.get(ActionPlanQuery.BASE_URL, EncodingUtils.toMap("project", projectKey));
-    List<ActionPlan> result = new ArrayList<>();
-    Map jsonRoot = (Map) JSONValue.parse(json);
-    List<Map> jsonActionPlans = (List<Map>) jsonRoot.get("actionPlans");
-    if (jsonActionPlans != null) {
-      for (Map jsonActionPlan : jsonActionPlans) {
-        result.add(new DefaultActionPlan(jsonActionPlan));
-      }
-    }
-    return result;
-  }
-
-  @Override
-  public ActionPlan create(NewActionPlan newActionPlan) {
-    String json = requestFactory.post("/api/action_plans/create", newActionPlan.urlParams());
-    return createActionPlanResult(json);
-  }
-
-  @Override
-  public ActionPlan update(UpdateActionPlan updateActionPlan) {
-    String json = requestFactory.post("/api/action_plans/update", updateActionPlan.urlParams());
-    return createActionPlanResult(json);
-  }
-
-  @Override
-  public void delete(String actionPlanKey) {
-    executeSimpleAction(actionPlanKey, "delete");
-  }
-
-  @Override
-  public ActionPlan open(String actionPlanKey) {
-    String json = executeSimpleAction(actionPlanKey, "open");
-    return createActionPlanResult(json);
-  }
-
-  @Override
-  public ActionPlan close(String actionPlanKey) {
-    String json = executeSimpleAction(actionPlanKey, "close");
-    return createActionPlanResult(json);
-  }
-
-  private String executeSimpleAction(String actionPlanKey, String action) {
-    return requestFactory.post("/api/action_plans/" + action, EncodingUtils.toMap("key", actionPlanKey));
-  }
-
-  private ActionPlan createActionPlanResult(String json) {
-    Map jsonRoot = (Map) JSONValue.parse(json);
-    return new DefaultActionPlan((Map) jsonRoot.get("actionPlan"));
-  }
-
-}
diff --git a/server/sonar-ws-client/src/main/java/org/sonar/wsclient/issue/internal/DefaultBulkChange.java b/server/sonar-ws-client/src/main/java/org/sonar/wsclient/issue/internal/DefaultBulkChange.java
deleted file mode 100644 (file)
index 9e51a56..0000000
+++ /dev/null
@@ -1,76 +0,0 @@
-/*
- * SonarQube, open source software quality management tool.
- * Copyright (C) 2008-2014 SonarSource
- * mailto:contact AT sonarsource DOT com
- *
- * SonarQube is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * SonarQube is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-package org.sonar.wsclient.issue.internal;
-
-import org.sonar.wsclient.issue.BulkChange;
-
-import javax.annotation.CheckForNull;
-import javax.annotation.Nullable;
-
-import java.util.ArrayList;
-import java.util.List;
-
-/**
- * @since 3.7
- */
-public class DefaultBulkChange implements BulkChange {
-
-  private Integer totalIssuesChanged;
-  private Integer totalIssuesNotChanged;
-  private final List<String> issuesNotChangedKeys = new ArrayList<>();
-
-  @Override
-  public List<String> issuesNotChangedKeys() {
-    return issuesNotChangedKeys;
-  }
-
-  @Override
-  @CheckForNull
-  public Integer totalIssuesChanged() {
-    return totalIssuesChanged;
-  }
-
-  @Override
-  @CheckForNull
-  public Integer totalIssuesNotChanged() {
-    return totalIssuesNotChanged;
-  }
-
-  DefaultBulkChange setTotalIssuesChanged(@Nullable Integer totalIssuesChanged) {
-    this.totalIssuesChanged = totalIssuesChanged;
-    return this;
-  }
-
-  DefaultBulkChange setTotalIssuesNotChanged(@Nullable Integer totalIssuesNotChanged) {
-    this.totalIssuesNotChanged = totalIssuesNotChanged;
-    return this;
-  }
-
-  DefaultBulkChange setIssuesNotChanged(List<String> issueKeys) {
-    issuesNotChangedKeys.addAll(issueKeys);
-    return this;
-  }
-
-  DefaultBulkChange addIssueNotchanged(String issueKey) {
-    issuesNotChangedKeys.add(issueKey);
-    return this;
-  }
-
-}
diff --git a/server/sonar-ws-client/src/main/java/org/sonar/wsclient/issue/internal/DefaultIssue.java b/server/sonar-ws-client/src/main/java/org/sonar/wsclient/issue/internal/DefaultIssue.java
deleted file mode 100644 (file)
index 7bbc8f8..0000000
+++ /dev/null
@@ -1,181 +0,0 @@
-/*
- * SonarQube, open source software quality management tool.
- * Copyright (C) 2008-2014 SonarSource
- * mailto:contact AT sonarsource DOT com
- *
- * SonarQube is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * SonarQube is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-package org.sonar.wsclient.issue.internal;
-
-import org.sonar.wsclient.issue.Issue;
-import org.sonar.wsclient.issue.IssueComment;
-import org.sonar.wsclient.unmarshallers.JsonUtils;
-
-import javax.annotation.CheckForNull;
-
-import java.util.*;
-
-/**
- * @since 3.6
- */
-public class DefaultIssue implements Issue {
-
-  private final Map json;
-
-  DefaultIssue(Map json) {
-    this.json = json;
-  }
-
-  /**
-   * Unique key
-   */
-  @Override
-  public String key() {
-    return JsonUtils.getString(json, "key");
-  }
-
-  @Override
-  public Long componentId() {
-    return JsonUtils.getLong(json, "componentId");
-  }
-
-  @Override
-  public String componentKey() {
-    return JsonUtils.getString(json, "component");
-  }
-
-  @Override
-  public String projectKey() {
-    return JsonUtils.getString(json, "project");
-  }
-
-  @Override
-  public String ruleKey() {
-    return JsonUtils.getString(json, "rule");
-  }
-
-  @Override
-  public String severity() {
-    return JsonUtils.getString(json, "severity");
-  }
-
-  @Override
-  @CheckForNull
-  public String message() {
-    return JsonUtils.getString(json, "message");
-  }
-
-  @Override
-  @CheckForNull
-  public Integer line() {
-    return JsonUtils.getInteger(json, "line");
-  }
-
-  @Override
-  @CheckForNull
-  public String debt() {
-    return JsonUtils.getString(json, "debt");
-  }
-
-  @Override
-  public String status() {
-    return JsonUtils.getString(json, "status");
-  }
-
-  /**
-   * The resolution type. Null if the issue is not resolved.
-   */
-  @Override
-  @CheckForNull
-  public String resolution() {
-    return JsonUtils.getString(json, "resolution");
-  }
-
-  @Override
-  @CheckForNull
-  public String reporter() {
-    return JsonUtils.getString(json, "reporter");
-  }
-
-  /**
-   * Login of assignee. Null if issue is not assigned.
-   */
-  @Override
-  @CheckForNull
-  public String assignee() {
-    return JsonUtils.getString(json, "assignee");
-  }
-
-  /**
-   * SCM account
-   */
-  @Override
-  @CheckForNull
-  public String author() {
-    return JsonUtils.getString(json, "author");
-  }
-
-  @Override
-  @CheckForNull
-  public String actionPlan() {
-    return JsonUtils.getString(json, "actionPlan");
-  }
-
-  @Override
-  public Date creationDate() {
-    return JsonUtils.getDateTime(json, "creationDate");
-  }
-
-  @Override
-  public Date updateDate() {
-    return JsonUtils.getDateTime(json, "updateDate");
-  }
-
-  @Override
-  @CheckForNull
-  public Date closeDate() {
-    return JsonUtils.getDateTime(json, "closeDate");
-  }
-
-  @Override
-  @CheckForNull
-  public String attribute(String key) {
-    return attributes().get(key);
-  }
-
-  @Override
-  public Map<String, String> attributes() {
-    Map<String, String> attr = (Map<String, String>) json.get("attr");
-    if (attr == null) {
-      return Collections.emptyMap();
-    }
-    return attr;
-  }
-
-  /**
-   * Non-null list of comments
-   */
-  @Override
-  public List<IssueComment> comments() {
-    List<IssueComment> comments = new ArrayList<>();
-    List<Map> jsonComments = (List<Map>) json.get("comments");
-    if (jsonComments != null) {
-      for (Map jsonComment : jsonComments) {
-        comments.add(new DefaultIssueComment(jsonComment));
-      }
-    }
-    return comments;
-  }
-}
diff --git a/server/sonar-ws-client/src/main/java/org/sonar/wsclient/issue/internal/DefaultIssueChange.java b/server/sonar-ws-client/src/main/java/org/sonar/wsclient/issue/internal/DefaultIssueChange.java
deleted file mode 100644 (file)
index dacd93c..0000000
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
- * SonarQube, open source software quality management tool.
- * Copyright (C) 2008-2014 SonarSource
- * mailto:contact AT sonarsource DOT com
- *
- * SonarQube is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * SonarQube is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-package org.sonar.wsclient.issue.internal;
-
-import org.sonar.wsclient.issue.IssueChange;
-import org.sonar.wsclient.issue.IssueChangeDiff;
-import org.sonar.wsclient.unmarshallers.JsonUtils;
-
-import java.util.ArrayList;
-import java.util.Date;
-import java.util.List;
-import java.util.Map;
-
-/**
- * @since 4.1
- */
-public class DefaultIssueChange implements IssueChange {
-
-  private final Map json;
-
-  DefaultIssueChange(Map json) {
-    this.json = json;
-  }
-
-  @Override
-  public String user() {
-    return JsonUtils.getString(json, "user");
-  }
-
-  @Override
-  public Date creationDate() {
-    return JsonUtils.getDateTime(json, "creationDate");
-  }
-
-  @Override
-  public List<IssueChangeDiff> diffs() {
-    List<IssueChangeDiff> diffs = new ArrayList<>();
-    List<Map> jsonDiffs = (List<Map>) json.get("diffs");
-    for (Map jsonDiff : jsonDiffs) {
-      diffs.add(new DefaultIssueChangeDiff(jsonDiff));
-    }
-    return diffs;
-  }
-
-}
diff --git a/server/sonar-ws-client/src/main/java/org/sonar/wsclient/issue/internal/DefaultIssueChangeDiff.java b/server/sonar-ws-client/src/main/java/org/sonar/wsclient/issue/internal/DefaultIssueChangeDiff.java
deleted file mode 100644 (file)
index e74b7c1..0000000
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
- * SonarQube, open source software quality management tool.
- * Copyright (C) 2008-2014 SonarSource
- * mailto:contact AT sonarsource DOT com
- *
- * SonarQube is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * SonarQube is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-package org.sonar.wsclient.issue.internal;
-
-import org.sonar.wsclient.issue.IssueChangeDiff;
-import org.sonar.wsclient.unmarshallers.JsonUtils;
-
-import javax.annotation.CheckForNull;
-
-import java.util.Map;
-
-/**
- * @since 4.1
- */
-public class DefaultIssueChangeDiff implements IssueChangeDiff {
-
-  private final Map json;
-
-  DefaultIssueChangeDiff(Map json) {
-    this.json = json;
-  }
-
-  @Override
-  public String key() {
-    return JsonUtils.getString(json, "key");
-  }
-
-  @Override
-  @CheckForNull
-  public Object newValue() {
-    return parseValue("newValue");
-
-  }
-
-  @Override
-  @CheckForNull
-  public Object oldValue() {
-    return parseValue("oldValue");
-  }
-
-  private Object parseValue(String attribute) {
-    return JsonUtils.getString(json, attribute);
-  }
-
-}
diff --git a/server/sonar-ws-client/src/main/java/org/sonar/wsclient/issue/internal/DefaultIssueClient.java b/server/sonar-ws-client/src/main/java/org/sonar/wsclient/issue/internal/DefaultIssueClient.java
deleted file mode 100644 (file)
index 024f5dd..0000000
+++ /dev/null
@@ -1,142 +0,0 @@
-/*
- * SonarQube, open source software quality management tool.
- * Copyright (C) 2008-2014 SonarSource
- * mailto:contact AT sonarsource DOT com
- *
- * SonarQube is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * SonarQube is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-package org.sonar.wsclient.issue.internal;
-
-import org.json.simple.JSONValue;
-import org.sonar.wsclient.internal.EncodingUtils;
-import org.sonar.wsclient.internal.HttpRequestFactory;
-import org.sonar.wsclient.issue.*;
-
-import javax.annotation.Nullable;
-
-import java.util.List;
-import java.util.Map;
-
-/**
- * Do not instantiate this class, but use {@link org.sonar.wsclient.SonarClient#issueClient()}.
- */
-public class DefaultIssueClient implements IssueClient {
-
-  private static final String SEARCH_URL = "/api/issues/search";
-  private static final String ASSIGN_URL = "/api/issues/assign";
-
-  private final HttpRequestFactory requestFactory;
-  private final IssueJsonParser parser;
-
-  public DefaultIssueClient(HttpRequestFactory requestFactory) {
-    this.requestFactory = requestFactory;
-    this.parser = new IssueJsonParser();
-  }
-
-  @Override
-  public Issues find(IssueQuery query) {
-    String json = requestFactory.get(SEARCH_URL, query.urlParams());
-    return parser.parseIssues(json);
-  }
-
-  @Override
-  public Issue create(NewIssue newIssue) {
-    String json = requestFactory.post("/api/issues/create", newIssue.urlParams());
-    return jsonToIssue(json);
-  }
-
-  @Override
-  public Issue setSeverity(String issueKey, String severity) {
-    Map<String, Object> params = EncodingUtils.toMap("issue", issueKey, "severity", severity);
-    String json = requestFactory.post("/api/issues/set_severity", params);
-    return jsonToIssue(json);
-  }
-
-  @Override
-  public Issue assign(String issueKey, @Nullable String assignee) {
-    Map<String, Object> params = EncodingUtils.toMap("issue", issueKey, "assignee", assignee);
-    String json = requestFactory.post(ASSIGN_URL, params);
-    return jsonToIssue(json);
-  }
-
-  @Override
-  public Issue assignToMe(String issueKey) {
-    Map<String, Object> params = EncodingUtils.toMap("issue", issueKey, "me", "true");
-    String json = requestFactory.post(ASSIGN_URL, params);
-    return jsonToIssue(json);
-  }
-
-  @Override
-  public Issue plan(String issueKey, @Nullable String actionPlanKey) {
-    Map<String, Object> params = EncodingUtils.toMap("issue", issueKey, "plan", actionPlanKey);
-    String json = requestFactory.post("/api/issues/plan", params);
-    return jsonToIssue(json);
-  }
-
-  @Override
-  public IssueComment addComment(String issueKey, String markdownText) {
-    Map<String, Object> params = EncodingUtils.toMap("issue", issueKey, "text", markdownText);
-    String json = requestFactory.post("/api/issues/add_comment", params);
-    Map rootJson = (Map) JSONValue.parse(json);
-    return new DefaultIssueComment((Map) rootJson.get("comment"));
-  }
-
-  @Override
-  public List<String> transitions(String issueKey) {
-    Map<String, Object> queryParams = EncodingUtils.toMap("issue", issueKey);
-    String json = requestFactory.get("/api/issues/transitions", queryParams);
-    return parser.parseTransitions(json);
-  }
-
-  @Override
-  public Issue doTransition(String issueKey, String transition) {
-    Map<String, Object> params = EncodingUtils.toMap("issue", issueKey, "transition", transition);
-    String json = requestFactory.post("/api/issues/do_transition", params);
-    return jsonToIssue(json);
-  }
-
-  @Override
-  public List<String> actions(String issueKey) {
-    Map<String, Object> queryParams = EncodingUtils.toMap("issue", issueKey);
-    String json = requestFactory.get("/api/issues/actions", queryParams);
-    return parser.parseActions(json);
-  }
-
-  @Override
-  public Issue doAction(String issueKey, String action) {
-    Map<String, Object> params = EncodingUtils.toMap("issue", issueKey, "actionKey", action);
-    String json = requestFactory.post("/api/issues/do_action", params);
-    return jsonToIssue(json);
-  }
-
-  @Override
-  public BulkChange bulkChange(BulkChangeQuery query) {
-    String json = requestFactory.post("/api/issues/bulk_change", query.urlParams());
-    return parser.parseBulkChange(json);
-  }
-
-  @Override
-  public List<IssueChange> changes(String issueKey) {
-    Map<String, Object> queryParams = EncodingUtils.toMap("issue", issueKey);
-    String json = requestFactory.post("/api/issues/changelog", queryParams);
-    return parser.parseChangelog(json);
-  }
-
-  private Issue jsonToIssue(String json) {
-    Map jsonRoot = (Map) JSONValue.parse(json);
-    return new DefaultIssue((Map) jsonRoot.get("issue"));
-  }
-
-}
diff --git a/server/sonar-ws-client/src/main/java/org/sonar/wsclient/issue/internal/DefaultIssueComment.java b/server/sonar-ws-client/src/main/java/org/sonar/wsclient/issue/internal/DefaultIssueComment.java
deleted file mode 100644 (file)
index 103bb94..0000000
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * SonarQube, open source software quality management tool.
- * Copyright (C) 2008-2014 SonarSource
- * mailto:contact AT sonarsource DOT com
- *
- * SonarQube is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * SonarQube is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-package org.sonar.wsclient.issue.internal;
-
-import org.sonar.wsclient.issue.IssueComment;
-import org.sonar.wsclient.unmarshallers.JsonUtils;
-
-import java.util.Date;
-import java.util.Map;
-
-/**
- * @since 3.6
- */
-public class DefaultIssueComment implements IssueComment {
-  private final Map json;
-
-  DefaultIssueComment(Map json) {
-    this.json = json;
-  }
-
-  @Override
-  public String key() {
-    return JsonUtils.getString(json, "key");
-  }
-
-  @Override
-  public String htmlText() {
-    return JsonUtils.getString(json, "htmlText");
-  }
-
-  @Override
-  public String login() {
-    return JsonUtils.getString(json, "login");
-  }
-
-  @Override
-  public Date createdAt() {
-    return JsonUtils.getDateTime(json, "createdAt");
-  }
-}
diff --git a/server/sonar-ws-client/src/main/java/org/sonar/wsclient/issue/internal/DefaultIssues.java b/server/sonar-ws-client/src/main/java/org/sonar/wsclient/issue/internal/DefaultIssues.java
deleted file mode 100644 (file)
index 524d7b5..0000000
+++ /dev/null
@@ -1,167 +0,0 @@
-/*
- * SonarQube, open source software quality management tool.
- * Copyright (C) 2008-2014 SonarSource
- * mailto:contact AT sonarsource DOT com
- *
- * SonarQube is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * SonarQube is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-package org.sonar.wsclient.issue.internal;
-
-import org.sonar.wsclient.base.Paging;
-import org.sonar.wsclient.component.Component;
-import org.sonar.wsclient.issue.ActionPlan;
-import org.sonar.wsclient.issue.Issue;
-import org.sonar.wsclient.issue.Issues;
-import org.sonar.wsclient.rule.Rule;
-import org.sonar.wsclient.user.User;
-
-import javax.annotation.CheckForNull;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-/**
- * @since 3.6
- */
-public class DefaultIssues implements Issues {
-
-  private final List<Issue> list = new ArrayList<>();
-  private final Map<String, Rule> rulesByKey = new HashMap<>();
-  private final Map<String, User> usersByKey = new HashMap<>();
-  private final Map<Long, Component> componentsById = new HashMap<>();
-  private final Map<String, Component> componentsByKey = new HashMap<>();
-  private final Map<String, Component> projectsByKey = new HashMap<>();
-  private final Map<String, ActionPlan> actionPlansByKey = new HashMap<>();
-  private Paging paging;
-
-  @Override
-  public List<Issue> list() {
-    return list;
-  }
-
-  @Override
-  public int size() {
-    return list.size();
-  }
-
-  @Override
-  public Collection<Rule> rules() {
-    return rulesByKey.values();
-  }
-
-  @Override
-  public Rule rule(Issue issue) {
-    return rulesByKey.get(issue.ruleKey());
-  }
-
-  @Override
-  public Collection<User> users() {
-    return usersByKey.values();
-  }
-
-  @Override
-  @CheckForNull
-  public User user(String login) {
-    return usersByKey.get(login);
-  }
-
-  @Override
-  public Collection<Component> components() {
-    return componentsByKey.values();
-  }
-
-  @Override
-  @CheckForNull
-  public Component component(Issue issue) {
-    return componentsByKey.get(issue.componentKey());
-  }
-
-  @Override
-  @CheckForNull
-  public Component componentById(long id) {
-    return componentsById.get(id);
-  }
-
-  @Override
-  @CheckForNull
-  public Component componentByKey(String key) {
-    return componentsByKey.get(key);
-  }
-
-  @Override
-  public Collection<Component> projects() {
-    return projectsByKey.values();
-  }
-
-  @Override
-  @CheckForNull
-  public Component project(Issue issue) {
-    return projectsByKey.get(issue.projectKey());
-  }
-
-  @Override
-  public Collection<ActionPlan> actionPlans() {
-    return actionPlansByKey.values();
-  }
-
-  @Override
-  @CheckForNull
-  public ActionPlan actionPlans(Issue issue) {
-    return actionPlansByKey.get(issue.actionPlan());
-  }
-
-  @Override
-  public Paging paging() {
-    return paging;
-  }
-
-  DefaultIssues add(Issue issue) {
-    list.add(issue);
-    return this;
-  }
-
-  DefaultIssues add(Rule rule) {
-    rulesByKey.put(rule.key(), rule);
-    return this;
-  }
-
-  DefaultIssues add(User user) {
-    usersByKey.put(user.login(), user);
-    return this;
-  }
-
-  DefaultIssues add(ActionPlan actionPlan) {
-    actionPlansByKey.put(actionPlan.key(), actionPlan);
-    return this;
-  }
-
-  DefaultIssues addComponent(Component c) {
-    componentsById.put(c.id(), c);
-    componentsByKey.put(c.key(), c);
-    return this;
-  }
-
-  DefaultIssues addProject(Component c) {
-    projectsByKey.put(c.key(), c);
-    return this;
-  }
-
-  DefaultIssues setPaging(Paging paging) {
-    this.paging = paging;
-    return this;
-  }
-}
diff --git a/server/sonar-ws-client/src/main/java/org/sonar/wsclient/issue/internal/IssueJsonParser.java b/server/sonar-ws-client/src/main/java/org/sonar/wsclient/issue/internal/IssueJsonParser.java
deleted file mode 100644 (file)
index 3ce006d..0000000
+++ /dev/null
@@ -1,161 +0,0 @@
-/*
- * SonarQube, open source software quality management tool.
- * Copyright (C) 2008-2014 SonarSource
- * mailto:contact AT sonarsource DOT com
- *
- * SonarQube is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * SonarQube is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-package org.sonar.wsclient.issue.internal;
-
-import org.json.simple.JSONArray;
-import org.json.simple.JSONValue;
-import org.sonar.wsclient.base.Paging;
-import org.sonar.wsclient.component.Component;
-import org.sonar.wsclient.issue.BulkChange;
-import org.sonar.wsclient.issue.IssueChange;
-import org.sonar.wsclient.issue.Issues;
-import org.sonar.wsclient.rule.Rule;
-import org.sonar.wsclient.unmarshallers.JsonUtils;
-import org.sonar.wsclient.user.User;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Map;
-
-/**
- * @since 3.6
- */
-public class IssueJsonParser {
-
-  private static final String ISSUES = "issues";
-  private static final String TOTAL = "total";
-
-  public Issues parseIssues(String json) {
-    DefaultIssues result = new DefaultIssues();
-    Map jsonRoot = (Map) JSONValue.parse(json);
-    List<Map> jsonIssues = (List<Map>) jsonRoot.get(ISSUES);
-    if (jsonIssues != null) {
-      for (Map jsonIssue : jsonIssues) {
-        result.add(new DefaultIssue(jsonIssue));
-      }
-    }
-    parseRules(result, jsonRoot);
-    parseUsers(result, jsonRoot);
-    parseComponents(result, jsonRoot);
-    parseProjects(result, jsonRoot);
-    parseActionPlans(result, jsonRoot);
-    parsePaging(result, jsonRoot);
-    return result;
-  }
-
-  private void parsePaging(DefaultIssues result, Map jsonRoot) {
-    Map paging = (Map) jsonRoot.get("paging");
-    result.setPaging(new Paging(paging));
-  }
-
-  private void parseProjects(DefaultIssues result, Map jsonRoot) {
-    List<Map> jsonProjects = (List<Map>) jsonRoot.get("projects");
-    if (jsonProjects != null) {
-      for (Map jsonProject : jsonProjects) {
-        result.addProject(new Component(jsonProject));
-      }
-    }
-  }
-
-  private void parseComponents(DefaultIssues result, Map jsonRoot) {
-    List<Map> jsonComponents = (List<Map>) jsonRoot.get("components");
-    if (jsonComponents != null) {
-      for (Map jsonComponent : jsonComponents) {
-        result.addComponent(new Component(jsonComponent));
-      }
-    }
-  }
-
-  private void parseUsers(DefaultIssues result, Map jsonRoot) {
-    List<Map> jsonUsers = (List<Map>) jsonRoot.get("users");
-    if (jsonUsers != null) {
-      for (Map jsonUser : jsonUsers) {
-        result.add(new User(jsonUser));
-      }
-    }
-  }
-
-  private void parseRules(DefaultIssues result, Map jsonRoot) {
-    List<Map> jsonRules = (List<Map>) jsonRoot.get("rules");
-    if (jsonRules != null) {
-      for (Map jsonRule : jsonRules) {
-        result.add(new Rule(jsonRule));
-      }
-    }
-  }
-
-  private void parseActionPlans(DefaultIssues result, Map jsonRoot) {
-    List<Map> jsonRules = (List) jsonRoot.get("actionPlans");
-    if (jsonRules != null) {
-      for (Map jsonRule : jsonRules) {
-        result.add(new DefaultActionPlan(jsonRule));
-      }
-    }
-  }
-
-  List<String> parseTransitions(String json) {
-    List<String> transitions = new ArrayList<>();
-    Map jRoot = (Map) JSONValue.parse(json);
-    List<String> jTransitions = (List<String>) jRoot.get("transitions");
-    for (String jTransition : jTransitions) {
-      transitions.add(jTransition);
-    }
-    return transitions;
-  }
-
-  List<IssueChange> parseChangelog(String json) {
-    List<IssueChange> changes = new ArrayList<>();
-    Map jRoot = (Map) JSONValue.parse(json);
-    List<Map> jChanges = (List<Map>) jRoot.get("changelog");
-    if (jChanges != null) {
-      for (Map jChange : jChanges) {
-        changes.add(new DefaultIssueChange(jChange));
-      }
-    }
-    return changes;
-  }
-
-  List<String> parseActions(String json) {
-    List<String> actions = new ArrayList<>();
-    Map jRoot = (Map) JSONValue.parse(json);
-    List<String> jActions = (List<String>) jRoot.get("actions");
-    for (String jAction : jActions) {
-      actions.add(jAction);
-    }
-    return actions;
-  }
-
-  BulkChange parseBulkChange(String json) {
-    DefaultBulkChange result = new DefaultBulkChange();
-
-    Map jsonRoot = (Map) JSONValue.parse(json);
-    Map issuesChanged = (Map) jsonRoot.get("issuesChanged");
-    result.setTotalIssuesChanged(JsonUtils.getInteger(issuesChanged, TOTAL));
-
-    Map issuesNotChanged = (Map) jsonRoot.get("issuesNotChanged");
-    result.setTotalIssuesNotChanged(JsonUtils.getInteger(issuesNotChanged, TOTAL));
-    JSONArray issuesJson = JsonUtils.getArray(issuesNotChanged, ISSUES);
-    if (issuesJson != null) {
-      result.setIssuesNotChanged(issuesJson);
-    }
-
-    return result;
-  }
-}
diff --git a/server/sonar-ws-client/src/main/java/org/sonar/wsclient/issue/internal/package-info.java b/server/sonar-ws-client/src/main/java/org/sonar/wsclient/issue/internal/package-info.java
deleted file mode 100644 (file)
index 3412b19..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-/*
- * SonarQube, open source software quality management tool.
- * Copyright (C) 2008-2014 SonarSource
- * mailto:contact AT sonarsource DOT com
- *
- * SonarQube is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * SonarQube is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-@javax.annotation.ParametersAreNonnullByDefault
-package org.sonar.wsclient.issue.internal;
diff --git a/server/sonar-ws-client/src/main/java/org/sonar/wsclient/issue/package-info.java b/server/sonar-ws-client/src/main/java/org/sonar/wsclient/issue/package-info.java
deleted file mode 100644 (file)
index 17e63ce..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-/*
- * SonarQube, open source software quality management tool.
- * Copyright (C) 2008-2014 SonarSource
- * mailto:contact AT sonarsource DOT com
- *
- * SonarQube is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * SonarQube is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-
-@javax.annotation.ParametersAreNonnullByDefault
-package org.sonar.wsclient.issue;
diff --git a/server/sonar-ws-client/src/main/java/org/sonar/wsclient/package-info.java b/server/sonar-ws-client/src/main/java/org/sonar/wsclient/package-info.java
deleted file mode 100644 (file)
index 0373f9e..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-/*
- * SonarQube, open source software quality management tool.
- * Copyright (C) 2008-2014 SonarSource
- * mailto:contact AT sonarsource DOT com
- *
- * SonarQube is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * SonarQube is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-
-@javax.annotation.ParametersAreNonnullByDefault
-package org.sonar.wsclient;
diff --git a/server/sonar-ws-client/src/main/java/org/sonar/wsclient/permissions/PermissionClient.java b/server/sonar-ws-client/src/main/java/org/sonar/wsclient/permissions/PermissionClient.java
deleted file mode 100644 (file)
index e20148c..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * SonarQube, open source software quality management tool.
- * Copyright (C) 2008-2014 SonarSource
- * mailto:contact AT sonarsource DOT com
- *
- * SonarQube is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * SonarQube is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-
-package org.sonar.wsclient.permissions;
-
-
-/**
- * @since 3.7
- */
-public interface PermissionClient {
-
-  /**
-   * @since 3.7
-   */
-  void addPermission(PermissionParameters permissionParameters);
-
-  /**
-   * @since 3.7
-   */
-  void removePermission(PermissionParameters permissionParameters);
-}
diff --git a/server/sonar-ws-client/src/main/java/org/sonar/wsclient/permissions/PermissionParameters.java b/server/sonar-ws-client/src/main/java/org/sonar/wsclient/permissions/PermissionParameters.java
deleted file mode 100644 (file)
index dcd2dec..0000000
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
- * SonarQube, open source software quality management tool.
- * Copyright (C) 2008-2014 SonarSource
- * mailto:contact AT sonarsource DOT com
- *
- * SonarQube is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * SonarQube is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-
-package org.sonar.wsclient.permissions;
-
-import java.util.HashMap;
-import java.util.Map;
-
-public class PermissionParameters {
-
-  private final Map<String, Object> params;
-
-  private PermissionParameters(){
-    params = new HashMap<>();
-  }
-
-  public static PermissionParameters create() {
-    return new PermissionParameters();
-  }
-
-  public PermissionParameters user(String user) {
-    params.put("user", user);
-    return this;
-  }
-
-  public PermissionParameters group(String group) {
-    params.put("group", group);
-    return this;
-  }
-
-  public PermissionParameters component(String component) {
-    params.put("component", component);
-    return this;
-  }
-
-  public PermissionParameters permission(String permission) {
-    params.put("permission", permission);
-    return this;
-  }
-
-  public Map<String, Object> urlParams() {
-    return params;
-  }
-}
diff --git a/server/sonar-ws-client/src/main/java/org/sonar/wsclient/permissions/internal/DefaultPermissionClient.java b/server/sonar-ws-client/src/main/java/org/sonar/wsclient/permissions/internal/DefaultPermissionClient.java
deleted file mode 100644 (file)
index cb45891..0000000
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * SonarQube, open source software quality management tool.
- * Copyright (C) 2008-2014 SonarSource
- * mailto:contact AT sonarsource DOT com
- *
- * SonarQube is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * SonarQube is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-
-package org.sonar.wsclient.permissions.internal;
-
-import org.sonar.wsclient.internal.HttpRequestFactory;
-import org.sonar.wsclient.permissions.PermissionClient;
-import org.sonar.wsclient.permissions.PermissionParameters;
-
-public class DefaultPermissionClient implements PermissionClient {
-
-  private static final String BASE_URL = "/api/permissions/";
-  private static final String ADD_URL = BASE_URL + "add";
-  private static final String REMOVE_URL = BASE_URL + "remove";
-
-  private final HttpRequestFactory requestFactory;
-
-  /**
-   * For internal use. Use {@link org.sonar.wsclient.SonarClient} to get an instance.
-   */
-  public DefaultPermissionClient(HttpRequestFactory requestFactory) {
-    this.requestFactory = requestFactory;
-  }
-
-  @Override
-  public void addPermission(PermissionParameters permissionParameters) {
-    requestFactory.post(ADD_URL, permissionParameters.urlParams());
-  }
-
-  @Override
-  public void removePermission(PermissionParameters permissionParameters) {
-    requestFactory.post(REMOVE_URL, permissionParameters.urlParams());
-  }
-}
diff --git a/server/sonar-ws-client/src/main/java/org/sonar/wsclient/permissions/internal/package-info.java b/server/sonar-ws-client/src/main/java/org/sonar/wsclient/permissions/internal/package-info.java
deleted file mode 100644 (file)
index 2b683b4..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-/*
- * SonarQube, open source software quality management tool.
- * Copyright (C) 2008-2014 SonarSource
- * mailto:contact AT sonarsource DOT com
- *
- * SonarQube is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * SonarQube is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-
-@javax.annotation.ParametersAreNonnullByDefault
-package org.sonar.wsclient.permissions.internal;
diff --git a/server/sonar-ws-client/src/main/java/org/sonar/wsclient/permissions/package-info.java b/server/sonar-ws-client/src/main/java/org/sonar/wsclient/permissions/package-info.java
deleted file mode 100644 (file)
index fe99a19..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-/*
- * SonarQube, open source software quality management tool.
- * Copyright (C) 2008-2014 SonarSource
- * mailto:contact AT sonarsource DOT com
- *
- * SonarQube is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * SonarQube is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-
-@javax.annotation.ParametersAreNonnullByDefault
-package org.sonar.wsclient.permissions;
diff --git a/server/sonar-ws-client/src/main/java/org/sonar/wsclient/project/NewProject.java b/server/sonar-ws-client/src/main/java/org/sonar/wsclient/project/NewProject.java
deleted file mode 100644 (file)
index 1aa5bff..0000000
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * SonarQube, open source software quality management tool.
- * Copyright (C) 2008-2014 SonarSource
- * mailto:contact AT sonarsource DOT com
- *
- * SonarQube is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * SonarQube is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-package org.sonar.wsclient.project;
-
-import java.util.HashMap;
-import java.util.Map;
-
-/**
- * @since 4.0
- */
-public class NewProject {
-
-  private final Map<String, Object> params;
-
-  private NewProject() {
-    params = new HashMap<>();
-  }
-
-  public static NewProject create() {
-    return new NewProject();
-  }
-
-  public Map<String, Object> urlParams() {
-    return params;
-  }
-
-  public NewProject key(String key) {
-    params.put("key", key);
-    return this;
-  }
-
-  public NewProject name(String name) {
-    params.put("name", name);
-    return this;
-  }
-}
diff --git a/server/sonar-ws-client/src/main/java/org/sonar/wsclient/project/Project.java b/server/sonar-ws-client/src/main/java/org/sonar/wsclient/project/Project.java
deleted file mode 100644 (file)
index 5ee3109..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * SonarQube, open source software quality management tool.
- * Copyright (C) 2008-2014 SonarSource
- * mailto:contact AT sonarsource DOT com
- *
- * SonarQube is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * SonarQube is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-package org.sonar.wsclient.project;
-
-/**
- * @since 4.0
- */
-public interface Project {
-
-  String id();
-
-  String key();
-
-  String name();
-
-  String qualifier();
-
-}
diff --git a/server/sonar-ws-client/src/main/java/org/sonar/wsclient/project/ProjectClient.java b/server/sonar-ws-client/src/main/java/org/sonar/wsclient/project/ProjectClient.java
deleted file mode 100644 (file)
index c3f37c4..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * SonarQube, open source software quality management tool.
- * Copyright (C) 2008-2014 SonarSource
- * mailto:contact AT sonarsource DOT com
- *
- * SonarQube is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * SonarQube is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-package org.sonar.wsclient.project;
-
-/**
- * @since 4.0
- */
-public interface ProjectClient {
-
-  Project create(NewProject newProject);
-}
diff --git a/server/sonar-ws-client/src/main/java/org/sonar/wsclient/project/internal/DefaultProject.java b/server/sonar-ws-client/src/main/java/org/sonar/wsclient/project/internal/DefaultProject.java
deleted file mode 100644 (file)
index 7362c6d..0000000
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * SonarQube, open source software quality management tool.
- * Copyright (C) 2008-2014 SonarSource
- * mailto:contact AT sonarsource DOT com
- *
- * SonarQube is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * SonarQube is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-package org.sonar.wsclient.project.internal;
-
-import org.sonar.wsclient.project.Project;
-import org.sonar.wsclient.unmarshallers.JsonUtils;
-
-import java.util.Map;
-
-/**
- * @since 4.0
- */
-public class DefaultProject implements Project {
-
-  private final Map<String, String> json;
-
-  public DefaultProject(Map<String, String> json) {
-    this.json = json;
-  }
-
-  @Override
-  public String id() {
-    return JsonUtils.getString(json, "id");
-  }
-
-  @Override
-  public String key() {
-    return JsonUtils.getString(json, "k");
-  }
-
-  @Override
-  public String name() {
-    return JsonUtils.getString(json, "nm");
-  }
-
-  @Override
-  public String qualifier() {
-    return JsonUtils.getString(json, "qu");
-  }
-
-}
diff --git a/server/sonar-ws-client/src/main/java/org/sonar/wsclient/project/internal/DefaultProjectClient.java b/server/sonar-ws-client/src/main/java/org/sonar/wsclient/project/internal/DefaultProjectClient.java
deleted file mode 100644 (file)
index 23cc942..0000000
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * SonarQube, open source software quality management tool.
- * Copyright (C) 2008-2014 SonarSource
- * mailto:contact AT sonarsource DOT com
- *
- * SonarQube is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * SonarQube is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-package org.sonar.wsclient.project.internal;
-
-import org.json.simple.JSONValue;
-import org.sonar.wsclient.internal.HttpRequestFactory;
-import org.sonar.wsclient.project.NewProject;
-import org.sonar.wsclient.project.Project;
-import org.sonar.wsclient.project.ProjectClient;
-
-import java.util.Map;
-
-/**
- * Do not instantiate this class, but use {@link org.sonar.wsclient.SonarClient#projectClient()}.
- */
-public class DefaultProjectClient implements ProjectClient {
-
-  private static final String ROOT_URL = "/api/projects";
-  private static final String CREATE_URL = ROOT_URL + "/create";
-
-  private final HttpRequestFactory requestFactory;
-
-  public DefaultProjectClient(HttpRequestFactory requestFactory) {
-    this.requestFactory = requestFactory;
-  }
-
-  @Override
-  public Project create(NewProject newProject) {
-    String json = requestFactory.post(CREATE_URL, newProject.urlParams());
-    return jsonToProject(json);
-  }
-
-  @SuppressWarnings({"rawtypes", "unchecked"})
-  private Project jsonToProject(String json) {
-    Map jsonRoot = (Map) JSONValue.parse(json);
-    return new DefaultProject(jsonRoot);
-  }
-}
diff --git a/server/sonar-ws-client/src/main/java/org/sonar/wsclient/project/internal/package-info.java b/server/sonar-ws-client/src/main/java/org/sonar/wsclient/project/internal/package-info.java
deleted file mode 100644 (file)
index c05b289..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-/*
- * SonarQube, open source software quality management tool.
- * Copyright (C) 2008-2014 SonarSource
- * mailto:contact AT sonarsource DOT com
- *
- * SonarQube is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * SonarQube is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-
-@javax.annotation.ParametersAreNonnullByDefault
-package org.sonar.wsclient.project.internal;
diff --git a/server/sonar-ws-client/src/main/java/org/sonar/wsclient/project/package-info.java b/server/sonar-ws-client/src/main/java/org/sonar/wsclient/project/package-info.java
deleted file mode 100644 (file)
index 81ab0cb..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-/*
- * SonarQube, open source software quality management tool.
- * Copyright (C) 2008-2014 SonarSource
- * mailto:contact AT sonarsource DOT com
- *
- * SonarQube is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * SonarQube is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-
-@javax.annotation.ParametersAreNonnullByDefault
-package org.sonar.wsclient.project;
diff --git a/server/sonar-ws-client/src/main/java/org/sonar/wsclient/qprofile/QProfileClient.java b/server/sonar-ws-client/src/main/java/org/sonar/wsclient/qprofile/QProfileClient.java
deleted file mode 100644 (file)
index e26cd14..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * SonarQube, open source software quality management tool.
- * Copyright (C) 2008-2014 SonarSource
- * mailto:contact AT sonarsource DOT com
- *
- * SonarQube is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * SonarQube is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-
-package org.sonar.wsclient.qprofile;
-
-
-/**
- * @since 4.4
- */
-public interface QProfileClient {
-
-  QProfileResult restoreDefault(String language);
-
-}
diff --git a/server/sonar-ws-client/src/main/java/org/sonar/wsclient/qprofile/QProfileResult.java b/server/sonar-ws-client/src/main/java/org/sonar/wsclient/qprofile/QProfileResult.java
deleted file mode 100644 (file)
index 9734e4c..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * SonarQube, open source software quality management tool.
- * Copyright (C) 2008-2014 SonarSource
- * mailto:contact AT sonarsource DOT com
- *
- * SonarQube is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * SonarQube is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-
-package org.sonar.wsclient.qprofile;
-
-import java.util.List;
-
-public interface QProfileResult {
-
-  List<String> infos();
-
-  List<String> warnings();
-}
diff --git a/server/sonar-ws-client/src/main/java/org/sonar/wsclient/qprofile/internal/DefaultQProfileClient.java b/server/sonar-ws-client/src/main/java/org/sonar/wsclient/qprofile/internal/DefaultQProfileClient.java
deleted file mode 100644 (file)
index 4948228..0000000
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * SonarQube, open source software quality management tool.
- * Copyright (C) 2008-2014 SonarSource
- * mailto:contact AT sonarsource DOT com
- *
- * SonarQube is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * SonarQube is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-
-package org.sonar.wsclient.qprofile.internal;
-
-import org.json.simple.JSONValue;
-import org.sonar.wsclient.internal.HttpRequestFactory;
-import org.sonar.wsclient.qprofile.QProfileClient;
-import org.sonar.wsclient.qprofile.QProfileResult;
-
-import java.util.Collections;
-import java.util.Map;
-
-public class DefaultQProfileClient implements QProfileClient {
-
-  private final HttpRequestFactory requestFactory;
-
-  public DefaultQProfileClient(HttpRequestFactory requestFactory) {
-    this.requestFactory = requestFactory;
-  }
-
-  @Override
-  public QProfileResult restoreDefault(String language) {
-    String json = requestFactory.post("/api/qualityprofiles/restore_default", Collections.singletonMap("language", (Object) language));
-    Map jsonRoot = (Map) JSONValue.parse(json);
-    return new DefaultQProfileResult(jsonRoot);
-  }
-
-}
diff --git a/server/sonar-ws-client/src/main/java/org/sonar/wsclient/qprofile/internal/DefaultQProfileResult.java b/server/sonar-ws-client/src/main/java/org/sonar/wsclient/qprofile/internal/DefaultQProfileResult.java
deleted file mode 100644 (file)
index 3e51fa2..0000000
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
- * SonarQube, open source software quality management tool.
- * Copyright (C) 2008-2014 SonarSource
- * mailto:contact AT sonarsource DOT com
- *
- * SonarQube is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * SonarQube is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-
-package org.sonar.wsclient.qprofile.internal;
-
-import org.sonar.wsclient.qprofile.QProfileResult;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Map;
-
-public class DefaultQProfileResult implements QProfileResult {
-
-  private Map json;
-
-  DefaultQProfileResult(Map json) {
-    this.json = json;
-  }
-
-  @Override
-  public List<String> infos() {
-    List<String> infos = new ArrayList<>();
-    List<String> jsonInfos = (List<String>) json.get("infos");
-    if (jsonInfos != null) {
-      for (String info : jsonInfos) {
-        infos.add(info);
-      }
-    }
-    return infos;
-  }
-
-  @Override
-  public List<String> warnings() {
-    List<String> warnings = new ArrayList<>();
-    List<String> jsonWarnings = (List<String>) json.get("warnings");
-    if (jsonWarnings != null) {
-      for (String warning : jsonWarnings) {
-        warnings.add(warning);
-      }
-    }
-    return warnings;
-  }
-
-}
diff --git a/server/sonar-ws-client/src/main/java/org/sonar/wsclient/qualitygate/NewCondition.java b/server/sonar-ws-client/src/main/java/org/sonar/wsclient/qualitygate/NewCondition.java
deleted file mode 100644 (file)
index da8b9b8..0000000
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * SonarQube, open source software quality management tool.
- * Copyright (C) 2008-2014 SonarSource
- * mailto:contact AT sonarsource DOT com
- *
- * SonarQube is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * SonarQube is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-package org.sonar.wsclient.qualitygate;
-
-import javax.annotation.Nullable;
-
-import java.util.HashMap;
-import java.util.Map;
-
-/**
- * @since 4.3
- */
-public class NewCondition {
-
-  private final Map<String, Object> params;
-
-  private NewCondition() {
-    params = new HashMap<>();
-  }
-
-  public static NewCondition create(long qGateId) {
-    NewCondition newCondition = new NewCondition();
-    newCondition.params.put("gateId", qGateId);
-    return newCondition;
-  }
-
-  public Map<String, Object> urlParams() {
-    return params;
-  }
-
-  public NewCondition metricKey(String metricKey) {
-    params.put("metric", metricKey);
-    return this;
-  }
-
-  public NewCondition operator(String operator) {
-    params.put("op", operator);
-    return this;
-  }
-
-  public NewCondition warningThreshold(@Nullable String warning) {
-    params.put("warning", warning);
-    return this;
-  }
-
-  public NewCondition errorThreshold(@Nullable String error) {
-    params.put("error", error);
-    return this;
-  }
-
-  public NewCondition period(@Nullable Integer period) {
-    params.put("period", period);
-    return this;
-  }
-}
-
diff --git a/server/sonar-ws-client/src/main/java/org/sonar/wsclient/qualitygate/QualityGate.java b/server/sonar-ws-client/src/main/java/org/sonar/wsclient/qualitygate/QualityGate.java
deleted file mode 100644 (file)
index 76b29d2..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * SonarQube, open source software quality management tool.
- * Copyright (C) 2008-2014 SonarSource
- * mailto:contact AT sonarsource DOT com
- *
- * SonarQube is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * SonarQube is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-package org.sonar.wsclient.qualitygate;
-
-/**
- * @since 4.3
- */
-public interface QualityGate {
-
-  Long id();
-
-  String name();
-}
diff --git a/server/sonar-ws-client/src/main/java/org/sonar/wsclient/qualitygate/QualityGateClient.java b/server/sonar-ws-client/src/main/java/org/sonar/wsclient/qualitygate/QualityGateClient.java
deleted file mode 100644 (file)
index 3744c37..0000000
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * SonarQube, open source software quality management tool.
- * Copyright (C) 2008-2014 SonarSource
- * mailto:contact AT sonarsource DOT com
- *
- * SonarQube is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * SonarQube is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-package org.sonar.wsclient.qualitygate;
-
-
-/**
- * @since 4.3
- */
-public interface QualityGateClient {
-
-  QualityGates list();
-
-  QualityGate create(String qGateName);
-
-  QualityGate rename(long qGateId, String qGateName);
-
-  QualityGateDetails show(long qGateId);
-
-  QualityGateDetails show(String qGateName);
-
-  QualityGateCondition createCondition(NewCondition condition);
-
-  QualityGateCondition updateCondition(UpdateCondition condition);
-
-  void deleteCondition(long conditionId);
-
-  void destroy(long qGateId);
-
-  void setDefault(long qGateId);
-
-  void unsetDefault();
-
-  void selectProject(long qGateId, long projectId);
-
-  void deselectProject(long qGateId, long projectId);
-}
diff --git a/server/sonar-ws-client/src/main/java/org/sonar/wsclient/qualitygate/QualityGateCondition.java b/server/sonar-ws-client/src/main/java/org/sonar/wsclient/qualitygate/QualityGateCondition.java
deleted file mode 100644 (file)
index 35f11fc..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * SonarQube, open source software quality management tool.
- * Copyright (C) 2008-2014 SonarSource
- * mailto:contact AT sonarsource DOT com
- *
- * SonarQube is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * SonarQube is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-package org.sonar.wsclient.qualitygate;
-
-/**
- * @since 4.3
- */
-public interface QualityGateCondition {
-
-  Long id();
-
-  String metricKey();
-
-  String operator();
-
-  String warningThreshold();
-
-  String errorThreshold();
-
-  Integer period();
-}
diff --git a/server/sonar-ws-client/src/main/java/org/sonar/wsclient/qualitygate/QualityGateDetails.java b/server/sonar-ws-client/src/main/java/org/sonar/wsclient/qualitygate/QualityGateDetails.java
deleted file mode 100644 (file)
index de3faed..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * SonarQube, open source software quality management tool.
- * Copyright (C) 2008-2014 SonarSource
- * mailto:contact AT sonarsource DOT com
- *
- * SonarQube is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * SonarQube is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-package org.sonar.wsclient.qualitygate;
-
-import java.util.Collection;
-
-/**
- * @since 4.3
- */
-public interface QualityGateDetails extends QualityGate {
-
-  Collection<QualityGateCondition> conditions();
-}
diff --git a/server/sonar-ws-client/src/main/java/org/sonar/wsclient/qualitygate/QualityGates.java b/server/sonar-ws-client/src/main/java/org/sonar/wsclient/qualitygate/QualityGates.java
deleted file mode 100644 (file)
index d757963..0000000
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- * SonarQube, open source software quality management tool.
- * Copyright (C) 2008-2014 SonarSource
- * mailto:contact AT sonarsource DOT com
- *
- * SonarQube is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * SonarQube is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-package org.sonar.wsclient.qualitygate;
-
-import java.util.Collection;
-
-/**
- * @since 4.3
- */
-public interface QualityGates {
-
-  Collection<QualityGate> qualityGates();
-
-  QualityGate defaultGate();
-}
diff --git a/server/sonar-ws-client/src/main/java/org/sonar/wsclient/qualitygate/UpdateCondition.java b/server/sonar-ws-client/src/main/java/org/sonar/wsclient/qualitygate/UpdateCondition.java
deleted file mode 100644 (file)
index e5fb7fc..0000000
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * SonarQube, open source software quality management tool.
- * Copyright (C) 2008-2014 SonarSource
- * mailto:contact AT sonarsource DOT com
- *
- * SonarQube is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * SonarQube is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-package org.sonar.wsclient.qualitygate;
-
-import javax.annotation.Nullable;
-
-import java.util.HashMap;
-import java.util.Map;
-
-/**
- * @since 4.3
- */
-public class UpdateCondition {
-
-  private final Map<String, Object> params;
-
-  private UpdateCondition() {
-    params = new HashMap<>();
-  }
-
-  public static UpdateCondition create(long id) {
-    UpdateCondition newCondition = new UpdateCondition();
-    newCondition.params.put("id", id);
-    return newCondition;
-  }
-
-  public Map<String, Object> urlParams() {
-    return params;
-  }
-
-  public UpdateCondition metricKey(String metricKey) {
-    params.put("metric", metricKey);
-    return this;
-  }
-
-  public UpdateCondition operator(String operator) {
-    params.put("op", operator);
-    return this;
-  }
-
-  public UpdateCondition warningThreshold(@Nullable String warning) {
-    params.put("warning", warning);
-    return this;
-  }
-
-  public UpdateCondition errorThreshold(@Nullable String error) {
-    params.put("error", error);
-    return this;
-  }
-
-  public UpdateCondition period(@Nullable Integer period) {
-    params.put("period", period);
-    return this;
-  }
-}
-
diff --git a/server/sonar-ws-client/src/main/java/org/sonar/wsclient/qualitygate/internal/DefaultQualityGate.java b/server/sonar-ws-client/src/main/java/org/sonar/wsclient/qualitygate/internal/DefaultQualityGate.java
deleted file mode 100644 (file)
index 06648eb..0000000
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * SonarQube, open source software quality management tool.
- * Copyright (C) 2008-2014 SonarSource
- * mailto:contact AT sonarsource DOT com
- *
- * SonarQube is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * SonarQube is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-package org.sonar.wsclient.qualitygate.internal;
-
-import org.sonar.wsclient.qualitygate.QualityGate;
-import org.sonar.wsclient.unmarshallers.JsonUtils;
-
-import java.util.Map;
-
-public class DefaultQualityGate implements QualityGate {
-
-  private Map<String, String> json;
-
-  DefaultQualityGate(Map<String, String> json) {
-    this.json = json;
-  }
-
-  @Override
-  public Long id() {
-    return JsonUtils.getLong(json, "id");
-  }
-
-  @Override
-  public String name() {
-    return JsonUtils.getString(json, "name");
-  }
-
-}
diff --git a/server/sonar-ws-client/src/main/java/org/sonar/wsclient/qualitygate/internal/DefaultQualityGateClient.java b/server/sonar-ws-client/src/main/java/org/sonar/wsclient/qualitygate/internal/DefaultQualityGateClient.java
deleted file mode 100644 (file)
index a9909d2..0000000
+++ /dev/null
@@ -1,168 +0,0 @@
-/*
- * SonarQube, open source software quality management tool.
- * Copyright (C) 2008-2014 SonarSource
- * mailto:contact AT sonarsource DOT com
- *
- * SonarQube is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * SonarQube is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-package org.sonar.wsclient.qualitygate.internal;
-
-import org.json.simple.JSONValue;
-import org.sonar.wsclient.internal.HttpRequestFactory;
-import org.sonar.wsclient.qualitygate.*;
-
-import java.util.*;
-
-public class DefaultQualityGateClient implements QualityGateClient {
-
-  private static final String ROOT_URL = "/api/qualitygates";
-  private static final String LIST_URL = ROOT_URL + "/list";
-  private static final String SHOW_URL = ROOT_URL + "/show";
-  private static final String CREATE_URL = ROOT_URL + "/create";
-  private static final String CREATE_CONDITION_URL = ROOT_URL + "/create_condition";
-  private static final String UPDATE_CONDITION_URL = ROOT_URL + "/update_condition";
-  private static final String DELETE_CONDITION_URL = ROOT_URL + "/delete_condition";
-  private static final String RENAME_URL = ROOT_URL + "/rename";
-  private static final String DESTROY_URL = ROOT_URL + "/destroy";
-  private static final String SET_DEFAULT_URL = ROOT_URL + "/set_as_default";
-  private static final String UNSET_DEFAULT_URL = ROOT_URL + "/unset_default";
-  private static final String SELECT_URL = ROOT_URL + "/select";
-  private static final String DESELECT_URL = ROOT_URL + "/deselect";
-
-  private final HttpRequestFactory requestFactory;
-
-  public DefaultQualityGateClient(HttpRequestFactory requestFactory) {
-    this.requestFactory = requestFactory;
-  }
-
-  @Override
-  public QualityGates list() {
-    String json = requestFactory.get(LIST_URL, Collections.<String, Object> emptyMap());
-    return jsonToQualityGates(json);
-  }
-
-  @Override
-  public QualityGate create(String qGateName) {
-    String json = requestFactory.post(CREATE_URL, Collections.singletonMap("name", (Object) qGateName));
-    return jsonToQualityGate(json);
-  }
-
-  @Override
-  public QualityGate rename(long qGateId, String qGateName) {
-    Map<String, Object> params = new HashMap<>();
-    params.put("id", qGateId);
-    params.put("name", qGateName);
-    String json = requestFactory.post(RENAME_URL, params);
-    return jsonToQualityGate(json);
-  }
-
-  @Override
-  public QualityGateDetails show(long qGateId) {
-    String json = requestFactory.get(SHOW_URL, Collections.singletonMap("id", (Object) qGateId));
-    return jsonToDetails(json);
-  }
-
-  @Override
-  public QualityGateDetails show(String qGateName) {
-    String json = requestFactory.get(SHOW_URL, Collections.singletonMap("name", (Object) qGateName));
-    return jsonToDetails(json);
-  }
-
-  @Override
-  public QualityGateCondition createCondition(NewCondition condition) {
-    String json = requestFactory.post(CREATE_CONDITION_URL, condition.urlParams());
-    return jsonToCondition(json);
-  }
-
-  @Override
-  public QualityGateCondition updateCondition(UpdateCondition condition) {
-    String json = requestFactory.post(UPDATE_CONDITION_URL, condition.urlParams());
-    return jsonToCondition(json);
-  }
-
-  @Override
-  public void deleteCondition(long conditionId) {
-    requestFactory.post(DELETE_CONDITION_URL, Collections.singletonMap("id", (Object) conditionId));
-  }
-
-  @Override
-  public void destroy(long qGateId) {
-    requestFactory.post(DESTROY_URL, Collections.singletonMap("id", (Object) qGateId));
-  }
-
-  @Override
-  public void setDefault(long qGateId) {
-    requestFactory.post(SET_DEFAULT_URL, Collections.singletonMap("id", (Object) qGateId));
-  }
-
-  @Override
-  public void unsetDefault() {
-    requestFactory.post(UNSET_DEFAULT_URL, Collections.<String, Object> emptyMap());
-  }
-
-  @Override
-  public void selectProject(long qGateId, long projectId) {
-    requestFactory.post(SELECT_URL, selectionParams(qGateId, projectId));
-  }
-
-  @Override
-  public void deselectProject(long qGateId, long projectId) {
-    requestFactory.post(DESELECT_URL, selectionParams(qGateId, projectId));
-  }
-
-  private Map<String, Object> selectionParams(long qGateId, long projectId) {
-    Map<String, Object> params = new HashMap<>();
-    params.put("gateId", Long.toString(qGateId));
-    params.put("projectId", Long.toString(projectId));
-    return params;
-  }
-
-
-  @SuppressWarnings({"rawtypes", "unchecked"})
-  private QualityGate jsonToQualityGate(String json) {
-    Map jsonRoot = (Map) JSONValue.parse(json);
-    return new DefaultQualityGate((Map) jsonRoot);
-  }
-
-  @SuppressWarnings({"rawtypes", "unchecked"})
-  private QualityGates jsonToQualityGates(String json) {
-    Map jsonRoot = (Map) JSONValue.parse(json);
-    return new DefaultQualityGates((Map) jsonRoot);
-  }
-
-  @SuppressWarnings({"rawtypes", "unchecked"})
-  private QualityGateDetails jsonToDetails(String json) {
-    Map jsonRoot = (Map) JSONValue.parse(json);
-    return new DefaultQualityGateDetails((Map) jsonRoot, jsonToConditions(json));
-  }
-
-  @SuppressWarnings({"rawtypes", "unchecked"})
-  private Collection<QualityGateCondition> jsonToConditions(String json) {
-    Map jsonRoot = (Map) JSONValue.parse(json);
-    Collection<Map> conditionArray = (Collection<Map>) jsonRoot.get("conditions");
-    Collection<QualityGateCondition> conditions = new ArrayList<>();
-    if (conditionArray != null) {
-      for (Map conditionJson: conditionArray) {
-        conditions.add(new DefaultQualityGateCondition(conditionJson));
-      }
-    }
-    return conditions;
-  }
-
-  @SuppressWarnings({"rawtypes", "unchecked"})
-  private DefaultQualityGateCondition jsonToCondition(String json) {
-    return new DefaultQualityGateCondition((Map) JSONValue.parse(json));
-  }
-}
diff --git a/server/sonar-ws-client/src/main/java/org/sonar/wsclient/qualitygate/internal/DefaultQualityGateCondition.java b/server/sonar-ws-client/src/main/java/org/sonar/wsclient/qualitygate/internal/DefaultQualityGateCondition.java
deleted file mode 100644 (file)
index cc8836a..0000000
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
- * SonarQube, open source software quality management tool.
- * Copyright (C) 2008-2014 SonarSource
- * mailto:contact AT sonarsource DOT com
- *
- * SonarQube is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * SonarQube is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-package org.sonar.wsclient.qualitygate.internal;
-
-import org.sonar.wsclient.qualitygate.QualityGateCondition;
-import org.sonar.wsclient.unmarshallers.JsonUtils;
-
-import java.util.Map;
-
-public class DefaultQualityGateCondition implements QualityGateCondition {
-
-  private Map<String, String> json;
-
-  public DefaultQualityGateCondition(Map<String, String> json) {
-    this.json = json;
-  }
-
-  @Override
-  public Long id() {
-    return JsonUtils.getLong(json, "id");
-  }
-
-  @Override
-  public String metricKey() {
-    return JsonUtils.getString(json, "metric");
-  }
-
-  @Override
-  public String operator() {
-    return JsonUtils.getString(json, "op");
-  }
-
-  @Override
-  public String warningThreshold() {
-    return JsonUtils.getString(json, "warning");
-  }
-
-  @Override
-  public String errorThreshold() {
-    return JsonUtils.getString(json, "error");
-  }
-
-  @Override
-  public Integer period() {
-    return JsonUtils.getInteger(json, "period");
-  }
-
-}
diff --git a/server/sonar-ws-client/src/main/java/org/sonar/wsclient/qualitygate/internal/DefaultQualityGateDetails.java b/server/sonar-ws-client/src/main/java/org/sonar/wsclient/qualitygate/internal/DefaultQualityGateDetails.java
deleted file mode 100644 (file)
index 318d038..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * SonarQube, open source software quality management tool.
- * Copyright (C) 2008-2014 SonarSource
- * mailto:contact AT sonarsource DOT com
- *
- * SonarQube is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * SonarQube is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-package org.sonar.wsclient.qualitygate.internal;
-
-import org.sonar.wsclient.qualitygate.QualityGateCondition;
-import org.sonar.wsclient.qualitygate.QualityGateDetails;
-
-import java.util.Collection;
-import java.util.Map;
-
-public class DefaultQualityGateDetails extends DefaultQualityGate implements QualityGateDetails {
-
-  private final Collection<QualityGateCondition> conditions;
-
-  DefaultQualityGateDetails(Map<String, String> json, Collection<QualityGateCondition> conditions) {
-    super(json);
-    this.conditions = conditions;
-  }
-
-  @Override
-  public Collection<QualityGateCondition> conditions() {
-    return conditions;
-  }
-
-}
diff --git a/server/sonar-ws-client/src/main/java/org/sonar/wsclient/qualitygate/internal/DefaultQualityGates.java b/server/sonar-ws-client/src/main/java/org/sonar/wsclient/qualitygate/internal/DefaultQualityGates.java
deleted file mode 100644 (file)
index 6367069..0000000
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
- * SonarQube, open source software quality management tool.
- * Copyright (C) 2008-2014 SonarSource
- * mailto:contact AT sonarsource DOT com
- *
- * SonarQube is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * SonarQube is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-package org.sonar.wsclient.qualitygate.internal;
-
-import org.json.simple.JSONArray;
-
-import org.sonar.wsclient.unmarshallers.JsonUtils;
-import org.sonar.wsclient.qualitygate.QualityGate;
-
-import java.util.Collection;
-import java.util.LinkedHashMap;
-import java.util.Map;
-
-import org.sonar.wsclient.qualitygate.QualityGates;
-
-public class DefaultQualityGates implements QualityGates {
-
-  private Map<Long, QualityGate> qualityGates;
-
-  private Long defaultId;
-
-  @SuppressWarnings("unchecked")
-  public DefaultQualityGates(Map<String, Object> json) {
-    qualityGates = new LinkedHashMap<>();
-    JSONArray gatesJson = JsonUtils.getArray(json, "qualitygates");
-    if (gatesJson != null) {
-      for (Object entry: gatesJson) {
-        QualityGate qGate = new DefaultQualityGate((Map<String, String>) entry);
-        qualityGates.put(qGate.id(), qGate);
-      }
-    }
-    defaultId = JsonUtils.getLong(json, "default");
-  }
-
-  @Override
-  public Collection<QualityGate> qualityGates() {
-    return qualityGates.values();
-  }
-
-  @Override
-  public QualityGate defaultGate() {
-    return qualityGates.get(defaultId);
-  }
-
-}
diff --git a/server/sonar-ws-client/src/main/java/org/sonar/wsclient/rule/Rule.java b/server/sonar-ws-client/src/main/java/org/sonar/wsclient/rule/Rule.java
deleted file mode 100644 (file)
index 7b668e0..0000000
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * SonarQube, open source software quality management tool.
- * Copyright (C) 2008-2014 SonarSource
- * mailto:contact AT sonarsource DOT com
- *
- * SonarQube is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * SonarQube is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-package org.sonar.wsclient.rule;
-
-import org.sonar.wsclient.unmarshallers.JsonUtils;
-
-import java.util.Map;
-
-/**
- * @since 3.6
- */
-public class Rule {
-  private final Map json;
-
-  public Rule(Map json) {
-    this.json = json;
-  }
-
-  /**
-   * Unique key
-   */
-  public String key() {
-    return JsonUtils.getString(json, "key");
-  }
-
-  public String name() {
-    return JsonUtils.getString(json, "name");
-  }
-
-  public String description() {
-    return JsonUtils.getString(json, "desc");
-  }
-}
diff --git a/server/sonar-ws-client/src/main/java/org/sonar/wsclient/rule/package-info.java b/server/sonar-ws-client/src/main/java/org/sonar/wsclient/rule/package-info.java
deleted file mode 100644 (file)
index 9a070fa..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-/*
- * SonarQube, open source software quality management tool.
- * Copyright (C) 2008-2014 SonarSource
- * mailto:contact AT sonarsource DOT com
- *
- * SonarQube is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * SonarQube is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-
-@javax.annotation.ParametersAreNonnullByDefault
-package org.sonar.wsclient.rule;
diff --git a/server/sonar-ws-client/src/main/java/org/sonar/wsclient/services/AbstractQuery.java b/server/sonar-ws-client/src/main/java/org/sonar/wsclient/services/AbstractQuery.java
deleted file mode 100644 (file)
index 2de84f7..0000000
+++ /dev/null
@@ -1,148 +0,0 @@
-/*
- * SonarQube, open source software quality management tool.
- * Copyright (C) 2008-2014 SonarSource
- * mailto:contact AT sonarsource DOT com
- *
- * SonarQube is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * SonarQube is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-package org.sonar.wsclient.services;
-
-import javax.annotation.Nullable;
-
-import java.util.Date;
-
-/**
- * @since 2.2
- */
-public abstract class AbstractQuery<M extends Model> {
-
-  /**
-   * Default timeout for waiting data, in milliseconds.
-   *
-   * @since 2.10
-   */
-  public static final int DEFAULT_TIMEOUT_MILLISECONDS = 30 * 1000;
-
-  private int timeoutMilliseconds = DEFAULT_TIMEOUT_MILLISECONDS;
-
-  // accepted-language as defined in http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html
-  private String locale;
-
-  /**
-   * Must start with a slash, for example: /api/metrics
-   * <p>
-   * IMPORTANT: In implementations of this method we must use helper methods to construct URL.
-   * </p>
-   *
-   * @see #encode(String)
-   * @see #appendUrlParameter(StringBuilder, String, Object)
-   * @see #appendUrlParameter(StringBuilder, String, Object[])
-   * @see #appendUrlParameter(StringBuilder, String, Date, boolean)
-   */
-  public abstract String getUrl();
-
-  /**
-   * Request body. By default it is empty but it can be overridden.
-   */
-  public String getBody() {
-    return null;
-  }
-
-  /**
-   * Get the timeout for waiting data, in milliseconds. A value of zero is interpreted as an infinite timeout.
-   *
-   * @since 2.10
-   */
-  public final int getTimeoutMilliseconds() {
-    return timeoutMilliseconds;
-  }
-
-  /**
-   * Set the timeout for waiting data, in milliseconds. Avalue of zero is interpreted as an infinite timeout.
-   *
-   * @since 2.10
-   */
-  public final AbstractQuery<M> setTimeoutMilliseconds(int i) {
-    this.timeoutMilliseconds = i<0 ? 0 : i;
-    return this;
-  }
-
-  /**
-   * Accepted-language, as defined in http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html
-   *
-   * @since 2.10
-   */
-  public final String getLocale() {
-    return locale;
-  }
-
-  /**
-   * Set the Accepted-language HTTP parameter
-   *
-   * @since 2.10
-   */
-  public final AbstractQuery<M> setLocale(String locale) {
-    this.locale = locale;
-    return this;
-  }
-
-  /**
-   * Encodes single parameter value.
-   */
-  protected static String encode(String value) {
-    return WSUtils.getINSTANCE().encodeUrl(value);
-  }
-
-  protected static void appendUrlParameter(StringBuilder url, String paramKey, int paramValue) {
-    url.append(paramKey)
-      .append('=')
-      .append(paramValue)
-      .append("&");
-  }
-
-  protected static void appendUrlParameter(StringBuilder url, String paramKey, @Nullable Object paramValue) {
-    if (paramValue != null) {
-      url.append(paramKey)
-        .append('=')
-        .append(encode(paramValue.toString()))
-        .append('&');
-    }
-  }
-
-  protected static void appendUrlParameter(StringBuilder url, String paramKey, @Nullable Object[] paramValues) {
-    if (paramValues != null) {
-      url.append(paramKey).append('=');
-      for (int index = 0; index < paramValues.length; index++) {
-        if (index > 0) {
-          url.append(',');
-        }
-        if (paramValues[index] != null) {
-          url.append(encode(paramValues[index].toString()));
-        }
-      }
-      url.append('&');
-    }
-  }
-
-  protected static void appendUrlParameter(StringBuilder url, String paramKey, @Nullable Date paramValue, boolean includeTime) {
-    if (paramValue != null) {
-      String format = includeTime ? "yyyy-MM-dd'T'HH:mm:ssZ" : "yyyy-MM-dd";
-      url.append(paramKey)
-        .append('=')
-        .append(encode(WSUtils.getINSTANCE().format(paramValue, format)))
-        .append('&');
-    }
-  }
-}
diff --git a/server/sonar-ws-client/src/main/java/org/sonar/wsclient/services/Authentication.java b/server/sonar-ws-client/src/main/java/org/sonar/wsclient/services/Authentication.java
deleted file mode 100644 (file)
index a47bd35..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * SonarQube, open source software quality management tool.
- * Copyright (C) 2008-2014 SonarSource
- * mailto:contact AT sonarsource DOT com
- *
- * SonarQube is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * SonarQube is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-package org.sonar.wsclient.services;
-
-public class Authentication extends Model {
-
-  private boolean valid;
-
-  public boolean isValid() {
-    return valid;
-  }
-
-  public Authentication setValid(boolean valid) {
-    this.valid = valid;
-    return this;
-  }
-}
diff --git a/server/sonar-ws-client/src/main/java/org/sonar/wsclient/services/AuthenticationQuery.java b/server/sonar-ws-client/src/main/java/org/sonar/wsclient/services/AuthenticationQuery.java
deleted file mode 100644 (file)
index f0191d3..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * SonarQube, open source software quality management tool.
- * Copyright (C) 2008-2014 SonarSource
- * mailto:contact AT sonarsource DOT com
- *
- * SonarQube is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * SonarQube is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-package org.sonar.wsclient.services;
-
-public class AuthenticationQuery extends Query<Authentication> {
-  public static final String BASE_URL = "/api/authentication/validate";
-
-  @Override
-  public String getUrl() {
-    return BASE_URL;
-  }
-
-  @Override
-  public Class<Authentication> getModelClass() {
-    return Authentication.class;
-  }
-}
diff --git a/server/sonar-ws-client/src/main/java/org/sonar/wsclient/services/CreateQuery.java b/server/sonar-ws-client/src/main/java/org/sonar/wsclient/services/CreateQuery.java
deleted file mode 100644 (file)
index 9878ff5..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * SonarQube, open source software quality management tool.
- * Copyright (C) 2008-2014 SonarSource
- * mailto:contact AT sonarsource DOT com
- *
- * SonarQube is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * SonarQube is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-package org.sonar.wsclient.services;
-
-/**
- * POST HTTP request
- *
- * @since 2.2
- */
-public abstract class CreateQuery<M extends Model> extends AbstractQuery<M> {
-
-  public abstract Class<M> getModelClass();
-
-}
diff --git a/server/sonar-ws-client/src/main/java/org/sonar/wsclient/services/DeleteQuery.java b/server/sonar-ws-client/src/main/java/org/sonar/wsclient/services/DeleteQuery.java
deleted file mode 100644 (file)
index 5921e95..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * SonarQube, open source software quality management tool.
- * Copyright (C) 2008-2014 SonarSource
- * mailto:contact AT sonarsource DOT com
- *
- * SonarQube is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * SonarQube is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-package org.sonar.wsclient.services;
-
-/**
- * DELETE HTTP request
- *
- * @since 2.2
- */
-public abstract class DeleteQuery extends AbstractQuery {
-
-}
diff --git a/server/sonar-ws-client/src/main/java/org/sonar/wsclient/services/Event.java b/server/sonar-ws-client/src/main/java/org/sonar/wsclient/services/Event.java
deleted file mode 100644 (file)
index b7a5d90..0000000
+++ /dev/null
@@ -1,113 +0,0 @@
-/*
- * SonarQube, open source software quality management tool.
- * Copyright (C) 2008-2014 SonarSource
- * mailto:contact AT sonarsource DOT com
- *
- * SonarQube is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * SonarQube is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-package org.sonar.wsclient.services;
-
-import javax.annotation.CheckForNull;
-import javax.annotation.Nullable;
-
-import java.util.Date;
-
-public class Event extends Model {
-
-  private String id;
-  private String name;
-  private String category;
-  private String description;
-  private String resourceKey;
-  private Date date;
-
-  @CheckForNull
-  public String getId() {
-    return id;
-  }
-
-  public Event setId(@Nullable String id) {
-    this.id = id;
-    return this;
-  }
-
-  @CheckForNull
-  public String getName() {
-    return name;
-  }
-
-  public Event setName(@Nullable String name) {
-    this.name = name;
-    return this;
-  }
-
-  @CheckForNull
-  public String getCategory() {
-    return category;
-  }
-
-  public Event setCategory(@Nullable String category) {
-    this.category = category;
-    return this;
-  }
-
-  @CheckForNull
-  public String getDescription() {
-    return description;
-  }
-
-  public Event setDescription(@Nullable String description) {
-    this.description = description;
-    return this;
-  }
-
-  @CheckForNull
-  public Date getDate() {
-    return date;
-  }
-
-  public Event setDate(@Nullable Date date) {
-    this.date = date;
-    return this;
-  }
-
-  @CheckForNull
-  public String getResourceKey() {
-    return resourceKey;
-  }
-
-  public Event setResourceKey(@Nullable String resourceKey) {
-    this.resourceKey = resourceKey;
-    return this;
-  }
-
-  @Override
-  public boolean equals(Object o) {
-    if (this == o) {
-      return true;
-    }
-    if (o == null || getClass() != o.getClass()) {
-      return false;
-    }
-
-    Event event = (Event) o;
-    return !(id != null ? !id.equals(event.id) : event.id != null);
-  }
-
-  @Override
-  public int hashCode() {
-    return id != null ? id.hashCode() : 0;
-  }
-}
diff --git a/server/sonar-ws-client/src/main/java/org/sonar/wsclient/services/EventCreateQuery.java b/server/sonar-ws-client/src/main/java/org/sonar/wsclient/services/EventCreateQuery.java
deleted file mode 100644 (file)
index bced338..0000000
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * SonarQube, open source software quality management tool.
- * Copyright (C) 2008-2014 SonarSource
- * mailto:contact AT sonarsource DOT com
- *
- * SonarQube is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * SonarQube is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-package org.sonar.wsclient.services;
-
-/**
- * @author Evgeny Mandrikov
- * @since 2.2
- */
-public class EventCreateQuery extends CreateQuery<Event> {
-  private Event event;
-
-  public EventCreateQuery(Event event) {
-    this.event = event;
-  }
-
-  @Override
-  public String getUrl() {
-    StringBuilder url = new StringBuilder(EventQuery.BASE_URL);
-    url.append('?');
-    appendUrlParameter(url, "resource", event.getResourceKey());
-    appendUrlParameter(url, "category", event.getCategory());
-    appendUrlParameter(url, "name", event.getName());
-    appendUrlParameter(url, "description", event.getDescription());
-    return url.toString();
-  }
-
-  @Override
-  public Class<Event> getModelClass() {
-    return Event.class;
-  }
-}
diff --git a/server/sonar-ws-client/src/main/java/org/sonar/wsclient/services/EventQuery.java b/server/sonar-ws-client/src/main/java/org/sonar/wsclient/services/EventQuery.java
deleted file mode 100644 (file)
index 28bff17..0000000
+++ /dev/null
@@ -1,114 +0,0 @@
-/*
- * SonarQube, open source software quality management tool.
- * Copyright (C) 2008-2014 SonarSource
- * mailto:contact AT sonarsource DOT com
- *
- * SonarQube is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * SonarQube is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-package org.sonar.wsclient.services;
-
-import java.util.Date;
-
-public class EventQuery extends Query<Event> {
-  public static final String BASE_URL = "/api/events";
-
-  private String resourceKey;
-  private String[] categories;
-  private Date fromDate;
-  private boolean includeFromTime;
-  private Date toDate;
-  private boolean includeToTime;
-
-  public EventQuery() {
-  }
-
-  public EventQuery(String resourceKey) {
-    this.resourceKey = resourceKey;
-  }
-
-  public Date getFrom() {
-    return fromDate;
-  }
-
-  public EventQuery setFrom(Date fromDate, boolean includeTime) {
-    this.fromDate = fromDate;
-    this.includeFromTime = includeTime;
-    return this;
-  }
-
-  public boolean isIncludeFromTime() {
-    return includeFromTime;
-  }
-
-  public Date getTo() {
-    return toDate;
-  }
-
-  public EventQuery setTo(Date toDate, boolean includeTime) {
-    this.toDate = toDate;
-    this.includeToTime = includeTime;
-    return this;
-  }
-
-  public boolean isIncludeToTime() {
-    return includeToTime;
-  }
-
-  public String getResourceKey() {
-    return resourceKey;
-  }
-
-  public EventQuery setResourceKey(String resourceKey) {
-    this.resourceKey = resourceKey;
-    return this;
-  }
-
-  public String[] getCategories() {
-    return categories;
-  }
-
-  public EventQuery setCategories(String[] categories) {
-    this.categories = categories;
-    return this;
-  }
-
-  @Override
-  public String getUrl() {
-    StringBuilder url = new StringBuilder(BASE_URL);
-    url.append('?');
-    appendUrlParameter(url, "resource", resourceKey);
-    appendUrlParameter(url, "categories", categories);
-    if (fromDate != null) {
-      if (includeFromTime) {
-        appendUrlParameter(url, "fromDateTime", fromDate, true);
-      } else {
-        appendUrlParameter(url, "fromDate", fromDate, false);
-      }
-    }
-    if (toDate != null) {
-      if (includeToTime) {
-        appendUrlParameter(url, "toDateTime", toDate, true);
-      } else {
-        appendUrlParameter(url, "toDate", toDate, false);
-      }
-    }
-    return url.toString();
-  }
-
-  @Override
-  public Class<Event> getModelClass() {
-    return Event.class;
-  }
-}
diff --git a/server/sonar-ws-client/src/main/java/org/sonar/wsclient/services/Favourite.java b/server/sonar-ws-client/src/main/java/org/sonar/wsclient/services/Favourite.java
deleted file mode 100644 (file)
index 9b9d149..0000000
+++ /dev/null
@@ -1,94 +0,0 @@
-/*
- * SonarQube, open source software quality management tool.
- * Copyright (C) 2008-2014 SonarSource
- * mailto:contact AT sonarsource DOT com
- *
- * SonarQube is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * SonarQube is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-package org.sonar.wsclient.services;
-
-import javax.annotation.CheckForNull;
-import javax.annotation.Nullable;
-
-public class Favourite extends Model {
-
-  private Integer id;
-  private String key;
-  private String name;
-  private String scope;
-  private String qualifier;
-  private String language;
-
-  @CheckForNull
-  public Integer getId() {
-    return id;
-  }
-
-  public Favourite setId(@Nullable Integer id) {
-    this.id = id;
-    return this;
-  }
-
-  @CheckForNull
-  public String getKey() {
-    return key;
-  }
-
-  public Favourite setKey(@Nullable String key) {
-    this.key = key;
-    return this;
-  }
-
-  @CheckForNull
-  public String getName() {
-    return name;
-  }
-
-
-  public Favourite setName(@Nullable String name) {
-    this.name = name;
-    return this;
-  }
-
-  @CheckForNull
-  public String getScope() {
-    return scope;
-  }
-
-  public Favourite setScope(@Nullable String scope) {
-    this.scope = scope;
-    return this;
-  }
-
-  @CheckForNull
-  public String getQualifier() {
-    return qualifier;
-  }
-
-  public Favourite setQualifier(@Nullable String qualifier) {
-    this.qualifier = qualifier;
-    return this;
-  }
-
-  @CheckForNull
-  public String getLanguage() {
-    return language;
-  }
-
-  public Favourite setLanguage(@Nullable String language) {
-    this.language = language;
-    return this;
-  }
-}
diff --git a/server/sonar-ws-client/src/main/java/org/sonar/wsclient/services/FavouriteCreateQuery.java b/server/sonar-ws-client/src/main/java/org/sonar/wsclient/services/FavouriteCreateQuery.java
deleted file mode 100644 (file)
index e28bbd8..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * SonarQube, open source software quality management tool.
- * Copyright (C) 2008-2014 SonarSource
- * mailto:contact AT sonarsource DOT com
- *
- * SonarQube is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * SonarQube is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-package org.sonar.wsclient.services;
-
-public class FavouriteCreateQuery extends CreateQuery<Favourite> {
-
-  private String idOrKey;
-
-  public FavouriteCreateQuery(String idOrKey) {
-    this.idOrKey = idOrKey;
-  }
-
-  @Override
-  public String getUrl() {
-    StringBuilder url = new StringBuilder(FavouriteQuery.BASE_URL).append('?');
-    appendUrlParameter(url, "key", idOrKey);
-    return url.toString();
-  }
-
-  @Override
-  public Class<Favourite> getModelClass() {
-    return Favourite.class;
-  }
-}
diff --git a/server/sonar-ws-client/src/main/java/org/sonar/wsclient/services/FavouriteDeleteQuery.java b/server/sonar-ws-client/src/main/java/org/sonar/wsclient/services/FavouriteDeleteQuery.java
deleted file mode 100644 (file)
index e8e8a6d..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * SonarQube, open source software quality management tool.
- * Copyright (C) 2008-2014 SonarSource
- * mailto:contact AT sonarsource DOT com
- *
- * SonarQube is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * SonarQube is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-package org.sonar.wsclient.services;
-
-public class FavouriteDeleteQuery extends DeleteQuery {
-
-  private String idOrKey;
-
-  public FavouriteDeleteQuery(String idOrKey) {
-    this.idOrKey = idOrKey;
-  }
-
-  public String getIdOrKey() {
-    return idOrKey;
-  }
-
-  @Override
-  public String getUrl() {
-    return new StringBuilder().append(FavouriteQuery.BASE_URL).append('/').append(encode(idOrKey)).toString();
-  }
-}
diff --git a/server/sonar-ws-client/src/main/java/org/sonar/wsclient/services/FavouriteQuery.java b/server/sonar-ws-client/src/main/java/org/sonar/wsclient/services/FavouriteQuery.java
deleted file mode 100644 (file)
index b3c2d5d..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * SonarQube, open source software quality management tool.
- * Copyright (C) 2008-2014 SonarSource
- * mailto:contact AT sonarsource DOT com
- *
- * SonarQube is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * SonarQube is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-package org.sonar.wsclient.services;
-
-public class FavouriteQuery extends Query<Favourite> {
-
-  public static final String BASE_URL = "/api/favourites";
-
-  @Override
-  public Class<Favourite> getModelClass() {
-    return Favourite.class;
-  }
-
-  @Override
-  public String getUrl() {
-    return BASE_URL;
-  }
-}
diff --git a/server/sonar-ws-client/src/main/java/org/sonar/wsclient/services/ManualMeasure.java b/server/sonar-ws-client/src/main/java/org/sonar/wsclient/services/ManualMeasure.java
deleted file mode 100644 (file)
index 714f660..0000000
+++ /dev/null
@@ -1,145 +0,0 @@
-/*
- * SonarQube, open source software quality management tool.
- * Copyright (C) 2008-2014 SonarSource
- * mailto:contact AT sonarsource DOT com
- *
- * SonarQube is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * SonarQube is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-package org.sonar.wsclient.services;
-
-import javax.annotation.CheckForNull;
-import javax.annotation.Nullable;
-
-import java.util.Date;
-
-/**
- * @since 2.10
- */
-public class ManualMeasure extends Model {
-
-  private Long id;
-  private String metricKey;
-  private String resourceKey;
-  private Double value;
-  private String textValue;
-  private Date createdAt;
-  private Date updatedAt;
-  private String userLogin;
-  private String username;
-
-  public ManualMeasure() {
-  }
-
-  @CheckForNull
-  public Long getId() {
-    return id;
-  }
-
-  public ManualMeasure setId(@Nullable Long id) {
-    this.id = id;
-    return this;
-  }
-
-  @CheckForNull
-  public String getMetricKey() {
-    return metricKey;
-  }
-
-  public ManualMeasure setMetricKey(@Nullable String metricKey) {
-    this.metricKey = metricKey;
-    return this;
-  }
-
-  @CheckForNull
-  public Double getValue() {
-    return value;
-  }
-
-  public ManualMeasure setValue(@Nullable Double value) {
-    this.value = value;
-    return this;
-  }
-
-  @CheckForNull
-  public String getTextValue() {
-    return textValue;
-  }
-
-  public ManualMeasure setTextValue(@Nullable String textValue) {
-    this.textValue = textValue;
-    return this;
-  }
-
-  @CheckForNull
-  public Date getCreatedAt() {
-    return createdAt;
-  }
-
-  public ManualMeasure setCreatedAt(@Nullable Date createdAt) {
-    this.createdAt = createdAt;
-    return this;
-  }
-
-  @CheckForNull
-  public Date getUpdatedAt() {
-    return updatedAt;
-  }
-
-  public ManualMeasure setUpdatedAt(@Nullable Date updatedAt) {
-    this.updatedAt = updatedAt;
-    return this;
-  }
-
-  @CheckForNull
-  public String getUserLogin() {
-    return userLogin;
-  }
-
-  public ManualMeasure setUserLogin(@Nullable String userLogin) {
-    this.userLogin = userLogin;
-    return this;
-  }
-
-  @CheckForNull
-  public String getUsername() {
-    return username;
-  }
-
-  public ManualMeasure setUsername(@Nullable String username) {
-    this.username = username;
-    return this;
-  }
-
-  @CheckForNull
-  public String getResourceKey() {
-    return resourceKey;
-  }
-
-  public ManualMeasure setResourceKey(@Nullable String resourceKey) {
-    this.resourceKey = resourceKey;
-    return this;
-  }
-
-  @Override
-  public String toString() {
-    return new StringBuilder().append("Measure{")
-      .append("id='").append(id).append('\'')
-      .append("resourceKey='").append(resourceKey).append('\'')
-      .append("metricKey='").append(metricKey).append('\'')
-      .append(", value=").append(value)
-      .append(", textValue='").append(textValue).append('\'')
-      .append('}').toString();
-  }
-}
diff --git a/server/sonar-ws-client/src/main/java/org/sonar/wsclient/services/ManualMeasureCreateQuery.java b/server/sonar-ws-client/src/main/java/org/sonar/wsclient/services/ManualMeasureCreateQuery.java
deleted file mode 100644 (file)
index ca3f456..0000000
+++ /dev/null
@@ -1,109 +0,0 @@
-/*
- * SonarQube, open source software quality management tool.
- * Copyright (C) 2008-2014 SonarSource
- * mailto:contact AT sonarsource DOT com
- *
- * SonarQube is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * SonarQube is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-package org.sonar.wsclient.services;
-
-/**
- * @since 2.10
- */
-public final class ManualMeasureCreateQuery extends CreateQuery<ManualMeasure> {
-
-  private String resourceKey;
-  private String metricKey;
-  private Integer intValue;
-  private Double value;
-  private String textValue;
-  private String description;
-
-  private ManualMeasureCreateQuery(String resourceKey, String metricKey) {
-    this.resourceKey = resourceKey;
-    this.metricKey = metricKey;
-  }
-
-  public String getResourceKey() {
-    return resourceKey;
-  }
-
-  public String getMetricKey() {
-    return metricKey;
-  }
-
-  public Double getValue() {
-    return value;
-  }
-
-  public ManualMeasureCreateQuery setValue(Double value) {
-    this.value = value;
-    return this;
-  }
-
-  public Integer getIntValue() {
-    return intValue;
-  }
-
-  public ManualMeasureCreateQuery setIntValue(Integer intValue) {
-    this.intValue = intValue;
-    return this;
-  }
-
-  public String getTextValue() {
-    return textValue;
-  }
-
-  public ManualMeasureCreateQuery setTextValue(String textValue) {
-    this.textValue = textValue;
-    return this;
-  }
-
-  public String getDescription() {
-    return description;
-  }
-
-  public ManualMeasureCreateQuery setDescription(String description) {
-    this.description = description;
-    return this;
-  }
-
-  @Override
-  public String getUrl() {
-    StringBuilder url = new StringBuilder();
-    url.append(ManualMeasureQuery.BASE_URL);
-    appendUrlParameter(url, "resource", resourceKey);
-    appendUrlParameter(url, "metric", metricKey);
-    if (value != null) {
-      appendUrlParameter(url, "val", value);
-    } else if (intValue != null) {
-      appendUrlParameter(url, "val", intValue);
-    }
-
-    // limitations : POST body is not used, so the complete URL size is limited
-    appendUrlParameter(url, "text", textValue);
-    appendUrlParameter(url, "desc", description);
-    return url.toString();
-  }
-
-  @Override
-  public Class<ManualMeasure> getModelClass() {
-    return ManualMeasure.class;
-  }
-
-  public static ManualMeasureCreateQuery create(String resourceKey, String metricKey) {
-    return new ManualMeasureCreateQuery(resourceKey, metricKey);
-  }
-}
diff --git a/server/sonar-ws-client/src/main/java/org/sonar/wsclient/services/ManualMeasureDeleteQuery.java b/server/sonar-ws-client/src/main/java/org/sonar/wsclient/services/ManualMeasureDeleteQuery.java
deleted file mode 100644 (file)
index 6e30c0d..0000000
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- * SonarQube, open source software quality management tool.
- * Copyright (C) 2008-2014 SonarSource
- * mailto:contact AT sonarsource DOT com
- *
- * SonarQube is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * SonarQube is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-package org.sonar.wsclient.services;
-
-/**
- * @since 2.10
- */
-public final class ManualMeasureDeleteQuery extends DeleteQuery {
-
-  private String resourceKey;
-  private String metricKey;
-
-  private ManualMeasureDeleteQuery(String resourceKey, String metricKey) {
-    this.resourceKey = resourceKey;
-    this.metricKey = metricKey;
-  }
-
-  public static ManualMeasureDeleteQuery create(String resourceKey, String metricKey) {
-    return new ManualMeasureDeleteQuery(resourceKey, metricKey);
-  }
-
-  public String getResourceKey() {
-    return resourceKey;
-  }
-
-  public String getMetricKey() {
-    return metricKey;
-  }
-
-  @Override
-  public String getUrl() {
-    StringBuilder url = new StringBuilder();
-    url.append(ManualMeasureQuery.BASE_URL);
-    appendUrlParameter(url, "resource", resourceKey);
-    appendUrlParameter(url, "metric", metricKey);
-    return url.toString();
-  }
-
-  @Override
-  public String toString() {
-    return getUrl();
-  }
-}
diff --git a/server/sonar-ws-client/src/main/java/org/sonar/wsclient/services/ManualMeasureQuery.java b/server/sonar-ws-client/src/main/java/org/sonar/wsclient/services/ManualMeasureQuery.java
deleted file mode 100644 (file)
index 709b891..0000000
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- * SonarQube, open source software quality management tool.
- * Copyright (C) 2008-2014 SonarSource
- * mailto:contact AT sonarsource DOT com
- *
- * SonarQube is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * SonarQube is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-package org.sonar.wsclient.services;
-
-/**
- * @since 2.10
- */
-public final class ManualMeasureQuery extends Query<ManualMeasure> {
-  public static final String BASE_URL = "/api/manual_measures?";
-
-  private String resourceKey;
-  private String metricKey;
-
-  private ManualMeasureQuery(String resourceKey) {
-    this.resourceKey = resourceKey;
-  }
-
-  public String getResourceKey() {
-    return resourceKey;
-  }
-
-  public String getMetricKey() {
-    return metricKey;
-  }
-
-  public ManualMeasureQuery setMetricKey(String s) {
-    this.metricKey = s;
-    return this;
-  }
-
-  @Override
-  public String getUrl() {
-    StringBuilder sb = new StringBuilder(BASE_URL);
-    appendUrlParameter(sb, "resource", resourceKey);
-    appendUrlParameter(sb, "metric", metricKey);
-    return sb.toString();
-  }
-
-  @Override
-  public Class<ManualMeasure> getModelClass() {
-    return ManualMeasure.class;
-  }
-
-  public static ManualMeasureQuery create(String resourceKey) {
-    return new ManualMeasureQuery(resourceKey);
-  }
-}
diff --git a/server/sonar-ws-client/src/main/java/org/sonar/wsclient/services/Measure.java b/server/sonar-ws-client/src/main/java/org/sonar/wsclient/services/Measure.java
deleted file mode 100644 (file)
index 6192dc1..0000000
+++ /dev/null
@@ -1,357 +0,0 @@
-/*
- * SonarQube, open source software quality management tool.
- * Copyright (C) 2008-2014 SonarSource
- * mailto:contact AT sonarsource DOT com
- *
- * SonarQube is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * SonarQube is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-package org.sonar.wsclient.services;
-
-import javax.annotation.CheckForNull;
-import javax.annotation.Nullable;
-import java.util.LinkedHashMap;
-import java.util.Map;
-
-public class Measure extends Model {
-
-  private String metricKey;
-  private String metricName;
-  private Double value;
-  private String formattedValue;
-  private String alertStatus;
-  private String alertText;
-  private String data;
-  private String characteristicKey;
-  private String characteristicName;
-
-  private String ruleKey;
-  private String ruleName;
-  private String ruleSeverity;
-
-  /**
-   * @deprecated since 2.5 See http://jira.codehaus.org/browse/SONAR-2007
-   */
-  @Deprecated
-  private String ruleCategory;
-
-  private Double variation1, variation2, variation3, variation4, variation5;
-
-  @CheckForNull
-  public String getMetricKey() {
-    return metricKey;
-  }
-
-  public Measure setMetricKey(@Nullable String metricKey) {
-    this.metricKey = metricKey;
-    return this;
-  }
-
-  @CheckForNull
-  public String getMetricName() {
-    return metricName;
-  }
-
-  public Measure setMetricName(@Nullable String metricName) {
-    this.metricName = metricName;
-    return this;
-  }
-
-  @CheckForNull
-  public Double getValue() {
-    return value;
-  }
-
-  @CheckForNull
-  public Integer getIntValue() {
-    if (value == null) {
-      return null;
-    }
-    return value.intValue();
-  }
-
-  @CheckForNull
-  public Long getLongValue() {
-    if (value == null) {
-      return null;
-    }
-    return value.longValue();
-  }
-
-  public Measure setValue(@Nullable Double value) {
-    this.value = value;
-    return this;
-  }
-
-  @CheckForNull
-  public String getFormattedValue() {
-    return formattedValue;
-  }
-
-  @CheckForNull
-  public String getFormattedValue(@Nullable String defaultValue) {
-    if (formattedValue == null) {
-      return defaultValue;
-    }
-    return formattedValue;
-  }
-
-  public Measure setFormattedValue(@Nullable String formattedValue) {
-    this.formattedValue = formattedValue;
-    return this;
-  }
-
-  @CheckForNull
-  public String getAlertStatus() {
-    return alertStatus;
-  }
-
-  public Measure setAlertStatus(@Nullable String alertStatus) {
-    this.alertStatus = alertStatus;
-    return this;
-  }
-
-  @CheckForNull
-  public String getAlertText() {
-    return alertText;
-  }
-
-  public Measure setAlertText(@Nullable String alertText) {
-    this.alertText = alertText;
-    return this;
-  }
-
-  @CheckForNull
-  public String getData() {
-    return data;
-  }
-
-  @CheckForNull
-  public Map<String, String> getDataAsMap() {
-    return getDataAsMap(",");
-  }
-
-  @CheckForNull
-  public Map<String, String> getDataAsMap(String separator) {
-    if (data == null) {
-      return null;
-    }
-    Map<String, String> map = new LinkedHashMap<>();
-    String[] parts = data.split(separator);
-    for (String part : parts) {
-      String[] kv = part.split("=");
-      map.put(kv[0], kv[1]);
-    }
-    return map;
-  }
-
-  public Measure setData(@Nullable String data) {
-    this.data = data;
-    return this;
-  }
-
-  @CheckForNull
-  public String getRuleKey() {
-    return ruleKey;
-  }
-
-  public Measure setRuleKey(@Nullable String ruleKey) {
-    this.ruleKey = ruleKey;
-    return this;
-  }
-
-  @CheckForNull
-  public String getRuleName() {
-    return ruleName;
-  }
-
-  public Measure setRuleName(@Nullable String ruleName) {
-    this.ruleName = ruleName;
-    return this;
-  }
-
-  /**
-   * @deprecated since 2.5 See http://jira.codehaus.org/browse/SONAR-2007
-   */
-  @Deprecated
-  @CheckForNull
-  public String getRuleCategory() {
-    return ruleCategory;
-  }
-
-  /**
-   * @deprecated since 2.5 See http://jira.codehaus.org/browse/SONAR-2007
-   */
-  @Deprecated
-  public Measure setRuleCategory(@Nullable String ruleCategory) {
-    this.ruleCategory = ruleCategory;
-    return this;
-  }
-
-  /**
-   * @since 2.5
-   */
-  public Measure setRuleSeverity(@Nullable String ruleSeverity) {
-    this.ruleSeverity = ruleSeverity;
-    return this;
-  }
-
-  /**
-   * @since 2.5
-   */
-  @CheckForNull
-  public String getRuleSeverity() {
-    return ruleSeverity;
-  }
-
-  /**
-   * @deprecated since 2.5 use {@link #getRuleSeverity()} instead. See http://jira.codehaus.org/browse/SONAR-1829
-   */
-  @Deprecated
-  @CheckForNull
-  public String getRulePriority() {
-    return ruleSeverity;
-  }
-
-  /**
-   * @deprecated since 2.5 use {@link #setRuleSeverity(String)} instead. See http://jira.codehaus.org/browse/SONAR-1829
-   */
-  @Deprecated
-  public Measure setRulePriority(@Nullable String rulePriority) {
-    this.ruleSeverity = rulePriority;
-    return this;
-  }
-
-  @CheckForNull
-  public String getCharacteristicKey() {
-    return characteristicKey;
-  }
-
-  @CheckForNull
-  public String getCharacteristicName() {
-    return characteristicName;
-  }
-
-  public Measure setCharacteristicKey(@Nullable String s) {
-    this.characteristicKey = s;
-    return this;
-  }
-
-  public Measure setCharacteristicName(@Nullable String s) {
-    this.characteristicName = s;
-    return this;
-  }
-
-  /**
-   * Variation value on period 1. The value is loaded if ResourceQuery#setIncludeTrends() is set to true.
-   * @since 2.5
-   */
-  @CheckForNull
-  public Double getVariation1() {
-    return variation1;
-  }
-
-  /**
-   * @since 2.5
-   */
-  public Measure setVariation1(@Nullable Double variation1) {
-    this.variation1 = variation1;
-    return this;
-  }
-
-  /**
-   * Variation value on period 2. The value is loaded if ResourceQuery#setIncludeTrends() is set to true.
-   * @since 2.5
-   */
-  @CheckForNull
-  public Double getVariation2() {
-    return variation2;
-  }
-
-  /**
-   * @since 2.5
-   */
-  public Measure setVariation2(@Nullable Double variation2) {
-    this.variation2 = variation2;
-    return this;
-  }
-
-  /**
-   * Variation value on period 3. The value is loaded if ResourceQuery#setIncludeTrends() is set to true.
-   * @since 2.5
-   */
-  @CheckForNull
-  public Double getVariation3() {
-    return variation3;
-  }
-
-  /**
-   * @since 2.5
-   */
-  public Measure setVariation3(@Nullable Double variation3) {
-    this.variation3 = variation3;
-    return this;
-  }
-
-  /**
-   * Variation value on period 4. The value is loaded if ResourceQuery#setIncludeTrends() is set to true.
-   * @since 2.5
-   */
-  @CheckForNull
-  public Double getVariation4() {
-    return variation4;
-  }
-
-  /**
-   * @since 2.5
-   */
-  public Measure setVariation4(@Nullable Double variation4) {
-    this.variation4 = variation4;
-    return this;
-  }
-
-  /**
-   * Variation value on period 5. The value is loaded if ResourceQuery#setIncludeTrends() is set to true.
-   * @since 2.5
-   */
-  @CheckForNull
-  public Double getVariation5() {
-    return variation5;
-  }
-
-  /**
-   * @since 2.5
-   */
-  public Measure setVariation5(@Nullable Double variation5) {
-    this.variation5 = variation5;
-    return this;
-  }
-
-  @Override
-  public String toString() {
-    return new StringBuilder().append("Measure{")
-        .append("metricKey='").append(metricKey).append('\'')
-        .append(", metricName='").append(metricName).append('\'')
-        .append(", value=").append(value)
-        .append(", formattedValue='").append(formattedValue).append('\'')
-        .append(", data='").append(data).append('\'')
-        .append(", characteristicKey='").append(characteristicKey).append('\'')
-        .append(", characteristicName='").append(characteristicName).append('\'')
-        .append(", ruleKey='").append(ruleKey).append('\'')
-        .append(", ruleName='").append(ruleName).append('\'')
-        .append(", ruleCategory='").append(ruleCategory).append('\'')
-        .append(", rulePriority='").append(ruleSeverity).append('\'')
-        .append('}').toString();
-  }
-}
diff --git a/server/sonar-ws-client/src/main/java/org/sonar/wsclient/services/Metric.java b/server/sonar-ws-client/src/main/java/org/sonar/wsclient/services/Metric.java
deleted file mode 100644 (file)
index 90ba55e..0000000
+++ /dev/null
@@ -1,125 +0,0 @@
-/*
- * SonarQube, open source software quality management tool.
- * Copyright (C) 2008-2014 SonarSource
- * mailto:contact AT sonarsource DOT com
- *
- * SonarQube is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * SonarQube is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-package org.sonar.wsclient.services;
-
-import javax.annotation.CheckForNull;
-import javax.annotation.Nullable;
-
-public class Metric extends Model {
-
-  private String key;
-  private String name;
-  private Integer direction;
-  private String domain;
-  private String description;
-  private String type;
-  private Boolean userManaged;
-  private Boolean hidden;
-
-  @CheckForNull
-  public String getKey() {
-    return key;
-  }
-
-  public Metric setKey(@Nullable String key) {
-    this.key = key;
-    return this;
-  }
-
-  @CheckForNull
-  public String getName() {
-    return name;
-  }
-
-  public Metric setName(@Nullable String name) {
-    this.name = name;
-    return this;
-  }
-
-  @CheckForNull
-  public Integer getDirection() {
-    return direction;
-  }
-
-  public Metric setDirection(@Nullable Integer direction) {
-    this.direction = direction;
-    return this;
-  }
-
-  @CheckForNull
-  public String getDomain() {
-    return domain;
-  }
-
-  public Metric setDomain(@Nullable String domain) {
-    this.domain = domain;
-    return this;
-  }
-
-  @CheckForNull
-  public String getDescription() {
-    return description;
-  }
-
-  public Metric setDescription(@Nullable String description) {
-    this.description = description;
-    return this;
-  }
-
-  @CheckForNull
-  public String getType() {
-    return type;
-  }
-
-  public Metric setType(@Nullable String type) {
-    this.type = type;
-    return this;
-  }
-
-  @CheckForNull
-  public Boolean getHidden() {
-    return hidden;
-  }
-
-  public Metric setHidden(@Nullable Boolean hidden) {
-    this.hidden = hidden;
-    return this;
-  }
-
-  @CheckForNull
-  public Boolean getUserManaged() {
-    return userManaged;
-  }
-
-  public Metric setUserManaged(@Nullable Boolean userManaged) {
-    this.userManaged = userManaged;
-    return this;
-  }
-
-  @Override
-  public String toString() {
-    return new StringBuilder()
-      .append(name)
-      .append("(")
-      .append(key)
-      .append(")")
-      .toString();
-  }
-}
diff --git a/server/sonar-ws-client/src/main/java/org/sonar/wsclient/services/MetricCreateQuery.java b/server/sonar-ws-client/src/main/java/org/sonar/wsclient/services/MetricCreateQuery.java
deleted file mode 100644 (file)
index 6cee369..0000000
+++ /dev/null
@@ -1,78 +0,0 @@
-/*
- * SonarQube, open source software quality management tool.
- * Copyright (C) 2008-2014 SonarSource
- * mailto:contact AT sonarsource DOT com
- *
- * SonarQube is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * SonarQube is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-package org.sonar.wsclient.services;
-
-/**
- * @since 3.6
- */
-public class MetricCreateQuery extends CreateQuery<Metric>  {
-
-  private String key;
-  private String name;
-  private String description;
-  private String domain;
-  private String type;
-
-  public static MetricCreateQuery create(String metricKey) {
-    return new MetricCreateQuery(metricKey);
-  }
-
-  private MetricCreateQuery(String key) {
-    this.key = key;
-  }
-
-  public MetricCreateQuery setName(String name) {
-    this.name = name;
-    return this;
-  }
-
-  public MetricCreateQuery setDescription(String description) {
-    this.description = description;
-    return this;
-  }
-
-  public MetricCreateQuery setDomain(String domain) {
-    this.domain = domain;
-    return this;
-  }
-
-  public MetricCreateQuery setType(String type) {
-    this.type = type;
-    return this;
-  }
-
-  @Override
-  public String getUrl() {
-    StringBuilder url = new StringBuilder();
-    url.append(MetricQuery.BASE_URL);
-    url.append("/").append(encode(key));
-    url.append('?');
-    appendUrlParameter(url, "name", name);
-    appendUrlParameter(url, "description", description);
-    appendUrlParameter(url, "domain", domain);
-    appendUrlParameter(url, "val_type", type);
-    return url.toString();
-  }
-
-  @Override
-  public Class<Metric> getModelClass() {
-    return Metric.class;
-  }
-}
diff --git a/server/sonar-ws-client/src/main/java/org/sonar/wsclient/services/MetricDeleteQuery.java b/server/sonar-ws-client/src/main/java/org/sonar/wsclient/services/MetricDeleteQuery.java
deleted file mode 100644 (file)
index 6a0de9d..0000000
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * SonarQube, open source software quality management tool.
- * Copyright (C) 2008-2014 SonarSource
- * mailto:contact AT sonarsource DOT com
- *
- * SonarQube is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * SonarQube is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-package org.sonar.wsclient.services;
-
-/**
- * @since 3.6
- */
-public class MetricDeleteQuery extends DeleteQuery {
-
-  private String key;
-
-  public static MetricDeleteQuery delete(String key){
-    return new MetricDeleteQuery(key);
-  }
-
-  private MetricDeleteQuery(String key) {
-    this.key = key;
-  }
-
-  public String getKey() {
-    return key;
-  }
-
-  public MetricDeleteQuery setKey(String key) {
-    this.key = key;
-    return this;
-  }
-
-  @Override
-  public String getUrl() {
-    StringBuilder url = new StringBuilder();
-    url.append(MetricQuery.BASE_URL);
-    url.append("/").append(encode(key));
-    return url.toString();
-  }
-}
diff --git a/server/sonar-ws-client/src/main/java/org/sonar/wsclient/services/MetricQuery.java b/server/sonar-ws-client/src/main/java/org/sonar/wsclient/services/MetricQuery.java
deleted file mode 100644 (file)
index c55749d..0000000
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * SonarQube, open source software quality management tool.
- * Copyright (C) 2008-2014 SonarSource
- * mailto:contact AT sonarsource DOT com
- *
- * SonarQube is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * SonarQube is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-package org.sonar.wsclient.services;
-
-public final class MetricQuery extends Query<Metric> {
-  public static final String BASE_URL = "/api/metrics";
-
-  private String key;
-
-  private MetricQuery() {
-  }
-
-  private MetricQuery(String key) {
-    this.key = key;
-  }
-
-  @Override
-  public String getUrl() {
-    StringBuilder sb = new StringBuilder(BASE_URL);
-    if (key != null && !"".equals(key)) {
-      sb.append("/");
-      sb.append(encode(key));
-    }
-    sb.append("?");
-    return sb.toString();
-  }
-
-  @Override
-  public Class<Metric> getModelClass() {
-    return Metric.class;
-  }
-
-  public static MetricQuery all() {
-    return new MetricQuery();
-  }
-
-  public static MetricQuery byKey(String metricKey) {
-    return new MetricQuery(metricKey);
-  }
-}
diff --git a/server/sonar-ws-client/src/main/java/org/sonar/wsclient/services/MetricUpdateQuery.java b/server/sonar-ws-client/src/main/java/org/sonar/wsclient/services/MetricUpdateQuery.java
deleted file mode 100644 (file)
index f66f200..0000000
+++ /dev/null
@@ -1,86 +0,0 @@
-/*
- * SonarQube, open source software quality management tool.
- * Copyright (C) 2008-2014 SonarSource
- * mailto:contact AT sonarsource DOT com
- *
- * SonarQube is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * SonarQube is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-package org.sonar.wsclient.services;
-
-/**
- * @since 3.6
- */
-public class MetricUpdateQuery extends UpdateQuery<Metric> {
-
-  private String key;
-  private String name;
-  private String description;
-  private String domain;
-  private String type;
-
-  public static MetricUpdateQuery update(String key){
-    return new MetricUpdateQuery(key);
-  }
-
-  private MetricUpdateQuery(String key) {
-    this.key = key;
-  }
-
-  public MetricUpdateQuery setName(String name) {
-    this.name = name;
-    return this;
-  }
-
-  public MetricUpdateQuery setDescription(String description) {
-    this.description = description;
-    return this;
-  }
-
-  public MetricUpdateQuery setDomain(String domain) {
-    this.domain = domain;
-    return this;
-  }
-
-  public MetricUpdateQuery setType(String type) {
-    this.type = type;
-    return this;
-  }
-
-  @Override
-  public String getUrl() {
-    StringBuilder url = new StringBuilder();
-    url.append(MetricQuery.BASE_URL);
-    url.append("/").append(encode(key));
-    url.append('?');
-    appendUrlParameter(url, "name", name);
-    appendUrlParameter(url, "description", description);
-    appendUrlParameter(url, "domain", domain);
-    appendUrlParameter(url, "val_type", type);
-    return url.toString();
-  }
-
-  /**
-   * Property {@link #description} transmitted through request body as content may exceed URL size allowed by the server.
-   */
-  @Override
-  public String getBody() {
-    return description;
-  }
-
-  @Override
-  public Class<Metric> getModelClass() {
-    return Metric.class;
-  }
-}
diff --git a/server/sonar-ws-client/src/main/java/org/sonar/wsclient/services/Model.java b/server/sonar-ws-client/src/main/java/org/sonar/wsclient/services/Model.java
deleted file mode 100644 (file)
index 706bc6e..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-/*
- * SonarQube, open source software quality management tool.
- * Copyright (C) 2008-2014 SonarSource
- * mailto:contact AT sonarsource DOT com
- *
- * SonarQube is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * SonarQube is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-package org.sonar.wsclient.services;
-
-public abstract class Model {
-}
diff --git a/server/sonar-ws-client/src/main/java/org/sonar/wsclient/services/Plugin.java b/server/sonar-ws-client/src/main/java/org/sonar/wsclient/services/Plugin.java
deleted file mode 100644 (file)
index e38ec4d..0000000
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- * SonarQube, open source software quality management tool.
- * Copyright (C) 2008-2014 SonarSource
- * mailto:contact AT sonarsource DOT com
- *
- * SonarQube is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * SonarQube is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-package org.sonar.wsclient.services;
-
-import javax.annotation.CheckForNull;
-import javax.annotation.Nullable;
-
-/**
- * @since 2.4
- */
-public class Plugin extends Model {
-
-  private String key;
-  private String name;
-  private String version;
-
-  @CheckForNull
-  public String getKey() {
-    return key;
-  }
-
-  public Plugin setKey(@Nullable String key) {
-    this.key = key;
-    return this;
-  }
-
-  @CheckForNull
-  public String getName() {
-    return name;
-  }
-
-  public Plugin setName(@Nullable String name) {
-    this.name = name;
-    return this;
-  }
-
-  @CheckForNull
-  public String getVersion() {
-    return version;
-  }
-
-  public Plugin setVersion(@Nullable String version) {
-    this.version = version;
-    return this;
-  }
-
-}
diff --git a/server/sonar-ws-client/src/main/java/org/sonar/wsclient/services/Profile.java b/server/sonar-ws-client/src/main/java/org/sonar/wsclient/services/Profile.java
deleted file mode 100644 (file)
index cc04371..0000000
+++ /dev/null
@@ -1,162 +0,0 @@
-/*
- * SonarQube, open source software quality management tool.
- * Copyright (C) 2008-2014 SonarSource
- * mailto:contact AT sonarsource DOT com
- *
- * SonarQube is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * SonarQube is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-
-package org.sonar.wsclient.services;
-
-import javax.annotation.CheckForNull;
-import javax.annotation.Nullable;
-
-import java.util.*;
-
-/**
- * @since 2.7
- */
-public class Profile extends Model {
-
-  private String language;
-  private String name;
-  private boolean defaultProfile;
-  private String parentName;
-  private List<Rule> rules = new ArrayList<>();
-
-  @CheckForNull
-  public String getLanguage() {
-    return language;
-  }
-
-  public Profile setLanguage(@Nullable String s) {
-    this.language = s;
-    return this;
-  }
-
-  @CheckForNull
-  public String getName() {
-    return name;
-  }
-
-  public Profile setName(@Nullable String name) {
-    this.name = name;
-    return this;
-  }
-
-  public boolean isDefaultProfile() {
-    return defaultProfile;
-  }
-
-  public Profile setDefaultProfile(boolean b) {
-    this.defaultProfile = b;
-    return this;
-  }
-
-  public String getParentName() {
-    return parentName;
-  }
-
-  @CheckForNull
-  public Profile setParentName(@Nullable String s) {
-    this.parentName = s;
-    return this;
-  }
-
-  public List<Rule> getRules() {
-    return rules;
-  }
-
-  public Rule getRule(String repositoryKey, String ruleKey) {
-    for (Rule rule : rules) {
-      if (repositoryKey.equals(rule.getRepository()) && ruleKey.equals(rule.getKey())) {
-        return rule;
-      }
-    }
-    return null;
-  }
-
-  public Profile addRule(Rule rule) {
-    rules.add(rule);
-    return this;
-  }
-
-  public static final class Rule {
-    private String key;
-    private String repository;
-    private String severity;
-    private String inheritance;
-    private Map<String,String> parameters;
-
-    @CheckForNull
-    public String getKey() {
-      return key;
-    }
-
-    public Rule setKey(@Nullable String key) {
-      this.key = key;
-      return this;
-    }
-
-    @CheckForNull
-    public String getRepository() {
-      return repository;
-    }
-
-    public Rule setRepository(@Nullable String repository) {
-      this.repository = repository;
-      return this;
-    }
-
-    @CheckForNull
-    public String getSeverity() {
-      return severity;
-    }
-
-    public Rule setSeverity(@Nullable String severity) {
-      this.severity = severity;
-      return this;
-    }
-
-    @CheckForNull
-    public String getInheritance() {
-      return inheritance;
-    }
-
-    public Rule setInheritance(@Nullable String inheritance) {
-      this.inheritance = inheritance;
-      return this;
-    }
-
-    public Map<String, String> getParameters() {
-      if (parameters==null) {
-        return Collections.emptyMap();
-      }
-      return parameters;
-    }
-
-    public String getParameter(String key) {
-      return getParameters().get(key);
-    }
-
-    public Rule addParameter(@Nullable String key, @Nullable String value) {
-      if (parameters==null) {
-        parameters = new HashMap<>();
-      }
-      parameters.put(key, value);
-      return this;
-    }
-  }
-}
diff --git a/server/sonar-ws-client/src/main/java/org/sonar/wsclient/services/ProfileQuery.java b/server/sonar-ws-client/src/main/java/org/sonar/wsclient/services/ProfileQuery.java
deleted file mode 100644 (file)
index dab318b..0000000
+++ /dev/null
@@ -1,91 +0,0 @@
-/*
- * SonarQube, open source software quality management tool.
- * Copyright (C) 2008-2014 SonarSource
- * mailto:contact AT sonarsource DOT com
- *
- * SonarQube is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * SonarQube is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-package org.sonar.wsclient.services;
-
-/**
- * @since 2.7
- */
-public final class ProfileQuery extends Query<Profile> {
-  public static final String BASE_URL = "/api/profiles";
-
-  private String language;
-  private String name;//optional
-  private String[] ruleRepositories;//optional
-  private String[] ruleSeverities;//optional
-
-  private ProfileQuery(String language) {
-    this.language = language;
-  }
-
-  public String getLanguage() {
-    return language;
-  }
-
-  public String getName() {
-    return name;
-  }
-
-  public String[] getRuleRepositories() {
-    return ruleRepositories;
-  }
-
-  public String[] getRuleSeverities() {
-    return ruleSeverities;
-  }
-
-  public ProfileQuery setName(String name) {
-    this.name = name;
-    return this;
-  }
-
-  public ProfileQuery setRuleRepositories(String[] ruleRepositories) {
-    this.ruleRepositories = ruleRepositories;
-    return this;
-  }
-
-  public ProfileQuery setRuleSeverities(String[] ruleSeverities) {
-    this.ruleSeverities = ruleSeverities;
-    return this;
-  }
-
-  @Override
-  public Class<Profile> getModelClass() {
-    return Profile.class;
-  }
-
-  @Override
-  public String getUrl() {
-    StringBuilder url = new StringBuilder(BASE_URL);
-    url.append('?');
-    appendUrlParameter(url, "language", language);
-    appendUrlParameter(url, "name", name);
-    appendUrlParameter(url, "rule_repositories", ruleRepositories);
-    appendUrlParameter(url, "rule_severities", ruleSeverities);
-    return url.toString();
-  }
-
-  public static ProfileQuery createWithLanguage(String language) {
-    return new ProfileQuery(language);
-  }
-
-  public static ProfileQuery create(String language, String name) {
-    return new ProfileQuery(language).setName(name);
-  }
-}
diff --git a/server/sonar-ws-client/src/main/java/org/sonar/wsclient/services/Property.java b/server/sonar-ws-client/src/main/java/org/sonar/wsclient/services/Property.java
deleted file mode 100644 (file)
index 83d90d2..0000000
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- * SonarQube, open source software quality management tool.
- * Copyright (C) 2008-2014 SonarSource
- * mailto:contact AT sonarsource DOT com
- *
- * SonarQube is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * SonarQube is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-package org.sonar.wsclient.services;
-
-import javax.annotation.CheckForNull;
-import javax.annotation.Nullable;
-
-public class Property extends Model {
-
-  private String key;
-  private String value;
-
-  public Property(String key, String value) {
-    this.key = key;
-    this.value = value;
-  }
-
-  public Property() {
-  }
-
-  @CheckForNull
-  public String getKey() {
-    return key;
-  }
-
-  public Property setKey(@Nullable String key) {
-    this.key = key;
-    return this;
-  }
-
-  @CheckForNull
-  public String getValue() {
-    return value;
-  }
-
-  public Property setValue(@Nullable String value) {
-    this.value = value;
-    return this;
-  }
-
-  @Override
-  public String toString() {
-    return new StringBuilder()
-      .append('[')
-      .append(key)
-      .append(':')
-      .append(value)
-      .append(']')
-      .toString();
-  }
-}
diff --git a/server/sonar-ws-client/src/main/java/org/sonar/wsclient/services/PropertyCreateQuery.java b/server/sonar-ws-client/src/main/java/org/sonar/wsclient/services/PropertyCreateQuery.java
deleted file mode 100644 (file)
index 0a4a98d..0000000
+++ /dev/null
@@ -1,100 +0,0 @@
-/*
- * SonarQube, open source software quality management tool.
- * Copyright (C) 2008-2014 SonarSource
- * mailto:contact AT sonarsource DOT com
- *
- * SonarQube is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * SonarQube is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-package org.sonar.wsclient.services;
-
-/**
- * @since 2.6
- */
-public class PropertyCreateQuery extends CreateQuery<Property> {
-
-  private String key;
-  private String value;
-  private String resourceKeyOrId;
-
-  public PropertyCreateQuery() {
-  }
-
-  public PropertyCreateQuery(String key, String value) {
-    this.key = key;
-    this.value = value;
-  }
-
-  public PropertyCreateQuery(String key, String value, String resourceKeyOrId) {
-    this.key = key;
-    this.value = value;
-    this.resourceKeyOrId = resourceKeyOrId;
-  }
-
-  public PropertyCreateQuery(Property property) {
-    this.key = property.getKey();
-    this.value = property.getValue();
-  }
-
-  public String getKey() {
-    return key;
-  }
-
-  public PropertyCreateQuery setKey(String key) {
-    this.key = key;
-    return this;
-  }
-
-  public String getValue() {
-    return value;
-  }
-
-  public PropertyCreateQuery setValue(String value) {
-    this.value = value;
-    return this;
-  }
-
-  public String getResourceKeyOrId() {
-    return resourceKeyOrId;
-  }
-
-  public PropertyCreateQuery setResourceKeyOrId(String resourceKeyOrId) {
-    this.resourceKeyOrId = resourceKeyOrId;
-    return this;
-  }
-
-  @Override
-  public String getUrl() {
-    StringBuilder url = new StringBuilder();
-    url.append(PropertyQuery.BASE_URL);
-    url.append("?id=").append(encode(key)).append("&");
-    appendUrlParameter(url, "value", value);
-    appendUrlParameter(url, "resource", resourceKeyOrId);
-    return url.toString();
-  }
-
-  /**
-   * Property value is transmitted through request body as content may
-   * exceed URL size allowed by the server.
-   */
-  @Override
-  public String getBody() {
-    return value;
-  }
-
-  @Override
-  public Class<Property> getModelClass() {
-    return Property.class;
-  }
-}
diff --git a/server/sonar-ws-client/src/main/java/org/sonar/wsclient/services/PropertyDeleteQuery.java b/server/sonar-ws-client/src/main/java/org/sonar/wsclient/services/PropertyDeleteQuery.java
deleted file mode 100644 (file)
index ce58cd7..0000000
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- * SonarQube, open source software quality management tool.
- * Copyright (C) 2008-2014 SonarSource
- * mailto:contact AT sonarsource DOT com
- *
- * SonarQube is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * SonarQube is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-package org.sonar.wsclient.services;
-
-/**
- * @since 2.6
- */
-public class PropertyDeleteQuery extends DeleteQuery {
-
-  private String key;
-  private String resourceKeyOrId;
-
-  public PropertyDeleteQuery(String key) {
-    this.key = key;
-  }
-
-  public PropertyDeleteQuery(String key, String resourceKeyOrId) {
-    this.key = key;
-    this.resourceKeyOrId = resourceKeyOrId;
-  }
-
-  public PropertyDeleteQuery(Property property) {
-    this.key = property.getKey();
-  }
-
-  public String getKey() {
-    return key;
-  }
-
-  public PropertyDeleteQuery setKey(String key) {
-    this.key = key;
-    return this;
-  }
-
-  public String getResourceKeyOrId() {
-    return resourceKeyOrId;
-  }
-
-  public PropertyDeleteQuery setResourceKeyOrId(String resourceKeyOrId) {
-    this.resourceKeyOrId = resourceKeyOrId;
-    return this;
-  }
-
-  @Override
-  public String getUrl() {
-    StringBuilder url = new StringBuilder();
-    url.append(PropertyQuery.BASE_URL);
-    url.append("/").append(encode(key));
-    url.append('?');
-    appendUrlParameter(url, "resource", resourceKeyOrId);
-    return url.toString();
-  }
-}
diff --git a/server/sonar-ws-client/src/main/java/org/sonar/wsclient/services/PropertyQuery.java b/server/sonar-ws-client/src/main/java/org/sonar/wsclient/services/PropertyQuery.java
deleted file mode 100644 (file)
index 3d8976b..0000000
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * SonarQube, open source software quality management tool.
- * Copyright (C) 2008-2014 SonarSource
- * mailto:contact AT sonarsource DOT com
- *
- * SonarQube is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * SonarQube is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-package org.sonar.wsclient.services;
-
-public class PropertyQuery extends Query<Property> {
-  public static final String BASE_URL = "/api/properties";
-
-  private String key = null;
-  private String resourceKeyOrId = null;
-
-  public String getKey() {
-    return key;
-  }
-
-  public PropertyQuery setKey(String key) {
-    this.key = key;
-    return this;
-  }
-
-  public String getResourceKeyOrId() {
-    return resourceKeyOrId;
-  }
-
-  public PropertyQuery setResourceKeyOrId(String resourceKeyOrId) {
-    this.resourceKeyOrId = resourceKeyOrId;
-    return this;
-  }
-
-  @Override
-  public String getUrl() {
-    StringBuilder url = new StringBuilder(BASE_URL);
-    if (key != null) {
-      url.append("/").append(encode(key));
-    }
-    url.append('?');
-    appendUrlParameter(url, "resource", resourceKeyOrId);
-    return url.toString();
-  }
-
-  @Override
-  public Class<Property> getModelClass() {
-    return Property.class;
-  }
-
-  public static PropertyQuery createForAll() {
-    return new PropertyQuery();
-  }
-
-  public static PropertyQuery createForKey(String key) {
-    return new PropertyQuery().setKey(key);
-  }
-
-  public static PropertyQuery createForResource(String key, String resourceKeyOrId) {
-    return new PropertyQuery().setKey(key).setResourceKeyOrId(resourceKeyOrId);
-  }
-}
diff --git a/server/sonar-ws-client/src/main/java/org/sonar/wsclient/services/PropertyUpdateQuery.java b/server/sonar-ws-client/src/main/java/org/sonar/wsclient/services/PropertyUpdateQuery.java
deleted file mode 100644 (file)
index 104e20e..0000000
+++ /dev/null
@@ -1,100 +0,0 @@
-/*
- * SonarQube, open source software quality management tool.
- * Copyright (C) 2008-2014 SonarSource
- * mailto:contact AT sonarsource DOT com
- *
- * SonarQube is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * SonarQube is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-package org.sonar.wsclient.services;
-
-/**
- * @since 2.6
- */
-public class PropertyUpdateQuery extends UpdateQuery<Property> {
-
-  private String key;
-  private String value;
-  private String resourceKeyOrId;
-
-  public PropertyUpdateQuery() {
-  }
-
-  public PropertyUpdateQuery(String key, String value) {
-    this.key = key;
-    this.value = value;
-  }
-
-  public PropertyUpdateQuery(String key, String value, String resourceKeyOrId) {
-    this.key = key;
-    this.value = value;
-    this.resourceKeyOrId = resourceKeyOrId;
-  }
-
-  public PropertyUpdateQuery(Property property) {
-    this.key = property.getKey();
-    this.value = property.getValue();
-  }
-
-  public String getKey() {
-    return key;
-  }
-
-  public PropertyUpdateQuery setKey(String key) {
-    this.key = key;
-    return this;
-  }
-
-  public String getValue() {
-    return value;
-  }
-
-  public PropertyUpdateQuery setValue(String value) {
-    this.value = value;
-    return this;
-  }
-
-  public String getResourceKeyOrId() {
-    return resourceKeyOrId;
-  }
-
-  public PropertyUpdateQuery setResourceKeyOrId(String resourceKeyOrId) {
-    this.resourceKeyOrId = resourceKeyOrId;
-    return this;
-  }
-
-  @Override
-  public String getUrl() {
-    StringBuilder url = new StringBuilder();
-    url.append(PropertyQuery.BASE_URL);
-    url.append("/").append(encode(key));
-    url.append('?');
-    appendUrlParameter(url, "resource", resourceKeyOrId);
-    return url.toString();
-  }
-
-  /**
-   * Property value is transmitted through request body as content may
-   * exceed URL size allowed by the server.
-   */
-  @Override
-  public String getBody() {
-    return value;
-  }
-
-  @Override
-  public Class<Property> getModelClass() {
-    return Property.class;
-  }
-}
diff --git a/server/sonar-ws-client/src/main/java/org/sonar/wsclient/services/Query.java b/server/sonar-ws-client/src/main/java/org/sonar/wsclient/services/Query.java
deleted file mode 100644 (file)
index 0af65a7..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * SonarQube, open source software quality management tool.
- * Copyright (C) 2008-2014 SonarSource
- * mailto:contact AT sonarsource DOT com
- *
- * SonarQube is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * SonarQube is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-package org.sonar.wsclient.services;
-
-/**
- * @since 2.1
- */
-public abstract class Query<M extends Model> extends AbstractQuery<M> {
-
-  public abstract Class<M> getModelClass();
-
-}
diff --git a/server/sonar-ws-client/src/main/java/org/sonar/wsclient/services/Resource.java b/server/sonar-ws-client/src/main/java/org/sonar/wsclient/services/Resource.java
deleted file mode 100644 (file)
index 19d2c3f..0000000
+++ /dev/null
@@ -1,500 +0,0 @@
-/*
- * SonarQube, open source software quality management tool.
- * Copyright (C) 2008-2014 SonarSource
- * mailto:contact AT sonarsource DOT com
- *
- * SonarQube is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * SonarQube is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-package org.sonar.wsclient.services;
-
-import javax.annotation.CheckForNull;
-import javax.annotation.Nullable;
-
-import java.util.Collections;
-import java.util.Date;
-import java.util.List;
-
-public class Resource extends Model {
-
-  /* SCOPES */
-  public static final String SCOPE_SET = "PRJ";
-  public static final String SCOPE_SPACE = "DIR";
-  public static final String SCOPE_ENTITY = "FIL";
-
-  /* QUALIFIERS */
-  public static final String QUALIFIER_VIEW = "VW";
-  public static final String QUALIFIER_SUBVIEW = "SVW";
-  public static final String QUALIFIER_LIB = "LIB";
-  public static final String QUALIFIER_PROJECT = "TRK";
-  public static final String QUALIFIER_MODULE = "BRC";
-  /**
-   * @deprecated since 4.2
-   */
-  @Deprecated
-  public static final String QUALIFIER_PACKAGE = "PAC";
-  public static final String QUALIFIER_DIRECTORY = "DIR";
-  public static final String QUALIFIER_FILE = "FIL";
-  /**
-   * @deprecated since 4.2
-   */
-  @Deprecated
-  public static final String QUALIFIER_CLASS = "CLA";
-  public static final String QUALIFIER_UNIT_TEST_CLASS = "UTS";
-
-  /* LANGUAGES */
-  public static final String LANGUAGE_JAVA = "java";
-
-  private Integer id;
-  private String key;
-  private String name;
-  private String longName;
-  private String scope;
-  private String qualifier;
-  private String language;
-  private String version;
-  private Integer copy;
-  private String description;
-  private Date date;
-  private List<Measure> measures;
-  private Date creationDate;
-
-  // periods used for variations and tracking of violations
-  private String period1Mode, period2Mode, period3Mode, period4Mode, period5Mode;
-  private String period1Param, period2Param, period3Param, period4Param, period5Param;
-  private Date period1Date, period2Date, period3Date, period4Date, period5Date;
-
-  @CheckForNull
-  public Integer getId() {
-    return id;
-  }
-
-  public Resource setId(@Nullable Integer id) {
-    this.id = id;
-    return this;
-  }
-
-  @CheckForNull
-  public String getKey() {
-    return key;
-  }
-
-  public Resource setKey(@Nullable String key) {
-    this.key = key;
-    return this;
-  }
-
-  @CheckForNull
-  public String getDescription() {
-    return description;
-  }
-
-  public Resource setDescription(@Nullable String description) {
-    this.description = description;
-    return this;
-  }
-
-  @CheckForNull
-  public String getName() {
-    return name;
-  }
-
-  @CheckForNull
-  public String getName(boolean longFormatIfDefined) {
-    if (longFormatIfDefined && longName != null && !"".equals(longName)) {
-      return longName;
-    }
-    return name;
-  }
-
-  @CheckForNull
-  public String getLongName() {
-    return longName;
-  }
-
-  public Resource setLongName(@Nullable String longName) {
-    this.longName = longName;
-    return this;
-  }
-
-  public Resource setName(@Nullable String s) {
-    this.name = s;
-    return this;
-  }
-
-  @CheckForNull
-  public String getScope() {
-    return scope;
-  }
-
-  public Resource setScope(@Nullable String scope) {
-    this.scope = scope;
-    return this;
-  }
-
-  @CheckForNull
-  public String getQualifier() {
-    return qualifier;
-  }
-
-  public Resource setQualifier(@Nullable String qualifier) {
-    this.qualifier = qualifier;
-    return this;
-  }
-
-  @CheckForNull
-  public String getLanguage() {
-    return language;
-  }
-
-  public Resource setLanguage(@Nullable String language) {
-    this.language = language;
-    return this;
-  }
-
-  @CheckForNull
-  public String getVersion() {
-    return version;
-  }
-
-  public Resource setVersion(@Nullable String version) {
-    this.version = version;
-    return this;
-  }
-
-  @CheckForNull
-  public Integer getCopy() {
-    return copy;
-  }
-
-  public Resource setCopy(@Nullable Integer copy) {
-    this.copy = copy;
-    return this;
-  }
-
-  @CheckForNull
-  public Date getDate() {
-    return date;
-  }
-
-  public Resource setDate(@Nullable Date d) {
-    this.date = d;
-    return this;
-  }
-
-  @CheckForNull
-  public Date getCreationDate() {
-    return creationDate;
-  }
-
-  public Resource setCreationDate(@Nullable Date d) {
-    this.creationDate = d;
-    return this;
-  }
-
-  public List<Measure> getMeasures() {
-    if (measures == null) {
-      return Collections.emptyList();
-    }
-    return measures;
-  }
-
-  public Measure getMeasure(String metricKey) {
-    for (Measure measure : getMeasures()) {
-      if (metricKey.equals(measure.getMetricKey())) {
-        return measure;
-      }
-    }
-    return null;
-  }
-
-  public Double getMeasureValue(String metricKey) {
-    Measure measure = getMeasure(metricKey);
-    if (measure != null) {
-      return measure.getValue();
-    }
-    return null;
-  }
-
-  public Integer getMeasureIntValue(String metricKey) {
-    Double d = getMeasureValue(metricKey);
-    if (d != null) {
-      return d.intValue();
-    }
-    return null;
-  }
-
-  public String getMeasureFormattedValue(String metricKey, String defaultValue) {
-    Measure measure = getMeasure(metricKey);
-    if (measure != null) {
-      return measure.getFormattedValue(defaultValue);
-    }
-    return defaultValue;
-  }
-
-  public void setMeasures(List<Measure> measures) {
-    this.measures = measures;
-  }
-
-  /**
-   * @since 2.5 only on projects, else null
-   */
-  @CheckForNull
-  public String getPeriod1Mode() {
-    return period1Mode;
-  }
-
-  /**
-   * @since 2.5
-   */
-  public Resource setPeriod1Mode(@Nullable String period1Mode) {
-    this.period1Mode = period1Mode;
-    return this;
-  }
-
-  /**
-   * @since 2.5 only on projects, else null
-   */
-  @CheckForNull
-  public String getPeriod2Mode() {
-    return period2Mode;
-  }
-
-  /**
-   * @since 2.5
-   */
-  public Resource setPeriod2Mode(@Nullable String period2Mode) {
-    this.period2Mode = period2Mode;
-    return this;
-  }
-
-  /**
-   * @since 2.5 only on projects, else null
-   */
-  @CheckForNull
-  public String getPeriod3Mode() {
-    return period3Mode;
-  }
-
-  /**
-   * @since 2.5
-   */
-  public Resource setPeriod3Mode(@Nullable String period3Mode) {
-    this.period3Mode = period3Mode;
-    return this;
-  }
-
-  /**
-   * @since 2.5 only on projects, else null
-   */
-  @CheckForNull
-  public String getPeriod4Mode() {
-    return period4Mode;
-  }
-
-  /**
-   * @since 2.5
-   */
-  public Resource setPeriod4Mode(@Nullable String period4Mode) {
-    this.period4Mode = period4Mode;
-    return this;
-  }
-
-  /**
-   * @since 2.5 only on projects, else null
-   */
-  @CheckForNull
-  public String getPeriod5Mode() {
-    return period5Mode;
-  }
-
-  /**
-   * @since 2.5
-   */
-  public Resource setPeriod5Mode(@Nullable String period5Mode) {
-    this.period5Mode = period5Mode;
-    return this;
-  }
-
-  /**
-   * @since 2.5 only on projects, else null
-   */
-  @CheckForNull
-  public String getPeriod1Param() {
-    return period1Param;
-  }
-
-  /**
-   * @since 2.5
-   */
-  public Resource setPeriod1Param(@Nullable String period1Param) {
-    this.period1Param = period1Param;
-    return this;
-  }
-
-  /**
-   * @since 2.5 only on projects, else null
-   */
-  @CheckForNull
-  public String getPeriod2Param() {
-    return period2Param;
-  }
-
-  /**
-   * @since 2.5
-   */
-  public Resource setPeriod2Param(@Nullable String period2Param) {
-    this.period2Param = period2Param;
-    return this;
-  }
-
-  /**
-   * @since 2.5 only on projects, else null
-   */
-  @CheckForNull
-  public String getPeriod3Param() {
-    return period3Param;
-  }
-
-  /**
-   * @since 2.5
-   */
-  public Resource setPeriod3Param(@Nullable String period3Param) {
-    this.period3Param = period3Param;
-    return this;
-  }
-
-  /**
-   * @since 2.5 only on projects, else null
-   */
-  @CheckForNull
-  public String getPeriod4Param() {
-    return period4Param;
-  }
-
-  /**
-   * @since 2.5
-   */
-  public Resource setPeriod4Param(@Nullable String period4Param) {
-    this.period4Param = period4Param;
-    return this;
-  }
-
-  /**
-   * @since 2.5 only on projects, else null
-   */
-  @CheckForNull
-  public String getPeriod5Param() {
-    return period5Param;
-  }
-
-  /**
-   * @since 2.5
-   */
-  public Resource setPeriod5Param(@Nullable String period5Param) {
-    this.period5Param = period5Param;
-    return this;
-  }
-
-  /**
-   * @since 2.5 only on projects, else null
-   */
-  @CheckForNull
-  public Date getPeriod1Date() {
-    return period1Date;
-  }
-
-  /**
-   * @since 2.5
-   */
-  public Resource setPeriod1Date(@Nullable Date period1Date) {
-    this.period1Date = period1Date;
-    return this;
-  }
-
-  /**
-   * @since 2.5 only on projects, else null
-   */
-  @CheckForNull
-  public Date getPeriod2Date() {
-    return period2Date;
-  }
-
-  /**
-   * @since 2.5
-   */
-  public Resource setPeriod2Date(@Nullable Date period2Date) {
-    this.period2Date = period2Date;
-    return this;
-  }
-
-  /**
-   * @since 2.5 only on projects, else null
-   */
-  @CheckForNull
-  public Date getPeriod3Date() {
-    return period3Date;
-  }
-
-  /**
-   * @since 2.5
-   */
-  public Resource setPeriod3Date(@Nullable Date period3Date) {
-    this.period3Date = period3Date;
-    return this;
-  }
-
-  /**
-   * @since 2.5 only on projects, else null
-   */
-  @CheckForNull
-  public Date getPeriod4Date() {
-    return period4Date;
-  }
-
-  /**
-   * @since 2.5
-   */
-  public Resource setPeriod4Date(@Nullable Date period4Date) {
-    this.period4Date = period4Date;
-    return this;
-  }
-
-  /**
-   * @since 2.5 only on projects, else null
-   */
-  @CheckForNull
-  public Date getPeriod5Date() {
-    return period5Date;
-  }
-
-  /**
-   * @since 2.5
-   */
-  public Resource setPeriod5Date(@Nullable Date period5Date) {
-    this.period5Date = period5Date;
-    return this;
-  }
-
-  @Override
-  public String toString() {
-    return new StringBuilder()
-      .append("[id=")
-      .append(id)
-      .append(",key=")
-      .append(key)
-      .append("]")
-      .toString();
-  }
-}
diff --git a/server/sonar-ws-client/src/main/java/org/sonar/wsclient/services/ResourceQuery.java b/server/sonar-ws-client/src/main/java/org/sonar/wsclient/services/ResourceQuery.java
deleted file mode 100644 (file)
index 2d06ec9..0000000
+++ /dev/null
@@ -1,317 +0,0 @@
-/*
- * SonarQube, open source software quality management tool.
- * Copyright (C) 2008-2014 SonarSource
- * mailto:contact AT sonarsource DOT com
- *
- * SonarQube is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * SonarQube is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-package org.sonar.wsclient.services;
-
-public class ResourceQuery extends Query<Resource> {
-
-  public static final String BASE_URL = "/api/resources";
-
-  public static final int DEPTH_UNLIMITED = -1;
-
-  private Integer depth;
-  private String resourceKeyOrId;
-  private Integer limit;
-  private String[] scopes;
-  private String[] qualifiers;
-  private String[] metrics;
-  private String[] rules;
-  private String[] ruleSeverities;
-  private String[] characteristicKeys;
-  private boolean excludeRules = true;
-  private boolean excludeRuleSeverities = true;
-  private Boolean includeTrends = null;
-  private Boolean includeAlerts = null;
-  private Boolean verbose = Boolean.FALSE;
-
-  public ResourceQuery() {
-  }
-
-  public ResourceQuery(String resourceKeyOrId) {
-    this.resourceKeyOrId = resourceKeyOrId;
-  }
-
-  public ResourceQuery(long resourceId) {
-    this.resourceKeyOrId = String.valueOf(resourceId);
-  }
-
-  public Integer getDepth() {
-    return depth;
-  }
-
-  public ResourceQuery setDepth(Integer depth) {
-    this.depth = depth;
-    return this;
-  }
-
-  public ResourceQuery setAllDepths() {
-    return setDepth(DEPTH_UNLIMITED);
-  }
-
-  public String getResourceKeyOrId() {
-    return resourceKeyOrId;
-  }
-
-  public ResourceQuery setResourceKeyOrId(String resourceKeyOrId) {
-    this.resourceKeyOrId = resourceKeyOrId;
-    return this;
-  }
-
-  public ResourceQuery setResourceId(int resourceId) {
-    this.resourceKeyOrId = Integer.toString(resourceId);
-    return this;
-  }
-
-  public ResourceQuery setCharacteristics(String... keys) {
-    this.characteristicKeys = keys;
-    return this;
-  }
-
-  public Integer getLimit() {
-    return limit;
-  }
-
-  public ResourceQuery setLimit(Integer limit) {
-    this.limit = limit;
-    return this;
-  }
-
-  public String[] getScopes() {
-    return scopes;
-  }
-
-  public ResourceQuery setScopes(String... scopes) {
-    this.scopes = scopes;
-    return this;
-  }
-
-  public String[] getQualifiers() {
-    return qualifiers;
-  }
-
-  public ResourceQuery setQualifiers(String... qualifiers) {
-    this.qualifiers = qualifiers;
-    return this;
-  }
-
-  public String[] getMetrics() {
-    return metrics;
-  }
-
-  public ResourceQuery setMetrics(String... metrics) {
-    this.metrics = metrics;
-    return this;
-  }
-
-  public String[] getRules() {
-    return rules;
-  }
-
-  public ResourceQuery setRules(String... rules) {
-    this.rules = rules;
-    this.excludeRules = false;
-    return this;
-  }
-
-  /**
-   * @deprecated since 2.5 See http://jira.codehaus.org/browse/SONAR-2007
-   */
-  @Deprecated
-  public String[] getRuleCategories() {
-    return null;
-  }
-
-  /**
-   * @param ruleCategories values: Maintainability, Usability, Reliability, Efficiency, Portability
-   * @deprecated since 2.5 See http://jira.codehaus.org/browse/SONAR-2007
-   */
-  @Deprecated
-  public ResourceQuery setRuleCategories(String... ruleCategories) {
-    return this;
-  }
-
-  /**
-   * @since 2.5
-   */
-  public String[] getRuleSeverities() {
-    return ruleSeverities;
-  }
-
-  /**
-   * @since 2.5
-   * @param ruleSeverities values: BLOCKER, CRITICAL, MAJOR, MINOR, INFO
-   */
-  public ResourceQuery setRuleSeverities(String... ruleSeverities) {
-    this.ruleSeverities = ruleSeverities;
-    this.excludeRuleSeverities = false;
-    return this;
-  }
-
-  /**
-   * @deprecated since 2.5 use {@link #getRuleSeverities()} instead. See http://jira.codehaus.org/browse/SONAR-1829
-   */
-  @Deprecated
-  public String[] getRulePriorities() {
-    return ruleSeverities;
-  }
-
-  /**
-   * @deprecated since 2.5 use {@link #setRuleSeverities(String...)} instead. See http://jira.codehaus.org/browse/SONAR-1829
-   */
-  @Deprecated
-  public ResourceQuery setRulePriorities(String... rulePriorities) {
-    return setRuleSeverities(rulePriorities);
-  }
-
-  public boolean isExcludeRules() {
-    return excludeRules;
-  }
-
-  public ResourceQuery setExcludeRules(boolean excludeRules) {
-    this.excludeRules = excludeRules;
-    return this;
-  }
-
-  /**
-   * @deprecated since 2.5 not used anymore
-   */
-  @Deprecated
-  public boolean isExcludeRuleCategories() {
-    return false;
-  }
-
-  /**
-   * @deprecated since 2.5 not used anymore
-   */
-  @Deprecated
-  public ResourceQuery setExcludeRuleCategories(boolean b) {
-    return this;
-  }
-
-  /**
-   * @since 2.5
-   */
-  public boolean isExcludeRuleSeverities() {
-    return excludeRuleSeverities;
-  }
-
-  public ResourceQuery setExcludeRuleSeverities(boolean excludeRuleSeverities) {
-    this.excludeRuleSeverities = excludeRuleSeverities;
-    return this;
-  }
-
-  /**
-   * @deprecated since 2.5 use {@link #isExcludeRuleSeverities()} instead. See http://jira.codehaus.org/browse/SONAR-1829
-   */
-  @Deprecated
-  public boolean isExcludeRulePriorities() {
-    return excludeRuleSeverities;
-  }
-
-  /**
-   * @deprecated since 2.5 use {@link #setExcludeRuleSeverities(boolean)} instead. See http://jira.codehaus.org/browse/SONAR-1829
-   */
-  @Deprecated
-  public ResourceQuery setExcludeRulePriorities(boolean b) {
-    this.excludeRuleSeverities = b;
-    return this;
-  }
-
-  public Boolean isVerbose() {
-    return verbose;
-  }
-
-  public ResourceQuery setVerbose(Boolean verbose) {
-    this.verbose = verbose;
-    return this;
-  }
-
-  public Boolean isIncludeTrends() {
-    return includeTrends;
-  }
-
-  public ResourceQuery setIncludeTrends(Boolean includeTrends) {
-    this.includeTrends = includeTrends;
-    return this;
-  }
-
-  public Boolean isIncludeAlerts() {
-    return includeAlerts;
-  }
-
-  public ResourceQuery setIncludeAlerts(Boolean includeAlerts) {
-    this.includeAlerts = includeAlerts;
-    return this;
-  }
-
-  @Override
-  public String getUrl() {
-    StringBuilder url = new StringBuilder(BASE_URL);
-    url.append('?');
-    appendUrlParameter(url, "resource", resourceKeyOrId);
-    appendUrlParameter(url, "metrics", metrics);
-    appendUrlParameter(url, "scopes", scopes);
-    appendUrlParameter(url, "qualifiers", qualifiers);
-    appendUrlParameter(url, "depth", depth);
-    appendUrlParameter(url, "limit", limit);
-    appendRuleField(url, "rules", excludeRules, rules);
-    appendRuleField(url, "rule_priorities", excludeRuleSeverities, ruleSeverities);
-    appendUrlParameter(url, "includetrends", includeTrends);
-    appendUrlParameter(url, "characteristics", characteristicKeys);
-    appendUrlParameter(url, "includealerts", includeAlerts);
-    appendUrlParameter(url, "verbose", verbose);
-    return url.toString();
-  }
-
-  private void appendRuleField(StringBuilder url, String field, boolean excludeField, String[] list) {
-    if (!excludeField) {
-      if (list == null || list.length == 0) {
-        appendUrlParameter(url, field, true);
-      } else {
-        appendUrlParameter(url, field, list);
-      }
-    }
-  }
-
-  @Override
-  public final Class<Resource> getModelClass() {
-    return Resource.class;
-  }
-
-  public static ResourceQuery createForMetrics(String resourceKeyOrId, String... metricKeys) {
-    return new ResourceQuery(resourceKeyOrId)
-        .setMetrics(metricKeys);
-  }
-
-  public static ResourceQuery createForResource(Resource resource, String... metricKeys) {
-    Integer id = resource.getId();
-    if (id == null) {
-      throw new IllegalArgumentException("id must be set");
-    }
-    return new ResourceQuery(id.toString())
-        .setMetrics(metricKeys);
-  }
-
-  /**
-   * @since 2.10
-   */
-  public static ResourceQuery create(String resourceKey) {
-    return new ResourceQuery(resourceKey);
-  }
-}
diff --git a/server/sonar-ws-client/src/main/java/org/sonar/wsclient/services/ResourceSearchQuery.java b/server/sonar-ws-client/src/main/java/org/sonar/wsclient/services/ResourceSearchQuery.java
deleted file mode 100644 (file)
index 64d5d39..0000000
+++ /dev/null
@@ -1,94 +0,0 @@
-/*
- * SonarQube, open source software quality management tool.
- * Copyright (C) 2008-2014 SonarSource
- * mailto:contact AT sonarsource DOT com
- *
- * SonarQube is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * SonarQube is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-package org.sonar.wsclient.services;
-
-/**
- * @since 3.4
- */
-public class ResourceSearchQuery extends Query<ResourceSearchResult> {
-
-  private int page = -1;
-  private int pageSize = -1;
-  private String[] qualifiers = null;
-  private String text;
-
-  private ResourceSearchQuery() {
-  }
-
-  public static ResourceSearchQuery create(String text) {
-    return new ResourceSearchQuery().setText(text);
-  }
-
-  public int getPage() {
-    return page;
-  }
-
-  public ResourceSearchQuery setPage(int page) {
-    this.page = page;
-    return this;
-  }
-
-  public int getPageSize() {
-    return pageSize;
-  }
-
-  public ResourceSearchQuery setPageSize(int pageSize) {
-    this.pageSize = pageSize;
-    return this;
-  }
-
-  public String[] getQualifiers() {
-    return qualifiers;
-  }
-
-  public ResourceSearchQuery setQualifiers(String... qualifiers) {
-    this.qualifiers = qualifiers;
-    return this;
-  }
-
-  public String getText() {
-    return text;
-  }
-
-  public ResourceSearchQuery setText(String text) {
-    this.text = text;
-    return this;
-  }
-
-  @Override
-  public String getUrl() {
-    StringBuilder url = new StringBuilder();
-    url.append("/api/resources/search?");
-    appendUrlParameter(url, "s", text);
-    if (page > 0) {
-      appendUrlParameter(url, "p", page);
-    }
-    if (pageSize > 0) {
-      appendUrlParameter(url, "ps", pageSize);
-    }
-    appendUrlParameter(url, "q", qualifiers);
-    return url.toString();
-  }
-
-  @Override
-  public Class<ResourceSearchResult> getModelClass() {
-    return ResourceSearchResult.class;
-  }
-}
diff --git a/server/sonar-ws-client/src/main/java/org/sonar/wsclient/services/ResourceSearchResult.java b/server/sonar-ws-client/src/main/java/org/sonar/wsclient/services/ResourceSearchResult.java
deleted file mode 100644 (file)
index e4bbce5..0000000
+++ /dev/null
@@ -1,98 +0,0 @@
-/*
- * SonarQube, open source software quality management tool.
- * Copyright (C) 2008-2014 SonarSource
- * mailto:contact AT sonarsource DOT com
- *
- * SonarQube is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * SonarQube is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-package org.sonar.wsclient.services;
-
-import javax.annotation.CheckForNull;
-import javax.annotation.Nullable;
-
-import java.util.List;
-
-public class ResourceSearchResult extends Model {
-
-  public static class Resource {
-    private String key, name, qualifier;
-
-    @CheckForNull
-    public String key() {
-      return key;
-    }
-
-    @CheckForNull
-    public String name() {
-      return name;
-    }
-
-    @CheckForNull
-    public String qualifier() {
-      return qualifier;
-    }
-
-    public void setKey(@Nullable String key) {
-      this.key = key;
-    }
-
-    public void setName(@Nullable String s) {
-      this.name = s;
-    }
-
-    public void setQualifier(@Nullable String qualifier) {
-      this.qualifier = qualifier;
-    }
-  }
-
-
-  private Integer page, pageSize, total;
-  private List<ResourceSearchResult.Resource> resources;
-
-  @CheckForNull
-  public Integer getPage() {
-    return page;
-  }
-
-  @CheckForNull
-  public Integer getTotal() {
-    return total;
-  }
-
-  public List<ResourceSearchResult.Resource> getResources() {
-    return resources;
-  }
-
-  public void setPage(@Nullable Integer page) {
-    this.page = page;
-  }
-
-  public void setTotal(@Nullable Integer total) {
-    this.total = total;
-  }
-
-  @CheckForNull
-  public Integer getPageSize() {
-    return pageSize;
-  }
-
-  public void setPageSize(@Nullable Integer pageSize) {
-    this.pageSize = pageSize;
-  }
-
-  public void setResources(List<Resource> resources) {
-    this.resources = resources;
-  }
-}
diff --git a/server/sonar-ws-client/src/main/java/org/sonar/wsclient/services/Server.java b/server/sonar-ws-client/src/main/java/org/sonar/wsclient/services/Server.java
deleted file mode 100644 (file)
index 3748ab1..0000000
+++ /dev/null
@@ -1,86 +0,0 @@
-/*
- * SonarQube, open source software quality management tool.
- * Copyright (C) 2008-2014 SonarSource
- * mailto:contact AT sonarsource DOT com
- *
- * SonarQube is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * SonarQube is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-package org.sonar.wsclient.services;
-
-import javax.annotation.CheckForNull;
-import javax.annotation.Nullable;
-
-/**
- * @author Evgeny Mandrikov
- */
-public class Server extends Model {
-
-  public enum Status {
-    SETUP,
-    UP,
-    DOWN,
-
-    /**
-     * @since 3.3
-     */
-    MIGRATION_RUNNING
-  }
-
-  private String id;
-  private String version;
-  private Status status;
-  private String statusMessage;
-
-  @CheckForNull
-  public String getVersion() {
-    return version;
-  }
-
-  @CheckForNull
-  public String getId() {
-    return id;
-  }
-
-  public Server setVersion(@Nullable String s) {
-    this.version = s;
-    return this;
-  }
-
-  public Server setId(@Nullable String id) {
-    this.id = id;
-    return this;
-  }
-
-  @CheckForNull
-  public Status getStatus() {
-    return status;
-  }
-
-  @CheckForNull
-  public String getStatusMessage() {
-    return statusMessage;
-  }
-
-  public Server setStatus(Status status) {
-    this.status = status;
-    return this;
-  }
-
-  public Server setStatusMessage(@Nullable String statusMessage) {
-    this.statusMessage = statusMessage;
-    return this;
-  }
-
-}
diff --git a/server/sonar-ws-client/src/main/java/org/sonar/wsclient/services/ServerQuery.java b/server/sonar-ws-client/src/main/java/org/sonar/wsclient/services/ServerQuery.java
deleted file mode 100644 (file)
index b3a3f8d..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * SonarQube, open source software quality management tool.
- * Copyright (C) 2008-2014 SonarSource
- * mailto:contact AT sonarsource DOT com
- *
- * SonarQube is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * SonarQube is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-package org.sonar.wsclient.services;
-
-/**
- * @author Evgeny Mandrikov
- */
-public class ServerQuery extends Query<Server> {
-  public static final String BASE_URL = "/api/server/index";
-
-  @Override
-  public String getUrl() {
-    return BASE_URL;
-  }
-
-  @Override
-  public Class<Server> getModelClass() {
-    return Server.class;
-  }
-}
diff --git a/server/sonar-ws-client/src/main/java/org/sonar/wsclient/services/ServerSetup.java b/server/sonar-ws-client/src/main/java/org/sonar/wsclient/services/ServerSetup.java
deleted file mode 100644 (file)
index dfddf40..0000000
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * SonarQube, open source software quality management tool.
- * Copyright (C) 2008-2014 SonarSource
- * mailto:contact AT sonarsource DOT com
- *
- * SonarQube is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * SonarQube is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-package org.sonar.wsclient.services;
-
-import javax.annotation.CheckForNull;
-import javax.annotation.Nullable;
-
-/**
- * @since 2.9
- */
-public class ServerSetup extends Model {
-  private String status;
-  private String message;
-
-  @CheckForNull
-  public String getStatus() {
-    return status;
-  }
-
-  public ServerSetup setStatus(@Nullable String status) {
-    this.status = status;
-    return this;
-  }
-
-  @CheckForNull
-  public String getMessage() {
-    return message;
-  }
-
-  public ServerSetup setMessage(@Nullable String message) {
-    this.message = message;
-    return this;
-  }
-
-  public boolean isSuccessful() {
-    return "ok".equals(status);
-  }
-}
diff --git a/server/sonar-ws-client/src/main/java/org/sonar/wsclient/services/ServerSetupQuery.java b/server/sonar-ws-client/src/main/java/org/sonar/wsclient/services/ServerSetupQuery.java
deleted file mode 100644 (file)
index db64178..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * SonarQube, open source software quality management tool.
- * Copyright (C) 2008-2014 SonarSource
- * mailto:contact AT sonarsource DOT com
- *
- * SonarQube is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * SonarQube is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-package org.sonar.wsclient.services;
-
-/**
- * @since 2.9
- */
-public class ServerSetupQuery extends CreateQuery<ServerSetup> {
-  public static final String BASE_URL = "/api/server/setup";
-
-  @Override
-  public String getUrl() {
-    return BASE_URL;
-  }
-
-  @Override
-  public Class<ServerSetup> getModelClass() {
-    return ServerSetup.class;
-  }
-}
diff --git a/server/sonar-ws-client/src/main/java/org/sonar/wsclient/services/Source.java b/server/sonar-ws-client/src/main/java/org/sonar/wsclient/services/Source.java
deleted file mode 100644 (file)
index e27a687..0000000
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * SonarQube, open source software quality management tool.
- * Copyright (C) 2008-2014 SonarSource
- * mailto:contact AT sonarsource DOT com
- *
- * SonarQube is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * SonarQube is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-package org.sonar.wsclient.services;
-
-import javax.annotation.CheckForNull;
-import javax.annotation.Nullable;
-
-import java.util.Collection;
-import java.util.SortedMap;
-import java.util.TreeMap;
-
-public class Source extends Model {
-
-  private SortedMap<Integer, String> lines = new TreeMap<>();
-
-  public Collection<String> getLines() {
-    return lines.values();
-  }
-
-  public SortedMap<Integer, String> getLinesById() {
-    return lines;
-  }
-
-  @CheckForNull
-  public String getLine(int index) {
-    return lines.get(index);
-  }
-
-  public int size() {
-    return lines.size();
-  }
-
-  public Source addLine(int index, @Nullable String line) {
-    lines.put(index, line);
-    return this;
-  }
-
-}
diff --git a/server/sonar-ws-client/src/main/java/org/sonar/wsclient/services/SourceQuery.java b/server/sonar-ws-client/src/main/java/org/sonar/wsclient/services/SourceQuery.java
deleted file mode 100644 (file)
index 8cdab7c..0000000
+++ /dev/null
@@ -1,87 +0,0 @@
-/*
- * SonarQube, open source software quality management tool.
- * Copyright (C) 2008-2014 SonarSource
- * mailto:contact AT sonarsource DOT com
- *
- * SonarQube is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * SonarQube is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-package org.sonar.wsclient.services;
-
-public class SourceQuery extends Query<Source> {
-  public static final String BASE_URL = "/api/sources";
-
-  private String resourceKeyOrId;
-  private int from = 0;
-  private int to = 0;
-
-  public SourceQuery(String resourceKeyOrId) {
-    this.resourceKeyOrId = resourceKeyOrId;
-  }
-
-  public String getResourceKeyOrId() {
-    return resourceKeyOrId;
-  }
-
-  public SourceQuery setResourceKeyOrId(String resourceKeyOrId) {
-    this.resourceKeyOrId = resourceKeyOrId;
-    return this;
-  }
-
-  public int getFrom() {
-    return from;
-  }
-
-  /**
-   * Get only a few lines
-   * 
-   * @param from Index of the first line, starts to 1
-   * @param excludedTo Index of the last line (excluded).
-   */
-  public SourceQuery setFromLineToLine(int from, int excludedTo) {
-    this.from = from;
-    this.to = excludedTo;
-    return this;
-  }
-
-  public SourceQuery setLinesFromLine(int from, int length) {
-    this.from = from;
-    this.to = from + length;
-    return this;
-  }
-
-  public int getTo() {
-    return to;
-  }
-
-  @Override
-  public String getUrl() {
-    StringBuilder url = new StringBuilder(BASE_URL);
-    url.append('?');
-    appendUrlParameter(url, "resource", resourceKeyOrId);
-    if (from > 0 && to > 0) {
-      url.append("from=").append(from).append("&to=").append(to).append("&");
-    }
-    return url.toString();
-  }
-
-  @Override
-  public Class<Source> getModelClass() {
-    return Source.class;
-  }
-
-  public static SourceQuery create(String resourceKeyOrId) {
-    return new SourceQuery(resourceKeyOrId);
-  }
-}
diff --git a/server/sonar-ws-client/src/main/java/org/sonar/wsclient/services/TimeMachine.java b/server/sonar-ws-client/src/main/java/org/sonar/wsclient/services/TimeMachine.java
deleted file mode 100644 (file)
index ab90b1d..0000000
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * SonarQube, open source software quality management tool.
- * Copyright (C) 2008-2014 SonarSource
- * mailto:contact AT sonarsource DOT com
- *
- * SonarQube is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * SonarQube is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-package org.sonar.wsclient.services;
-
-/**
- * Past values of a given resource
- *
- * @since 2.5
- */
-public class TimeMachine extends Model {
-
-  private TimeMachineColumn[] columns;
-  private TimeMachineCell[] cells;
-
-  public TimeMachine(TimeMachineColumn[] columns, TimeMachineCell[] cells) {
-    this.columns = columns;
-    this.cells = cells;
-  }
-
-  public TimeMachineColumn[] getColumns() {
-    return columns;
-  }
-
-  public TimeMachineCell[] getCells() {
-    return cells;
-  }
-
-  public TimeMachineColumn getColumn(String metricKey) {
-    for (TimeMachineColumn column : columns) {
-      if (metricKey.equals(column.getMetricKey()) && column.getCharacteristicKey()==null) {
-        return column;
-      }
-    }
-    return null;
-  }
-
-  public int getColumnIndex(String metricKey) {
-    TimeMachineColumn col = getColumn(metricKey);
-    return col!=null ? col.getIndex() : -1;
-  }
-}
diff --git a/server/sonar-ws-client/src/main/java/org/sonar/wsclient/services/TimeMachineCell.java b/server/sonar-ws-client/src/main/java/org/sonar/wsclient/services/TimeMachineCell.java
deleted file mode 100644 (file)
index 04a2193..0000000
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * SonarQube, open source software quality management tool.
- * Copyright (C) 2008-2014 SonarSource
- * mailto:contact AT sonarsource DOT com
- *
- * SonarQube is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * SonarQube is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-package org.sonar.wsclient.services;
-
-import javax.annotation.CheckForNull;
-import javax.annotation.Nullable;
-
-import java.util.Date;
-
-/**
- * @since 2.5
- */
-public class TimeMachineCell {
-
-  private Date date;
-  public Object[] values;
-
-  public TimeMachineCell(@Nullable Date date, Object[] values) {
-    this.date = date;
-    this.values = values;
-  }
-
-  @CheckForNull
-  public Date getDate() {
-    return date;
-  }
-
-  public Object[] getValues() {
-    return values;
-  }
-}
diff --git a/server/sonar-ws-client/src/main/java/org/sonar/wsclient/services/TimeMachineColumn.java b/server/sonar-ws-client/src/main/java/org/sonar/wsclient/services/TimeMachineColumn.java
deleted file mode 100644 (file)
index 9a7ce4e..0000000
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- * SonarQube, open source software quality management tool.
- * Copyright (C) 2008-2014 SonarSource
- * mailto:contact AT sonarsource DOT com
- *
- * SonarQube is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * SonarQube is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-package org.sonar.wsclient.services;
-
-import javax.annotation.CheckForNull;
-import javax.annotation.Nullable;
-
-/**
- * @since 2.5
- */
-public class TimeMachineColumn {
-
-  private int index;
-  private String metricKey;
-  private String modelName;
-  private String characteristicKey;
-
-  public TimeMachineColumn(int index, @Nullable String metricKey, @Nullable String modelName, @Nullable String characteristicKey) {
-    this.index = index;
-    this.metricKey = metricKey;
-    this.modelName = modelName;
-    this.characteristicKey = characteristicKey;
-  }
-
-  @CheckForNull
-  public String getMetricKey() {
-    return metricKey;
-  }
-
-  @CheckForNull
-  public String getModelName() {
-    return modelName;
-  }
-
-  @CheckForNull
-  public String getCharacteristicKey() {
-    return characteristicKey;
-  }
-
-  public int getIndex() {
-    return index;
-  }
-}
diff --git a/server/sonar-ws-client/src/main/java/org/sonar/wsclient/services/TimeMachineQuery.java b/server/sonar-ws-client/src/main/java/org/sonar/wsclient/services/TimeMachineQuery.java
deleted file mode 100644 (file)
index c0bfe1d..0000000
+++ /dev/null
@@ -1,106 +0,0 @@
-/*
- * SonarQube, open source software quality management tool.
- * Copyright (C) 2008-2014 SonarSource
- * mailto:contact AT sonarsource DOT com
- *
- * SonarQube is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * SonarQube is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-package org.sonar.wsclient.services;
-
-import java.util.Date;
-
-/**
- * @since 2.5
- */
-public class TimeMachineQuery extends Query<TimeMachine> {
-
-  public static final String BASE_URL = "/api/timemachine";
-
-  private String resourceKeyOrId;
-  private String[] metrics;
-  private Date from;
-  private Date to;
-
-  private String model;
-  private String[] characteristicKeys;
-
-  public TimeMachineQuery(String resourceKeyOrId) {
-    this.resourceKeyOrId = resourceKeyOrId;
-  }
-
-  public String[] getMetrics() {
-    return metrics;
-  }
-
-  public TimeMachineQuery setMetrics(String... metrics) {
-    this.metrics = metrics;
-    return this;
-  }
-
-  public Date getFrom() {
-    return from;
-  }
-
-  public TimeMachineQuery setFrom(Date from) {
-    this.from = from;
-    return this;
-  }
-
-  public Date getTo() {
-    return to;
-  }
-
-  public TimeMachineQuery setTo(Date to) {
-    this.to = to;
-    return this;
-  }
-
-  public TimeMachineQuery setCharacteristicKeys(String model, String... keys) {
-    this.model = model;
-    this.characteristicKeys = keys;
-    return this;
-  }
-
-  @Override
-  public String getUrl() {
-    StringBuilder url = new StringBuilder(BASE_URL);
-    url.append('?');
-    appendUrlParameter(url, "resource", resourceKeyOrId);
-    appendUrlParameter(url, "metrics", metrics);
-    appendUrlParameter(url, "fromDateTime", from, true);
-    appendUrlParameter(url, "toDateTime", to, true);
-    appendUrlParameter(url, "model", model);
-    appendUrlParameter(url, "characteristics", characteristicKeys);
-    return url.toString();
-  }
-
-  @Override
-  public Class<TimeMachine> getModelClass() {
-    return TimeMachine.class;
-  }
-
-  public static TimeMachineQuery createForMetrics(String resourceKeyOrId, String... metricKeys) {
-    return new TimeMachineQuery(resourceKeyOrId).setMetrics(metricKeys);
-  }
-
-  public static TimeMachineQuery createForMetrics(Resource resource, String... metricKeys) {
-    Integer id = resource.getId();
-    if (id == null) {
-      throw new IllegalArgumentException("id must be set");
-    }
-    return new TimeMachineQuery(id.toString()).setMetrics(metricKeys);
-  }
-
-}
diff --git a/server/sonar-ws-client/src/main/java/org/sonar/wsclient/services/UpdateCenterQuery.java b/server/sonar-ws-client/src/main/java/org/sonar/wsclient/services/UpdateCenterQuery.java
deleted file mode 100644 (file)
index b4ec302..0000000
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * SonarQube, open source software quality management tool.
- * Copyright (C) 2008-2014 SonarSource
- * mailto:contact AT sonarsource DOT com
- *
- * SonarQube is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * SonarQube is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-package org.sonar.wsclient.services;
-
-/**
- * @since 2.4
- */
-public final class UpdateCenterQuery extends Query<Plugin> {
-
-  public static final String BASE_URL = "/api/updatecenter/";
-  private String action;
-
-  private UpdateCenterQuery(String action) {
-    this.action = action;
-  }
-
-  @Override
-  public Class<Plugin> getModelClass() {
-    return Plugin.class;
-  }
-
-  @Override
-  public String getUrl() {
-    return BASE_URL + action;
-  }
-
-  public static UpdateCenterQuery createForInstalledPlugins() {
-    return new UpdateCenterQuery("installed_plugins");
-  }
-
-}
diff --git a/server/sonar-ws-client/src/main/java/org/sonar/wsclient/services/UpdateQuery.java b/server/sonar-ws-client/src/main/java/org/sonar/wsclient/services/UpdateQuery.java
deleted file mode 100644 (file)
index 49aa372..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * SonarQube, open source software quality management tool.
- * Copyright (C) 2008-2014 SonarSource
- * mailto:contact AT sonarsource DOT com
- *
- * SonarQube is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * SonarQube is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-package org.sonar.wsclient.services;
-
-/**
- * PUT HTTP request
- *
- * @since 2.6
- */
-public abstract class UpdateQuery<M extends Model> extends AbstractQuery<M> {
-
-  public abstract Class<M> getModelClass();
-
-}
diff --git a/server/sonar-ws-client/src/main/java/org/sonar/wsclient/services/UserPropertyCreateQuery.java b/server/sonar-ws-client/src/main/java/org/sonar/wsclient/services/UserPropertyCreateQuery.java
deleted file mode 100644 (file)
index c5310d7..0000000
+++ /dev/null
@@ -1,75 +0,0 @@
-/*
- * SonarQube, open source software quality management tool.
- * Copyright (C) 2008-2014 SonarSource
- * mailto:contact AT sonarsource DOT com
- *
- * SonarQube is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * SonarQube is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-package org.sonar.wsclient.services;
-
-/**
- * @since 2.2
- */
-public class UserPropertyCreateQuery extends CreateQuery<Property> {
-
-  private String key;
-  private String value;
-
-  public UserPropertyCreateQuery() {
-  }
-
-  public UserPropertyCreateQuery(String key, String value) {
-    this.key = key;
-    this.value = value;
-  }
-
-  public UserPropertyCreateQuery(Property property) {
-    this.key = property.getKey();
-    this.value = property.getValue();
-  }
-
-  public String getKey() {
-    return key;
-  }
-
-  public UserPropertyCreateQuery setKey(String key) {
-    this.key = key;
-    return this;
-  }
-
-  public String getValue() {
-    return value;
-  }
-
-  public UserPropertyCreateQuery setValue(String value) {
-    this.value = value;
-    return this;
-  }
-
-  @Override
-  public String getUrl() {
-    StringBuilder sb = new StringBuilder();
-    sb.append(UserPropertyQuery.BASE_URL);
-    sb.append('?');
-    appendUrlParameter(sb, "key", key);
-    appendUrlParameter(sb, "value", value);
-    return sb.toString();
-  }
-
-  @Override
-  public Class<Property> getModelClass() {
-    return Property.class;
-  }
-}
diff --git a/server/sonar-ws-client/src/main/java/org/sonar/wsclient/services/UserPropertyDeleteQuery.java b/server/sonar-ws-client/src/main/java/org/sonar/wsclient/services/UserPropertyDeleteQuery.java
deleted file mode 100644 (file)
index b37b468..0000000
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * SonarQube, open source software quality management tool.
- * Copyright (C) 2008-2014 SonarSource
- * mailto:contact AT sonarsource DOT com
- *
- * SonarQube is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * SonarQube is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-package org.sonar.wsclient.services;
-
-/**
- * @since 2.2
- */
-public class UserPropertyDeleteQuery extends DeleteQuery {
-
-  private String key;
-
-  public UserPropertyDeleteQuery(String key) {
-    this.key = key;
-  }
-
-  public UserPropertyDeleteQuery(Property property) {
-    this.key = property.getKey();
-  }
-
-  public String getKey() {
-    return key;
-  }
-
-  public UserPropertyDeleteQuery setKey(String key) {
-    this.key = key;
-    return this;
-  }
-
-  @Override
-  public String getUrl() {
-    return new StringBuilder().append(UserPropertyQuery.BASE_URL).append('/').append(encode(key)).toString();
-  }
-}
diff --git a/server/sonar-ws-client/src/main/java/org/sonar/wsclient/services/UserPropertyQuery.java b/server/sonar-ws-client/src/main/java/org/sonar/wsclient/services/UserPropertyQuery.java
deleted file mode 100644 (file)
index 67d1fd3..0000000
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
- * SonarQube, open source software quality management tool.
- * Copyright (C) 2008-2014 SonarSource
- * mailto:contact AT sonarsource DOT com
- *
- * SonarQube is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * SonarQube is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-package org.sonar.wsclient.services;
-
-/**
- * Get properties of the authenticated user.
- * 
- * @since 2.2
- */
-public class UserPropertyQuery extends Query<Property> {
-  public static final String BASE_URL = "/api/user_properties";
-
-  private String key = null;
-
-  /**
-   * Get all user properties
-   */
-  public UserPropertyQuery() {
-  }
-
-  /**
-   * Get only one specific user property
-   */
-  public UserPropertyQuery(String key) {
-    this.key = key;
-  }
-
-  public String getKey() {
-    return key;
-  }
-
-  public UserPropertyQuery setKey(String key) {
-    this.key = key;
-    return this;
-  }
-
-  @Override
-  public String getUrl() {
-    String url = BASE_URL;
-    if (key != null) {
-      url += "/" + encode(key);
-    }
-    return url + "?";
-  }
-
-  @Override
-  public Class<Property> getModelClass() {
-    return Property.class;
-  }
-}
diff --git a/server/sonar-ws-client/src/main/java/org/sonar/wsclient/services/WSUtils.java b/server/sonar-ws-client/src/main/java/org/sonar/wsclient/services/WSUtils.java
deleted file mode 100644 (file)
index 0c8dab2..0000000
+++ /dev/null
@@ -1,118 +0,0 @@
-/*
- * SonarQube, open source software quality management tool.
- * Copyright (C) 2008-2014 SonarSource
- * mailto:contact AT sonarsource DOT com
- *
- * SonarQube is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * SonarQube is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-package org.sonar.wsclient.services;
-
-import javax.annotation.CheckForNull;
-
-import java.util.Date;
-import java.util.Set;
-
-/**
- * Compatibility layer between GWT and plain Java.
- * Well, this is bad, because code is not type-safe, so all unmarshallers also,
- * but this allows to remove duplications between sonar-gwt-api and sonar-ws-client.
- */
-public abstract class WSUtils {
-
-  private static volatile WSUtils instance = null;
-
-  public static void setInstance(WSUtils utils) {
-    instance = utils;
-  }
-
-  public static WSUtils getINSTANCE() {
-    return instance;
-  }
-
-  public abstract String format(Date date, String format);
-
-  public abstract String encodeUrl(String url);
-
-  /**
-   * @return value of specified field from specified JSON object,
-   *         or <code>null</code> if field does not exist
-   */
-  @CheckForNull
-  public abstract Object getField(Object json, String field);
-
-  /**
-   * @return value of a string field from specified JSON object,
-   *         or string representation of a numeric field,
-   *         or <code>null</code> if field does not exist
-   */
-  @CheckForNull
-  public abstract String getString(Object json, String field);
-
-  /**
-   * @return Boolean value of specified field from specified JSON object,
-   *         or <code>null</code> if field does not exist
-   */
-  @CheckForNull
-  public abstract Boolean getBoolean(Object json, String field);
-
-  /**
-   * @return Integer value of specified field from specified JSON object,
-   *         or <code>null</code> if field does not exist
-   */
-  @CheckForNull
-  public abstract Integer getInteger(Object json, String field);
-
-  /**
-   * @return Double value of specified field from specified JSON object,
-   *         or <code>null</code> if field does not exist
-   */
-  @CheckForNull
-  public abstract Double getDouble(Object json, String field);
-
-  /**
-   * @return Long value of specified field from specified JSON object,
-   *         or <code>null</code> if field does not exist
-   */
-  @CheckForNull
-  public abstract Long getLong(Object json, String field);
-
-  /**
-   * @return Date value of specified field from specified JSON object,
-   *         or <code>null</code> if field does not exist
-   */
-  @CheckForNull
-  public abstract Date getDateTime(Object json, String field);
-
-  /**
-   * @return size of specified JSON array
-   */
-  public abstract int getArraySize(Object array);
-
-  /**
-   * @return element from specified JSON array
-   */
-  public abstract Object getArrayElement(Object array, int i);
-
-  /**
-   * @return JSON object
-   */
-  public abstract Object parse(String jsonStr);
-
-  /**
-   * @return field names in specified JSON object
-   */
-  public abstract Set<String> getFields(Object json);
-
-}
diff --git a/server/sonar-ws-client/src/main/java/org/sonar/wsclient/services/package-info.java b/server/sonar-ws-client/src/main/java/org/sonar/wsclient/services/package-info.java
deleted file mode 100644 (file)
index d17eb90..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-/*
- * SonarQube, open source software quality management tool.
- * Copyright (C) 2008-2014 SonarSource
- * mailto:contact AT sonarsource DOT com
- *
- * SonarQube is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * SonarQube is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-
-@javax.annotation.ParametersAreNonnullByDefault
-package org.sonar.wsclient.services;
diff --git a/server/sonar-ws-client/src/main/java/org/sonar/wsclient/system/Migration.java b/server/sonar-ws-client/src/main/java/org/sonar/wsclient/system/Migration.java
deleted file mode 100644 (file)
index 7c9ee2b..0000000
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * SonarQube, open source software quality management tool.
- * Copyright (C) 2008-2014 SonarSource
- * mailto:contact AT sonarsource DOT com
- *
- * SonarQube is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * SonarQube is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-package org.sonar.wsclient.system;
-
-import javax.annotation.Nullable;
-import java.util.Date;
-
-/**
- * @since 4.0
- */
-public interface Migration {
-  enum Status {
-    MIGRATION_NEEDED, MIGRATION_RUNNING, MIGRATION_FAILED,
-    MIGRATION_SUCCEEDED, NO_MIGRATION
-  }
-
-  boolean operationalWebapp();
-
-  Status status();
-
-  @Nullable
-  String message();
-
-  @Nullable
-  Date startedAt();
-}
diff --git a/server/sonar-ws-client/src/main/java/org/sonar/wsclient/system/SystemClient.java b/server/sonar-ws-client/src/main/java/org/sonar/wsclient/system/SystemClient.java
deleted file mode 100644 (file)
index 297925e..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * SonarQube, open source software quality management tool.
- * Copyright (C) 2008-2014 SonarSource
- * mailto:contact AT sonarsource DOT com
- *
- * SonarQube is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * SonarQube is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-package org.sonar.wsclient.system;
-
-/**
- * @since 4.0
- */
-public interface SystemClient {
-  /**
-   * Asynchronously start a database migration. No effect if executed
-   * several times.
-   */
-  Migration migrate();
-
-  /**
-   * Synchronously start a database migration.
-   */
-  Migration migrate(long timeoutInSeconds, long rateInSeconds);
-
-  /**
-   * Restart server. Available only in development mode.
-   * @since 4.3
-   */
-  void restart();
-}
diff --git a/server/sonar-ws-client/src/main/java/org/sonar/wsclient/system/internal/DefaultMigration.java b/server/sonar-ws-client/src/main/java/org/sonar/wsclient/system/internal/DefaultMigration.java
deleted file mode 100644 (file)
index 2aa30be..0000000
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
- * SonarQube, open source software quality management tool.
- * Copyright (C) 2008-2014 SonarSource
- * mailto:contact AT sonarsource DOT com
- *
- * SonarQube is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * SonarQube is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-package org.sonar.wsclient.system.internal;
-
-import org.sonar.wsclient.system.Migration;
-import org.sonar.wsclient.unmarshallers.JsonUtils;
-
-import javax.annotation.Nullable;
-import java.util.Date;
-import java.util.Map;
-
-public class DefaultMigration implements Migration {
-
-  private final Map json;
-
-  public DefaultMigration(Map json) {
-    this.json = json;
-  }
-
-  @Override
-  public boolean operationalWebapp() {
-    return JsonUtils.getBoolean(json, "operational")==Boolean.TRUE;
-  }
-
-  @Override
-  public Status status() {
-    String state = JsonUtils.getString(json, "state");
-    if (state == null) {
-      throw new IllegalStateException("State is not set");
-    }
-    return Status.valueOf(state);
-  }
-
-  @Override
-  public String message() {
-    return JsonUtils.getString(json, "message");
-  }
-
-  @Override
-  @Nullable
-  public Date startedAt() {
-    return JsonUtils.getDateTime(json, "startedAt");
-  }
-}
diff --git a/server/sonar-ws-client/src/main/java/org/sonar/wsclient/system/internal/DefaultSystemClient.java b/server/sonar-ws-client/src/main/java/org/sonar/wsclient/system/internal/DefaultSystemClient.java
deleted file mode 100644 (file)
index 7eacea2..0000000
+++ /dev/null
@@ -1,81 +0,0 @@
-/*
- * SonarQube, open source software quality management tool.
- * Copyright (C) 2008-2014 SonarSource
- * mailto:contact AT sonarsource DOT com
- *
- * SonarQube is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * SonarQube is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-package org.sonar.wsclient.system.internal;
-
-import org.json.simple.JSONValue;
-import org.sonar.wsclient.internal.HttpRequestFactory;
-import org.sonar.wsclient.system.Migration;
-import org.sonar.wsclient.system.SystemClient;
-
-import java.util.Collections;
-import java.util.Map;
-
-public class DefaultSystemClient implements SystemClient {
-
-  private final HttpRequestFactory requestFactory;
-
-  public DefaultSystemClient(HttpRequestFactory requestFactory) {
-    this.requestFactory = requestFactory;
-  }
-
-  @Override
-  public Migration migrate() {
-    String json = requestFactory.post("/api/server/setup", Collections.<String, Object>emptyMap());
-    return jsonToMigration(json);
-  }
-
-  @Override
-  public Migration migrate(long timeoutInMs, long rateInMs) {
-    if (rateInMs >= timeoutInMs) {
-      throw new IllegalArgumentException("Timeout must be greater than rate");
-    }
-    Migration migration = null;
-    boolean running = true;
-    long endAt = System.currentTimeMillis() + timeoutInMs;
-    while (running && System.currentTimeMillis() < endAt) {
-      migration = migrate();
-      if (migration.status() == Migration.Status.MIGRATION_NEEDED ||
-        migration.status() == Migration.Status.MIGRATION_RUNNING) {
-        sleepQuietly(rateInMs);
-      } else {
-        running = false;
-      }
-    }
-    return migration;
-  }
-
-  @Override
-  public void restart() {
-    requestFactory.post("/api/system/restart", Collections.<String, Object>emptyMap());
-  }
-
-  private void sleepQuietly(long rateInMs) {
-    try {
-      Thread.sleep(rateInMs);
-    } catch (InterruptedException e) {
-      throw new IllegalStateException("Fail to sleep!", e);
-    }
-  }
-
-  private Migration jsonToMigration(String json) {
-    Map jsonRoot = (Map) JSONValue.parse(json);
-    return new DefaultMigration(jsonRoot);
-  }
-}
diff --git a/server/sonar-ws-client/src/main/java/org/sonar/wsclient/system/internal/package-info.java b/server/sonar-ws-client/src/main/java/org/sonar/wsclient/system/internal/package-info.java
deleted file mode 100644 (file)
index 637c20b..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-/*
- * SonarQube, open source software quality management tool.
- * Copyright (C) 2008-2014 SonarSource
- * mailto:contact AT sonarsource DOT com
- *
- * SonarQube is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * SonarQube is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-
-@javax.annotation.ParametersAreNonnullByDefault
-package org.sonar.wsclient.system.internal;
diff --git a/server/sonar-ws-client/src/main/java/org/sonar/wsclient/system/package-info.java b/server/sonar-ws-client/src/main/java/org/sonar/wsclient/system/package-info.java
deleted file mode 100644 (file)
index 5acdc1a..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-/*
- * SonarQube, open source software quality management tool.
- * Copyright (C) 2008-2014 SonarSource
- * mailto:contact AT sonarsource DOT com
- *
- * SonarQube is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * SonarQube is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-
-@javax.annotation.ParametersAreNonnullByDefault
-package org.sonar.wsclient.system;
diff --git a/server/sonar-ws-client/src/main/java/org/sonar/wsclient/unmarshallers/AbstractUnmarshaller.java b/server/sonar-ws-client/src/main/java/org/sonar/wsclient/unmarshallers/AbstractUnmarshaller.java
deleted file mode 100644 (file)
index fc3254e..0000000
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- * SonarQube, open source software quality management tool.
- * Copyright (C) 2008-2014 SonarSource
- * mailto:contact AT sonarsource DOT com
- *
- * SonarQube is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * SonarQube is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-package org.sonar.wsclient.unmarshallers;
-
-import org.sonar.wsclient.services.Model;
-import org.sonar.wsclient.services.WSUtils;
-
-import java.util.ArrayList;
-import java.util.List;
-
-public abstract class AbstractUnmarshaller<M extends Model> implements Unmarshaller<M> {
-
-  @Override
-  public final M toModel(String json) {
-    WSUtils utils = WSUtils.getINSTANCE();
-    M result = null;
-    Object array = utils.parse(json);
-    if (array instanceof List) {
-      if (utils.getArraySize(array) >= 1) {
-        Object elt = utils.getArrayElement(array, 0);
-        if (elt != null) {
-          result = parse(elt);
-        }
-      }
-    } else {
-      result = parse(array);
-    }
-    return result;
-
-  }
-
-  @Override
-  public final List<M> toModels(String json) {
-    WSUtils utils = WSUtils.getINSTANCE();
-    List<M> result = new ArrayList<>();
-    Object array = utils.parse(json);
-    for (int i = 0; i < utils.getArraySize(array); i++) {
-      Object elt = utils.getArrayElement(array, i);
-      if (elt != null) {
-        result.add(parse(elt));
-      }
-    }
-    return result;
-  }
-
-  protected abstract M parse(Object elt);
-}
diff --git a/server/sonar-ws-client/src/main/java/org/sonar/wsclient/unmarshallers/AuthenticationUnmarshaller.java b/server/sonar-ws-client/src/main/java/org/sonar/wsclient/unmarshallers/AuthenticationUnmarshaller.java
deleted file mode 100644 (file)
index fd9d3a2..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * SonarQube, open source software quality management tool.
- * Copyright (C) 2008-2014 SonarSource
- * mailto:contact AT sonarsource DOT com
- *
- * SonarQube is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * SonarQube is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-package org.sonar.wsclient.unmarshallers;
-
-import org.sonar.wsclient.services.Authentication;
-import org.sonar.wsclient.services.WSUtils;
-
-import java.util.List;
-
-public class AuthenticationUnmarshaller implements Unmarshaller<Authentication> {
-
-  @Override
-  public Authentication toModel(String json) {
-    WSUtils utils = WSUtils.getINSTANCE();
-    Object map = utils.parse(json);
-
-    Boolean validJson = utils.getBoolean(map, "valid");
-    return new Authentication().setValid(validJson != null ? validJson : false);
-  }
-
-  @Override
-  public List<Authentication> toModels(String json) {
-    throw new UnsupportedOperationException();
-  }
-}
diff --git a/server/sonar-ws-client/src/main/java/org/sonar/wsclient/unmarshallers/EventUnmarshaller.java b/server/sonar-ws-client/src/main/java/org/sonar/wsclient/unmarshallers/EventUnmarshaller.java
deleted file mode 100644 (file)
index 44c3298..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * SonarQube, open source software quality management tool.
- * Copyright (C) 2008-2014 SonarSource
- * mailto:contact AT sonarsource DOT com
- *
- * SonarQube is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * SonarQube is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-package org.sonar.wsclient.unmarshallers;
-
-import org.sonar.wsclient.services.Event;
-import org.sonar.wsclient.services.WSUtils;
-
-public class EventUnmarshaller extends AbstractUnmarshaller<Event> {
-
-  @Override
-  protected Event parse(Object json) {
-    WSUtils utils = WSUtils.getINSTANCE();
-    return new Event()
-        .setId(utils.getString(json, "id"))
-        .setResourceKey(utils.getString(json, "rk"))
-        .setName(utils.getString(json, "n"))
-        .setCategory(utils.getString(json, "c"))
-        .setDate(utils.getDateTime(json, "dt"))
-        .setDescription(utils.getString(json, "ds"));
-  }
-}
diff --git a/server/sonar-ws-client/src/main/java/org/sonar/wsclient/unmarshallers/FavouriteUnmarshaller.java b/server/sonar-ws-client/src/main/java/org/sonar/wsclient/unmarshallers/FavouriteUnmarshaller.java
deleted file mode 100644 (file)
index 7be9b03..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * SonarQube, open source software quality management tool.
- * Copyright (C) 2008-2014 SonarSource
- * mailto:contact AT sonarsource DOT com
- *
- * SonarQube is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * SonarQube is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-package org.sonar.wsclient.unmarshallers;
-
-import org.sonar.wsclient.services.Favourite;
-import org.sonar.wsclient.services.WSUtils;
-
-public class FavouriteUnmarshaller extends AbstractUnmarshaller<Favourite> {
-
-  @Override
-  protected Favourite parse(Object json) {
-    WSUtils utils = WSUtils.getINSTANCE();
-    return new Favourite()
-        .setId(utils.getInteger(json, "id"))
-        .setKey(utils.getString(json, "key"))
-        .setName(utils.getString(json, "name"))
-        .setScope(utils.getString(json, "scope"))
-        .setQualifier(utils.getString(json, "qualifier"))
-        .setLanguage(utils.getString(json, "lang"));
-  }
-}
diff --git a/server/sonar-ws-client/src/main/java/org/sonar/wsclient/unmarshallers/JsonUtils.java b/server/sonar-ws-client/src/main/java/org/sonar/wsclient/unmarshallers/JsonUtils.java
deleted file mode 100644 (file)
index 6843ec8..0000000
+++ /dev/null
@@ -1,125 +0,0 @@
-/*
- * SonarQube, open source software quality management tool.
- * Copyright (C) 2008-2014 SonarSource
- * mailto:contact AT sonarsource DOT com
- *
- * SonarQube is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * SonarQube is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-package org.sonar.wsclient.unmarshallers;
-
-import org.json.simple.JSONArray;
-
-import javax.annotation.CheckForNull;
-import javax.annotation.Nullable;
-
-import java.text.ParseException;
-import java.text.SimpleDateFormat;
-import java.util.Date;
-import java.util.Map;
-
-// Godin: we will use raw types here, because typically JSONObject passed as an argument
-@SuppressWarnings("rawtypes")
-public final class JsonUtils {
-
-  private JsonUtils() {
-    // only static methods
-  }
-
-  @CheckForNull
-  public static String getString(Map obj, String field) {
-    Object value = obj.get(field);
-    if (value instanceof String || value instanceof Number) {
-      return value.toString();
-    }
-    return null;
-  }
-
-  @CheckForNull
-  public static Integer getInteger(Map obj, String field) {
-    Object value = obj.get(field);
-    if (value != null) {
-      return ((Long) value).intValue();
-    }
-    return null;
-  }
-
-  @CheckForNull
-  public static Boolean getBoolean(Map obj, String field) {
-    Object value = obj.get(field);
-    if (value != null) {
-      return (Boolean) value;
-    }
-    return null;
-  }
-
-  @CheckForNull
-  public static Long getLong(Map obj, String field) {
-    Object value = obj.get(field);
-    if (value != null) {
-      return (Long) value;
-    }
-    return null;
-  }
-
-  @CheckForNull
-  public static Double getDouble(Map obj, String field) {
-    Object value = obj.get(field);
-    if (value != null) {
-      if (value instanceof Long) {
-        return ((Long) value).doubleValue();
-      }
-      return (Double) value;
-    }
-    return null;
-  }
-
-  /**
-   * @since 2.5
-   */
-  @CheckForNull
-  public static JSONArray getArray(Map obj, String field) {
-    return (JSONArray) obj.get(field);
-  }
-
-  @CheckForNull
-  public static Date getDateTime(Map obj, String field) {
-    return parseDate(getString(obj, field), "yyyy-MM-dd'T'HH:mm:ssZ");
-  }
-
-  @CheckForNull
-  public static Date getDate(Map obj, String field) {
-    return parseDate(getString(obj, field));
-  }
-
-  @CheckForNull
-  public static Date parseDate(@Nullable String value) {
-    return parseDate(value, "yyyy-MM-dd");
-  }
-
-  @CheckForNull
-  private static Date parseDate(@Nullable String value, String format) {
-    if (value != null) {
-      try {
-        SimpleDateFormat dateFormat = new SimpleDateFormat(format);
-        return dateFormat.parse(value);
-
-      } catch (ParseException e) {
-        throw new IllegalArgumentException("Fail to parse date '" + value + "': " + format, e);
-      }
-    }
-    return null;
-  }
-
-}
diff --git a/server/sonar-ws-client/src/main/java/org/sonar/wsclient/unmarshallers/ManualMeasureUnmarshaller.java b/server/sonar-ws-client/src/main/java/org/sonar/wsclient/unmarshallers/ManualMeasureUnmarshaller.java
deleted file mode 100644 (file)
index d8f2de9..0000000
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * SonarQube, open source software quality management tool.
- * Copyright (C) 2008-2014 SonarSource
- * mailto:contact AT sonarsource DOT com
- *
- * SonarQube is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * SonarQube is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-package org.sonar.wsclient.unmarshallers;
-
-import org.sonar.wsclient.services.ManualMeasure;
-import org.sonar.wsclient.services.WSUtils;
-
-/**
- * @since 2.10
- */
-public class ManualMeasureUnmarshaller extends AbstractUnmarshaller<ManualMeasure> {
-
-  @Override
-  protected ManualMeasure parse(Object json) {
-    WSUtils utils = WSUtils.getINSTANCE();
-    return new ManualMeasure()
-        .setId(utils.getLong(json, "id"))
-        .setMetricKey(utils.getString(json, "metric"))
-        .setResourceKey(utils.getString(json, "resource"))
-        .setCreatedAt(utils.getDateTime(json, "created_at"))
-        .setUpdatedAt(utils.getDateTime(json, "updated_at"))
-        .setUserLogin(utils.getString(json, "login"))
-        .setUsername(utils.getString(json, "username"))
-        .setValue(utils.getDouble(json, "val"))
-        .setTextValue(utils.getString(json, "text"));
-  }
-}
diff --git a/server/sonar-ws-client/src/main/java/org/sonar/wsclient/unmarshallers/MetricUnmarshaller.java b/server/sonar-ws-client/src/main/java/org/sonar/wsclient/unmarshallers/MetricUnmarshaller.java
deleted file mode 100644 (file)
index 3064a84..0000000
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * SonarQube, open source software quality management tool.
- * Copyright (C) 2008-2014 SonarSource
- * mailto:contact AT sonarsource DOT com
- *
- * SonarQube is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * SonarQube is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-package org.sonar.wsclient.unmarshallers;
-
-import org.sonar.wsclient.services.Metric;
-import org.sonar.wsclient.services.WSUtils;
-
-public class MetricUnmarshaller extends AbstractUnmarshaller<Metric> {
-
-  @Override
-  protected Metric parse(Object json) {
-    WSUtils utils = WSUtils.getINSTANCE();
-    return new Metric()
-        .setKey(utils.getString(json, "key"))
-        .setName(utils.getString(json, "name"))
-        .setDomain(utils.getString(json, "domain"))
-        .setDescription(utils.getString(json, "description"))
-        .setDirection(utils.getInteger(json, "direction"))
-        .setType(utils.getString(json, "val_type"))
-        .setUserManaged(utils.getBoolean(json, "user_managed"))
-        .setHidden(utils.getBoolean(json, "hidden"));
-  }
-}
diff --git a/server/sonar-ws-client/src/main/java/org/sonar/wsclient/unmarshallers/PluginUnmarshaller.java b/server/sonar-ws-client/src/main/java/org/sonar/wsclient/unmarshallers/PluginUnmarshaller.java
deleted file mode 100644 (file)
index a871445..0000000
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * SonarQube, open source software quality management tool.
- * Copyright (C) 2008-2014 SonarSource
- * mailto:contact AT sonarsource DOT com
- *
- * SonarQube is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * SonarQube is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-package org.sonar.wsclient.unmarshallers;
-
-import org.sonar.wsclient.services.Plugin;
-import org.sonar.wsclient.services.WSUtils;
-
-/**
- * @since 2.4
- */
-public class PluginUnmarshaller extends AbstractUnmarshaller<Plugin> {
-
-  @Override
-  protected Plugin parse(Object json) {
-    WSUtils utils = WSUtils.getINSTANCE();
-    return new Plugin()
-      .setKey(utils.getString(json, "key"))
-      .setName(utils.getString(json, "name"))
-      .setVersion(utils.getString(json, "version"));
-  }
-
-}
diff --git a/server/sonar-ws-client/src/main/java/org/sonar/wsclient/unmarshallers/ProfileUnmarshaller.java b/server/sonar-ws-client/src/main/java/org/sonar/wsclient/unmarshallers/ProfileUnmarshaller.java
deleted file mode 100644 (file)
index 988fcad..0000000
+++ /dev/null
@@ -1,71 +0,0 @@
-/*
- * SonarQube, open source software quality management tool.
- * Copyright (C) 2008-2014 SonarSource
- * mailto:contact AT sonarsource DOT com
- *
- * SonarQube is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * SonarQube is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-package org.sonar.wsclient.unmarshallers;
-
-import org.sonar.wsclient.services.Profile;
-import org.sonar.wsclient.services.WSUtils;
-
-public class ProfileUnmarshaller extends AbstractUnmarshaller<Profile> {
-
-  @Override
-  protected Profile parse(Object json) {
-    WSUtils utils = WSUtils.getINSTANCE();
-    Profile profile = new Profile();
-    Boolean defaultProfile = utils.getBoolean(json, "default");
-    profile
-        .setLanguage(utils.getString(json, "language"))
-        .setName(utils.getString(json, "name"))
-        .setDefaultProfile(defaultProfile != null ? defaultProfile : false)
-        .setParentName(utils.getString(json, "parent"));
-
-    parseRules(utils, profile, json);
-    return profile;
-  }
-
-  private void parseRules(WSUtils utils, Profile profile, Object json) {
-    Object rulesJson = utils.getField(json, "rules");
-    if (rulesJson != null) {
-      for (int i = 0; i < utils.getArraySize(rulesJson); i++) {
-        Object ruleJson = utils.getArrayElement(rulesJson, i);
-        if (ruleJson != null) {
-          Profile.Rule rule = new Profile.Rule();
-          rule.setKey(utils.getString(ruleJson, "key"));
-          rule.setRepository(utils.getString(ruleJson, "repo"));
-          rule.setSeverity(utils.getString(ruleJson, "severity"));
-          rule.setInheritance(utils.getString(ruleJson, "inheritance"));
-
-          parseRuleParameters(utils, rule, ruleJson);
-          profile.addRule(rule);
-        }
-      }
-    }
-  }
-
-  private void parseRuleParameters(WSUtils utils, Profile.Rule rule, Object ruleJson) {
-    Object paramsJson = utils.getField(ruleJson, "params");
-    if (paramsJson != null) {
-      for (int indexParam = 0; indexParam < utils.getArraySize(paramsJson); indexParam++) {
-        Object paramJson = utils.getArrayElement(paramsJson, indexParam);
-        rule.addParameter(utils.getString(paramJson, "key"), utils.getString(paramJson, "value"));
-      }
-    }
-  }
-
-}
diff --git a/server/sonar-ws-client/src/main/java/org/sonar/wsclient/unmarshallers/PropertyUnmarshaller.java b/server/sonar-ws-client/src/main/java/org/sonar/wsclient/unmarshallers/PropertyUnmarshaller.java
deleted file mode 100644 (file)
index 8c26c2f..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * SonarQube, open source software quality management tool.
- * Copyright (C) 2008-2014 SonarSource
- * mailto:contact AT sonarsource DOT com
- *
- * SonarQube is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * SonarQube is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-package org.sonar.wsclient.unmarshallers;
-
-import org.sonar.wsclient.services.Property;
-import org.sonar.wsclient.services.WSUtils;
-
-public class PropertyUnmarshaller extends AbstractUnmarshaller<Property> {
-
-  @Override
-  protected Property parse(Object json) {
-    WSUtils utils = WSUtils.getINSTANCE();
-    return new Property()
-        .setKey(utils.getString(json, "key"))
-        .setValue(utils.getString(json, "value"));
-  }
-}
diff --git a/server/sonar-ws-client/src/main/java/org/sonar/wsclient/unmarshallers/ResourceSearchUnmarshaller.java b/server/sonar-ws-client/src/main/java/org/sonar/wsclient/unmarshallers/ResourceSearchUnmarshaller.java
deleted file mode 100644 (file)
index b907a17..0000000
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- * SonarQube, open source software quality management tool.
- * Copyright (C) 2008-2014 SonarSource
- * mailto:contact AT sonarsource DOT com
- *
- * SonarQube is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * SonarQube is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-package org.sonar.wsclient.unmarshallers;
-
-import org.json.simple.JSONArray;
-import org.json.simple.JSONObject;
-import org.sonar.wsclient.services.ResourceSearchResult;
-import org.sonar.wsclient.services.WSUtils;
-
-import java.util.ArrayList;
-import java.util.List;
-
-/**
- * @since 3.4
- */
-public class ResourceSearchUnmarshaller extends AbstractUnmarshaller<ResourceSearchResult> {
-
-  @Override
-  protected ResourceSearchResult parse(Object json) {
-    WSUtils utils = WSUtils.getINSTANCE();
-    ResourceSearchResult result = new ResourceSearchResult();
-    result.setPage(utils.getInteger(json, "page"));
-    result.setPageSize(utils.getInteger(json, "page_size"));
-    result.setTotal(utils.getInteger(json, "total"));
-
-    List<ResourceSearchResult.Resource> resources = new ArrayList<>();
-    JSONArray dataJson = JsonUtils.getArray((JSONObject) json, "data");
-    if (dataJson != null) {
-      for (Object jsonResource : dataJson) {
-        ResourceSearchResult.Resource resource = new ResourceSearchResult.Resource();
-        resource.setKey(JsonUtils.getString((JSONObject) jsonResource, "key"));
-        resource.setName(JsonUtils.getString((JSONObject) jsonResource, "nm"));
-        resource.setQualifier(JsonUtils.getString((JSONObject) jsonResource, "q"));
-        resources.add(resource);
-      }
-    }
-    result.setResources(resources);
-    return result;
-  }
-
-
-}
diff --git a/server/sonar-ws-client/src/main/java/org/sonar/wsclient/unmarshallers/ResourceUnmarshaller.java b/server/sonar-ws-client/src/main/java/org/sonar/wsclient/unmarshallers/ResourceUnmarshaller.java
deleted file mode 100644 (file)
index 836d0f8..0000000
+++ /dev/null
@@ -1,117 +0,0 @@
-/*
- * SonarQube, open source software quality management tool.
- * Copyright (C) 2008-2014 SonarSource
- * mailto:contact AT sonarsource DOT com
- *
- * SonarQube is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * SonarQube is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-package org.sonar.wsclient.unmarshallers;
-
-import org.sonar.wsclient.services.Measure;
-import org.sonar.wsclient.services.Resource;
-import org.sonar.wsclient.services.WSUtils;
-
-import java.util.ArrayList;
-import java.util.List;
-
-public class ResourceUnmarshaller extends AbstractUnmarshaller<Resource> {
-
-  @Override
-  protected Resource parse(Object json) {
-    Resource resource = new Resource();
-    parseResourceFields(json, resource);
-    parseMeasures(json, resource);
-    return resource;
-  }
-
-  private void parseResourceFields(Object json, Resource resource) {
-    WSUtils utils = WSUtils.getINSTANCE();
-    resource.setId(utils.getInteger(json, "id"))
-        .setKey(utils.getString(json, "key"))
-        .setName(utils.getString(json, "name"))
-        .setLongName(utils.getString(json, "lname"))
-        .setCopy(utils.getInteger(json, "copy"))
-        .setScope(utils.getString(json, "scope"))
-        .setQualifier(utils.getString(json, "qualifier"))
-        .setLanguage(utils.getString(json, "lang"))
-        .setDescription(utils.getString(json, "description"))
-        .setDate(utils.getDateTime(json, "date"))
-        .setCreationDate(utils.getDateTime(json, "creationDate"))
-        .setVersion(utils.getString(json, "version"))
-        .setPeriod1Mode(utils.getString(json, "p1"))
-        .setPeriod1Param(utils.getString(json, "p1p"))
-        .setPeriod1Date(utils.getDateTime(json, "p1d"))
-        .setPeriod2Mode(utils.getString(json, "p2"))
-        .setPeriod2Param(utils.getString(json, "p2p"))
-        .setPeriod2Date(utils.getDateTime(json, "p2d"))
-        .setPeriod3Mode(utils.getString(json, "p3"))
-        .setPeriod3Param(utils.getString(json, "p3p"))
-        .setPeriod3Date(utils.getDateTime(json, "p3d"))
-        .setPeriod4Mode(utils.getString(json, "p4"))
-        .setPeriod4Param(utils.getString(json, "p4p"))
-        .setPeriod4Date(utils.getDateTime(json, "p4d"))
-        .setPeriod5Mode(utils.getString(json, "p5"))
-        .setPeriod5Param(utils.getString(json, "p5p"))
-        .setPeriod5Date(utils.getDateTime(json, "p5d"));
-  }
-
-  private void parseMeasures(Object json, Resource resource) {
-    WSUtils utils = WSUtils.getINSTANCE();
-    Object measuresJson = utils.getField(json, "msr");
-    if (measuresJson != null) {
-      resource.setMeasures(parseMeasures(measuresJson));
-    }
-  }
-
-  private List<Measure> parseMeasures(Object measuresJson) {
-    WSUtils utils = WSUtils.getINSTANCE();
-    List<Measure> projectMeasures = new ArrayList<>();
-    int len = utils.getArraySize(measuresJson);
-    for (int i = 0; i < len; i++) {
-      Object measureJson = utils.getArrayElement(measuresJson, i);
-      if (measureJson != null) {
-        Measure measure = parseMeasure(measureJson);
-        projectMeasures.add(measure);
-      }
-    }
-    return projectMeasures;
-  }
-
-  private Measure parseMeasure(Object json) {
-    WSUtils utils = WSUtils.getINSTANCE();
-
-    Measure measure = new Measure();
-    measure
-        .setMetricKey(utils.getString(json, "key"))
-        .setMetricName(utils.getString(json, "name"))
-        .setValue(utils.getDouble(json, "val"))
-        .setFormattedValue(utils.getString(json, "frmt_val"))
-        .setAlertStatus(utils.getString(json, "alert"))
-        .setAlertText(utils.getString(json, "alert_text"))
-        .setData(utils.getString(json, "data"))
-        .setRuleKey(utils.getString(json, "rule_key"))
-        .setRuleName(utils.getString(json, "rule_name"))
-        .setRuleCategory(utils.getString(json, "rule_category"))
-        .setRuleSeverity(utils.getString(json, "rule_priority"))
-        .setCharacteristicKey(utils.getString(json, "ctic_key"))
-        .setCharacteristicName(utils.getString(json, "ctic_name"))
-        .setVariation1(utils.getDouble(json, "var1"))
-        .setVariation2(utils.getDouble(json, "var2"))
-        .setVariation3(utils.getDouble(json, "var3"))
-        .setVariation4(utils.getDouble(json, "var4"))
-        .setVariation5(utils.getDouble(json, "var5"));
-    return measure;
-  }
-}
diff --git a/server/sonar-ws-client/src/main/java/org/sonar/wsclient/unmarshallers/ServerSetupUnmarshaller.java b/server/sonar-ws-client/src/main/java/org/sonar/wsclient/unmarshallers/ServerSetupUnmarshaller.java
deleted file mode 100644 (file)
index 318a885..0000000
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * SonarQube, open source software quality management tool.
- * Copyright (C) 2008-2014 SonarSource
- * mailto:contact AT sonarsource DOT com
- *
- * SonarQube is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * SonarQube is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-package org.sonar.wsclient.unmarshallers;
-
-import org.sonar.wsclient.services.ServerSetup;
-import org.sonar.wsclient.services.WSUtils;
-
-import java.util.List;
-
-/**
- * @since 2.9
- */
-public class ServerSetupUnmarshaller implements Unmarshaller<ServerSetup> {
-  @Override
-  public ServerSetup toModel(String json) {
-    WSUtils utils = WSUtils.getINSTANCE();
-    Object map = utils.parse(json);
-    return new ServerSetup()
-      .setStatus(utils.getString(map, "status"))
-      .setMessage(utils.getString(map, "msg"));
-  }
-
-  @Override
-  public List<ServerSetup> toModels(String json) {
-    throw new UnsupportedOperationException();
-  }
-}
diff --git a/server/sonar-ws-client/src/main/java/org/sonar/wsclient/unmarshallers/ServerUnmarshaller.java b/server/sonar-ws-client/src/main/java/org/sonar/wsclient/unmarshallers/ServerUnmarshaller.java
deleted file mode 100644 (file)
index 0949eaa..0000000
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * SonarQube, open source software quality management tool.
- * Copyright (C) 2008-2014 SonarSource
- * mailto:contact AT sonarsource DOT com
- *
- * SonarQube is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * SonarQube is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-package org.sonar.wsclient.unmarshallers;
-
-import org.sonar.wsclient.services.Server;
-import org.sonar.wsclient.services.WSUtils;
-
-import java.util.List;
-
-/**
- * @author Evgeny Mandrikov
- */
-public class ServerUnmarshaller implements Unmarshaller<Server> {
-  @Override
-  public Server toModel(String json) {
-    WSUtils utils = WSUtils.getINSTANCE();
-    Object map = utils.parse(json);
-    Server server = new Server()
-        .setId(utils.getString(map, "id"))
-        .setVersion(utils.getString(map, "version"))
-        .setStatusMessage(utils.getString(map, "status_msg"));
-    String status = utils.getString(map, "status");
-    if (status != null) {
-      server.setStatus(Server.Status.valueOf(status));
-    }
-    return server;
-  }
-
-  @Override
-  public List<Server> toModels(String json) {
-    throw new UnsupportedOperationException();
-  }
-}
diff --git a/server/sonar-ws-client/src/main/java/org/sonar/wsclient/unmarshallers/SourceUnmarshaller.java b/server/sonar-ws-client/src/main/java/org/sonar/wsclient/unmarshallers/SourceUnmarshaller.java
deleted file mode 100644 (file)
index bdf91d1..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * SonarQube, open source software quality management tool.
- * Copyright (C) 2008-2014 SonarSource
- * mailto:contact AT sonarsource DOT com
- *
- * SonarQube is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * SonarQube is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-package org.sonar.wsclient.unmarshallers;
-
-import org.sonar.wsclient.services.Source;
-import org.sonar.wsclient.services.WSUtils;
-
-public class SourceUnmarshaller extends AbstractUnmarshaller<Source> {
-
-  @Override
-  protected Source parse(Object json) {
-    WSUtils utils = WSUtils.getINSTANCE();
-    Source source = new Source();
-
-    for (String field : utils.getFields(json)) {
-      source.addLine(Integer.parseInt(field), utils.getString(json, field));
-    }
-
-    return source;
-  }
-}
diff --git a/server/sonar-ws-client/src/main/java/org/sonar/wsclient/unmarshallers/TimeMachineUnmarshaller.java b/server/sonar-ws-client/src/main/java/org/sonar/wsclient/unmarshallers/TimeMachineUnmarshaller.java
deleted file mode 100644 (file)
index dd2248d..0000000
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * SonarQube, open source software quality management tool.
- * Copyright (C) 2008-2014 SonarSource
- * mailto:contact AT sonarsource DOT com
- *
- * SonarQube is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * SonarQube is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-package org.sonar.wsclient.unmarshallers;
-
-import org.sonar.wsclient.services.TimeMachine;
-import org.sonar.wsclient.services.TimeMachineCell;
-import org.sonar.wsclient.services.TimeMachineColumn;
-import org.sonar.wsclient.services.WSUtils;
-
-public class TimeMachineUnmarshaller extends AbstractUnmarshaller<TimeMachine> {
-
-  @Override
-  protected TimeMachine parse(Object json) {
-    WSUtils utils = WSUtils.getINSTANCE();
-    Object cols = utils.getField(json, "cols");
-    if (cols == null) {
-      throw new IllegalArgumentException("cols must be set");
-    }
-    Object cells = utils.getField(json, "cells");
-    if (cells == null) {
-      throw new IllegalArgumentException("cells must be set");
-    }
-    return new TimeMachine(toColumns(cols), toCells(cells));
-  }
-
-  private TimeMachineColumn[] toColumns(Object cols) {
-    WSUtils utils = WSUtils.getINSTANCE();
-    int size = utils.getArraySize(cols);
-    TimeMachineColumn[] result = new TimeMachineColumn[size];
-    for (int index = 0; index < size; index++) {
-      Object colJson = utils.getArrayElement(cols, index);
-      result[index] = new TimeMachineColumn(index, utils.getString(colJson, "metric"), null, null);
-    }
-    return result;
-  }
-
-  private TimeMachineCell[] toCells(Object cells) {
-    WSUtils utils = WSUtils.getINSTANCE();
-    int size = utils.getArraySize(cells);
-    TimeMachineCell[] result = new TimeMachineCell[size];
-    for (int i = 0; i < size; i++) {
-      Object cellJson = utils.getArrayElement(cells, i);
-      Object valuesJson = utils.getField(cellJson, "v");
-      if (valuesJson != null) {
-        Object[] resultValues = new Object[utils.getArraySize(valuesJson)];
-        for (int indexValue = 0; indexValue < utils.getArraySize(valuesJson); indexValue++) {
-          Object value = utils.getArrayElement(valuesJson, indexValue);
-          resultValues[indexValue] = value;
-        }
-        result[i] = new TimeMachineCell(utils.getDateTime(cellJson, "d"), resultValues);
-      }
-    }
-    return result;
-  }
-
-}
diff --git a/server/sonar-ws-client/src/main/java/org/sonar/wsclient/unmarshallers/UnmarshalException.java b/server/sonar-ws-client/src/main/java/org/sonar/wsclient/unmarshallers/UnmarshalException.java
deleted file mode 100644 (file)
index 2e02827..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * SonarQube, open source software quality management tool.
- * Copyright (C) 2008-2014 SonarSource
- * mailto:contact AT sonarsource DOT com
- *
- * SonarQube is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * SonarQube is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-package org.sonar.wsclient.unmarshallers;
-
-import org.sonar.wsclient.services.AbstractQuery;
-
-/**
- * @since 2.10
- */
-public final class UnmarshalException extends RuntimeException {
-  public UnmarshalException(String s) {
-    super(s);
-  }
-
-  public UnmarshalException(AbstractQuery query, String json, Throwable t) {
-    super("Can not parse the response of query " + query.getUrl() + ": " + json, t);
-  }
-}
diff --git a/server/sonar-ws-client/src/main/java/org/sonar/wsclient/unmarshallers/Unmarshaller.java b/server/sonar-ws-client/src/main/java/org/sonar/wsclient/unmarshallers/Unmarshaller.java
deleted file mode 100644 (file)
index 0609cfb..0000000
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- * SonarQube, open source software quality management tool.
- * Copyright (C) 2008-2014 SonarSource
- * mailto:contact AT sonarsource DOT com
- *
- * SonarQube is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * SonarQube is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-package org.sonar.wsclient.unmarshallers;
-
-import org.sonar.wsclient.services.Model;
-
-import java.util.List;
-
-public interface Unmarshaller<M extends Model> {
-
-  M toModel(String json);
-
-  List<M> toModels(String json);
-
-}
diff --git a/server/sonar-ws-client/src/main/java/org/sonar/wsclient/unmarshallers/Unmarshallers.java b/server/sonar-ws-client/src/main/java/org/sonar/wsclient/unmarshallers/Unmarshallers.java
deleted file mode 100644 (file)
index 52d6759..0000000
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- * SonarQube, open source software quality management tool.
- * Copyright (C) 2008-2014 SonarSource
- * mailto:contact AT sonarsource DOT com
- *
- * SonarQube is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * SonarQube is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-package org.sonar.wsclient.unmarshallers;
-
-import org.sonar.wsclient.services.Authentication;
-import org.sonar.wsclient.services.Event;
-import org.sonar.wsclient.services.Favourite;
-import org.sonar.wsclient.services.ManualMeasure;
-import org.sonar.wsclient.services.Metric;
-import org.sonar.wsclient.services.Model;
-import org.sonar.wsclient.services.Plugin;
-import org.sonar.wsclient.services.Profile;
-import org.sonar.wsclient.services.Property;
-import org.sonar.wsclient.services.Resource;
-import org.sonar.wsclient.services.ResourceSearchResult;
-import org.sonar.wsclient.services.Server;
-import org.sonar.wsclient.services.ServerSetup;
-import org.sonar.wsclient.services.Source;
-import org.sonar.wsclient.services.TimeMachine;
-
-import java.util.HashMap;
-import java.util.Map;
-
-public final class Unmarshallers {
-  private Unmarshallers() {
-  }
-
-  private static volatile Map<Class, Unmarshaller> unmarshallers;
-
-  static {
-    unmarshallers = new HashMap<>();
-    unmarshallers.put(Metric.class, new MetricUnmarshaller());
-    unmarshallers.put(Resource.class, new ResourceUnmarshaller());
-    unmarshallers.put(Property.class, new PropertyUnmarshaller());
-    unmarshallers.put(Source.class, new SourceUnmarshaller());
-    unmarshallers.put(Server.class, new ServerUnmarshaller());
-    unmarshallers.put(ServerSetup.class, new ServerSetupUnmarshaller());
-    unmarshallers.put(Event.class, new EventUnmarshaller());
-    unmarshallers.put(Favourite.class, new FavouriteUnmarshaller());
-    unmarshallers.put(Plugin.class, new PluginUnmarshaller());
-    unmarshallers.put(TimeMachine.class, new TimeMachineUnmarshaller());
-    unmarshallers.put(Profile.class, new ProfileUnmarshaller());
-    unmarshallers.put(ManualMeasure.class, new ManualMeasureUnmarshaller());
-    unmarshallers.put(Authentication.class, new AuthenticationUnmarshaller());
-    unmarshallers.put(ResourceSearchResult.class, new ResourceSearchUnmarshaller());
-  }
-
-  public static <M extends Model> Unmarshaller<M> forModel(Class<M> modelClass) {
-    return unmarshallers.get(modelClass);
-  }
-}
diff --git a/server/sonar-ws-client/src/main/java/org/sonar/wsclient/unmarshallers/package-info.java b/server/sonar-ws-client/src/main/java/org/sonar/wsclient/unmarshallers/package-info.java
deleted file mode 100644 (file)
index f3773ea..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-/*
- * SonarQube, open source software quality management tool.
- * Copyright (C) 2008-2014 SonarSource
- * mailto:contact AT sonarsource DOT com
- *
- * SonarQube is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * SonarQube is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-
-@javax.annotation.ParametersAreNonnullByDefault
-package org.sonar.wsclient.unmarshallers;
diff --git a/server/sonar-ws-client/src/main/java/org/sonar/wsclient/user/User.java b/server/sonar-ws-client/src/main/java/org/sonar/wsclient/user/User.java
deleted file mode 100644 (file)
index c7a814f..0000000
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * SonarQube, open source software quality management tool.
- * Copyright (C) 2008-2014 SonarSource
- * mailto:contact AT sonarsource DOT com
- *
- * SonarQube is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * SonarQube is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-package org.sonar.wsclient.user;
-
-import org.sonar.wsclient.unmarshallers.JsonUtils;
-
-import javax.annotation.CheckForNull;
-import java.util.Map;
-
-/**
- * @since 3.6
- */
-public class User {
-  private final Map json;
-
-  public User(Map json) {
-    this.json = json;
-  }
-
-  /**
-   * Unique login
-   */
-  public String login() {
-    return JsonUtils.getString(json, "login");
-  }
-
-  public String name() {
-    return JsonUtils.getString(json, "name");
-  }
-
-  @CheckForNull
-  public String email() {
-    return JsonUtils.getString(json, "email");
-  }
-
-  public boolean active() {
-    return JsonUtils.getBoolean(json, "active") == Boolean.TRUE;
-  }
-}
diff --git a/server/sonar-ws-client/src/main/java/org/sonar/wsclient/user/package-info.java b/server/sonar-ws-client/src/main/java/org/sonar/wsclient/user/package-info.java
deleted file mode 100644 (file)
index 3825e7d..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-/*
- * SonarQube, open source software quality management tool.
- * Copyright (C) 2008-2014 SonarSource
- * mailto:contact AT sonarsource DOT com
- *
- * SonarQube is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * SonarQube is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-
-@javax.annotation.ParametersAreNonnullByDefault
-package org.sonar.wsclient.user;
diff --git a/server/sonar-ws-client/src/test/java/org/sonar/wsclient/BadRulesServlet.java b/server/sonar-ws-client/src/test/java/org/sonar/wsclient/BadRulesServlet.java
deleted file mode 100644 (file)
index 6d47057..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * SonarQube, open source software quality management tool.
- * Copyright (C) 2008-2014 SonarSource
- * mailto:contact AT sonarsource DOT com
- *
- * SonarQube is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * SonarQube is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-package org.sonar.wsclient;
-
-import javax.servlet.GenericServlet;
-import javax.servlet.ServletException;
-import javax.servlet.ServletRequest;
-import javax.servlet.ServletResponse;
-import java.io.IOException;
-import java.io.PrintWriter;
-
-public class BadRulesServlet extends GenericServlet {
-
-  static final String JSON = "[{'foo': 'bar'}]";
-
-  @Override
-  public void service(ServletRequest request, ServletResponse response) throws ServletException, IOException {
-    PrintWriter out = response.getWriter();
-    out.println(JSON);
-  }
-}
diff --git a/server/sonar-ws-client/src/test/java/org/sonar/wsclient/EmptyServlet.java b/server/sonar-ws-client/src/test/java/org/sonar/wsclient/EmptyServlet.java
deleted file mode 100644 (file)
index dedceda..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * SonarQube, open source software quality management tool.
- * Copyright (C) 2008-2014 SonarSource
- * mailto:contact AT sonarsource DOT com
- *
- * SonarQube is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * SonarQube is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-package org.sonar.wsclient;
-
-import javax.servlet.GenericServlet;
-import javax.servlet.ServletException;
-import javax.servlet.ServletRequest;
-import javax.servlet.ServletResponse;
-import java.io.IOException;
-
-public class EmptyServlet extends GenericServlet {
-  @Override
-  public void service(ServletRequest request, ServletResponse response) throws ServletException, IOException {
-    response.getWriter().println("[]");
-  }
-}
diff --git a/server/sonar-ws-client/src/test/java/org/sonar/wsclient/MetricServlet.java b/server/sonar-ws-client/src/test/java/org/sonar/wsclient/MetricServlet.java
deleted file mode 100644 (file)
index 4e41b59..0000000
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * SonarQube, open source software quality management tool.
- * Copyright (C) 2008-2014 SonarSource
- * mailto:contact AT sonarsource DOT com
- *
- * SonarQube is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * SonarQube is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-package org.sonar.wsclient;
-
-import org.apache.commons.io.IOUtils;
-
-import javax.servlet.GenericServlet;
-import javax.servlet.ServletException;
-import javax.servlet.ServletRequest;
-import javax.servlet.ServletResponse;
-import java.io.IOException;
-import java.io.PrintWriter;
-
-public class MetricServlet extends GenericServlet {
-  @Override
-  public void service(ServletRequest request, ServletResponse response) throws ServletException, IOException {
-    PrintWriter out = response.getWriter();
-
-    String json = IOUtils.toString(MetricServlet.class.getResourceAsStream("/metrics/many_metrics.json"));
-    out.println(json);
-  }
-}
diff --git a/server/sonar-ws-client/src/test/java/org/sonar/wsclient/MockHttpServer.java b/server/sonar-ws-client/src/test/java/org/sonar/wsclient/MockHttpServer.java
deleted file mode 100644 (file)
index 34a4352..0000000
+++ /dev/null
@@ -1,113 +0,0 @@
-/*
- * SonarQube, open source software quality management tool.
- * Copyright (C) 2008-2014 SonarSource
- * mailto:contact AT sonarsource DOT com
- *
- * SonarQube is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * SonarQube is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-package org.sonar.wsclient;
-
-import org.eclipse.jetty.server.Handler;
-import org.eclipse.jetty.server.Request;
-import org.eclipse.jetty.server.Server;
-import org.eclipse.jetty.server.handler.AbstractHandler;
-
-import javax.servlet.ServletException;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-import java.io.IOException;
-import java.util.Enumeration;
-import java.util.HashMap;
-import java.util.Map;
-
-import static javax.servlet.http.HttpServletResponse.SC_OK;
-import static org.apache.commons.io.IOUtils.write;
-
-public class MockHttpServer {
-  private Server server;
-  private String responseBody;
-  private int responseStatus = SC_OK;
-  private String requestPath;
-  private Map requestHeaders = new HashMap(), requestParams = new HashMap();
-
-  public void start() throws Exception {
-    // 0 is random available port
-    server = new Server(0);
-    server.setHandler(getMockHandler());
-    server.start();
-  }
-
-  public Handler getMockHandler() {
-    Handler handler = new AbstractHandler() {
-      @Override
-      public void handle(String target, Request baseRequest, HttpServletRequest httpServletRequest, HttpServletResponse response) throws IOException, ServletException {
-        requestPath = baseRequest.getUri().toString();
-        requestHeaders.clear();
-        Enumeration names = baseRequest.getHeaderNames();
-        while (names.hasMoreElements()) {
-          String headerName = (String)names.nextElement();
-          requestHeaders.put(headerName, baseRequest.getHeader(headerName));
-        }
-        requestParams.clear();
-        names = baseRequest.getParameterNames();
-        while (names.hasMoreElements()) {
-          String headerName = (String)names.nextElement();
-          requestParams.put(headerName, baseRequest.getParameter(headerName));
-        }
-        response.setStatus(responseStatus);
-        response.setContentType("application/json;charset=utf-8");
-        write(responseBody, response.getOutputStream());
-        baseRequest.setHandled(true);
-      }
-    };
-    return handler;
-  }
-
-  public void stop() {
-    try {
-      if (server != null) {
-        server.stop();
-      }
-    } catch (Exception e) {
-      throw new IllegalStateException("Fail to stop HTTP server", e);
-    }
-  }
-
-  public MockHttpServer doReturnBody(String responseBody) {
-    this.responseBody = responseBody;
-    return this;
-  }
-
-  public MockHttpServer doReturnStatus(int status) {
-    this.responseStatus = status;
-    return this;
-  }
-
-  public String requestPath() {
-    return requestPath;
-  }
-
-  public Map requestHeaders() {
-    return requestHeaders;
-  }
-
-  public Map requestParams() {
-    return requestParams;
-  }
-
-  public int getPort() {
-    return server.getConnectors()[0].getLocalPort();
-  }
-}
diff --git a/server/sonar-ws-client/src/test/java/org/sonar/wsclient/MockHttpServerInterceptor.java b/server/sonar-ws-client/src/test/java/org/sonar/wsclient/MockHttpServerInterceptor.java
deleted file mode 100644 (file)
index 071bda3..0000000
+++ /dev/null
@@ -1,71 +0,0 @@
-/*
- * SonarQube, open source software quality management tool.
- * Copyright (C) 2008-2014 SonarSource
- * mailto:contact AT sonarsource DOT com
- *
- * SonarQube is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * SonarQube is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-
-package org.sonar.wsclient;
-
-import org.junit.rules.ExternalResource;
-
-import java.util.Map;
-
-public final class MockHttpServerInterceptor extends ExternalResource {
-
-  private MockHttpServer server;
-
-  @Override
-  protected final void before() throws Throwable {
-    server = new MockHttpServer();
-    server.start();
-  }
-
-  @Override
-  protected void after() {
-    server.stop();
-  }
-
-  public MockHttpServerInterceptor stubResponseBody(String body) {
-    server.doReturnBody(body);
-    return this;
-  }
-
-  public MockHttpServerInterceptor stubStatusCode(int status) {
-    server.doReturnStatus(status);
-    return this;
-  }
-
-  public String requestedPath() {
-    return server.requestPath();
-  }
-
-  public Map requestHeaders() {
-    return server.requestHeaders();
-  }
-
-  public Map requestParams() {
-    return server.requestParams();
-  }
-
-  public int port() {
-    return server.getPort();
-  }
-
-  public String url() {
-    return "http://localhost:" + port();
-  }
-}
diff --git a/server/sonar-ws-client/src/test/java/org/sonar/wsclient/ServerServlet.java b/server/sonar-ws-client/src/test/java/org/sonar/wsclient/ServerServlet.java
deleted file mode 100644 (file)
index ecdec14..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * SonarQube, open source software quality management tool.
- * Copyright (C) 2008-2014 SonarSource
- * mailto:contact AT sonarsource DOT com
- *
- * SonarQube is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * SonarQube is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-package org.sonar.wsclient;
-
-import javax.servlet.GenericServlet;
-import javax.servlet.ServletException;
-import javax.servlet.ServletRequest;
-import javax.servlet.ServletResponse;
-import java.io.IOException;
-import java.io.PrintWriter;
-
-/**
- * @author Evgeny Mandrikov
- */
-public class ServerServlet  extends GenericServlet {
-  @Override
-  public void service(ServletRequest request, ServletResponse response) throws ServletException, IOException {
-    PrintWriter out = response.getWriter();
-    out.println("{\"id\":\"123456789\",\"version\":\"2.0\"}");
-  }
-}
diff --git a/server/sonar-ws-client/src/test/java/org/sonar/wsclient/SonarClientTest.java b/server/sonar-ws-client/src/test/java/org/sonar/wsclient/SonarClientTest.java
deleted file mode 100644 (file)
index 5b01598..0000000
+++ /dev/null
@@ -1,165 +0,0 @@
-/*
- * SonarQube, open source software quality management tool.
- * Copyright (C) 2008-2014 SonarSource
- * mailto:contact AT sonarsource DOT com
- *
- * SonarQube is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * SonarQube is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-package org.sonar.wsclient;
-
-import org.junit.Test;
-import org.mockito.ArgumentCaptor;
-import org.sonar.wsclient.internal.HttpRequestFactory;
-import org.sonar.wsclient.issue.internal.DefaultActionPlanClient;
-import org.sonar.wsclient.issue.internal.DefaultIssueClient;
-import org.sonar.wsclient.permissions.internal.DefaultPermissionClient;
-import org.sonar.wsclient.project.internal.DefaultProjectClient;
-import org.sonar.wsclient.qprofile.internal.DefaultQProfileClient;
-import org.sonar.wsclient.qualitygate.internal.DefaultQualityGateClient;
-import org.sonar.wsclient.system.internal.DefaultSystemClient;
-
-import java.util.Map;
-
-import static org.assertj.core.api.Assertions.assertThat;
-import static org.junit.Assert.fail;
-import static org.mockito.Matchers.eq;
-import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.verify;
-
-public class SonarClientTest {
-  @Test
-  public void should_build_clients() {
-    SonarClient client = SonarClient.create("http://localhost:9000");
-    assertThat(client.issueClient()).isNotNull().isInstanceOf(DefaultIssueClient.class);
-    assertThat(client.actionPlanClient()).isNotNull().isInstanceOf(DefaultActionPlanClient.class);
-    assertThat(client.permissionClient()).isNotNull().isInstanceOf(DefaultPermissionClient.class);
-    assertThat(client.projectClient()).isNotNull().isInstanceOf(DefaultProjectClient.class);
-    assertThat(client.qualityGateClient()).isNotNull().isInstanceOf(DefaultQualityGateClient.class);
-    assertThat(client.qProfileClient()).isNotNull().isInstanceOf(DefaultQProfileClient.class);
-    assertThat(client.systemClient()).isNotNull().isInstanceOf(DefaultSystemClient.class);
-  }
-
-  @Test
-  public void url_should_not_be_null() {
-    try {
-      SonarClient.builder().build();
-      fail();
-    } catch (IllegalStateException e) {
-      assertThat(e).hasMessage("Server URL must be set");
-    }
-  }
-
-  @Test
-  public void url_should_not_be_empty() {
-    try {
-      SonarClient.create("");
-      fail();
-    } catch (IllegalStateException e) {
-      assertThat(e).hasMessage("Server URL must be set");
-    }
-  }
-
-  @Test
-  public void test_default_configuration() throws Exception {
-    SonarClient client = SonarClient.create("http://localhost:9000");
-    assertThat(client.requestFactory.getBaseUrl()).isEqualTo("http://localhost:9000");
-    assertThat(client.requestFactory.getLogin()).isNull();
-    assertThat(client.requestFactory.getPassword()).isNull();
-    assertThat(client.requestFactory.getConnectTimeoutInMilliseconds()).isEqualTo(SonarClient.DEFAULT_CONNECT_TIMEOUT_MILLISECONDS);
-    assertThat(client.requestFactory.getReadTimeoutInMilliseconds()).isEqualTo(SonarClient.DEFAULT_READ_TIMEOUT_MILLISECONDS);
-    assertThat(client.requestFactory.getProxyHost()).isNull();
-    assertThat(client.requestFactory.getProxyPort()).isEqualTo(0);
-    assertThat(client.requestFactory.getProxyLogin()).isNull();
-    assertThat(client.requestFactory.getProxyPassword()).isNull();
-
-  }
-
-  @Test
-  public void test_custom_configuration() throws Exception {
-    SonarClient client = SonarClient.builder().url("http://localhost:9000")
-      .login("eric")
-      .password("pass")
-      .connectTimeoutMilliseconds(12345)
-      .readTimeoutMilliseconds(6789)
-      .proxy("localhost", 2052)
-      .proxyLogin("proxyLogin")
-      .proxyPassword("proxyPass")
-      .build();
-    assertThat(client.requestFactory.getBaseUrl()).isEqualTo("http://localhost:9000");
-    assertThat(client.requestFactory.getLogin()).isEqualTo("eric");
-    assertThat(client.requestFactory.getPassword()).isEqualTo("pass");
-    assertThat(client.requestFactory.getConnectTimeoutInMilliseconds()).isEqualTo(12345);
-    assertThat(client.requestFactory.getReadTimeoutInMilliseconds()).isEqualTo(6789);
-    assertThat(client.requestFactory.getProxyHost()).isEqualTo("localhost");
-    assertThat(client.requestFactory.getProxyPort()).isEqualTo(2052);
-    assertThat(client.requestFactory.getProxyLogin()).isEqualTo("proxyLogin");
-    assertThat(client.requestFactory.getProxyPassword()).isEqualTo("proxyPass");
-  }
-
-  @Test
-  public void get() {
-    HttpRequestFactory requestFactory = mock(HttpRequestFactory.class);
-    SonarClient client = new SonarClient(requestFactory);
-
-    client.get("api/foo", "key", "the_key", "max", 10);
-
-    ArgumentCaptor<Map> paramsCapture = ArgumentCaptor.forClass(Map.class);
-    verify(requestFactory).get(eq("api/foo"), paramsCapture.capture());
-    Map params = paramsCapture.getValue();
-    assertThat(params).hasSize(2);
-    assertThat(params).containsEntry("key", "the_key");
-    assertThat(params).containsEntry("max", 10);
-  }
-
-  @Test
-  public void post() {
-    HttpRequestFactory requestFactory = mock(HttpRequestFactory.class);
-    SonarClient client = new SonarClient(requestFactory);
-
-    client.post("api/foo", "max", 10);
-
-    ArgumentCaptor<Map> paramsCapture = ArgumentCaptor.forClass(Map.class);
-    verify(requestFactory).post(eq("api/foo"), paramsCapture.capture());
-    Map params = paramsCapture.getValue();
-    assertThat(params).hasSize(1);
-    assertThat(params).containsEntry("max", 10);
-  }
-
-  @Test
-  public void fail_if_odd_number_arguments() {
-    HttpRequestFactory requestFactory = mock(HttpRequestFactory.class);
-    SonarClient client = new SonarClient(requestFactory);
-
-    try {
-      client.post("api/foo", "max", 10, "min");
-      fail();
-    } catch (IllegalArgumentException e) {
-      assertThat(e).hasMessage("Expecting even number of elements. Got [max, 10, min]");
-    }
-  }
-
-  @Test
-  public void fail_if_null_property_key() {
-    HttpRequestFactory requestFactory = mock(HttpRequestFactory.class);
-    SonarClient client = new SonarClient(requestFactory);
-
-    try {
-      client.post("api/foo", "max", 10, null, 5);
-      fail();
-    } catch (IllegalArgumentException e) {
-      assertThat(e).hasMessage("Parameter key can't be null at index 2 of [max, 10, null, 5]");
-    }
-  }
-}
diff --git a/server/sonar-ws-client/src/test/java/org/sonar/wsclient/SonarTest.java b/server/sonar-ws-client/src/test/java/org/sonar/wsclient/SonarTest.java
deleted file mode 100644 (file)
index 930b245..0000000
+++ /dev/null
@@ -1,125 +0,0 @@
-/*
- * SonarQube, open source software quality management tool.
- * Copyright (C) 2008-2014 SonarSource
- * mailto:contact AT sonarsource DOT com
- *
- * SonarQube is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * SonarQube is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-package org.sonar.wsclient;
-
-import org.eclipse.jetty.testing.ServletTester;
-import org.hamcrest.Matchers;
-import org.junit.AfterClass;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.junit.runners.Parameterized;
-import org.sonar.wsclient.connectors.ConnectionException;
-import org.sonar.wsclient.connectors.HttpClient3Connector;
-import org.sonar.wsclient.connectors.HttpClient4Connector;
-import org.sonar.wsclient.services.Metric;
-import org.sonar.wsclient.services.MetricQuery;
-import org.sonar.wsclient.services.Query;
-import org.sonar.wsclient.services.Server;
-import org.sonar.wsclient.services.ServerQuery;
-
-import java.util.Arrays;
-import java.util.Collection;
-
-import static org.junit.Assert.assertThat;
-
-@RunWith(value = Parameterized.class)
-public class SonarTest {
-
-  private static ServletTester tester;
-  private static String baseUrl;
-  private Sonar sonar;
-
-  public SonarTest(Sonar sonar) {
-    this.sonar = sonar;
-  }
-
-  /**
-   * This kicks off an instance of the Jetty
-   * servlet container so that we can hit it.
-   * We register an echo service that simply
-   * returns the parameters passed to it.
-   */
-  @Parameterized.Parameters
-  public static Collection<Object[]> data() throws Exception {
-    tester = new ServletTester();
-    tester.setContextPath("/");
-    tester.addServlet(ServerServlet.class, "/api/server/index");
-    tester.addServlet(MetricServlet.class, "/api/metrics");
-    tester.addServlet(EmptyServlet.class, "/api/empty");
-    tester.addServlet(BadRulesServlet.class, "/api/rules");
-    baseUrl = tester.createSocketConnector(true);
-    tester.start();
-
-    return Arrays.asList(new Object[][] {
-      {new Sonar(new HttpClient4Connector(new Host(baseUrl)))},
-      {new Sonar(new HttpClient3Connector(new Host(baseUrl)))}
-    });
-  }
-
-  @AfterClass
-  public static void stopServer() throws Exception {
-    tester.stop();
-  }
-
-  @Test
-  public void findAll() {
-    Collection<Metric> metrics = sonar.findAll(MetricQuery.all());
-    assertThat(metrics.size(), Matchers.greaterThan(1));
-  }
-
-  @Test
-  public void findEmptyResults() {
-    Query<Metric> query = new EmptyQuery();
-    Collection<Metric> metrics = sonar.findAll(query);
-    assertThat(metrics.size(), Matchers.is(0));
-  }
-
-  @Test
-  public void returnNullWhenSingleResultNotFound() {
-    Query<Metric> query = new EmptyQuery();
-    assertThat(sonar.find(query), Matchers.nullValue());
-  }
-
-  @Test(expected = ConnectionException.class)
-  public void failWhenConnectionIsClosed() {
-    Sonar fakeSonar = Sonar.create("http://localhost:70");
-    fakeSonar.findAll(MetricQuery.all());
-  }
-
-  @Test
-  public void getVersion() {
-    Server server = sonar.find(new ServerQuery());
-    assertThat(server.getId(), Matchers.is("123456789"));
-    assertThat(server.getVersion(), Matchers.is("2.0"));
-  }
-
-  static class EmptyQuery extends Query<Metric> {
-    @Override
-    public String getUrl() {
-      return "/api/empty";
-    }
-
-    @Override
-    public Class<Metric> getModelClass() {
-      return Metric.class;
-    }
-  }
-
-}
diff --git a/server/sonar-ws-client/src/test/java/org/sonar/wsclient/base/HttpExceptionTest.java b/server/sonar-ws-client/src/test/java/org/sonar/wsclient/base/HttpExceptionTest.java
deleted file mode 100644 (file)
index a45a98f..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * SonarQube, open source software quality management tool.
- * Copyright (C) 2008-2014 SonarSource
- * mailto:contact AT sonarsource DOT com
- *
- * SonarQube is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * SonarQube is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-package org.sonar.wsclient.base;
-
-import org.junit.Test;
-
-import static org.assertj.core.api.Assertions.assertThat;
-
-public class HttpExceptionTest {
-  @Test
-  public void test_exception() throws Exception {
-    HttpException exception = new HttpException("http://localhost:9000/api/search", 500, "Not found");
-    assertThat(exception.status()).isEqualTo(500);
-    assertThat(exception.url()).isEqualTo("http://localhost:9000/api/search");
-    assertThat(exception.getMessage()).isEqualTo("Error 500 on http://localhost:9000/api/search : Not found");
-  }
-}
diff --git a/server/sonar-ws-client/src/test/java/org/sonar/wsclient/internal/EncodingUtilsTest.java b/server/sonar-ws-client/src/test/java/org/sonar/wsclient/internal/EncodingUtilsTest.java
deleted file mode 100644 (file)
index 899a81d..0000000
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
- * SonarQube, open source software quality management tool.
- * Copyright (C) 2008-2014 SonarSource
- * mailto:contact AT sonarsource DOT com
- *
- * SonarQube is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * SonarQube is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-package org.sonar.wsclient.internal;
-
-import org.junit.Test;
-
-import java.util.Date;
-
-import static org.assertj.core.api.Assertions.assertThat;
-import static org.assertj.core.api.Assertions.entry;
-import static org.junit.Assert.fail;
-
-public class EncodingUtilsTest {
-  @Test
-  public void test_date_param() {
-
-    assertThat(EncodingUtils.toQueryParam(new Date(), false)).isNotEmpty().matches("\\d{4}-\\d{2}-\\d{2}");
-    assertThat(EncodingUtils.toQueryParam(new Date(), true)).isNotEmpty();
-  }
-
-  @Test
-  public void test_string_array_param() {
-    assertThat(EncodingUtils.toQueryParam(new String[] {"foo", "bar"})).isEqualTo("foo,bar");
-    assertThat(EncodingUtils.toQueryParam(new String[] {"foo"})).isEqualTo("foo");
-    assertThat(EncodingUtils.toQueryParam(new String[] {""})).isEqualTo("");
-  }
-
-  @Test
-  public void test_toMap() {
-    assertThat(EncodingUtils.toMap()).isEmpty();
-    assertThat(EncodingUtils.toMap("foo", "bar")).hasSize(1).containsEntry("foo", "bar");
-    assertThat(EncodingUtils.toMap("1", "one", "2", "two")).hasSize(2).contains(entry("1", "one"), entry("2", "two"));
-    assertThat(EncodingUtils.toMap("foo", null)).isEmpty();
-  }
-
-  @Test
-  public void toMap_should_fail_if_odd_arguments() {
-    try {
-      EncodingUtils.toMap("foo");
-      fail();
-    } catch (IllegalArgumentException e) {
-      assertThat(e).hasMessage("Not an even number of arguments");
-    }
-  }
-}
diff --git a/server/sonar-ws-client/src/test/java/org/sonar/wsclient/internal/HttpRequestFactoryTest.java b/server/sonar-ws-client/src/test/java/org/sonar/wsclient/internal/HttpRequestFactoryTest.java
deleted file mode 100644 (file)
index 54bd547..0000000
+++ /dev/null
@@ -1,160 +0,0 @@
-/*
- * SonarQube, open source software quality management tool.
- * Copyright (C) 2008-2014 SonarSource
- * mailto:contact AT sonarsource DOT com
- *
- * SonarQube is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * SonarQube is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-package org.sonar.wsclient.internal;
-
-import org.junit.Rule;
-import org.junit.Test;
-import org.sonar.wsclient.MockHttpServerInterceptor;
-import org.sonar.wsclient.issue.IssueClient;
-import org.sonar.wsclient.issue.IssueQuery;
-import org.sonar.wsclient.issue.internal.DefaultIssueClient;
-
-import java.net.ConnectException;
-import java.text.ParseException;
-import java.text.SimpleDateFormat;
-import java.util.Collections;
-import java.util.Date;
-
-import static org.assertj.core.api.Assertions.assertThat;
-import static org.junit.Assert.fail;
-
-public class HttpRequestFactoryTest {
-  @Rule
-  public MockHttpServerInterceptor httpServer = new MockHttpServerInterceptor();
-
-  @Test
-  public void test_get() {
-    httpServer.stubStatusCode(200).stubResponseBody("{'issues': []}");
-
-    HttpRequestFactory factory = new HttpRequestFactory(httpServer.url());
-    String json = factory.get("/api/issues", Collections.<String, Object>emptyMap());
-
-    assertThat(json).isEqualTo("{'issues': []}");
-    assertThat(httpServer.requestedPath()).isEqualTo("/api/issues");
-  }
-
-  @Test
-  public void should_throw_illegal_state_exc_if_connect_exception() {
-    HttpRequestFactory factory = new HttpRequestFactory("http://localhost:1");
-    try {
-      factory.get("/api/issues", Collections.<String, Object>emptyMap());
-      fail();
-    } catch (Exception e) {
-      assertThat(e).isInstanceOf(IllegalStateException.class);
-      assertThat(e).hasMessage("Fail to request http://localhost:1/api/issues");
-      assertThat(e.getCause().getMessage()).matches(".*(Connection refused|Connexion refusée).*");
-    }
-  }
-
-  @Test
-  public void test_post() {
-    httpServer.stubStatusCode(200).stubResponseBody("{}");
-
-    HttpRequestFactory factory = new HttpRequestFactory(httpServer.url());
-    String json = factory.post("/api/issues/change", Collections.<String, Object>emptyMap());
-
-    assertThat(json).isEqualTo("{}");
-    assertThat(httpServer.requestedPath()).isEqualTo("/api/issues/change");
-  }
-
-  @Test
-  public void post_successful_if_created() {
-    httpServer.stubStatusCode(201).stubResponseBody("{}");
-
-    HttpRequestFactory factory = new HttpRequestFactory(httpServer.url());
-    String json = factory.post("/api/issues/change", Collections.<String, Object>emptyMap());
-
-    assertThat(json).isEqualTo("{}");
-    assertThat(httpServer.requestedPath()).isEqualTo("/api/issues/change");
-  }
-
-  @Test
-  public void post_successful_if_no_content() {
-    httpServer.stubStatusCode(204).stubResponseBody("");
-
-    HttpRequestFactory factory = new HttpRequestFactory(httpServer.url());
-    String json = factory.post("/api/issues/change", Collections.<String, Object>emptyMap());
-
-    assertThat(json).isEqualTo("");
-    assertThat(httpServer.requestedPath()).isEqualTo("/api/issues/change");
-  }
-
-  @Test
-  public void test_authentication() {
-    httpServer.stubStatusCode(200).stubResponseBody("{}");
-
-    HttpRequestFactory factory = new HttpRequestFactory(httpServer.url()).setLogin("karadoc").setPassword("legrascestlavie");
-    String json = factory.get("/api/issues", Collections.<String, Object>emptyMap());
-
-    assertThat(json).isEqualTo("{}");
-    assertThat(httpServer.requestedPath()).isEqualTo("/api/issues");
-    assertThat(httpServer.requestHeaders().get("Authorization")).isEqualTo("Basic a2FyYWRvYzpsZWdyYXNjZXN0bGF2aWU=");
-  }
-
-  @Test
-  public void test_proxy() throws Exception {
-    HttpRequestFactory factory = new HttpRequestFactory(httpServer.url())
-      .setProxyHost("localhost").setProxyPort(1)
-      .setProxyLogin("john").setProxyPassword("smith");
-    try {
-      factory.get("/api/issues", Collections.<String, Object>emptyMap());
-      fail();
-    } catch (IllegalStateException e) {
-      // it's not possible to check that the proxy is correctly configured
-      assertThat(e.getCause()).isInstanceOf(ConnectException.class);
-    }
-  }
-
-  @Test
-  public void beginning_slash_is_optional() {
-    HttpRequestFactory factory = new HttpRequestFactory(httpServer.url());
-    factory.get("api/foo", Collections.<String, Object>emptyMap());
-    assertThat(httpServer.requestedPath()).isEqualTo("/api/foo");
-
-    factory.get("/api/bar", Collections.<String, Object>emptyMap());
-    assertThat(httpServer.requestedPath()).isEqualTo("/api/bar");
-  }
-
-  @Test
-  public void should_encode_characters() {
-    HttpRequestFactory requestFactory = new HttpRequestFactory(httpServer.url());
-    httpServer.stubResponseBody("{\"issues\": [{\"key\": \"ABCDE\"}]}");
-
-    IssueClient client = new DefaultIssueClient(requestFactory);
-    client.find(IssueQuery.create().issues("ABC DE"));
-    assertThat(httpServer.requestedPath()).isEqualTo("/api/issues/search?issues=ABC%20DE");
-
-    client.find(IssueQuery.create().issues("ABC+BDE"));
-    assertThat(httpServer.requestedPath()).isEqualTo("/api/issues/search?issues=ABC%2BBDE");
-
-    client.find(IssueQuery.create().createdAfter(toDate("2013-01-01")));
-    // TODO complete assertion with timestamp when test is isolated from default timezone
-    assertThat(httpServer.requestedPath()).startsWith("/api/issues/search?createdAfter=2013-01-01T");
-  }
-
-  protected static Date toDate(String sDate) {
-    try {
-      SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
-      return sdf.parse(sDate);
-    } catch (ParseException e) {
-      throw new RuntimeException(e);
-    }
-  }
-}
diff --git a/server/sonar-ws-client/src/test/java/org/sonar/wsclient/issue/ActionPlanQueryTest.java b/server/sonar-ws-client/src/test/java/org/sonar/wsclient/issue/ActionPlanQueryTest.java
deleted file mode 100644 (file)
index 6a04d8a..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * SonarQube, open source software quality management tool.
- * Copyright (C) 2008-2014 SonarSource
- * mailto:contact AT sonarsource DOT com
- *
- * SonarQube is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * SonarQube is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-
-package org.sonar.wsclient.issue;
-
-import org.junit.Test;
-
-import java.util.Map;
-
-import static org.assertj.core.api.Assertions.assertThat;
-
-public class ActionPlanQueryTest {
-
-  @Test
-  public void test_empty_params() throws Exception {
-    ActionPlanQuery query = ActionPlanQuery.create();
-    Map<String, Object> params = query.urlParams();
-
-    assertThat(params).isEmpty();
-  }
-}
diff --git a/server/sonar-ws-client/src/test/java/org/sonar/wsclient/issue/BulkChangeQueryTest.java b/server/sonar-ws-client/src/test/java/org/sonar/wsclient/issue/BulkChangeQueryTest.java
deleted file mode 100644 (file)
index 68dd900..0000000
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- * SonarQube, open source software quality management tool.
- * Copyright (C) 2008-2014 SonarSource
- * mailto:contact AT sonarsource DOT com
- *
- * SonarQube is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * SonarQube is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-
-package org.sonar.wsclient.issue;
-
-import org.junit.Test;
-
-import static org.assertj.core.api.Assertions.assertThat;
-
-public class BulkChangeQueryTest {
-
-  @Test
-  public void get_all_issues() {
-    BulkChangeQuery query = BulkChangeQuery.create();
-    assertThat(query.urlParams()).isEmpty();
-  }
-
-  @Test
-  public void test_create() {
-    BulkChangeQuery query = BulkChangeQuery.create()
-      .issues("ABCD", "EFGH")
-      .actions("assign")
-      .actionParameter("assign", "assignee", "geoffrey")
-      .comment("My bulk comment")
-      .sendNotifications(false);
-
-    assertThat(query.urlParams()).hasSize(5)
-      .containsEntry("issues", "ABCD,EFGH")
-      .containsEntry("actions", "assign")
-      .containsEntry("assign.assignee", "geoffrey")
-      .containsEntry("comment", "My bulk comment")
-      .containsEntry("sendNotifications", "false");
-  }
-
-  @Test
-  public void should_not_add_null_issues() {
-    BulkChangeQuery query = BulkChangeQuery.create()
-      .issues(null);
-
-    assertThat(query.urlParams()).isEmpty();
-  }
-
-  @Test
-  public void should_not_add_null_actions() {
-    BulkChangeQuery query = BulkChangeQuery.create()
-      .actions(null);
-
-    assertThat(query.urlParams()).isEmpty();
-  }
-
-}
diff --git a/server/sonar-ws-client/src/test/java/org/sonar/wsclient/issue/IssueQueryTest.java b/server/sonar-ws-client/src/test/java/org/sonar/wsclient/issue/IssueQueryTest.java
deleted file mode 100644 (file)
index a13ba3d..0000000
+++ /dev/null
@@ -1,94 +0,0 @@
-/*
- * SonarQube, open source software quality management tool.
- * Copyright (C) 2008-2014 SonarSource
- * mailto:contact AT sonarsource DOT com
- *
- * SonarQube is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * SonarQube is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-package org.sonar.wsclient.issue;
-
-import org.junit.Test;
-
-import java.text.ParseException;
-import java.text.SimpleDateFormat;
-
-import static org.assertj.core.api.Assertions.assertThat;
-
-
-public class IssueQueryTest {
-  @Test
-  public void get_all_issues() {
-    IssueQuery query = IssueQuery.create();
-    assertThat(query.urlParams()).isEmpty();
-  }
-
-  @Test
-  public void get_all_issues_by_parameter() throws ParseException {
-    SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss");
-    IssueQuery query = IssueQuery.create()
-      .issues("ABCDE", "FGHIJ")
-      .assignees("arthur", "perceval")
-      .assigned(true)
-      .planned(true)
-      .components("Action.java", "Filter.java")
-      .onComponentOnly(true)
-      .resolutions("FIXED", "FALSE-POSITIVE")
-      .resolved(true)
-      .hideRules(true)
-      .rules("squid:AvoidCycle")
-      .actionPlans("ABC")
-      .statuses("OPEN", "CLOSED")
-      .severities("BLOCKER", "INFO")
-      .reporters("login1", "login2")
-      .languages("xoo", "java")
-      .createdAt(df.parse("2015-01-02T05:59:50:50"))
-      .createdBefore(df.parse("2015-12-13T05:59:50"))
-      .createdAfter(df.parse("2012-01-23T13:40:50"))
-      .sort("ASSIGNEE")
-      .asc(false)
-      .pageSize(5)
-      .pageIndex(4);
-
-    assertThat(query.urlParams()).hasSize(22);
-    assertThat(query.urlParams()).containsEntry("issues", "ABCDE,FGHIJ");
-    assertThat(query.urlParams()).containsEntry("assignees", "arthur,perceval");
-    assertThat(query.urlParams()).containsEntry("assigned", true);
-    assertThat(query.urlParams()).containsEntry("planned", true);
-    assertThat(query.urlParams()).containsEntry("components", "Action.java,Filter.java");
-    assertThat(query.urlParams()).containsEntry("onComponentOnly", true);
-    assertThat(query.urlParams()).containsEntry("rules", "squid:AvoidCycle");
-    assertThat(query.urlParams()).containsEntry("actionPlans", "ABC");
-    assertThat(query.urlParams()).containsEntry("resolutions", "FIXED,FALSE-POSITIVE");
-    assertThat(query.urlParams()).containsEntry("resolved", true);
-    assertThat(query.urlParams()).containsEntry("hideRules", true);
-    assertThat(query.urlParams()).containsEntry("statuses", "OPEN,CLOSED");
-    assertThat(query.urlParams()).containsEntry("severities", "BLOCKER,INFO");
-    assertThat(query.urlParams()).containsEntry("reporters", "login1,login2");
-    assertThat(query.urlParams()).containsEntry("languages", "xoo,java");
-    assertThat((String) query.urlParams().get("createdBefore")).startsWith("2015-12-13T05:59:50");
-    assertThat((String) query.urlParams().get("createdAfter")).startsWith("2012-01-23T13:40:50");
-    assertThat((String) query.urlParams().get("createdAt")).startsWith("2015-01-02T05:59:50");
-    assertThat(query.urlParams()).containsEntry("sort", "ASSIGNEE");
-    assertThat(query.urlParams()).containsEntry("asc", false);
-    assertThat(query.urlParams()).containsEntry("pageSize", 5);
-    assertThat(query.urlParams()).containsEntry("pageIndex", 4);
-  }
-
-  @Test
-  public void should_ignore_null_values() {
-    IssueQuery query = IssueQuery.create().severities(null);
-    assertThat(query.urlParams()).isEmpty();
-  }
-}
diff --git a/server/sonar-ws-client/src/test/java/org/sonar/wsclient/issue/NewIssueTest.java b/server/sonar-ws-client/src/test/java/org/sonar/wsclient/issue/NewIssueTest.java
deleted file mode 100644 (file)
index da23f49..0000000
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
- * SonarQube, open source software quality management tool.
- * Copyright (C) 2008-2014 SonarSource
- * mailto:contact AT sonarsource DOT com
- *
- * SonarQube is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * SonarQube is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-package org.sonar.wsclient.issue;
-
-import org.junit.Test;
-
-import static org.assertj.core.api.Assertions.assertThat;
-import static org.assertj.core.api.Assertions.entry;
-
-
-public class NewIssueTest {
-  @Test
-  public void test_create_empty() {
-    assertThat(NewIssue.create().urlParams()).isEmpty();
-  }
-
-  @Test
-  public void test_create() {
-    NewIssue newIssue = NewIssue.create()
-      .component("Action.java")
-      .effortToFix(4.2)
-      .message("the message")
-      .line(123)
-      .rule("squid:AvoidCycle")
-      .severity("BLOCKER")
-      .attribute("JIRA", "FOO-123");
-
-    assertThat(newIssue.urlParams()).hasSize(7).contains(
-      entry("component", "Action.java"),
-      entry("effortToFix", 4.2),
-      entry("message", "the message"),
-      entry("line", 123),
-      entry("rule", "squid:AvoidCycle"),
-      entry("severity", "BLOCKER"),
-      entry("attr[JIRA]", "FOO-123")
-    );
-  }
-
-  @Test
-  public void create_with_only_required_parameters() {
-    NewIssue newIssue = NewIssue.create()
-      .component("Action.java")
-      .rule("squid:AvoidCycle");
-
-    assertThat(newIssue.urlParams()).containsOnly(
-      entry("component", "Action.java"),
-      entry("rule", "squid:AvoidCycle")
-    );
-  }
-}
diff --git a/server/sonar-ws-client/src/test/java/org/sonar/wsclient/issue/internal/DefaultActionPlanClientTest.java b/server/sonar-ws-client/src/test/java/org/sonar/wsclient/issue/internal/DefaultActionPlanClientTest.java
deleted file mode 100644 (file)
index 8cb916b..0000000
+++ /dev/null
@@ -1,186 +0,0 @@
-/*
- * SonarQube, open source software quality management tool.
- * Copyright (C) 2008-2014 SonarSource
- * mailto:contact AT sonarsource DOT com
- *
- * SonarQube is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * SonarQube is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-
-package org.sonar.wsclient.issue.internal;
-
-import org.junit.Rule;
-import org.junit.Test;
-import org.sonar.wsclient.MockHttpServerInterceptor;
-import org.sonar.wsclient.base.HttpException;
-import org.sonar.wsclient.internal.HttpRequestFactory;
-import org.sonar.wsclient.issue.ActionPlan;
-import org.sonar.wsclient.issue.ActionPlanClient;
-import org.sonar.wsclient.issue.NewActionPlan;
-import org.sonar.wsclient.issue.UpdateActionPlan;
-
-import java.text.ParseException;
-import java.text.SimpleDateFormat;
-import java.util.Date;
-import java.util.List;
-
-import static org.assertj.core.api.Assertions.assertThat;
-import static org.assertj.core.api.Assertions.entry;
-import static org.junit.Assert.fail;
-
-public class DefaultActionPlanClientTest {
-
-  @Rule
-  public MockHttpServerInterceptor httpServer = new MockHttpServerInterceptor();
-
-  @Test
-  public void should_find_action_plans() {
-    HttpRequestFactory requestFactory = new HttpRequestFactory(httpServer.url());
-    httpServer.stubResponseBody("{\"actionPlans\": [{\"key\": \"382f6f2e-ad9d-424a-b973-9b065e04348a\",\n" +
-      "\"name\": \"Long term\",\n" +
-      "\"desc\": \"Long term acton plan\",\n" +
-      "\"status\": \"CLOSED\",\n" +
-      "\"project\": \"com.sonarsource.it.samples:simple-sample\",\n" +
-      "\"userLogin\": \"admin\",\n" +
-      "\"deadLine\": \"2013-05-30T00:00:00+0200\",\n" +
-      "\"totalIssues\": 3,\n" +
-      "\"unresolvedIssues\": 2,\n" +
-      "\"createdAt\": \"2013-05-13T12:50:29+0200\",\n" +
-      "\"updatedAt\": \"2013-05-13T12:50:44+0200\"}]}");
-
-    ActionPlanClient client = new DefaultActionPlanClient(requestFactory);
-    List<ActionPlan> actionPlans = client.find("com.sonarsource.it.samples:simple-sample");
-
-    assertThat(httpServer.requestedPath()).isEqualTo("/api/action_plans/search?project=com.sonarsource.it.samples:simple-sample");
-    assertThat(actionPlans).hasSize(1);
-    ActionPlan actionPlan = actionPlans.get(0);
-    assertThat(actionPlan.key()).isEqualTo("382f6f2e-ad9d-424a-b973-9b065e04348a");
-    assertThat(actionPlan.name()).isEqualTo("Long term");
-    assertThat(actionPlan.description()).isEqualTo("Long term acton plan");
-    assertThat(actionPlan.project()).isEqualTo("com.sonarsource.it.samples:simple-sample");
-    assertThat(actionPlan.status()).isEqualTo("CLOSED");
-    assertThat(actionPlan.userLogin()).isEqualTo("admin");
-    assertThat(actionPlan.deadLine()).isNotNull();
-    assertThat(actionPlan.totalIssues()).isEqualTo(3);
-    assertThat(actionPlan.unresolvedIssues()).isEqualTo(2);
-    assertThat(actionPlan.createdAt()).isNotNull();
-    assertThat(actionPlan.updatedAt()).isNotNull();
-  }
-
-  @Test
-  public void should_create_action_plan() {
-    HttpRequestFactory requestFactory = new HttpRequestFactory(httpServer.url());
-    httpServer.stubResponseBody("{\"actionPlan\": {\"key\": \"382f6f2e-ad9d-424a-b973-9b065e04348a\"}}");
-
-    ActionPlanClient client = new DefaultActionPlanClient(requestFactory);
-    ActionPlan result = client.create(
-      NewActionPlan.create().name("Short term").project("org.sonar.Sample").description("Short term issues").deadLine(stringToDate("2014-01-01")));
-
-    assertThat(httpServer.requestedPath()).isEqualTo("/api/action_plans/create");
-    assertThat(httpServer.requestParams()).contains(
-      entry("project", "org.sonar.Sample"),
-      entry("description", "Short term issues"),
-      entry("name", "Short term"),
-      entry("deadLine", "2014-01-01")
-      );
-    assertThat(result).isNotNull();
-  }
-
-  @Test
-  public void should_update_action_plan() {
-    HttpRequestFactory requestFactory = new HttpRequestFactory(httpServer.url());
-    httpServer.stubResponseBody("{\"actionPlan\": {\"key\": \"382f6f2e-ad9d-424a-b973-9b065e04348a\"}}");
-
-    ActionPlanClient client = new DefaultActionPlanClient(requestFactory);
-    ActionPlan result = client.update(
-      UpdateActionPlan.create().key("382f6f2e-ad9d-424a-b973-9b065e04348a").name("Short term").description("Short term issues").deadLine(stringToDate("2014-01-01")));
-
-    assertThat(httpServer.requestedPath()).isEqualTo("/api/action_plans/update");
-    assertThat(httpServer.requestParams()).contains(
-      entry("key", "382f6f2e-ad9d-424a-b973-9b065e04348a"),
-      entry("description", "Short term issues"),
-      entry("name", "Short term"),
-      entry("deadLine", "2014-01-01")
-      );
-    assertThat(result).isNotNull();
-  }
-
-  @Test
-  public void should_delete_action_plan() {
-    HttpRequestFactory requestFactory = new HttpRequestFactory(httpServer.url());
-
-    ActionPlanClient client = new DefaultActionPlanClient(requestFactory);
-    client.delete("382f6f2e-ad9d-424a-b973-9b065e04348a");
-
-    assertThat(httpServer.requestedPath()).isEqualTo("/api/action_plans/delete");
-    assertThat(httpServer.requestParams()).contains(
-      entry("key", "382f6f2e-ad9d-424a-b973-9b065e04348a")
-      );
-  }
-
-  @Test
-  public void should_fail_to_delete_action_plan() {
-    HttpRequestFactory requestFactory = new HttpRequestFactory(httpServer.url());
-    httpServer.stubStatusCode(500);
-
-    ActionPlanClient client = new DefaultActionPlanClient(requestFactory);
-    try {
-      client.delete("382f6f2e-ad9d-424a-b973-9b065e04348a");
-      fail();
-    } catch (HttpException e) {
-      assertThat(e.status()).isEqualTo(500);
-      assertThat(e.url()).startsWith("http://localhost");
-      assertThat(e.url()).endsWith("/api/action_plans/delete");
-      assertThat(httpServer.requestParams()).contains(
-        entry("key", "382f6f2e-ad9d-424a-b973-9b065e04348a")
-        );
-    }
-  }
-
-  @Test
-  public void should_open_action_plan() {
-    HttpRequestFactory requestFactory = new HttpRequestFactory(httpServer.url());
-    httpServer.stubResponseBody("{\"actionPlan\": {\"key\": \"382f6f2e-ad9d-424a-b973-9b065e04348a\"}}");
-
-    ActionPlanClient client = new DefaultActionPlanClient(requestFactory);
-    ActionPlan result = client.open("382f6f2e-ad9d-424a-b973-9b065e04348a");
-
-    assertThat(httpServer.requestedPath()).isEqualTo("/api/action_plans/open");
-    assertThat(httpServer.requestParams()).containsEntry("key", "382f6f2e-ad9d-424a-b973-9b065e04348a");
-    assertThat(result).isNotNull();
-  }
-
-  @Test
-  public void should_close_action_plan() {
-    HttpRequestFactory requestFactory = new HttpRequestFactory(httpServer.url());
-    httpServer.stubResponseBody("{\"actionPlan\": {\"key\": \"382f6f2e-ad9d-424a-b973-9b065e04348a\"}}");
-
-    ActionPlanClient client = new DefaultActionPlanClient(requestFactory);
-    ActionPlan result = client.close("382f6f2e-ad9d-424a-b973-9b065e04348a");
-
-    assertThat(httpServer.requestedPath()).isEqualTo("/api/action_plans/close");
-    assertThat(httpServer.requestParams()).containsEntry("key", "382f6f2e-ad9d-424a-b973-9b065e04348a");
-    assertThat(result).isNotNull();
-  }
-
-  private static Date stringToDate(String sDate) {
-    try {
-      SimpleDateFormat sdf = new SimpleDateFormat("yyyy-dd-MM");
-      return sdf.parse(sDate);
-    } catch (ParseException e) {
-      throw new RuntimeException(e);
-    }
-  }
-
-}
diff --git a/server/sonar-ws-client/src/test/java/org/sonar/wsclient/issue/internal/DefaultIssueClientTest.java b/server/sonar-ws-client/src/test/java/org/sonar/wsclient/issue/internal/DefaultIssueClientTest.java
deleted file mode 100644 (file)
index 2ec92b5..0000000
+++ /dev/null
@@ -1,283 +0,0 @@
-/*
- * SonarQube, open source software quality management tool.
- * Copyright (C) 2008-2014 SonarSource
- * mailto:contact AT sonarsource DOT com
- *
- * SonarQube is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * SonarQube is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-package org.sonar.wsclient.issue.internal;
-
-import org.apache.commons.io.IOUtils;
-import org.junit.Rule;
-import org.junit.Test;
-import org.sonar.wsclient.MockHttpServerInterceptor;
-import org.sonar.wsclient.base.HttpException;
-import org.sonar.wsclient.internal.HttpRequestFactory;
-import org.sonar.wsclient.issue.BulkChange;
-import org.sonar.wsclient.issue.BulkChangeQuery;
-import org.sonar.wsclient.issue.Issue;
-import org.sonar.wsclient.issue.IssueClient;
-import org.sonar.wsclient.issue.IssueComment;
-import org.sonar.wsclient.issue.IssueQuery;
-import org.sonar.wsclient.issue.Issues;
-import org.sonar.wsclient.issue.NewIssue;
-
-import java.util.List;
-
-import static org.assertj.core.api.Assertions.assertThat;
-import static org.junit.Assert.fail;
-
-public class DefaultIssueClientTest {
-
-  @Rule
-  public MockHttpServerInterceptor httpServer = new MockHttpServerInterceptor();
-
-  @Test
-  public void should_find_issues() {
-    HttpRequestFactory requestFactory = new HttpRequestFactory(httpServer.url());
-    httpServer.stubResponseBody("{\"issues\": [{\"key\": \"ABCDE\"}]}");
-
-    IssueClient client = new DefaultIssueClient(requestFactory);
-    IssueQuery query = IssueQuery.create().issues("ABCDE");
-    Issues issues = client.find(query);
-
-    assertThat(httpServer.requestedPath()).isEqualTo("/api/issues/search?issues=ABCDE");
-    assertThat(issues.list()).hasSize(1);
-    assertThat(issues.list().get(0).key()).isEqualTo("ABCDE");
-  }
-
-  @Test
-  public void should_fail_to_find_issues() {
-    HttpRequestFactory requestFactory = new HttpRequestFactory(httpServer.url());
-    httpServer.stubStatusCode(500);
-
-    IssueClient client = new DefaultIssueClient(requestFactory);
-    try {
-      client.find(IssueQuery.create());
-      fail();
-    } catch (HttpException e) {
-      assertThat(e.status()).isEqualTo(500);
-      assertThat(e.url()).startsWith("http://localhost");
-      assertThat(e.url()).endsWith("/api/issues/search");
-    }
-  }
-
-  @Test
-  public void should_set_severity() {
-    HttpRequestFactory requestFactory = new HttpRequestFactory(httpServer.url());
-    httpServer.stubResponseBody("{\"issue\": {\"key\": \"ABCDE\"}}");
-
-    IssueClient client = new DefaultIssueClient(requestFactory);
-    Issue result = client.setSeverity("ABCDE", "BLOCKER");
-
-    assertThat(httpServer.requestedPath()).isEqualTo("/api/issues/set_severity");
-    assertThat(httpServer.requestParams())
-      .containsEntry("issue", "ABCDE")
-      .containsEntry("severity", "BLOCKER");
-    assertThat(result).isNotNull();
-  }
-
-  @Test
-  public void should_assign() {
-    HttpRequestFactory requestFactory = new HttpRequestFactory(httpServer.url());
-    httpServer.stubResponseBody("{\"issue\": {\"key\": \"ABCDE\"}}");
-
-    IssueClient client = new DefaultIssueClient(requestFactory);
-    Issue result = client.assign("ABCDE", "emmerik");
-
-    assertThat(httpServer.requestedPath()).isEqualTo("/api/issues/assign");
-    assertThat(httpServer.requestParams())
-      .containsEntry("issue", "ABCDE")
-      .containsEntry("assignee", "emmerik");
-    assertThat(result).isNotNull();
-  }
-
-  @Test
-  public void assign_to_me() {
-    HttpRequestFactory requestFactory = new HttpRequestFactory(httpServer.url());
-    httpServer.stubResponseBody("{\"issue\": {\"key\": \"ABCDE\"}}");
-
-    IssueClient client = new DefaultIssueClient(requestFactory);
-    Issue result = client.assignToMe("ABCDE");
-
-    assertThat(httpServer.requestedPath()).isEqualTo("/api/issues/assign");
-    assertThat(httpServer.requestParams())
-      .containsEntry("issue", "ABCDE")
-      .containsEntry("me", "true");
-    assertThat(result).isNotNull();
-  }
-
-  @Test
-  public void should_unassign() {
-    HttpRequestFactory requestFactory = new HttpRequestFactory(httpServer.url());
-    httpServer.stubResponseBody("{\"issue\": {\"key\": \"ABCDE\"}}");
-
-    IssueClient client = new DefaultIssueClient(requestFactory);
-    Issue result = client.assign("ABCDE", null);
-
-    assertThat(httpServer.requestedPath()).isEqualTo("/api/issues/assign");
-    assertThat(httpServer.requestParams()).containsEntry("issue", "ABCDE");
-    assertThat(result).isNotNull();
-  }
-
-  @Test
-  public void should_plan() {
-    HttpRequestFactory requestFactory = new HttpRequestFactory(httpServer.url());
-    httpServer.stubResponseBody("{\"issue\": {\"key\": \"ABCDE\"}}");
-
-    IssueClient client = new DefaultIssueClient(requestFactory);
-    Issue result = client.plan("ABCDE", "DEFGH");
-
-    assertThat(httpServer.requestedPath()).isEqualTo("/api/issues/plan");
-    assertThat(httpServer.requestParams())
-      .containsEntry("issue", "ABCDE")
-      .containsEntry("plan", "DEFGH");
-    assertThat(result).isNotNull();
-  }
-
-  @Test
-  public void should_unplan() {
-    HttpRequestFactory requestFactory = new HttpRequestFactory(httpServer.url());
-    httpServer.stubResponseBody("{\"issue\": {\"key\": \"ABCDE\"}}");
-
-    IssueClient client = new DefaultIssueClient(requestFactory);
-    Issue result = client.plan("ABCDE", null);
-
-    assertThat(httpServer.requestedPath()).isEqualTo("/api/issues/plan");
-    assertThat(httpServer.requestParams()).containsEntry("issue", "ABCDE");
-    assertThat(result).isNotNull();
-  }
-
-  @Test
-  public void should_create_issue() {
-    HttpRequestFactory requestFactory = new HttpRequestFactory(httpServer.url());
-    httpServer.stubResponseBody("{\"issue\": {\"key\": \"ABCDE\"}}");
-
-    IssueClient client = new DefaultIssueClient(requestFactory);
-    Issue result = client.create(NewIssue.create().component("Action.java").rule("squid:AvoidCycle"));
-
-    assertThat(httpServer.requestedPath()).isEqualTo("/api/issues/create");
-    assertThat(httpServer.requestParams())
-      .containsEntry("component", "Action.java")
-      .containsEntry("rule", "squid:AvoidCycle");
-    assertThat(result).isNotNull();
-  }
-
-  @Test
-  public void should_get_transitions() {
-    HttpRequestFactory requestFactory = new HttpRequestFactory(httpServer.url());
-    httpServer.stubResponseBody("{\n" +
-      "  \"transitions\": [\n" +
-      "    \"resolve\",\n" +
-      "    \"falsepositive\"\n" +
-      "  ]\n" +
-      "}");
-
-    IssueClient client = new DefaultIssueClient(requestFactory);
-    List<String> transitions = client.transitions("ABCDE");
-
-    assertThat(httpServer.requestedPath()).isEqualTo("/api/issues/transitions?issue=ABCDE");
-    assertThat(transitions).hasSize(2);
-    assertThat(transitions).containsOnly("resolve", "falsepositive");
-  }
-
-  @Test
-  public void should_apply_transition() {
-    HttpRequestFactory requestFactory = new HttpRequestFactory(httpServer.url());
-    httpServer.stubResponseBody("{\"issue\": {\"key\": \"ABCDE\"}}");
-
-    IssueClient client = new DefaultIssueClient(requestFactory);
-    Issue result = client.doTransition("ABCDE", "resolve");
-
-    assertThat(httpServer.requestedPath()).isEqualTo("/api/issues/do_transition");
-    assertThat(httpServer.requestParams())
-      .containsEntry("issue", "ABCDE")
-      .containsEntry("transition", "resolve");
-    assertThat(result).isNotNull();
-  }
-
-  @Test
-  public void should_add_comment() throws Exception {
-    HttpRequestFactory requestFactory = new HttpRequestFactory(httpServer.url());
-    httpServer.stubResponseBody(IOUtils.toString(getClass().getResourceAsStream("/org/sonar/wsclient/issue/internal/DefaultIssueClientTest/add_comment_result.json")));
-
-    IssueClient client = new DefaultIssueClient(requestFactory);
-    IssueComment comment = client.addComment("ISSUE-1", "this is my comment");
-
-    assertThat(httpServer.requestedPath()).isEqualTo("/api/issues/add_comment");
-    assertThat(httpServer.requestParams())
-      .containsEntry("issue", "ISSUE-1")
-      .containsEntry("text", "this is my comment");
-    assertThat(comment).isNotNull();
-    assertThat(comment.key()).isEqualTo("COMMENT-123");
-    assertThat(comment.htmlText()).isEqualTo("this is my comment");
-    assertThat(comment.login()).isEqualTo("admin");
-    assertThat(comment.createdAt().getDate()).isEqualTo(18);
-  }
-
-  @Test
-  public void should_get_actions() {
-    HttpRequestFactory requestFactory = new HttpRequestFactory(httpServer.url());
-    httpServer.stubResponseBody("{\n" +
-      "  \"actions\": [\n" +
-      "    \"link-to-jira\",\n" +
-      "    \"tweet\"\n" +
-      "  ]\n" +
-      "}");
-
-    IssueClient client = new DefaultIssueClient(requestFactory);
-    List<String> actions = client.actions("ABCDE");
-
-    assertThat(httpServer.requestedPath()).isEqualTo("/api/issues/actions?issue=ABCDE");
-    assertThat(actions).hasSize(2);
-    assertThat(actions).containsOnly("link-to-jira", "tweet");
-  }
-
-  @Test
-  public void should_apply_action() {
-    HttpRequestFactory requestFactory = new HttpRequestFactory(httpServer.url());
-    httpServer.stubResponseBody("{\"issue\": {\"key\": \"ABCDE\"}}");
-
-    IssueClient client = new DefaultIssueClient(requestFactory);
-    Issue result = client.doAction("ABCDE", "tweet");
-
-    assertThat(httpServer.requestedPath()).isEqualTo("/api/issues/do_action");
-    assertThat(httpServer.requestParams())
-      .containsEntry("issue", "ABCDE")
-      .containsEntry("actionKey", "tweet");
-    assertThat(result).isNotNull();
-  }
-
-  @Test
-  public void should_do_bulk_change() {
-    HttpRequestFactory requestFactory = new HttpRequestFactory(httpServer.url());
-    httpServer.stubResponseBody("{\"issuesChanged\": {\"total\": 2}, \"issuesNotChanged\": {\"total\": 1, \"issues\": [\"06ed4db6-fd96-450a-bcb0-e0184db50105\"]} }");
-
-    BulkChangeQuery query = BulkChangeQuery.create()
-      .issues("ABCD", "EFGH")
-      .actions("assign")
-      .actionParameter("assign", "assignee", "geoffrey");
-
-    IssueClient client = new DefaultIssueClient(requestFactory);
-    BulkChange result = client.bulkChange(query);
-
-    assertThat(httpServer.requestedPath()).isEqualTo("/api/issues/bulk_change");
-    assertThat(httpServer.requestParams())
-      .containsEntry("assign.assignee", "geoffrey")
-      .containsEntry("issues", "ABCD,EFGH")
-      .containsEntry("actions", "assign");
-    assertThat(result).isNotNull();
-  }
-}
diff --git a/server/sonar-ws-client/src/test/java/org/sonar/wsclient/issue/internal/IssueJsonParserTest.java b/server/sonar-ws-client/src/test/java/org/sonar/wsclient/issue/internal/IssueJsonParserTest.java
deleted file mode 100644 (file)
index 4929598..0000000
+++ /dev/null
@@ -1,283 +0,0 @@
-/*
- * SonarQube, open source software quality management tool.
- * Copyright (C) 2008-2014 SonarSource
- * mailto:contact AT sonarsource DOT com
- *
- * SonarQube is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * SonarQube is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-package org.sonar.wsclient.issue.internal;
-
-import org.apache.commons.io.IOUtils;
-import org.junit.Test;
-import org.sonar.wsclient.base.Paging;
-import org.sonar.wsclient.component.Component;
-import org.sonar.wsclient.issue.*;
-import org.sonar.wsclient.user.User;
-
-import java.util.List;
-
-import static org.assertj.core.api.Assertions.assertThat;
-
-public class IssueJsonParserTest {
-
-  @Test
-  public void test_GET_search() throws Exception {
-    String json = IOUtils.toString(getClass().getResourceAsStream("/org/sonar/wsclient/issue/internal/IssueJsonParserTest/search.json"));
-    Issues issues = new IssueJsonParser().parseIssues(json);
-    assertThat(issues).isNotNull();
-    List<Issue> list = issues.list();
-    assertThat(list).hasSize(2);
-    Issue first = list.get(0);
-    assertThat(first.key()).isEqualTo("ABCDE");
-    assertThat(first.componentKey()).isEqualTo("Action.java");
-    assertThat(first.componentId()).isEqualTo(5L);
-    assertThat(first.projectKey()).isEqualTo("struts");
-    assertThat(first.ruleKey()).isEqualTo("squid:CycleBetweenPackages");
-    assertThat(first.severity()).isEqualTo("CRITICAL");
-    assertThat(first.line()).isEqualTo(10);
-    assertThat(first.resolution()).isEqualTo("FIXED");
-    assertThat(first.status()).isEqualTo("OPEN");
-    assertThat(first.assignee()).isEqualTo("karadoc");
-    assertThat(first.message()).isEqualTo("the message");
-    assertThat(first.debt()).isNull();
-    assertThat(first.reporter()).isEqualTo("perceval");
-    assertThat(first.author()).isEqualTo("pirlouis");
-    assertThat(first.actionPlan()).isEqualTo("9450b10c-e725-48b8-bf01-acdec751c491");
-    assertThat(first.creationDate()).isNotNull();
-    assertThat(first.updateDate()).isNotNull();
-    assertThat(first.closeDate()).isNotNull();
-    assertThat(first.attribute("JIRA")).isEqualTo("FOO-1234");
-    assertThat(first.attribute("OTHER")).isNull();
-    assertThat(first.attributes()).hasSize(1);
-    assertThat(first.comments()).isEmpty();
-
-    Issue second = list.get(1);
-    assertThat(second.key()).isEqualTo("FGHIJ");
-    assertThat(second.line()).isNull();
-    assertThat(second.debt()).isNull();
-    assertThat(second.reporter()).isNull();
-    assertThat(second.author()).isNull();
-    assertThat(second.attribute("JIRA")).isNull();
-    assertThat(second.attributes()).isEmpty();
-    assertThat(second.comments()).isEmpty();
-
-    assertThat(issues.rules()).hasSize(2);
-    assertThat(issues.rule(first).key()).isEqualTo("squid:CycleBetweenPackages");
-    assertThat(issues.rule(first).name()).isEqualTo("Avoid cycle between java packages");
-    assertThat(issues.rule(first).description()).contains("When several packages");
-
-    assertThat(issues.paging()).isNotNull();
-    Paging paging = issues.paging();
-    assertThat(paging.pageIndex()).isEqualTo(1);
-    assertThat(paging.pageSize()).isEqualTo(100);
-    assertThat(paging.pages()).isEqualTo(1);
-    assertThat(paging.total()).isEqualTo(2);
-  }
-
-  @Test
-  public void test_GET_empty_search() throws Exception {
-    String json = IOUtils.toString(getClass().getResourceAsStream("/org/sonar/wsclient/issue/internal/IssueJsonParserTest/empty.json"));
-    Issues issues = new IssueJsonParser().parseIssues(json);
-    assertThat(issues).isNotNull();
-    assertThat(issues.list()).isEmpty();
-    assertThat(issues.rules()).isEmpty();
-  }
-
-  @Test
-  public void test_GET_transitions() throws Exception {
-    String json = IOUtils.toString(getClass().getResourceAsStream("/org/sonar/wsclient/issue/internal/IssueJsonParserTest/getTransitions.json"));
-    List<String> transitions = new IssueJsonParser().parseTransitions(json);
-
-    assertThat(transitions).isNotNull();
-    assertThat(transitions).hasSize(2);
-    assertThat(transitions).containsOnly("resolve", "falsepositive");
-  }
-
-  @Test
-  public void parse_comments() throws Exception {
-    String json = IOUtils.toString(getClass().getResourceAsStream("/org/sonar/wsclient/issue/internal/IssueJsonParserTest/issue-with-comments.json"));
-    Issues issues = new IssueJsonParser().parseIssues(json);
-    assertThat(issues.size()).isEqualTo(1);
-
-    Issue issue = issues.list().get(0);
-    assertThat(issue.comments()).hasSize(2);
-
-    IssueComment firstComment = issue.comments().get(0);
-    assertThat(firstComment.key()).isEqualTo("COMMENT-1");
-    assertThat(firstComment.login()).isEqualTo("morgan");
-    assertThat(firstComment.htmlText()).isEqualTo("the first comment");
-    assertThat(firstComment.createdAt().getDate()).isEqualTo(18);
-
-    IssueComment secondComment = issue.comments().get(1);
-    assertThat(secondComment.key()).isEqualTo("COMMENT-2");
-    assertThat(secondComment.login()).isEqualTo("arthur");
-    assertThat(secondComment.htmlText()).isEqualTo("the second comment");
-    assertThat(secondComment.createdAt().getDate()).isEqualTo(19);
-  }
-
-  @Test
-  public void parse_users() throws Exception {
-    String json = IOUtils.toString(getClass().getResourceAsStream("/org/sonar/wsclient/issue/internal/IssueJsonParserTest/issue-with-users.json"));
-    Issues issues = new IssueJsonParser().parseIssues(json);
-
-    assertThat(issues.users()).hasSize(2);
-
-    User morgan = issues.user("morgan");
-    assertThat(morgan.login()).isEqualTo("morgan");
-    assertThat(morgan.name()).isEqualTo("Morgan");
-    assertThat(morgan.active()).isTrue();
-    assertThat(morgan.email()).isEqualTo("mor@gan.bzh");
-
-    User arthur = issues.user("arthur");
-    assertThat(arthur.login()).isEqualTo("arthur");
-    assertThat(arthur.name()).isEqualTo("Arthur");
-    assertThat(arthur.active()).isFalse();
-    assertThat(arthur.email()).isEqualTo("ar@thur.bzh");
-  }
-
-  @Test
-  public void parse_components() throws Exception {
-    String json = IOUtils.toString(getClass().getResourceAsStream("/org/sonar/wsclient/issue/internal/IssueJsonParserTest/issue-with-components.json"));
-    Issues issues = new IssueJsonParser().parseIssues(json);
-
-    assertThat(issues.components()).hasSize(1);
-
-    Component component = issues.component(issues.list().get(0));
-    assertThat(component.key()).isEqualTo("struts:Action.java");
-    assertThat(component.id()).isEqualTo(10L);
-    assertThat(component.qualifier()).isEqualTo("CLA");
-    assertThat(component.name()).isEqualTo("Action");
-    assertThat(component.longName()).isEqualTo("org.struts.Action");
-    assertThat(component.subProjectId()).isEqualTo(2L);
-    assertThat(component.projectId()).isEqualTo(1L);
-
-    assertThat(issues.componentByKey("struts:Action.java").key()).isEqualTo("struts:Action.java");
-    assertThat(issues.componentById(10).key()).isEqualTo("struts:Action.java");
-  }
-
-  @Test
-  public void parse_projects() throws Exception {
-    String json = IOUtils.toString(getClass().getResourceAsStream("/org/sonar/wsclient/issue/internal/IssueJsonParserTest/issue-with-projects.json"));
-    Issues issues = new IssueJsonParser().parseIssues(json);
-
-    assertThat(issues.projects()).hasSize(1);
-
-    Component component = issues.project(issues.list().get(0));
-    assertThat(component.key()).isEqualTo("struts");
-    assertThat(component.qualifier()).isEqualTo("TRK");
-    assertThat(component.name()).isEqualTo("Struts");
-    assertThat(component.longName()).isEqualTo("org.struts");
-  }
-
-  @Test
-  public void parse_action_plans() throws Exception {
-    String json = IOUtils.toString(getClass().getResourceAsStream("/org/sonar/wsclient/issue/internal/IssueJsonParserTest/issue-with-action-plans.json"));
-    Issues issues = new IssueJsonParser().parseIssues(json);
-
-    assertThat(issues.actionPlans()).hasSize(1);
-
-    ActionPlan actionPlan = issues.actionPlans(issues.list().get(0));
-    assertThat(actionPlan.key()).isEqualTo("9450b10c-e725-48b8-bf01-acdec751c491");
-    assertThat(actionPlan.name()).isEqualTo("3.6");
-    assertThat(actionPlan.status()).isEqualTo("OPEN");
-    assertThat(actionPlan.project()).isEqualTo("struts");
-    assertThat(actionPlan.deadLine().getTime()).isEqualTo(1369951200000l);
-    assertThat(actionPlan.createdAt().getTime()).isEqualTo(1369828520000l);
-    assertThat(actionPlan.updatedAt().getTime()).isEqualTo(1369828520000l);
-  }
-
-  @Test
-  public void parse_technical_debt() throws Exception {
-    String json = IOUtils.toString(getClass().getResourceAsStream("/org/sonar/wsclient/issue/internal/IssueJsonParserTest/issue-with-technical-debt.json"));
-    Issues issues = new IssueJsonParser().parseIssues(json);
-    assertThat(issues.size()).isEqualTo(1);
-
-    Issue issue = issues.list().get(0);
-    assertThat(issue.debt()).isEqualTo("3d10min");
-  }
-
-  @Test
-  public void parse_changelog() throws Exception {
-    String json = IOUtils.toString(getClass().getResourceAsStream("/org/sonar/wsclient/issue/internal/IssueJsonParserTest/changelog.json"));
-    List<IssueChange> changes = new IssueJsonParser().parseChangelog(json);
-
-    assertThat(changes).hasSize(2);
-    IssueChange change1 = changes.get(0);
-    assertThat(change1.user()).isEqualTo("julien");
-    assertThat(change1.creationDate().getTime()).isEqualTo(1383202235000l);
-    assertThat(change1.diffs()).hasSize(1);
-    IssueChangeDiff diffChange1 = change1.diffs().get(0);
-    assertThat(diffChange1.key()).isEqualTo("actionPlan");
-    assertThat(diffChange1.newValue()).isEqualTo("1.0");
-    assertThat(diffChange1.oldValue()).isNull();
-
-    IssueChange change2 = changes.get(1);
-    assertThat(change2.user()).isEqualTo("simon");
-    assertThat(change2.creationDate().getTime()).isEqualTo(1383202239000l);
-    assertThat(change2.diffs()).hasSize(2);
-    IssueChangeDiff diff1Change2 = change2.diffs().get(0);
-    assertThat(diff1Change2.key()).isEqualTo("severity");
-    assertThat(diff1Change2.newValue()).isEqualTo("INFO");
-    assertThat(diff1Change2.oldValue()).isEqualTo("BLOCKER");
-    IssueChangeDiff diff2Change2 = change2.diffs().get(1);
-    assertThat(diff2Change2.key()).isEqualTo("status");
-    assertThat(diff2Change2.newValue()).isEqualTo("REOPEN");
-    assertThat(diff2Change2.oldValue()).isEqualTo("RESOLVED");
-  }
-
-  @Test
-  public void parse_changelog_with_technical_debt() throws Exception {
-    String json = IOUtils.toString(getClass().getResourceAsStream("/org/sonar/wsclient/issue/internal/IssueJsonParserTest/changelog-with-technical-debt.json"));
-    List<IssueChange> changes = new IssueJsonParser().parseChangelog(json);
-
-    assertThat(changes).hasSize(1);
-    IssueChange change = changes.get(0);
-    assertThat(change.user()).isEqualTo("julien");
-    assertThat(change.creationDate().getTime()).isEqualTo(1383202235000l);
-
-    assertThat(change.diffs()).hasSize(1);
-    IssueChangeDiff changeDiff = change.diffs().get(0);
-    assertThat(changeDiff.key()).isEqualTo("technicalDebt");
-    assertThat(changeDiff.newValue()).isEqualTo("2d1h");
-    assertThat(changeDiff.oldValue()).isEqualTo("3d10min");
-  }
-
-  @Test
-  public void parse_changelog_with_only_new_technical_debt() throws Exception {
-    String json = IOUtils.toString(getClass().getResourceAsStream("/org/sonar/wsclient/issue/internal/IssueJsonParserTest/changelog-with-only-new-technical-debt.json"));
-    List<IssueChange> changes = new IssueJsonParser().parseChangelog(json);
-
-    assertThat(changes).hasSize(1);
-    IssueChange change = changes.get(0);
-    assertThat(change.user()).isEqualTo("julien");
-    assertThat(change.creationDate().getTime()).isEqualTo(1383202235000l);
-
-    assertThat(change.diffs()).hasSize(1);
-    IssueChangeDiff changeDiff = change.diffs().get(0);
-    assertThat(changeDiff.key()).isEqualTo("technicalDebt");
-    assertThat(changeDiff.newValue()).isEqualTo("2d1h");
-    assertThat(changeDiff.oldValue()).isNull();
-  }
-
-  @Test
-  public void parse_bulk_change() throws Exception {
-    String json = IOUtils.toString(getClass().getResourceAsStream("/org/sonar/wsclient/issue/internal/IssueJsonParserTest/bulk-change.json"));
-    BulkChange bulkChange = new IssueJsonParser().parseBulkChange(json);
-
-    assertThat(bulkChange.totalIssuesChanged()).isEqualTo(3);
-    assertThat(bulkChange.totalIssuesNotChanged()).isEqualTo(2);
-    assertThat(bulkChange.issuesNotChangedKeys()).containsOnly("06ed4db6-fd96-450a-bcb0-e0184db50105", "06ed4db6-fd96-450a-bcb0-e0184db50654");
-  }
-}
diff --git a/server/sonar-ws-client/src/test/java/org/sonar/wsclient/permissions/DefaultPermissionClientTest.java b/server/sonar-ws-client/src/test/java/org/sonar/wsclient/permissions/DefaultPermissionClientTest.java
deleted file mode 100644 (file)
index 8b2eee8..0000000
+++ /dev/null
@@ -1,153 +0,0 @@
-/*
- * SonarQube, open source software quality management tool.
- * Copyright (C) 2008-2014 SonarSource
- * mailto:contact AT sonarsource DOT com
- *
- * SonarQube is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * SonarQube is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-
-package org.sonar.wsclient.permissions;
-
-import org.junit.Before;
-import org.junit.Rule;
-import org.junit.Test;
-import org.sonar.wsclient.MockHttpServerInterceptor;
-import org.sonar.wsclient.internal.HttpRequestFactory;
-import org.sonar.wsclient.permissions.internal.DefaultPermissionClient;
-
-import static org.assertj.core.api.Assertions.assertThat;
-
-public class DefaultPermissionClientTest {
-
-  HttpRequestFactory requestFactory;
-  DefaultPermissionClient client;
-
-  @Rule
-  public MockHttpServerInterceptor httpServer = new MockHttpServerInterceptor();
-
-  @Before
-  public void setUp() {
-    requestFactory = new HttpRequestFactory(httpServer.url());
-    client = new DefaultPermissionClient(requestFactory);
-  }
-
-  @Test
-  public void should_add_global_user_permission() {
-    httpServer.stubStatusCode(200);
-
-    PermissionParameters params = PermissionParameters.create().user("daveloper").permission("admin");
-    client.addPermission(params);
-
-    assertThat(httpServer.requestedPath()).isEqualTo("/api/permissions/add");
-    assertThat(httpServer.requestParams())
-      .containsEntry("user", "daveloper")
-      .containsEntry("permission", "admin");
-  }
-
-  @Test
-  public void should_add_component_user_permission() {
-    httpServer.stubStatusCode(200);
-
-    PermissionParameters params = PermissionParameters.create().user("daveloper").component("org.sample.Sample").permission("admin");
-    client.addPermission(params);
-
-    assertThat(httpServer.requestedPath()).isEqualTo("/api/permissions/add");
-    assertThat(httpServer.requestParams())
-      .containsEntry("user", "daveloper")
-      .containsEntry("component", "org.sample.Sample")
-      .containsEntry("permission", "admin");
-  }
-
-  @Test
-  public void should_add_global_group_permission() {
-    httpServer.stubStatusCode(200);
-
-    PermissionParameters params = PermissionParameters.create().group("my_group").permission("admin");
-    client.addPermission(params);
-
-    assertThat(httpServer.requestedPath()).isEqualTo("/api/permissions/add");
-    assertThat(httpServer.requestParams())
-      .containsEntry("group", "my_group")
-      .containsEntry("permission", "admin");
-  }
-
-  @Test
-  public void should_add_component_group_permission() {
-    httpServer.stubStatusCode(200);
-
-    PermissionParameters params = PermissionParameters.create().group("my_group").component("org.sample.Sample").permission("admin");
-    client.addPermission(params);
-
-    assertThat(httpServer.requestedPath()).isEqualTo("/api/permissions/add");
-    assertThat(httpServer.requestParams())
-      .containsEntry("group", "my_group")
-      .containsEntry("component", "org.sample.Sample")
-      .containsEntry("permission", "admin");
-  }
-
-  @Test
-  public void should_remove_global_user_permission() {
-    httpServer.stubStatusCode(200);
-
-    PermissionParameters params = PermissionParameters.create().user("daveloper").permission("admin");
-    client.removePermission(params);
-
-    assertThat(httpServer.requestedPath()).isEqualTo("/api/permissions/remove");
-    assertThat(httpServer.requestParams())
-      .containsEntry("user", "daveloper")
-      .containsEntry("permission", "admin");
-  }
-
-  @Test
-  public void should_remove_component_user_permission() {
-    httpServer.stubStatusCode(200);
-
-    PermissionParameters params = PermissionParameters.create().user("daveloper").component("org.sample.Sample").permission("admin");
-    client.removePermission(params);
-
-    assertThat(httpServer.requestedPath()).isEqualTo("/api/permissions/remove");
-    assertThat(httpServer.requestParams())
-      .containsEntry("user", "daveloper")
-      .containsEntry("component", "org.sample.Sample")
-      .containsEntry("permission", "admin");
-  }
-
-  @Test
-  public void should_remove_global_group_permission() {
-    httpServer.stubStatusCode(200);
-
-    PermissionParameters params = PermissionParameters.create().group("my_group").permission("admin");
-    client.removePermission(params);
-
-    assertThat(httpServer.requestedPath()).isEqualTo("/api/permissions/remove");
-    assertThat(httpServer.requestParams())
-      .containsEntry("group", "my_group")
-      .containsEntry("permission", "admin");
-  }
-
-  @Test
-  public void should_remove_component_group_permission() {
-    httpServer.stubStatusCode(200);
-
-    PermissionParameters params = PermissionParameters.create().group("my_group").component("org.sample.Sample").permission("admin");
-    client.removePermission(params);
-
-    assertThat(httpServer.requestedPath()).isEqualTo("/api/permissions/remove");
-    assertThat(httpServer.requestParams())
-      .containsEntry("group", "my_group")
-      .containsEntry("component", "org.sample.Sample")
-      .containsEntry("permission", "admin");
-  }
-}
diff --git a/server/sonar-ws-client/src/test/java/org/sonar/wsclient/project/NewProjectTest.java b/server/sonar-ws-client/src/test/java/org/sonar/wsclient/project/NewProjectTest.java
deleted file mode 100644 (file)
index eb01a0b..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * SonarQube, open source software quality management tool.
- * Copyright (C) 2008-2014 SonarSource
- * mailto:contact AT sonarsource DOT com
- *
- * SonarQube is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * SonarQube is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-package org.sonar.wsclient.project;
-
-import org.junit.Test;
-
-import java.util.Map;
-
-import static org.assertj.core.api.Assertions.assertThat;
-
-public class NewProjectTest {
-
-  @Test
-  public void test_empty() throws Exception {
-    assertThat(NewProject.create().urlParams()).isEmpty();
-  }
-
-  @Test
-  public void test_create() throws Exception {
-    String key = "key", name = "name";
-    Map<String, Object> params = NewProject.create().key(key).name(name).urlParams();
-    assertThat(params.get("key")).isEqualTo(key);
-    assertThat(params.get("name")).isEqualTo(name);
-  }
-}
diff --git a/server/sonar-ws-client/src/test/java/org/sonar/wsclient/project/internal/DefaultProjectClientTest.java b/server/sonar-ws-client/src/test/java/org/sonar/wsclient/project/internal/DefaultProjectClientTest.java
deleted file mode 100644 (file)
index 2ee2763..0000000
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * SonarQube, open source software quality management tool.
- * Copyright (C) 2008-2014 SonarSource
- * mailto:contact AT sonarsource DOT com
- *
- * SonarQube is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * SonarQube is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-package org.sonar.wsclient.project.internal;
-
-import org.junit.Rule;
-import org.junit.Test;
-import org.sonar.wsclient.MockHttpServerInterceptor;
-import org.sonar.wsclient.internal.HttpRequestFactory;
-import org.sonar.wsclient.project.NewProject;
-import org.sonar.wsclient.project.Project;
-import org.sonar.wsclient.project.ProjectClient;
-
-import static org.assertj.core.api.Assertions.assertThat;
-import static org.assertj.core.api.Assertions.entry;
-
-public class DefaultProjectClientTest {
-
-  @Rule
-  public MockHttpServerInterceptor httpServer = new MockHttpServerInterceptor();
-
-  @Test
-  public void should_create_project() {
-    HttpRequestFactory requestFactory = new HttpRequestFactory(httpServer.url());
-
-    httpServer.stubResponseBody("{\"id\":\"1\",\"k\":\"polop\",\"nm\":\"Polop\",\"sc\":\"PRJ\",\"qu\":\"TRK\"}");
-
-    ProjectClient client = new DefaultProjectClient(requestFactory);
-    Project result = client.create(NewProject.create().key("polop").name("Polop"));
-
-    assertThat(httpServer.requestedPath()).isEqualTo("/api/projects/create");
-    assertThat(httpServer.requestParams()).contains(
-      entry("key", "polop"),
-      entry("name", "Polop")
-      );
-    assertThat(result).isNotNull();
-
-  }
-}
diff --git a/server/sonar-ws-client/src/test/java/org/sonar/wsclient/qprofile/internal/DefaultQProfileClientTest.java b/server/sonar-ws-client/src/test/java/org/sonar/wsclient/qprofile/internal/DefaultQProfileClientTest.java
deleted file mode 100644 (file)
index c3b987e..0000000
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * SonarQube, open source software quality management tool.
- * Copyright (C) 2008-2014 SonarSource
- * mailto:contact AT sonarsource DOT com
- *
- * SonarQube is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * SonarQube is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-
-package org.sonar.wsclient.qprofile.internal;
-
-import org.junit.Rule;
-import org.junit.Test;
-import org.sonar.wsclient.MockHttpServerInterceptor;
-import org.sonar.wsclient.internal.HttpRequestFactory;
-import org.sonar.wsclient.qprofile.QProfileResult;
-
-import static org.assertj.core.api.Assertions.assertThat;
-
-public class DefaultQProfileClientTest {
-
-  @Rule
-  public MockHttpServerInterceptor httpServer = new MockHttpServerInterceptor();
-
-  @Test
-  public void restore_default_profiles() {
-    HttpRequestFactory requestFactory = new HttpRequestFactory(httpServer.url());
-
-    httpServer.stubResponseBody("{\"infos\":[\"Some info\"],\"warnings\":[\"Some warnings\"]}");
-
-    DefaultQProfileClient client = new DefaultQProfileClient(requestFactory);
-    QProfileResult result = client.restoreDefault("java");
-
-    assertThat(httpServer.requestedPath()).isEqualTo("/api/qualityprofiles/restore_default");
-    assertThat(httpServer.requestParams()).containsEntry("language", "java");
-    assertThat(result).isNotNull();
-    assertThat(result.infos()).containsOnly("Some info");
-    assertThat(result.warnings()).containsOnly("Some warnings");
-  }
-
-}
diff --git a/server/sonar-ws-client/src/test/java/org/sonar/wsclient/qualitygate/internal/DefaultQualityGateClientTest.java b/server/sonar-ws-client/src/test/java/org/sonar/wsclient/qualitygate/internal/DefaultQualityGateClientTest.java
deleted file mode 100644 (file)
index ea4d796..0000000
+++ /dev/null
@@ -1,337 +0,0 @@
-/*
- * SonarQube, open source software quality management tool.
- * Copyright (C) 2008-2014 SonarSource
- * mailto:contact AT sonarsource DOT com
- *
- * SonarQube is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * SonarQube is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-package org.sonar.wsclient.qualitygate.internal;
-
-import org.junit.Rule;
-import org.junit.Test;
-import org.sonar.wsclient.MockHttpServerInterceptor;
-import org.sonar.wsclient.internal.HttpRequestFactory;
-import org.sonar.wsclient.qualitygate.NewCondition;
-import org.sonar.wsclient.qualitygate.QualityGate;
-import org.sonar.wsclient.qualitygate.QualityGateClient;
-import org.sonar.wsclient.qualitygate.QualityGateCondition;
-import org.sonar.wsclient.qualitygate.QualityGateDetails;
-import org.sonar.wsclient.qualitygate.QualityGates;
-import org.sonar.wsclient.qualitygate.UpdateCondition;
-
-import java.net.HttpURLConnection;
-import java.util.Collection;
-import java.util.Iterator;
-
-import static org.assertj.core.api.Assertions.assertThat;
-import static org.assertj.core.api.Assertions.entry;
-
-public class DefaultQualityGateClientTest {
-
-  @Rule
-  public MockHttpServerInterceptor httpServer = new MockHttpServerInterceptor();
-
-  @Test
-  public void should_create_qualitygate() {
-    HttpRequestFactory requestFactory = new HttpRequestFactory(httpServer.url());
-
-    httpServer.stubResponseBody("{\"id\":666,\"name\":\"Ninth\"}");
-
-    QualityGateClient client = new DefaultQualityGateClient(requestFactory);
-    QualityGate result = client.create("Ninth");
-
-    assertThat(httpServer.requestedPath()).isEqualTo("/api/qualitygates/create");
-    assertThat(httpServer.requestParams()).containsEntry("name", "Ninth");
-    assertThat(result).isNotNull();
-    assertThat(result.id()).isEqualTo(666L);
-    assertThat(result.name()).isEqualTo("Ninth");
-  }
-
-  @Test
-  public void should_list_qualitygates() {
-    HttpRequestFactory requestFactory = new HttpRequestFactory(httpServer.url());
-
-    httpServer.stubResponseBody(
-      "{\"qualitygates\":[{\"id\":666,\"name\":\"Ninth\"},{\"id\":42,\"name\":\"Golden\"},{\"id\":43,\"name\":\"Star\"}],\"default\":42}");
-
-    QualityGateClient client = new DefaultQualityGateClient(requestFactory);
-    QualityGates qGates = client.list();
-
-    assertThat(httpServer.requestedPath()).isEqualTo("/api/qualitygates/list");
-    assertThat(httpServer.requestParams()).isEmpty();
-    assertThat(qGates.qualityGates()).hasSize(3);
-    assertThat(qGates.defaultGate().id()).isEqualTo(42L);
-  }
-
-  @Test
-  public void should_list_qualitygates_empty() {
-    HttpRequestFactory requestFactory = new HttpRequestFactory(httpServer.url());
-
-    httpServer.stubResponseBody(
-      "{}");
-
-    QualityGateClient client = new DefaultQualityGateClient(requestFactory);
-    QualityGates qGates = client.list();
-
-    assertThat(httpServer.requestedPath()).isEqualTo("/api/qualitygates/list");
-    assertThat(httpServer.requestParams()).isEmpty();
-    assertThat(qGates.qualityGates()).isEmpty();
-    assertThat(qGates.defaultGate()).isNull();
-  }
-
-  @Test
-  public void should_rename_qualitygate() {
-    HttpRequestFactory requestFactory = new HttpRequestFactory(httpServer.url());
-
-    httpServer.stubResponseBody("{\"id\":666,\"name\":\"Ninth\"}");
-
-    QualityGateClient client = new DefaultQualityGateClient(requestFactory);
-    QualityGate result = client.rename(666L, "Hell");
-
-    assertThat(httpServer.requestedPath()).isEqualTo("/api/qualitygates/rename");
-    assertThat(httpServer.requestParams()).contains(
-      entry("id", "666"),
-      entry("name", "Hell")
-      );
-    assertThat(result).isNotNull();
-  }
-
-  @Test
-  public void should_show_qualitygate_by_id() {
-    HttpRequestFactory requestFactory = new HttpRequestFactory(httpServer.url());
-
-    httpServer.stubResponseBody("{\"id\":5,\"name\":\"Sonar way\",\"conditions\":["
-      + "{\"id\":6,\"metric\":\"blocker_violations\",\"op\":\"GT\",\"warning\":\"\",\"error\":\"0\"},"
-      + "{\"id\":7,\"metric\":\"critical_violations\",\"op\":\"GT\",\"warning\":\"\",\"error\":\"0\"},"
-      + "{\"id\":10,\"metric\":\"test_errors\",\"op\":\"GT\",\"warning\":\"\",\"error\":\"0\"},"
-      + "{\"id\":11,\"metric\":\"test_failures\",\"op\":\"GT\",\"warning\":\"\",\"error\":\"0\"},"
-      + "{\"id\":12,\"metric\":\"new_coverage\",\"op\":\"LT\",\"warning\":\"\",\"error\":\"80%\",\"period\":3},"
-      + "{\"id\":13,\"metric\":\"open_issues\",\"op\":\"GT\",\"warning\":\"0\",\"error\":\"\"},"
-      + "{\"id\":14,\"metric\":\"reopened_issues\",\"op\":\"GT\",\"warning\":\"0\",\"error\":\"\"},"
-      + "{\"id\":15,\"metric\":\"skipped_tests\",\"op\":\"GT\",\"warning\":\"0\",\"error\":\"\"}"
-      + "]}");
-
-    QualityGateClient client = new DefaultQualityGateClient(requestFactory);
-
-    QualityGateDetails qGate = client.show(5L);
-    assertThat(httpServer.requestedPath()).isEqualTo("/api/qualitygates/show?id=5");
-    assertThat(qGate.id()).isEqualTo(5L);
-    assertThat(qGate.name()).isEqualTo("Sonar way");
-
-    Collection<QualityGateCondition> conditions = qGate.conditions();
-    assertThat(conditions).hasSize(8);
-    Iterator<QualityGateCondition> condIterator = conditions.iterator();
-    QualityGateCondition first = condIterator.next();
-    assertThat(first.id()).isEqualTo(6L);
-    QualityGateCondition second = condIterator.next();
-    assertThat(second.period()).isNull();
-    QualityGateCondition third = condIterator.next();
-    assertThat(third.metricKey()).isEqualTo("test_errors");
-    QualityGateCondition fourth = condIterator.next();
-    assertThat(fourth.operator()).isEqualTo("GT");
-    QualityGateCondition fifth = condIterator.next();
-    assertThat(fifth.errorThreshold()).isEqualTo("80%");
-    assertThat(fifth.period()).isEqualTo(3);
-    QualityGateCondition sixth = condIterator.next();
-    assertThat(sixth.warningThreshold()).isEqualTo("0");
-  }
-
-  @Test
-  public void should_show_qualitygate_by_name() {
-    HttpRequestFactory requestFactory = new HttpRequestFactory(httpServer.url());
-
-    httpServer.stubResponseBody("{\"id\":5,\"name\":\"Sonar way\",\"conditions\":["
-      + "{\"id\":6,\"metric\":\"blocker_violations\",\"op\":\"GT\",\"warning\":\"\",\"error\":\"0\"},"
-      + "{\"id\":7,\"metric\":\"critical_violations\",\"op\":\"GT\",\"warning\":\"\",\"error\":\"0\"},"
-      + "{\"id\":10,\"metric\":\"test_errors\",\"op\":\"GT\",\"warning\":\"\",\"error\":\"0\"},"
-      + "{\"id\":11,\"metric\":\"test_failures\",\"op\":\"GT\",\"warning\":\"\",\"error\":\"0\"},"
-      + "{\"id\":12,\"metric\":\"new_coverage\",\"op\":\"LT\",\"warning\":\"\",\"error\":\"80%\",\"period\":3},"
-      + "{\"id\":13,\"metric\":\"open_issues\",\"op\":\"GT\",\"warning\":\"0\",\"error\":\"\"},"
-      + "{\"id\":14,\"metric\":\"reopened_issues\",\"op\":\"GT\",\"warning\":\"0\",\"error\":\"\"},"
-      + "{\"id\":15,\"metric\":\"skipped_tests\",\"op\":\"GT\",\"warning\":\"0\",\"error\":\"\"}"
-      + "]}");
-
-    QualityGateClient client = new DefaultQualityGateClient(requestFactory);
-
-    QualityGateDetails qGate = client.show("Sonar way");
-    assertThat(httpServer.requestedPath()).isEqualTo("/api/qualitygates/show?name=Sonar%20way");
-    assertThat(qGate.id()).isEqualTo(5L);
-    assertThat(qGate.name()).isEqualTo("Sonar way");
-
-    Collection<QualityGateCondition> conditions = qGate.conditions();
-    assertThat(conditions).hasSize(8);
-    Iterator<QualityGateCondition> condIterator = conditions.iterator();
-    QualityGateCondition first = condIterator.next();
-    assertThat(first.id()).isEqualTo(6L);
-    QualityGateCondition second = condIterator.next();
-    assertThat(second.period()).isNull();
-    QualityGateCondition third = condIterator.next();
-    assertThat(third.metricKey()).isEqualTo("test_errors");
-    QualityGateCondition fourth = condIterator.next();
-    assertThat(fourth.operator()).isEqualTo("GT");
-    QualityGateCondition fifth = condIterator.next();
-    assertThat(fifth.errorThreshold()).isEqualTo("80%");
-    assertThat(fifth.period()).isEqualTo(3);
-    QualityGateCondition sixth = condIterator.next();
-    assertThat(sixth.warningThreshold()).isEqualTo("0");
-  }
-
-  @Test
-  public void should_show_empty_qualitygate_by_id() {
-    HttpRequestFactory requestFactory = new HttpRequestFactory(httpServer.url());
-
-    httpServer.stubResponseBody("{\"id\":5,\"name\":\"Sonar way\"}");
-
-    QualityGateClient client = new DefaultQualityGateClient(requestFactory);
-
-    QualityGateDetails qGate = client.show(5L);
-    assertThat(httpServer.requestedPath()).isEqualTo("/api/qualitygates/show?id=5");
-    assertThat(qGate.id()).isEqualTo(5L);
-    assertThat(qGate.name()).isEqualTo("Sonar way");
-
-    Collection<QualityGateCondition> conditions = qGate.conditions();
-    assertThat(conditions).isEmpty();
-  }
-
-  @Test
-  public void should_destroy_qualitygate() {
-    HttpRequestFactory requestFactory = new HttpRequestFactory(httpServer.url());
-
-    httpServer.stubStatusCode(HttpURLConnection.HTTP_NO_CONTENT);
-
-    QualityGateClient client = new DefaultQualityGateClient(requestFactory);
-    client.destroy(666L);
-
-    assertThat(httpServer.requestedPath()).isEqualTo("/api/qualitygates/destroy");
-    assertThat(httpServer.requestParams()).containsEntry("id", "666");
-  }
-
-  @Test
-  public void should_set_default_qualitygate() {
-    HttpRequestFactory requestFactory = new HttpRequestFactory(httpServer.url());
-
-    httpServer.stubStatusCode(HttpURLConnection.HTTP_NO_CONTENT);
-
-    QualityGateClient client = new DefaultQualityGateClient(requestFactory);
-    client.setDefault(666L);
-
-    assertThat(httpServer.requestedPath()).isEqualTo("/api/qualitygates/set_as_default");
-    assertThat(httpServer.requestParams()).containsEntry("id", "666");
-  }
-
-  @Test
-  public void should_unset_default_qualitygate() {
-    HttpRequestFactory requestFactory = new HttpRequestFactory(httpServer.url());
-
-    httpServer.stubStatusCode(HttpURLConnection.HTTP_NO_CONTENT);
-
-    QualityGateClient client = new DefaultQualityGateClient(requestFactory);
-    client.unsetDefault();
-
-    assertThat(httpServer.requestedPath()).isEqualTo("/api/qualitygates/unset_default");
-    assertThat(httpServer.requestParams()).isEmpty();
-  }
-
-  @Test
-  public void should_create_condition_on_qualitygate() {
-    HttpRequestFactory requestFactory = new HttpRequestFactory(httpServer.url());
-
-    httpServer.stubResponseBody("{\"id\":42,\"metric\":\"new_coverage\",\"op\":\"LT\",\"warning\":\"90\",\"error\":\"80\",\"period\":3}");
-
-    QualityGateClient client = new DefaultQualityGateClient(requestFactory);
-    QualityGateCondition result = client.createCondition(NewCondition.create(12345L)
-      .metricKey("new_coverage").operator("LT").warningThreshold("90").errorThreshold("80").period(3));
-
-    assertThat(httpServer.requestedPath()).isEqualTo("/api/qualitygates/create_condition");
-    assertThat(httpServer.requestParams()).contains(
-      entry("gateId", "12345"),
-      entry("metric", "new_coverage"),
-      entry("op", "LT"),
-      entry("warning", "90"),
-      entry("error", "80"),
-      entry("period", "3")
-      );
-    assertThat(result).isNotNull();
-    assertThat(result.id()).isEqualTo(42L);
-  }
-
-  @Test
-  public void should_update_condition() {
-    HttpRequestFactory requestFactory = new HttpRequestFactory(httpServer.url());
-
-    httpServer.stubResponseBody("{\"id\":12345,\"metric\":\"ncloc\",\"op\":\"GT\",\"warning\":\"1000\",\"error\":\"2000\",\"period\":1}");
-
-    QualityGateClient client = new DefaultQualityGateClient(requestFactory);
-    QualityGateCondition result = client.updateCondition(UpdateCondition.create(12345L)
-      .metricKey("ncloc").operator("GT").warningThreshold("1000").errorThreshold("2000").period(1));
-
-    assertThat(httpServer.requestedPath()).isEqualTo("/api/qualitygates/update_condition");
-    assertThat(httpServer.requestParams()).contains(
-      entry("id", "12345"),
-      entry("metric", "ncloc"),
-      entry("op", "GT"),
-      entry("warning", "1000"),
-      entry("error", "2000"),
-      entry("period", "1")
-      );
-    assertThat(result).isNotNull();
-    assertThat(result.id()).isEqualTo(12345L);
-  }
-
-  @Test
-  public void should_delete_condition() {
-    HttpRequestFactory requestFactory = new HttpRequestFactory(httpServer.url());
-
-    httpServer.stubStatusCode(HttpURLConnection.HTTP_NO_CONTENT);
-
-    QualityGateClient client = new DefaultQualityGateClient(requestFactory);
-    client.deleteCondition(666L);
-
-    assertThat(httpServer.requestedPath()).isEqualTo("/api/qualitygates/delete_condition");
-    assertThat(httpServer.requestParams()).containsEntry("id", "666");
-  }
-
-  @Test
-  public void should_select_project() {
-    HttpRequestFactory requestFactory = new HttpRequestFactory(httpServer.url());
-
-    httpServer.stubStatusCode(HttpURLConnection.HTTP_NO_CONTENT);
-
-    QualityGateClient client = new DefaultQualityGateClient(requestFactory);
-    client.selectProject(666L, 999L);
-
-    assertThat(httpServer.requestedPath()).isEqualTo("/api/qualitygates/select");
-    assertThat(httpServer.requestParams()).contains(
-      entry("gateId", "666"),
-      entry("projectId", "999")
-      );
-  }
-
-  @Test
-  public void should_deselect_project() {
-    HttpRequestFactory requestFactory = new HttpRequestFactory(httpServer.url());
-
-    httpServer.stubStatusCode(HttpURLConnection.HTTP_NO_CONTENT);
-
-    QualityGateClient client = new DefaultQualityGateClient(requestFactory);
-    client.deselectProject(666L, 999L);
-
-    assertThat(httpServer.requestedPath()).isEqualTo("/api/qualitygates/deselect");
-    assertThat(httpServer.requestParams()).contains(
-      entry("gateId", "666"),
-      entry("projectId", "999")
-      );
-  }
-}
diff --git a/server/sonar-ws-client/src/test/java/org/sonar/wsclient/services/AbstractQueryTest.java b/server/sonar-ws-client/src/test/java/org/sonar/wsclient/services/AbstractQueryTest.java
deleted file mode 100644 (file)
index f77016d..0000000
+++ /dev/null
@@ -1,113 +0,0 @@
-/*
- * SonarQube, open source software quality management tool.
- * Copyright (C) 2008-2014 SonarSource
- * mailto:contact AT sonarsource DOT com
- *
- * SonarQube is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * SonarQube is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-package org.sonar.wsclient.services;
-
-import org.junit.AfterClass;
-import org.junit.BeforeClass;
-import org.junit.Test;
-import org.sonar.wsclient.JdkUtils;
-
-import java.text.ParseException;
-import java.text.SimpleDateFormat;
-import java.util.Date;
-
-import static junit.framework.Assert.assertEquals;
-import static org.assertj.core.api.Assertions.assertThat;
-
-public class AbstractQueryTest {
-
-  @BeforeClass
-  public static void before() {
-    WSUtils.setInstance(new JdkUtils());
-  }
-
-  @AfterClass
-  public static void after() {
-    WSUtils.setInstance(null);
-  }
-
-  @Test
-  public void appendSpecialChars() {
-    StringBuilder url = new StringBuilder();
-    AbstractQuery.appendUrlParameter(url, "foo", "should escape []()");
-    assertEquals("foo=should+escape+%5B%5D%28%29&", url.toString());
-  }
-
-  @Test
-  public void appendSpecialCharsInArray() {
-    StringBuilder url = new StringBuilder();
-    AbstractQuery.appendUrlParameter(url, "foo", new String[]{"should escape", "[]()"});
-    assertEquals("foo=should+escape,%5B%5D%28%29&", url.toString());
-  }
-
-  @Test
-  public void appendUrlParameter() {
-    StringBuilder url = new StringBuilder();
-    AbstractQuery.appendUrlParameter(url, "foo", "bar");
-    assertEquals("foo=bar&", url.toString());
-    AbstractQuery.appendUrlParameter(url, "foo2", "bar2");
-    assertEquals("foo=bar&foo2=bar2&", url.toString());
-  }
-
-  @Test
-  public void appendUrlBooleanParameter() {
-    StringBuilder url = new StringBuilder();
-    AbstractQuery.appendUrlParameter(url, "foo", Boolean.TRUE);
-    assertEquals("foo=true&", url.toString());
-  }
-
-  @Test
-  public void appendUrlIntParameter() {
-    StringBuilder url = new StringBuilder();
-    AbstractQuery.appendUrlParameter(url, "foo", 9);
-    assertEquals("foo=9&", url.toString());
-  }
-
-  @Test
-  public void appendUrlArrayParameter() {
-    StringBuilder url = new StringBuilder();
-    AbstractQuery.appendUrlParameter(url, "foo", new String[]{"bar", "bar2"});
-    assertEquals("foo=bar,bar2&", url.toString());
-  }
-
-  @Test
-  public void appendUrlNullParameter() {
-    StringBuilder url = new StringBuilder();
-    AbstractQuery.appendUrlParameter(url, "foo", null);
-    assertEquals("", url.toString());
-  }
-
-  @Test
-  public void appendUrlDateParameter() throws ParseException {
-    StringBuilder url = new StringBuilder();
-    Date date = new SimpleDateFormat("dd/MM/yyyy").parse("25/12/2009");
-    AbstractQuery.appendUrlParameter(url, "date", date, false);
-    assertEquals("date=2009-12-25&", url.toString());
-  }
-
-  @Test
-  public void appendUrlDateTimeParameter() throws ParseException {
-    StringBuilder url = new StringBuilder();
-    Date date = new SimpleDateFormat("dd/MM/yyyy HH:mm").parse("25/12/2009 15:59");
-    AbstractQuery.appendUrlParameter(url, "date", date, true);
-    // TODO complete assertion with timestamp when test is isolated from default timezone
-    assertThat(url.toString()).startsWith("date=2009-12-25T");
-  }
-}
diff --git a/server/sonar-ws-client/src/test/java/org/sonar/wsclient/services/AuthenticationQueryTest.java b/server/sonar-ws-client/src/test/java/org/sonar/wsclient/services/AuthenticationQueryTest.java
deleted file mode 100644 (file)
index d667080..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * SonarQube, open source software quality management tool.
- * Copyright (C) 2008-2014 SonarSource
- * mailto:contact AT sonarsource DOT com
- *
- * SonarQube is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * SonarQube is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-package org.sonar.wsclient.services;
-
-import org.junit.Test;
-
-import static org.assertj.core.api.Assertions.assertThat;
-
-public class AuthenticationQueryTest extends QueryTestCase {
-  @Test
-  public void should_query_right_url() {
-    AuthenticationQuery query = new AuthenticationQuery();
-
-    assertThat(query.getUrl()).isEqualTo("/api/authentication/validate");
-    assertThat(query.getModelClass().getName()).isEqualTo(Authentication.class.getName());
-  }
-}
diff --git a/server/sonar-ws-client/src/test/java/org/sonar/wsclient/services/AuthenticationTest.java b/server/sonar-ws-client/src/test/java/org/sonar/wsclient/services/AuthenticationTest.java
deleted file mode 100644 (file)
index cfd9df6..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * SonarQube, open source software quality management tool.
- * Copyright (C) 2008-2014 SonarSource
- * mailto:contact AT sonarsource DOT com
- *
- * SonarQube is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * SonarQube is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-package org.sonar.wsclient.services;
-
-import org.junit.Test;
-
-import static org.assertj.core.api.Assertions.assertThat;
-
-public class AuthenticationTest {
-
-  @Test
-  public void should_set_valid_state() {
-    assertThat(new Authentication().isValid()).isFalse();
-    assertThat(new Authentication().setValid(false).isValid()).isFalse();
-    assertThat(new Authentication().setValid(true).isValid()).isTrue();
-  }
-}
diff --git a/server/sonar-ws-client/src/test/java/org/sonar/wsclient/services/EventQueryTest.java b/server/sonar-ws-client/src/test/java/org/sonar/wsclient/services/EventQueryTest.java
deleted file mode 100644 (file)
index 307c569..0000000
+++ /dev/null
@@ -1,99 +0,0 @@
-/*
- * SonarQube, open source software quality management tool.
- * Copyright (C) 2008-2014 SonarSource
- * mailto:contact AT sonarsource DOT com
- *
- * SonarQube is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * SonarQube is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-package org.sonar.wsclient.services;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
-
-import java.util.Date;
-
-import org.junit.Test;
-
-public final class EventQueryTest extends QueryTestCase {
-
-  @Test
-  public void from() {
-    EventQuery query = new EventQuery();
-    query.setResourceKey("key");
-    Date from = new Date();
-    query.setFrom(from, true);
-    assertEquals(from, query.getFrom());
-    assertEquals(true, query.isIncludeFromTime());
-  }
-
-  @Test
-  public void to() {
-    EventQuery query = new EventQuery();
-    query.setResourceKey("key");
-    Date to = new Date();
-    query.setTo(to, true);
-    assertEquals(to, query.getTo());
-    assertEquals(true, query.isIncludeToTime());
-  }
-
-  @Test
-  public void urlWithTime() {
-    EventQuery query = new EventQuery("key");
-    query.setCategories(new String[] { "category" });
-    Date date = new Date();
-    query.setTo(date, true);
-    query.setFrom(date, true);
-
-    assertNotNull(query.getResourceKey());
-    assertNotNull(query.getCategories());
-
-    String url = query.getUrl();
-    assertNotNull(url);
-    assertTrue(url.contains("fromDateTime"));
-    assertTrue(url.contains("toDateTime"));
-  }
-
-  @Test
-  public void urlWithoutTime() {
-    EventQuery query = new EventQuery("key");
-    query.setCategories(new String[] { "category" });
-    Date date = new Date();
-    query.setTo(date, false);
-    query.setFrom(date, false);
-
-    final String url = query.getUrl();
-    assertNotNull(url);
-    assertFalse(url.contains("fromDateTime"));
-    assertFalse(url.contains("toDateTime"));
-    assertTrue(url.contains("fromDate"));
-    assertTrue(url.contains("toDate"));
-  }
-
-  @Test
-  public void urlWithoutDate() {
-    EventQuery query = new EventQuery("key");
-    query.setCategories(new String[] { "category" });
-
-    final String url = query.getUrl();
-    assertNotNull(url);
-    assertFalse(url.contains("fromDateTime"));
-    assertFalse(url.contains("toDateTime"));
-    assertFalse(url.contains("fromDate"));
-    assertFalse(url.contains("toDate"));
-  }
-
-}
diff --git a/server/sonar-ws-client/src/test/java/org/sonar/wsclient/services/ManualMeasureCreateQueryTest.java b/server/sonar-ws-client/src/test/java/org/sonar/wsclient/services/ManualMeasureCreateQueryTest.java
deleted file mode 100644 (file)
index 2e1ae00..0000000
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * SonarQube, open source software quality management tool.
- * Copyright (C) 2008-2014 SonarSource
- * mailto:contact AT sonarsource DOT com
- *
- * SonarQube is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * SonarQube is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-package org.sonar.wsclient.services;
-
-import org.junit.Test;
-
-import static org.hamcrest.core.Is.is;
-import static org.junit.Assert.assertThat;
-
-public class ManualMeasureCreateQueryTest extends QueryTestCase {
-
-  @Test
-  public void shouldCreateWithOnlyMandatoryProperties() {
-    ManualMeasureCreateQuery query = ManualMeasureCreateQuery.create("foo", "team_size");
-    assertThat(query.getUrl(), is("/api/manual_measures?resource=foo&metric=team_size&"));
-    assertThat(query.getModelClass().getName(), is(ManualMeasure.class.getName()));
-  }
-
-  @Test
-  public void shouldCreateWithAllOptionalProperties() {
-    ManualMeasureCreateQuery query = ManualMeasureCreateQuery.create("foo", "burned_budget").setValue(3.14).setTextValue("xxx").setDescription("yyy");
-    assertThat(query.getUrl(), is("/api/manual_measures?resource=foo&metric=burned_budget&val=3.14&text=xxx&desc=yyy&"));
-    assertThat(query.getModelClass().getName(), is(ManualMeasure.class.getName()));
-  }
-
-  @Test
-  public void shouldSetIntValue() {
-    ManualMeasureCreateQuery query = ManualMeasureCreateQuery.create("foo", "team_size").setIntValue(45);
-    assertThat(query.getUrl(), is("/api/manual_measures?resource=foo&metric=team_size&val=45&"));
-    assertThat(query.getModelClass().getName(), is(ManualMeasure.class.getName()));
-  }
-}
diff --git a/server/sonar-ws-client/src/test/java/org/sonar/wsclient/services/ManualMeasureDeleteQueryTest.java b/server/sonar-ws-client/src/test/java/org/sonar/wsclient/services/ManualMeasureDeleteQueryTest.java
deleted file mode 100644 (file)
index 006e00d..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * SonarQube, open source software quality management tool.
- * Copyright (C) 2008-2014 SonarSource
- * mailto:contact AT sonarsource DOT com
- *
- * SonarQube is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * SonarQube is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-package org.sonar.wsclient.services;
-
-import org.junit.Test;
-
-import static org.hamcrest.core.Is.is;
-import static org.junit.Assert.assertThat;
-
-public class ManualMeasureDeleteQueryTest extends QueryTestCase {
-
-  @Test
-  public void delete() {
-    ManualMeasureDeleteQuery query = ManualMeasureDeleteQuery.create("foo", "team_size");
-    assertThat(query.getUrl(), is("/api/manual_measures?resource=foo&metric=team_size&"));
-  }
-}
diff --git a/server/sonar-ws-client/src/test/java/org/sonar/wsclient/services/ManualMeasureQueryTest.java b/server/sonar-ws-client/src/test/java/org/sonar/wsclient/services/ManualMeasureQueryTest.java
deleted file mode 100644 (file)
index 56487aa..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * SonarQube, open source software quality management tool.
- * Copyright (C) 2008-2014 SonarSource
- * mailto:contact AT sonarsource DOT com
- *
- * SonarQube is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * SonarQube is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-package org.sonar.wsclient.services;
-
-import org.junit.Test;
-
-import static org.hamcrest.core.Is.is;
-import static org.junit.Assert.assertThat;
-
-public class ManualMeasureQueryTest extends QueryTestCase {
-
-  @Test
-  public void shouldGetAllResourceMeasures() {
-    ManualMeasureQuery query = ManualMeasureQuery.create("foo");
-    assertThat(query.getUrl(), is("/api/manual_measures?resource=foo&"));
-    assertThat(query.getModelClass().getName(), is(ManualMeasure.class.getName()));
-  }
-
-  @Test
-  public void shouldFilterMetric() {
-    ManualMeasureQuery query = ManualMeasureQuery.create("foo").setMetricKey("burned_budget");
-    assertThat(query.getUrl(), is("/api/manual_measures?resource=foo&metric=burned_budget&"));
-  }
-}
diff --git a/server/sonar-ws-client/src/test/java/org/sonar/wsclient/services/MeasureTest.java b/server/sonar-ws-client/src/test/java/org/sonar/wsclient/services/MeasureTest.java
deleted file mode 100644 (file)
index 34a020e..0000000
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * SonarQube, open source software quality management tool.
- * Copyright (C) 2008-2014 SonarSource
- * mailto:contact AT sonarsource DOT com
- *
- * SonarQube is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * SonarQube is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-package org.sonar.wsclient.services;
-
-import org.junit.Test;
-
-import java.util.Iterator;
-import java.util.Map;
-
-import static org.hamcrest.Matchers.nullValue;
-import static org.hamcrest.core.Is.is;
-import static org.junit.Assert.assertThat;
-
-public class MeasureTest {
-
-  @Test
-  public void getDataAsMap() {
-    Measure measure = new Measure().setData("foo=1,bar=2,hello=3");
-    Map<String,String> map = measure.getDataAsMap();
-    assertThat(map.get("foo"), is("1"));
-    assertThat(map.get("bar"), is("2"));
-    assertThat(map.get("hello"), is("3"));
-    assertThat(map.get("unknown"), nullValue());
-
-    // sorted map
-    Iterator<String> keys = map.keySet().iterator();
-    assertThat(keys.next(), is("foo"));
-    assertThat(keys.next(), is("bar"));
-    assertThat(keys.next(), is("hello"));
-    assertThat(keys.hasNext(), is(false));
-  }
-}
diff --git a/server/sonar-ws-client/src/test/java/org/sonar/wsclient/services/MetricCreateQueryTest.java b/server/sonar-ws-client/src/test/java/org/sonar/wsclient/services/MetricCreateQueryTest.java
deleted file mode 100644 (file)
index 227f313..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * SonarQube, open source software quality management tool.
- * Copyright (C) 2008-2014 SonarSource
- * mailto:contact AT sonarsource DOT com
- *
- * SonarQube is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * SonarQube is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-package org.sonar.wsclient.services;
-
-import org.junit.Test;
-
-import static org.assertj.core.api.Assertions.assertThat;
-
-public class MetricCreateQueryTest extends QueryTestCase {
-
-  @Test
-  public void should_create() {
-    MetricCreateQuery query = MetricCreateQuery.create("key").setName("name").setDescription("description").setDomain("domain").setType("type");
-    assertThat(query.getUrl()).isEqualTo("/api/metrics/key?name=name&description=description&domain=domain&val_type=type&");
-    assertThat(query.getModelClass().getName()).isEqualTo(Metric.class.getName());
-  }
-
-}
diff --git a/server/sonar-ws-client/src/test/java/org/sonar/wsclient/services/MetricDeleteQueryTest.java b/server/sonar-ws-client/src/test/java/org/sonar/wsclient/services/MetricDeleteQueryTest.java
deleted file mode 100644 (file)
index 4c7af3b..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * SonarQube, open source software quality management tool.
- * Copyright (C) 2008-2014 SonarSource
- * mailto:contact AT sonarsource DOT com
- *
- * SonarQube is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * SonarQube is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-package org.sonar.wsclient.services;
-
-import org.junit.Test;
-
-import static org.assertj.core.api.Assertions.assertThat;
-
-public class MetricDeleteQueryTest extends QueryTestCase {
-
-  @Test
-  public void should_delete() {
-    MetricDeleteQuery query = MetricDeleteQuery.delete("key");
-    assertThat(query.getUrl()).isEqualTo("/api/metrics/key");
-  }
-}
diff --git a/server/sonar-ws-client/src/test/java/org/sonar/wsclient/services/MetricQueryTest.java b/server/sonar-ws-client/src/test/java/org/sonar/wsclient/services/MetricQueryTest.java
deleted file mode 100644 (file)
index df63e04..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * SonarQube, open source software quality management tool.
- * Copyright (C) 2008-2014 SonarSource
- * mailto:contact AT sonarsource DOT com
- *
- * SonarQube is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * SonarQube is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-package org.sonar.wsclient.services;
-
-import static org.hamcrest.core.Is.is;
-import static org.junit.Assert.assertThat;
-
-import org.junit.Test;
-
-public class MetricQueryTest extends QueryTestCase {
-
-  @Test
-  public void all() {
-    assertThat(MetricQuery.all().getUrl(), is("/api/metrics?"));
-    assertThat(MetricQuery.all().getModelClass().getName(), is(Metric.class.getName()));
-  }
-
-  @Test
-  public void byKey() {
-    assertThat(MetricQuery.byKey("ncloc").getUrl(), is("/api/metrics/ncloc?"));
-    assertThat(MetricQuery.byKey("ncloc").getModelClass().getName(), is(Metric.class.getName()));
-  }
-
-}
diff --git a/server/sonar-ws-client/src/test/java/org/sonar/wsclient/services/MetricUpdateQueryTest.java b/server/sonar-ws-client/src/test/java/org/sonar/wsclient/services/MetricUpdateQueryTest.java
deleted file mode 100644 (file)
index f5baf38..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * SonarQube, open source software quality management tool.
- * Copyright (C) 2008-2014 SonarSource
- * mailto:contact AT sonarsource DOT com
- *
- * SonarQube is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * SonarQube is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-package org.sonar.wsclient.services;
-
-import org.junit.Test;
-
-import static org.assertj.core.api.Assertions.assertThat;
-
-public class MetricUpdateQueryTest extends QueryTestCase {
-
-  @Test
-  public void should_update() {
-    MetricUpdateQuery query = MetricUpdateQuery.update("key").setName("name").setDescription("description").setDomain("domain").setType("type");
-    assertThat(query.getUrl()).isEqualTo("/api/metrics/key?name=name&description=description&domain=domain&val_type=type&");
-    assertThat(query.getBody()).isEqualTo("description");
-    assertThat(query.getModelClass().getName()).isEqualTo(Metric.class.getName());
-  }
-
-}
diff --git a/server/sonar-ws-client/src/test/java/org/sonar/wsclient/services/PropertyCreateQueryTest.java b/server/sonar-ws-client/src/test/java/org/sonar/wsclient/services/PropertyCreateQueryTest.java
deleted file mode 100644 (file)
index 6646112..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * SonarQube, open source software quality management tool.
- * Copyright (C) 2008-2014 SonarSource
- * mailto:contact AT sonarsource DOT com
- *
- * SonarQube is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * SonarQube is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-package org.sonar.wsclient.services;
-
-import static org.hamcrest.core.Is.is;
-import static org.junit.Assert.assertThat;
-
-import org.junit.Test;
-
-public class PropertyCreateQueryTest extends QueryTestCase {
-
-  @Test
-  public void create() {
-    PropertyCreateQuery query = new PropertyCreateQuery("foo", "bar");
-    assertThat(query.getUrl(), is("/api/properties?id=foo&value=bar&"));
-    assertThat(query.getModelClass().getName(), is(Property.class.getName()));
-  }
-
-  @Test
-  public void createForResource() {
-    PropertyCreateQuery query = new PropertyCreateQuery("foo", "bar", "my:resource");
-    assertThat(query.getUrl(), is("/api/properties?id=foo&value=bar&resource=my%3Aresource&"));
-    assertThat(query.getModelClass().getName(), is(Property.class.getName()));
-  }
-}
diff --git a/server/sonar-ws-client/src/test/java/org/sonar/wsclient/services/PropertyDeleteQueryTest.java b/server/sonar-ws-client/src/test/java/org/sonar/wsclient/services/PropertyDeleteQueryTest.java
deleted file mode 100644 (file)
index a52a6d9..0000000
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * SonarQube, open source software quality management tool.
- * Copyright (C) 2008-2014 SonarSource
- * mailto:contact AT sonarsource DOT com
- *
- * SonarQube is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * SonarQube is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-package org.sonar.wsclient.services;
-
-import static org.hamcrest.core.Is.is;
-import static org.junit.Assert.assertThat;
-
-import org.junit.Test;
-
-public class PropertyDeleteQueryTest extends QueryTestCase {
-
-  @Test
-  public void delete() {
-    PropertyDeleteQuery query = new PropertyDeleteQuery("foo");
-    assertThat(query.getUrl(), is("/api/properties/foo?"));
-  }
-
-  @Test
-  public void deleteResourceProp() {
-    PropertyDeleteQuery query = new PropertyDeleteQuery("foo", "my:resource");
-    assertThat(query.getUrl(), is("/api/properties/foo?resource=my%3Aresource&"));
-  }
-}
diff --git a/server/sonar-ws-client/src/test/java/org/sonar/wsclient/services/PropertyQueryTest.java b/server/sonar-ws-client/src/test/java/org/sonar/wsclient/services/PropertyQueryTest.java
deleted file mode 100644 (file)
index 93bed83..0000000
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * SonarQube, open source software quality management tool.
- * Copyright (C) 2008-2014 SonarSource
- * mailto:contact AT sonarsource DOT com
- *
- * SonarQube is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * SonarQube is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-package org.sonar.wsclient.services;
-
-import org.junit.Test;
-
-import static org.hamcrest.core.Is.is;
-import static org.junit.Assert.assertThat;
-
-public class PropertyQueryTest extends QueryTestCase {
-
-  @Test
-  public void test_global_properties() {
-    PropertyQuery query = PropertyQuery.createForAll();
-    assertThat(query.getUrl(), is("/api/properties?"));
-    assertThat(query.getModelClass().getName(), is(Property.class.getName()));
-  }
-
-  @Test
-  public void test_project_properties() {
-    PropertyQuery query = PropertyQuery.createForAll().setResourceKeyOrId("org.apache:struts");
-    assertThat(query.getUrl(), is("/api/properties?resource=org.apache%3Astruts&"));
-    assertThat(query.getModelClass().getName(), is(Property.class.getName()));
-  }
-
-  @Test
-  public void test_global_property() {
-    PropertyQuery query = PropertyQuery.createForKey("myprop");
-    assertThat(query.getUrl(), is("/api/properties/myprop?"));
-    assertThat(query.getModelClass().getName(), is(Property.class.getName()));
-  }
-
-  @Test
-  public void test_project_property() {
-    PropertyQuery query = PropertyQuery.createForResource("myprop", "my:resource");
-    assertThat(query.getUrl(), is("/api/properties/myprop?resource=my%3Aresource&"));
-    assertThat(query.getModelClass().getName(), is(Property.class.getName()));
-  }
-}
diff --git a/server/sonar-ws-client/src/test/java/org/sonar/wsclient/services/QueryTestCase.java b/server/sonar-ws-client/src/test/java/org/sonar/wsclient/services/QueryTestCase.java
deleted file mode 100644 (file)
index 4172675..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * SonarQube, open source software quality management tool.
- * Copyright (C) 2008-2014 SonarSource
- * mailto:contact AT sonarsource DOT com
- *
- * SonarQube is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * SonarQube is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-package org.sonar.wsclient.services;
-
-import org.junit.BeforeClass;
-import org.sonar.wsclient.JdkUtils;
-
-public abstract class QueryTestCase {
-
-  @BeforeClass
-  public static void setupWsUtils() {
-    // WSUtils is called during getUrl()
-    // It has to be initialized.
-    WSUtils.setInstance(new JdkUtils());
-  }
-
-}
diff --git a/server/sonar-ws-client/src/test/java/org/sonar/wsclient/services/ResourceQueryTest.java b/server/sonar-ws-client/src/test/java/org/sonar/wsclient/services/ResourceQueryTest.java
deleted file mode 100644 (file)
index c9ca840..0000000
+++ /dev/null
@@ -1,98 +0,0 @@
-/*
- * SonarQube, open source software quality management tool.
- * Copyright (C) 2008-2014 SonarSource
- * mailto:contact AT sonarsource DOT com
- *
- * SonarQube is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * SonarQube is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-package org.sonar.wsclient.services;
-
-import org.junit.Test;
-
-import static org.assertj.core.api.Assertions.assertThat;
-
-public class ResourceQueryTest extends QueryTestCase {
-
-  @Test
-  public void resource() {
-    ResourceQuery query = new ResourceQuery("org.foo:bar");
-    assertThat(query.getUrl()).isEqualTo(("/api/resources?resource=org.foo%3Abar&verbose=false&"));
-    assertThat(query.getResourceKeyOrId()).isEqualTo(("org.foo:bar"));
-    assertThat(query.isVerbose()).isEqualTo((false));
-  }
-
-  @Test
-  public void measures() {
-    ResourceQuery query = new ResourceQuery();
-    query.setMetrics("loc", "coverage", "lines");
-    assertThat(query.getUrl()).isEqualTo(("/api/resources?metrics=loc,coverage,lines&verbose=false&"));
-    assertThat(query.getResourceKeyOrId()).isNull();
-    assertThat(query.getMetrics()).isEqualTo((new String[]{"loc", "coverage", "lines"}));
-  }
-
-  @Test
-  public void measuresWithTrends() {
-    ResourceQuery query = new ResourceQuery();
-    query.setIncludeTrends(true);
-
-    assertThat(query.getUrl()).isEqualTo(("/api/resources?includetrends=true&verbose=false&"));
-  }
-
-  @Test
-  public void measuresWithAlerts() {
-    ResourceQuery query = new ResourceQuery();
-    query.setIncludeAlerts(true);
-
-    assertThat(query.getUrl()).isEqualTo(("/api/resources?includealerts=true&verbose=false&"));
-  }
-
-  @Test
-  public void measuresOnRules() {
-    ResourceQuery query = new ResourceQuery().setMetrics("violations");
-    query.setRules("ruleA", "ruleB");
-    assertThat(query.getUrl()).isEqualTo(("/api/resources?metrics=violations&rules=ruleA,ruleB&verbose=false&"));
-  }
-
-  @Test
-  public void measuresOnRulePriorities() {
-    ResourceQuery query = new ResourceQuery().setMetrics("violations");
-    query.setRuleSeverities("MAJOR", "MINOR");
-
-    assertThat(query.getUrl()).isEqualTo(("/api/resources?metrics=violations&rule_priorities=MAJOR,MINOR&verbose=false&"));
-  }
-
-  @Test
-  public void should_create_query() {
-    ResourceQuery query = ResourceQuery.createForMetrics("org.foo", "ncloc", "lines");
-    assertThat(query.getResourceKeyOrId()).isEqualTo(("org.foo"));
-    assertThat(query.getMetrics()).isEqualTo((new String[]{"ncloc", "lines"}));
-  }
-
-  @Test
-  public void should_create_query_from_resource() {
-    ResourceQuery query = ResourceQuery.createForResource(new Resource().setId(1), "ncloc");
-    assertThat(query.getResourceKeyOrId()).isEqualTo("1");
-    assertThat(query.getUrl()).isEqualTo("/api/resources?resource=1&metrics=ncloc&verbose=false&");
-  }
-
-  @Test
-  public void should_not_create_query_from_resource_without_id() {
-    try {
-      ResourceQuery.createForResource(new Resource());
-    } catch (Exception e) {
-      assertThat(e).isInstanceOf(IllegalArgumentException.class);
-    }
-  }
-}
diff --git a/server/sonar-ws-client/src/test/java/org/sonar/wsclient/services/ResourceSearchQueryTest.java b/server/sonar-ws-client/src/test/java/org/sonar/wsclient/services/ResourceSearchQueryTest.java
deleted file mode 100644 (file)
index 5debed6..0000000
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * SonarQube, open source software quality management tool.
- * Copyright (C) 2008-2014 SonarSource
- * mailto:contact AT sonarsource DOT com
- *
- * SonarQube is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * SonarQube is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-package org.sonar.wsclient.services;
-
-import org.junit.Test;
-
-import static org.hamcrest.core.Is.is;
-import static org.junit.Assert.assertThat;
-
-public class ResourceSearchQueryTest extends QueryTestCase {
-
-  @Test
-  public void test_url() {
-    ResourceSearchQuery query = ResourceSearchQuery.create("commons");
-    assertThat(query.getUrl(), is("/api/resources/search?s=commons&"));
-    assertThat(query.getModelClass().getName(), is(ResourceSearchResult.class.getName()));
-  }
-
-  @Test
-  public void test_encode_url_search_param() {
-    ResourceSearchQuery query = ResourceSearchQuery.create("commons logging");
-    assertThat(query.getUrl(), is("/api/resources/search?s=commons+logging&"));
-    assertThat(query.getModelClass().getName(), is(ResourceSearchResult.class.getName()));
-  }
-
-  @Test
-  public void test_optional_parameters() {
-    ResourceSearchQuery query = ResourceSearchQuery.create("commons");
-    query.setPage(5);
-    query.setPageSize(20);
-    query.setQualifiers("TRK", "BRC");
-    assertThat(query.getUrl(), is("/api/resources/search?s=commons&p=5&ps=20&q=TRK,BRC&"));
-  }
-}
diff --git a/server/sonar-ws-client/src/test/java/org/sonar/wsclient/services/ResourceTest.java b/server/sonar-ws-client/src/test/java/org/sonar/wsclient/services/ResourceTest.java
deleted file mode 100644 (file)
index ad0a6b0..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * SonarQube, open source software quality management tool.
- * Copyright (C) 2008-2014 SonarSource
- * mailto:contact AT sonarsource DOT com
- *
- * SonarQube is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * SonarQube is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-package org.sonar.wsclient.services;
-
-import org.junit.Test;
-
-import static org.hamcrest.Matchers.is;
-import static org.hamcrest.Matchers.nullValue;
-import static org.junit.Assert.assertThat;
-
-public class ResourceTest {
-
-  @Test
-  public void doNotReturnNullMeasures() {
-    assertThat(new Resource().getMeasures().isEmpty(), is(true));
-    assertThat(new Resource().getMeasure("loc"), nullValue());
-    assertThat(new Resource().getMeasureIntValue("loc"), nullValue());
-    assertThat(new Resource().getMeasureValue("loc"), nullValue());
-  }
-}
diff --git a/server/sonar-ws-client/src/test/java/org/sonar/wsclient/services/ServerQueryTest.java b/server/sonar-ws-client/src/test/java/org/sonar/wsclient/services/ServerQueryTest.java
deleted file mode 100644 (file)
index c8c01c8..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * SonarQube, open source software quality management tool.
- * Copyright (C) 2008-2014 SonarSource
- * mailto:contact AT sonarsource DOT com
- *
- * SonarQube is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * SonarQube is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-package org.sonar.wsclient.services;
-
-import static org.hamcrest.Matchers.is;
-import static org.junit.Assert.assertThat;
-
-import org.junit.Test;
-
-public class ServerQueryTest extends QueryTestCase {
-  @Test
-  public void index() {
-    ServerQuery query = new ServerQuery();
-    assertThat(query.getUrl(), is("/api/server/index"));
-    assertThat(query.getModelClass().getName(), is(Server.class.getName()));
-  }
-}
diff --git a/server/sonar-ws-client/src/test/java/org/sonar/wsclient/services/ServerSetupQueryTest.java b/server/sonar-ws-client/src/test/java/org/sonar/wsclient/services/ServerSetupQueryTest.java
deleted file mode 100644 (file)
index 1863a7f..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * SonarQube, open source software quality management tool.
- * Copyright (C) 2008-2014 SonarSource
- * mailto:contact AT sonarsource DOT com
- *
- * SonarQube is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * SonarQube is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-package org.sonar.wsclient.services;
-
-import org.junit.Test;
-
-import static org.assertj.core.api.Assertions.assertThat;
-
-public class ServerSetupQueryTest extends QueryTestCase {
-  @Test
-  public void index() {
-    ServerSetupQuery query = new ServerSetupQuery();
-    assertThat(query.getUrl()).isEqualTo("/api/server/setup");
-    assertThat(query.getModelClass().getName()).isEqualTo(ServerSetup.class.getName());
-  }
-}
diff --git a/server/sonar-ws-client/src/test/java/org/sonar/wsclient/services/SourceQueryTest.java b/server/sonar-ws-client/src/test/java/org/sonar/wsclient/services/SourceQueryTest.java
deleted file mode 100644 (file)
index 60d174b..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * SonarQube, open source software quality management tool.
- * Copyright (C) 2008-2014 SonarSource
- * mailto:contact AT sonarsource DOT com
- *
- * SonarQube is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * SonarQube is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-package org.sonar.wsclient.services;
-
-import org.junit.Test;
-
-import static org.hamcrest.core.Is.is;
-import static org.junit.Assert.assertThat;
-
-public class SourceQueryTest extends QueryTestCase {
-
-  @Test
-  public void create() {
-    assertThat(SourceQuery.create("myproject:org.foo.Bar").getUrl(), is("/api/sources?resource=myproject%3Aorg.foo.Bar&"));
-    assertThat(SourceQuery.create("myproject:org.foo.Bar").getModelClass().getName(), is(Source.class.getName()));
-  }
-
-  @Test
-  public void getOnlyAFewLines() {
-    assertThat(SourceQuery.create("myproject:org.foo.Bar").setFromLineToLine(10, 30).getUrl(),
-        is("/api/sources?resource=myproject%3Aorg.foo.Bar&from=10&to=30&"));
-    assertThat(SourceQuery.create("myproject:org.foo.Bar").setLinesFromLine(10, 20).getUrl(),
-        is("/api/sources?resource=myproject%3Aorg.foo.Bar&from=10&to=30&"));
-  }
-}
diff --git a/server/sonar-ws-client/src/test/java/org/sonar/wsclient/services/TimeMachineQueryTest.java b/server/sonar-ws-client/src/test/java/org/sonar/wsclient/services/TimeMachineQueryTest.java
deleted file mode 100644 (file)
index 70ab0e1..0000000
+++ /dev/null
@@ -1,78 +0,0 @@
-/*
- * SonarQube, open source software quality management tool.
- * Copyright (C) 2008-2014 SonarSource
- * mailto:contact AT sonarsource DOT com
- *
- * SonarQube is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * SonarQube is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-package org.sonar.wsclient.services;
-
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-import org.sonar.wsclient.JdkUtils;
-
-import java.text.ParseException;
-import java.text.SimpleDateFormat;
-import java.util.Date;
-import java.util.TimeZone;
-
-import static org.assertj.core.api.Assertions.assertThat;
-
-public class TimeMachineQueryTest extends QueryTestCase {
-
-  private TimeZone systemTimeZone;
-
-  @Before
-  public void before() {
-    systemTimeZone = TimeZone.getDefault();
-    TimeZone.setDefault(TimeZone.getTimeZone("GMT"));
-    WSUtils.setInstance(new JdkUtils());
-  }
-
-  @After
-  public void after() {
-    TimeZone.setDefault(systemTimeZone);
-  }
-
-  @Test
-  public void should_get_url() {
-    TimeMachineQuery query = TimeMachineQuery.createForMetrics("12345", "ncloc", "coverage");
-    assertThat(query.getUrl()).isEqualTo("/api/timemachine?resource=12345&metrics=ncloc,coverage&");
-  }
-
-  @Test
-  public void should_set_period() throws ParseException {
-    Date from = new SimpleDateFormat("yyyy-MM-dd").parse("2010-02-18");
-    Date to = new SimpleDateFormat("yyyy-MM-dd HH:mm").parse("2010-03-25 14:59");
-    TimeMachineQuery query = TimeMachineQuery.createForMetrics("12345", "ncloc").setFrom(from).setTo(to);
-    assertThat(query.getUrl()).isEqualTo(
-        "/api/timemachine?resource=12345&metrics=ncloc&fromDateTime=2010-02-18T00%3A00%3A00%2B0000&toDateTime=2010-03-25T14%3A59%3A00%2B0000&");
-  }
-
-  @Test
-  public void should_create_query_from_resource() {
-    TimeMachineQuery query = TimeMachineQuery.createForMetrics(new Resource().setId(1), "ncloc");
-    assertThat(query.getUrl()).isEqualTo("/api/timemachine?resource=1&metrics=ncloc&");  }
-
-  @Test
-  public void should_not_create_query_from_resource_without_id() {
-    try {
-      TimeMachineQuery.createForMetrics(new Resource());
-    } catch (Exception e) {
-      assertThat(e).isInstanceOf(IllegalArgumentException.class);
-    }
-  }
-}
diff --git a/server/sonar-ws-client/src/test/java/org/sonar/wsclient/services/UpdateCenterQueryTest.java b/server/sonar-ws-client/src/test/java/org/sonar/wsclient/services/UpdateCenterQueryTest.java
deleted file mode 100644 (file)
index 150b681..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * SonarQube, open source software quality management tool.
- * Copyright (C) 2008-2014 SonarSource
- * mailto:contact AT sonarsource DOT com
- *
- * SonarQube is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * SonarQube is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-package org.sonar.wsclient.services;
-
-import static org.hamcrest.Matchers.is;
-import static org.junit.Assert.assertThat;
-
-import org.junit.Test;
-
-public class UpdateCenterQueryTest extends QueryTestCase {
-
-  @Test
-  public void index() {
-    UpdateCenterQuery query = UpdateCenterQuery.createForInstalledPlugins();
-    assertThat(query.getUrl(), is("/api/updatecenter/installed_plugins"));
-  }
-
-}
diff --git a/server/sonar-ws-client/src/test/java/org/sonar/wsclient/services/UserPropertyCreateQueryTest.java b/server/sonar-ws-client/src/test/java/org/sonar/wsclient/services/UserPropertyCreateQueryTest.java
deleted file mode 100644 (file)
index fb600a4..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * SonarQube, open source software quality management tool.
- * Copyright (C) 2008-2014 SonarSource
- * mailto:contact AT sonarsource DOT com
- *
- * SonarQube is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * SonarQube is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-package org.sonar.wsclient.services;
-
-import static org.hamcrest.core.Is.is;
-import static org.junit.Assert.assertThat;
-
-import org.junit.Test;
-
-public class UserPropertyCreateQueryTest extends QueryTestCase {
-
-  @Test
-  public void create() {
-    UserPropertyCreateQuery query = new UserPropertyCreateQuery("foo", "bar");
-    assertThat(query.getUrl(), is("/api/user_properties?key=foo&value=bar&"));
-    assertThat(query.getModelClass().getName(), is(Property.class.getName()));
-  }
-
-}
diff --git a/server/sonar-ws-client/src/test/java/org/sonar/wsclient/services/UserPropertyDeleteQueryTest.java b/server/sonar-ws-client/src/test/java/org/sonar/wsclient/services/UserPropertyDeleteQueryTest.java
deleted file mode 100644 (file)
index e2385d5..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * SonarQube, open source software quality management tool.
- * Copyright (C) 2008-2014 SonarSource
- * mailto:contact AT sonarsource DOT com
- *
- * SonarQube is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * SonarQube is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-package org.sonar.wsclient.services;
-
-import static org.hamcrest.core.Is.is;
-import static org.junit.Assert.assertThat;
-
-import org.junit.Test;
-
-public class UserPropertyDeleteQueryTest extends QueryTestCase {
-
-  @Test
-  public void delete() {
-    UserPropertyDeleteQuery query = new UserPropertyDeleteQuery("foo");
-    assertThat(query.getUrl(), is("/api/user_properties/foo"));
-  }
-
-}
diff --git a/server/sonar-ws-client/src/test/java/org/sonar/wsclient/system/internal/DefaultSystemClientTest.java b/server/sonar-ws-client/src/test/java/org/sonar/wsclient/system/internal/DefaultSystemClientTest.java
deleted file mode 100644 (file)
index 5cc2321..0000000
+++ /dev/null
@@ -1,126 +0,0 @@
-/*
- * SonarQube, open source software quality management tool.
- * Copyright (C) 2008-2014 SonarSource
- * mailto:contact AT sonarsource DOT com
- *
- * SonarQube is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * SonarQube is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-package org.sonar.wsclient.system.internal;
-
-import org.junit.Rule;
-import org.junit.Test;
-import org.sonar.wsclient.MockHttpServerInterceptor;
-import org.sonar.wsclient.internal.HttpRequestFactory;
-import org.sonar.wsclient.system.Migration;
-
-import java.util.Collections;
-
-import static org.assertj.core.api.Assertions.assertThat;
-import static org.junit.Assert.fail;
-import static org.mockito.Matchers.anyMap;
-import static org.mockito.Matchers.eq;
-import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.verify;
-import static org.mockito.Mockito.when;
-
-public class DefaultSystemClientTest {
-
-  static final String RUNNING_JSON = "{\"status\": \"KO\", \"state\": \"MIGRATION_RUNNING\", " +
-    "\"operational\": false, \"startedAt\": \"2013-12-20T12:34:56+0100\"}";
-
-  static final String DONE_JSON = "{\"status\": \"OK\", \"state\": \"MIGRATION_SUCCEEDED\", " +
-    "\"operational\": true, \"message\": \"done\"}";
-
-  @Rule
-  public MockHttpServerInterceptor httpServer = new MockHttpServerInterceptor();
-
-  @Test
-  public void start_migration_asynchronously() {
-    HttpRequestFactory requestFactory = new HttpRequestFactory(httpServer.url());
-    httpServer.stubResponseBody(RUNNING_JSON);
-
-    DefaultSystemClient client = new DefaultSystemClient(requestFactory);
-    Migration migration = client.migrate();
-
-    assertThat(httpServer.requestedPath()).isEqualTo("/api/server/setup");
-    assertThat(migration.status()).isEqualTo(Migration.Status.MIGRATION_RUNNING);
-    assertThat(migration.operationalWebapp()).isFalse();
-    assertThat(migration.startedAt().getYear()).isEqualTo(113);//2013 = nb of years since 1900
-  }
-
-  @Test
-  public void fail_if_rate_is_greater_than_timeout() {
-    try {
-      DefaultSystemClient client = new DefaultSystemClient(mock(HttpRequestFactory.class));
-      client.migrate(5L, 50L);
-      fail();
-    } catch (IllegalArgumentException e) {
-      assertThat(e.getMessage()).isEqualTo("Timeout must be greater than rate");
-    }
-  }
-
-  @Test
-  public void stop_synchronous_migration_on_timeout() {
-    HttpRequestFactory requestFactory = new HttpRequestFactory(httpServer.url());
-    httpServer.stubResponseBody(RUNNING_JSON);
-
-    DefaultSystemClient client = new DefaultSystemClient(requestFactory);
-    Migration migration = client.migrate(50L, 5L);
-
-    assertThat(migration.status()).isEqualTo(Migration.Status.MIGRATION_RUNNING);
-    assertThat(migration.operationalWebapp()).isFalse();
-  }
-
-  @Test
-  public void return_result_before_timeout_of_synchronous_migration() {
-    HttpRequestFactory requestFactory = mock(HttpRequestFactory.class);
-    when(requestFactory.post(eq("/api/server/setup"), anyMap())).thenReturn(
-      RUNNING_JSON, DONE_JSON
-    );
-
-    DefaultSystemClient client = new DefaultSystemClient(requestFactory);
-    Migration migration = client.migrate(500L, 5L);
-
-    assertThat(migration.status()).isEqualTo(Migration.Status.MIGRATION_SUCCEEDED);
-    assertThat(migration.operationalWebapp()).isTrue();
-    assertThat(migration.message()).isEqualTo("done");
-    assertThat(migration.startedAt()).isNull();
-  }
-
-  @Test
-  public void fail_if_missing_state() {
-    // should never occur
-    HttpRequestFactory requestFactory = mock(HttpRequestFactory.class);
-    when(requestFactory.post(eq("/api/server/setup"), anyMap())).thenReturn(
-      "{\"status\": \"ko\", \"message\": \"done\"}"
-    );
-
-    DefaultSystemClient client = new DefaultSystemClient(requestFactory);
-    try {
-      client.migrate(500L, 5L);
-      fail();
-    } catch (IllegalStateException e) {
-      assertThat(e.getMessage()).isEqualTo("State is not set");
-    }
-  }
-
-  @Test
-  public void restart() {
-    HttpRequestFactory requestFactory = mock(HttpRequestFactory.class);
-    DefaultSystemClient client = new DefaultSystemClient(requestFactory);
-    client.restart();
-    verify(requestFactory).post("/api/system/restart", Collections.<String, Object>emptyMap());
-  }
-}
diff --git a/server/sonar-ws-client/src/test/java/org/sonar/wsclient/unmarshallers/AuthenticationUnmarshallerTest.java b/server/sonar-ws-client/src/test/java/org/sonar/wsclient/unmarshallers/AuthenticationUnmarshallerTest.java
deleted file mode 100644 (file)
index c0742ae..0000000
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- * SonarQube, open source software quality management tool.
- * Copyright (C) 2008-2014 SonarSource
- * mailto:contact AT sonarsource DOT com
- *
- * SonarQube is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * SonarQube is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-package org.sonar.wsclient.unmarshallers;
-
-import org.junit.Test;
-import org.sonar.wsclient.services.Authentication;
-
-import static org.assertj.core.api.Assertions.assertThat;
-import static org.junit.Assert.fail;
-
-public class AuthenticationUnmarshallerTest extends UnmarshallerTestCase {
-  @Test
-  public void should_unmarshall_valid_authentication() {
-    Authentication authentication = new AuthenticationUnmarshaller().toModel(loadFile("/authentication/authentication_valid.json"));
-
-    assertThat(authentication.isValid()).isTrue();
-  }
-
-  @Test
-  public void should_unmarshall_invalid_authentication() {
-    Authentication authentication = new AuthenticationUnmarshaller().toModel(loadFile("/authentication/authentication_invalid.json"));
-
-    assertThat(authentication.isValid()).isFalse();
-  }
-
-  @Test
-  public void should_unmarshall_empty_authentication() {
-    Authentication authentication = new AuthenticationUnmarshaller().toModel("{}");
-
-    assertThat(authentication.isValid()).isFalse();
-  }
-
-  @Test
-  public void should_not_umarshall_authentication_list() {
-    try {
-      new AuthenticationUnmarshaller().toModels("[{\"valid\":true},{\"valid\":true}]");
-      fail();
-    } catch (Exception e) {
-      assertThat(e).isInstanceOf(UnsupportedOperationException.class);
-    }
-  }
-}
diff --git a/server/sonar-ws-client/src/test/java/org/sonar/wsclient/unmarshallers/EventUnmarshallerTest.java b/server/sonar-ws-client/src/test/java/org/sonar/wsclient/unmarshallers/EventUnmarshallerTest.java
deleted file mode 100644 (file)
index 4c60eec..0000000
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * SonarQube, open source software quality management tool.
- * Copyright (C) 2008-2014 SonarSource
- * mailto:contact AT sonarsource DOT com
- *
- * SonarQube is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * SonarQube is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-package org.sonar.wsclient.unmarshallers;
-
-import org.junit.Test;
-import org.sonar.wsclient.services.Event;
-
-import java.text.SimpleDateFormat;
-import java.util.Date;
-import java.util.List;
-
-import static org.hamcrest.core.Is.is;
-import static org.junit.Assert.assertThat;
-
-public class EventUnmarshallerTest extends UnmarshallerTestCase {
-
-  @Test
-  public void toModel() throws Exception {
-    List<Event> events = new EventUnmarshaller().toModels(loadFile("/events/events.json"));
-    Event event = events.get(0);
-    assertThat(event.getId(), is("10"));
-    assertThat(event.getName(), is("foo"));
-    assertThat(event.getDescription(), is("desc"));
-    assertThat(event.getCategory(), is("categ"));
-    final Date expectedDate = new SimpleDateFormat("yyyy-MM-dd'T'kk:mm:ssZZZZ").parse("2009-12-25T15:59:23+0000");
-    assertThat(event.getDate(), is(expectedDate));
-  }
-
-}
diff --git a/server/sonar-ws-client/src/test/java/org/sonar/wsclient/unmarshallers/JsonUtilsTest.java b/server/sonar-ws-client/src/test/java/org/sonar/wsclient/unmarshallers/JsonUtilsTest.java
deleted file mode 100644 (file)
index 80ea21f..0000000
+++ /dev/null
@@ -1,91 +0,0 @@
-/*
- * SonarQube, open source software quality management tool.
- * Copyright (C) 2008-2014 SonarSource
- * mailto:contact AT sonarsource DOT com
- *
- * SonarQube is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * SonarQube is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-package org.sonar.wsclient.unmarshallers;
-
-import org.json.simple.JSONObject;
-import org.json.simple.JSONValue;
-import org.junit.Test;
-
-import java.util.Date;
-import java.util.TimeZone;
-
-import static org.hamcrest.Matchers.is;
-import static org.hamcrest.Matchers.nullValue;
-import static org.junit.Assert.assertThat;
-
-public class JsonUtilsTest extends UnmarshallerTestCase {
-
-  @Test
-  public void getIntFields() {
-    JSONObject obj = (JSONObject) JSONValue.parse("{\"one\": 1, \"two\": 2}");
-    assertThat(JsonUtils.getInteger(obj, "one"), is(1));
-    assertThat(JsonUtils.getInteger(obj, "two"), is(2));
-    assertThat(JsonUtils.getInteger(obj, "three"), nullValue());
-  }
-
-  @Test
-  public void getLongFields() {
-    JSONObject obj = (JSONObject) JSONValue.parse("{\"one\": 1, \"two\": 2}");
-    assertThat(JsonUtils.getLong(obj, "one"), is(1l));
-    assertThat(JsonUtils.getLong(obj, "two"), is(2l));
-    assertThat(JsonUtils.getLong(obj, "three"), nullValue());
-  }
-
-  @Test
-  public void getStringFields() {
-    JSONObject obj = (JSONObject) JSONValue.parse("{\"one\": \"1\", \"two\": \"2\"}");
-    assertThat(JsonUtils.getString(obj, "one"), is("1"));
-    assertThat(JsonUtils.getString(obj, "two"), is("2"));
-    assertThat(JsonUtils.getString(obj, "three"), nullValue());
-  }
-
-  @Test
-  public void getNumberAsString() {
-    JSONObject obj = (JSONObject) JSONValue.parse("{\"one\": 1, \"two\": 2}");
-    assertThat(JsonUtils.getString(obj, "one"), is("1"));
-    assertThat(JsonUtils.getString(obj, "two"), is("2"));
-  }
-
-  @Test
-  public void getDateField() {
-    JSONObject obj = (JSONObject) JSONValue.parse("{\"foo\": \"2009-12-25\", \"two\": \"2\"}");
-    Date date = JsonUtils.getDate(obj, "foo");
-    assertThat(date.getDate(), is(25));
-    assertThat(date.getMonth(), is(11));
-    assertThat(date.getYear(), is(109));
-  }
-
-  @Test
-  public void getDateTimeField() {
-    TimeZone defaultTimeZone = TimeZone.getDefault();
-    try {
-      TimeZone.setDefault(TimeZone.getTimeZone("GMT"));
-      JSONObject obj = (JSONObject) JSONValue.parse("{\"foo\": \"2009-12-25T15:59:59-0100\", \"two\": \"2\"}");
-      Date date = JsonUtils.getDateTime(obj, "foo");
-      assertThat(date.getDate(), is(25));
-      assertThat(date.getMonth(), is(11));
-      assertThat(date.getYear(), is(109));
-      assertThat(date.getHours(), is(16));
-      assertThat(date.getMinutes(), is(59));
-    } finally {
-      TimeZone.setDefault(defaultTimeZone);
-    }
-  }
-}
diff --git a/server/sonar-ws-client/src/test/java/org/sonar/wsclient/unmarshallers/ManualMeasureUnmarshallerTest.java b/server/sonar-ws-client/src/test/java/org/sonar/wsclient/unmarshallers/ManualMeasureUnmarshallerTest.java
deleted file mode 100644 (file)
index 7f146a6..0000000
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- * SonarQube, open source software quality management tool.
- * Copyright (C) 2008-2014 SonarSource
- * mailto:contact AT sonarsource DOT com
- *
- * SonarQube is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * SonarQube is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-package org.sonar.wsclient.unmarshallers;
-
-import org.junit.Test;
-import org.sonar.wsclient.services.ManualMeasure;
-
-import java.util.List;
-
-import static org.assertj.core.api.Assertions.assertThat;
-
-
-public class ManualMeasureUnmarshallerTest extends UnmarshallerTestCase {
-
-  @Test
-  public void testSingleMeasure() {
-    ManualMeasure measure = new ManualMeasureUnmarshaller().toModel("[]");
-    assertThat(measure).isNull();
-
-    measure = new ManualMeasureUnmarshaller().toModel(loadFile("/manual_measures/single_measure.json"));
-    assertThat(measure.getId()).isEqualTo(1L);
-    assertThat(measure.getMetricKey()).isEqualTo("burned_budget");
-    assertThat(measure.getResourceKey()).isEqualTo("org.apache.struts:struts-parent");
-    assertThat(measure.getValue()).isEqualTo(302.5);
-    assertThat(measure.getUserLogin()).isEqualTo("admin");
-    assertThat(measure.getUsername()).isEqualTo("Administrator");
-    assertThat(measure.getCreatedAt()).isNotNull();
-    assertThat(measure.getUpdatedAt()).isNotNull();
-  }
-
-
-  @Test
-  public void testAllMeasures() {
-    List<ManualMeasure> measures = new ManualMeasureUnmarshaller().toModels(loadFile("/manual_measures/all_measures.json"));
-    assertThat(measures).hasSize(2);
-  }
-}
diff --git a/server/sonar-ws-client/src/test/java/org/sonar/wsclient/unmarshallers/MetricUnmarshallerTest.java b/server/sonar-ws-client/src/test/java/org/sonar/wsclient/unmarshallers/MetricUnmarshallerTest.java
deleted file mode 100644 (file)
index a73943a..0000000
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- * SonarQube, open source software quality management tool.
- * Copyright (C) 2008-2014 SonarSource
- * mailto:contact AT sonarsource DOT com
- *
- * SonarQube is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * SonarQube is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-package org.sonar.wsclient.unmarshallers;
-
-import org.junit.Test;
-import org.sonar.wsclient.services.Metric;
-
-import java.util.Collection;
-
-import static org.hamcrest.Matchers.nullValue;
-import static org.hamcrest.core.Is.is;
-import static org.junit.Assert.assertThat;
-import static org.junit.Assert.assertTrue;
-
-public class MetricUnmarshallerTest extends UnmarshallerTestCase {
-
-  @Test
-  public void toModel() {
-    Metric metric = new MetricUnmarshaller().toModel("[]");
-    assertThat(metric, nullValue());
-
-    metric = new MetricUnmarshaller().toModel(loadFile("/metrics/one_metric.json"));
-    assertThat(metric.getKey(), is("ncloc"));
-    assertThat(metric.getName(), is("Lines of code"));
-    assertThat(metric.getDescription(), is("Non Commenting Lines of Code"));
-    assertThat(metric.getType(), is("INT"));
-    assertTrue(metric.getHidden());
-  }
-
-  @Test
-  public void toModels() {
-    Collection<Metric> metrics = new MetricUnmarshaller().toModels("[]");
-    assertThat(metrics.size(), is(0));
-
-    metrics = new MetricUnmarshaller().toModels(loadFile("/metrics/one_metric.json"));
-    assertThat(metrics.size(), is(1));
-
-    metrics = new MetricUnmarshaller().toModels(loadFile("/metrics/many_metrics.json"));
-    assertThat(metrics.size(), is(10));
-  }
-
-}
diff --git a/server/sonar-ws-client/src/test/java/org/sonar/wsclient/unmarshallers/PluginUnmarshallerTest.java b/server/sonar-ws-client/src/test/java/org/sonar/wsclient/unmarshallers/PluginUnmarshallerTest.java
deleted file mode 100644 (file)
index 7fb5690..0000000
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * SonarQube, open source software quality management tool.
- * Copyright (C) 2008-2014 SonarSource
- * mailto:contact AT sonarsource DOT com
- *
- * SonarQube is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * SonarQube is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-package org.sonar.wsclient.unmarshallers;
-
-import org.junit.Test;
-import org.sonar.wsclient.JdkUtils;
-import org.sonar.wsclient.services.Plugin;
-import org.sonar.wsclient.services.WSUtils;
-
-import java.util.List;
-
-import static org.hamcrest.core.Is.is;
-import static org.junit.Assert.assertThat;
-
-public class PluginUnmarshallerTest extends UnmarshallerTestCase {
-
-  @Test
-  public void toModel() {
-    WSUtils.setInstance(new JdkUtils());
-
-    List<Plugin> plugins = new PluginUnmarshaller().toModels(loadFile("/plugins/plugins.json"));
-    Plugin plugin = plugins.get(0);
-    assertThat(plugin.getKey(), is("foo"));
-    assertThat(plugin.getName(), is("Foo"));
-    assertThat(plugin.getVersion(), is("1.0"));
-  }
-
-}
diff --git a/server/sonar-ws-client/src/test/java/org/sonar/wsclient/unmarshallers/ProfileUnmarshallerTest.java b/server/sonar-ws-client/src/test/java/org/sonar/wsclient/unmarshallers/ProfileUnmarshallerTest.java
deleted file mode 100644 (file)
index 15ef01d..0000000
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * SonarQube, open source software quality management tool.
- * Copyright (C) 2008-2014 SonarSource
- * mailto:contact AT sonarsource DOT com
- *
- * SonarQube is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * SonarQube is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-package org.sonar.wsclient.unmarshallers;
-
-import org.junit.Test;
-import org.sonar.wsclient.services.Profile;
-
-import static org.hamcrest.Matchers.nullValue;
-import static org.hamcrest.core.Is.is;
-import static org.junit.Assert.assertThat;
-
-public class ProfileUnmarshallerTest extends UnmarshallerTestCase {
-
-  @Test
-  public void shouldNotHaveProfile() {
-    Profile profile = new ProfileUnmarshaller().toModel("[]");
-    assertThat(profile, nullValue());
-  }
-
-  @Test
-  public void shouldGetProfile() {
-    Profile profile = new ProfileUnmarshaller().toModel(loadFile("/profiles/profile.json"));
-    assertThat(profile.getLanguage(), is("java"));
-    assertThat(profile.getName(), is("Sonar way"));
-    assertThat(profile.getParentName(), nullValue());
-    assertThat(profile.isDefaultProfile(), is(true));
-
-    assertThat(profile.getRules().size(), is(116));
-    Profile.Rule rule1 = profile.getRules().get(0);
-    assertThat(rule1.getKey(), is("com.puppycrawl.tools.checkstyle.checks.coding.InnerAssignmentCheck"));
-    assertThat(rule1.getRepository(), is("checkstyle"));
-    assertThat(rule1.getInheritance(), nullValue());
-    assertThat(rule1.getSeverity(), is("MAJOR"));
-    assertThat(rule1.getParameters().size(), is(0));
-    assertThat(rule1.getParameter("foo"), nullValue());
-
-    Profile.Rule rule2 = profile.getRule("checkstyle", "com.puppycrawl.tools.checkstyle.checks.naming.LocalFinalVariableNameCheck");
-    assertThat(rule2.getParameters().size(), is(1));
-    assertThat(rule2.getParameter("format"), is("^[a-z][a-zA-Z0-9]*$"));
-  }
-}
diff --git a/server/sonar-ws-client/src/test/java/org/sonar/wsclient/unmarshallers/PropertyUnmarshallerTest.java b/server/sonar-ws-client/src/test/java/org/sonar/wsclient/unmarshallers/PropertyUnmarshallerTest.java
deleted file mode 100644 (file)
index 77d1094..0000000
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * SonarQube, open source software quality management tool.
- * Copyright (C) 2008-2014 SonarSource
- * mailto:contact AT sonarsource DOT com
- *
- * SonarQube is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * SonarQube is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-package org.sonar.wsclient.unmarshallers;
-
-import org.junit.Test;
-import org.sonar.wsclient.services.Property;
-
-import java.util.Collection;
-
-import static org.hamcrest.Matchers.nullValue;
-import static org.hamcrest.core.Is.is;
-import static org.junit.Assert.assertThat;
-
-public class PropertyUnmarshallerTest extends UnmarshallerTestCase {
-  @Test
-  public void toModel() {
-    Property property = new PropertyUnmarshaller().toModel("[]");
-    assertThat(property, nullValue());
-
-    property = new PropertyUnmarshaller().toModel(loadFile("/properties/single.json"));
-    assertThat(property.getKey(), is("myprop"));
-    assertThat(property.getValue(), is("myvalue"));
-  }
-
-  @Test
-  public void toModels() {
-    Collection<Property> properties = new PropertyUnmarshaller().toModels("[]");
-    assertThat(properties.size(), is(0));
-
-    properties = new PropertyUnmarshaller().toModels(loadFile("/properties/single.json"));
-    assertThat(properties.size(), is(1));
-
-    properties = new PropertyUnmarshaller().toModels(loadFile("/properties/many.json"));
-    assertThat(properties.size(), is(3));
-  }
-}
diff --git a/server/sonar-ws-client/src/test/java/org/sonar/wsclient/unmarshallers/ResourceSearchUnmarshallerTest.java b/server/sonar-ws-client/src/test/java/org/sonar/wsclient/unmarshallers/ResourceSearchUnmarshallerTest.java
deleted file mode 100644 (file)
index 98ba91c..0000000
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * SonarQube, open source software quality management tool.
- * Copyright (C) 2008-2014 SonarSource
- * mailto:contact AT sonarsource DOT com
- *
- * SonarQube is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * SonarQube is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-package org.sonar.wsclient.unmarshallers;
-
-import org.junit.Test;
-import org.sonar.wsclient.services.ResourceSearchResult;
-
-import static org.hamcrest.core.Is.is;
-import static org.junit.Assert.assertThat;
-
-public class ResourceSearchUnmarshallerTest extends UnmarshallerTestCase {
-
-  @Test
-  public void testToModel() {
-    ResourceSearchResult result = new ResourceSearchUnmarshaller().toModel(loadFile("/resources/search.json"));
-    assertThat(result.getPage(), is(1));
-    assertThat(result.getPageSize(), is(10));
-    assertThat(result.getTotal(), is(4));
-    assertThat(result.getResources().size(), is(4));
-
-  }
-
-}
diff --git a/server/sonar-ws-client/src/test/java/org/sonar/wsclient/unmarshallers/ResourceUnmarshallerTest.java b/server/sonar-ws-client/src/test/java/org/sonar/wsclient/unmarshallers/ResourceUnmarshallerTest.java
deleted file mode 100644 (file)
index 271ad82..0000000
+++ /dev/null
@@ -1,90 +0,0 @@
-/*
- * SonarQube, open source software quality management tool.
- * Copyright (C) 2008-2014 SonarSource
- * mailto:contact AT sonarsource DOT com
- *
- * SonarQube is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * SonarQube is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-package org.sonar.wsclient.unmarshallers;
-
-import org.junit.Test;
-import org.sonar.wsclient.services.Resource;
-
-import java.util.List;
-
-import static org.hamcrest.Matchers.not;
-import static org.hamcrest.Matchers.nullValue;
-import static org.hamcrest.core.Is.is;
-import static org.junit.Assert.assertThat;
-
-public class ResourceUnmarshallerTest extends UnmarshallerTestCase {
-
-  @Test
-  public void singleResource() {
-    String json = loadFile("/resources/single-resource.json");
-    assertSonar(new ResourceUnmarshaller().toModel(json));
-
-    List<Resource> resources = new ResourceUnmarshaller().toModels(json);
-    assertThat(resources.size(), is(1));
-    assertSonar(resources.get(0));
-  }
-
-  @Test
-  public void singleResourceWithMeasures() {
-    Resource resource = new ResourceUnmarshaller().toModel(loadFile("/resources/single-resource-with-measures.json"));
-    assertSonar(resource);
-
-    assertThat(resource.getMeasures().size(), is(2));
-    assertThat(resource.getMeasureIntValue("lines"), is(47798));
-    assertThat(resource.getMeasureIntValue("ncloc"), is(27066));
-    assertThat(resource.getMeasureIntValue("unknown"), nullValue());
-  }
-
-  @Test
-  public void manyResources() {
-    List<Resource> resources = new ResourceUnmarshaller().toModels(loadFile("/resources/many-resources.json"));
-
-    assertThat(resources.size(), is(19));
-    for (Resource resource : resources) {
-      assertThat(resource.getKey(), not(nullValue()));
-      assertThat(resource.getId(), not(nullValue()));
-      assertThat(resource.getMeasures().isEmpty(), is(true));
-    }
-  }
-
-  @Test
-  public void manyResourcesWithMeasures() {
-    List<Resource> resources = new ResourceUnmarshaller().toModels(loadFile("/resources/many-resources-with-measures.json"));
-
-    assertThat(resources.size(), is(17));
-    for (Resource resource : resources) {
-      assertThat(resource.getKey(), not(nullValue()));
-      assertThat(resource.getId(), not(nullValue()));
-      assertThat(resource.getMeasures().size(), is(2));
-    }
-  }
-
-  private void assertSonar(Resource resource) {
-    assertThat(resource.getId(), is(48569));
-    assertThat(resource.getKey(), is("org.codehaus.sonar:sonar"));
-    assertThat(resource.getName(), is("Sonar"));
-    assertThat(resource.getScope(), is("PRJ"));
-    assertThat(resource.getQualifier(), is("TRK"));
-    assertThat(resource.getLanguage(), is("java"));
-    assertThat(resource.getDescription(), is("Embrace Quality"));
-    assertThat(resource.getDate(), not(nullValue()));
-    assertThat(resource.getCreationDate(), not(nullValue()));
-  }
-}
diff --git a/server/sonar-ws-client/src/test/java/org/sonar/wsclient/unmarshallers/ServerSetupUnmarshallerTest.java b/server/sonar-ws-client/src/test/java/org/sonar/wsclient/unmarshallers/ServerSetupUnmarshallerTest.java
deleted file mode 100644 (file)
index a8eeaae..0000000
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * SonarQube, open source software quality management tool.
- * Copyright (C) 2008-2014 SonarSource
- * mailto:contact AT sonarsource DOT com
- *
- * SonarQube is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * SonarQube is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-package org.sonar.wsclient.unmarshallers;
-
-import org.junit.Test;
-import org.sonar.wsclient.services.ServerSetup;
-
-import static org.hamcrest.Matchers.nullValue;
-import static org.hamcrest.core.Is.is;
-import static org.junit.Assert.assertThat;
-
-public class ServerSetupUnmarshallerTest extends UnmarshallerTestCase {
-
-  @Test
-  public void testSuccessfulSetup() {
-    ServerSetup setup = new ServerSetupUnmarshaller().toModel(loadFile("/server_setup/ok.json"));
-    assertThat(setup.getStatus(), is("ok"));
-    assertThat(setup.getMessage(), nullValue());
-    assertThat(setup.isSuccessful(), is(true));
-  }
-
-  @Test
-  public void testFailedSetup() {
-    ServerSetup setup = new ServerSetupUnmarshaller().toModel(loadFile("/server_setup/ko.json"));
-    assertThat(setup.getStatus(), is("ko"));
-    assertThat(setup.getMessage(), is("error"));
-    assertThat(setup.isSuccessful(), is(false));
-  }
-
-}
diff --git a/server/sonar-ws-client/src/test/java/org/sonar/wsclient/unmarshallers/ServerUnmarshallerTest.java b/server/sonar-ws-client/src/test/java/org/sonar/wsclient/unmarshallers/ServerUnmarshallerTest.java
deleted file mode 100644 (file)
index 576075e..0000000
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * SonarQube, open source software quality management tool.
- * Copyright (C) 2008-2014 SonarSource
- * mailto:contact AT sonarsource DOT com
- *
- * SonarQube is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * SonarQube is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-package org.sonar.wsclient.unmarshallers;
-
-import org.junit.Test;
-import org.sonar.wsclient.services.Server;
-
-import static org.hamcrest.Matchers.nullValue;
-import static org.hamcrest.core.Is.is;
-import static org.junit.Assert.assertThat;
-
-public class ServerUnmarshallerTest extends UnmarshallerTestCase {
-
-  @Test
-  public void testToModel() {
-    Server server = new ServerUnmarshaller().toModel(loadFile("/server/server.json"));
-    assertThat(server.getId(), is("123456789"));
-    assertThat(server.getVersion(), is("2.0-SNAPSHOT"));
-    assertThat(server.getStatus(), is(Server.Status.UP));
-    assertThat(server.getStatusMessage(), is("everything is under control"));
-  }
-
-  @Test
-  public void shouldNotFailIfStatusIsMissing() {
-    Server server = new ServerUnmarshaller().toModel(loadFile("/server/status_missing.json"));
-    assertThat(server.getId(), is("123456789"));
-    assertThat(server.getVersion(), is("2.0-SNAPSHOT"));
-    assertThat(server.getStatus(), nullValue());
-    assertThat(server.getStatusMessage(), nullValue());
-  }
-
-}
diff --git a/server/sonar-ws-client/src/test/java/org/sonar/wsclient/unmarshallers/SourceUnmarshallerTest.java b/server/sonar-ws-client/src/test/java/org/sonar/wsclient/unmarshallers/SourceUnmarshallerTest.java
deleted file mode 100644 (file)
index 5acb55f..0000000
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * SonarQube, open source software quality management tool.
- * Copyright (C) 2008-2014 SonarSource
- * mailto:contact AT sonarsource DOT com
- *
- * SonarQube is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * SonarQube is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-package org.sonar.wsclient.unmarshallers;
-
-import org.junit.Test;
-import org.sonar.wsclient.services.Source;
-
-import static org.hamcrest.Matchers.nullValue;
-import static org.hamcrest.core.Is.is;
-import static org.junit.Assert.assertThat;
-
-public class SourceUnmarshallerTest extends UnmarshallerTestCase {
-
-  @Test
-  public void toModel() {
-    Source source = new SourceUnmarshaller().toModel("[]");
-    assertThat(source, nullValue());
-
-    source = new SourceUnmarshaller().toModel(loadFile("/sources/source.json"));
-    assertThat(source.getLines().size(), is(236));
-    assertThat(source.getLine(3), is(" * Copyright (C) 2008-2014 SonarSource"));
-  }
-
-  @Test
-  public void fromLineToLine() {
-    Source source = new SourceUnmarshaller().toModel(loadFile("/sources/from_line_to_line.json"));
-    assertThat(source.getLines().size(), is(15));
-    assertThat(source.getLine(1), nullValue());
-    assertThat(source.getLine(3), is(" * Copyright (C) 2008-2014 SonarSource"));
-  }
-
-}
diff --git a/server/sonar-ws-client/src/test/java/org/sonar/wsclient/unmarshallers/TimeMachineUnmarshallerTest.java b/server/sonar-ws-client/src/test/java/org/sonar/wsclient/unmarshallers/TimeMachineUnmarshallerTest.java
deleted file mode 100644 (file)
index 965d272..0000000
+++ /dev/null
@@ -1,80 +0,0 @@
-/*
- * SonarQube, open source software quality management tool.
- * Copyright (C) 2008-2014 SonarSource
- * mailto:contact AT sonarsource DOT com
- *
- * SonarQube is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * SonarQube is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-package org.sonar.wsclient.unmarshallers;
-
-import org.junit.Test;
-import org.sonar.wsclient.services.TimeMachine;
-
-import java.util.Calendar;
-import java.util.Date;
-
-import static org.assertj.core.api.Assertions.assertThat;
-
-public class TimeMachineUnmarshallerTest extends UnmarshallerTestCase {
-
-  @Test
-  public void test_to_model() throws Exception {
-    TimeMachine timeMachine = new TimeMachineUnmarshaller().toModel(loadFile("/timemachine/timemachine.json"));
-
-    // columns
-    assertThat(timeMachine.getColumns().length).isEqualTo(2);
-    assertThat(timeMachine.getColumns()[0].getIndex()).isEqualTo(0);
-    assertThat(timeMachine.getColumns()[0].getMetricKey()).isEqualTo("ncloc");
-    assertThat(timeMachine.getColumns()[1].getIndex()).isEqualTo(1);
-    assertThat(timeMachine.getColumns()[1].getMetricKey()).isEqualTo("coverage");
-
-    // values sorted by date
-    assertThat(timeMachine.getCells().length).isEqualTo(3); // 3 days
-    assertThat(getDayOfMonth(timeMachine.getCells()[0].getDate())).isEqualTo(19);
-    assertThat(getDayOfMonth(timeMachine.getCells()[1].getDate())).isEqualTo(21);
-    assertThat(getDayOfMonth(timeMachine.getCells()[2].getDate())).isEqualTo(25);
-
-    assertThat(timeMachine.getCells()[0].getValues()).hasSize(2);
-    assertThat((Double) timeMachine.getCells()[0].getValues()[0]).isEqualTo(21.0);
-    assertThat((Double) timeMachine.getCells()[0].getValues()[1]).isEqualTo(80.0);
-  }
-
-  @Test
-  public void should_accept_null_values() {
-    TimeMachine timeMachine = new TimeMachineUnmarshaller().toModel(loadFile("/timemachine/null-values.json"));
-
-    assertThat(timeMachine.getCells()[0].getValues().length).isEqualTo(2);
-    assertThat(timeMachine.getCells()[0].getValues()[0]).isNull();
-    assertThat((Double) timeMachine.getCells()[0].getValues()[1]).isEqualTo(80.0);
-
-    assertThat((Double) timeMachine.getCells()[1].getValues()[0]).isEqualTo(29.0);
-    assertThat(timeMachine.getCells()[1].getValues()[1]).isNull();
-  }
-
-  @Test
-  public void should_cast_values() {
-    TimeMachine timeMachine = new TimeMachineUnmarshaller().toModel(loadFile("/timemachine/typed-values.json"));
-
-    assertThat(timeMachine.getCells()[0].getValues().length).isEqualTo(2);
-    assertThat((String) timeMachine.getCells()[0].getValues()[0]).isEqualTo("Sonar way");
-    assertThat((Double) timeMachine.getCells()[0].getValues()[1]).isEqualTo(80.0);
-  }
-
-  private int getDayOfMonth(Date date) {
-    Calendar calendar = Calendar.getInstance();
-    calendar.setTime(date);
-    return calendar.get(Calendar.DAY_OF_MONTH);
-  }
-}
diff --git a/server/sonar-ws-client/src/test/java/org/sonar/wsclient/unmarshallers/UnmarshallerTestCase.java b/server/sonar-ws-client/src/test/java/org/sonar/wsclient/unmarshallers/UnmarshallerTestCase.java
deleted file mode 100644 (file)
index 339a2f2..0000000
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * SonarQube, open source software quality management tool.
- * Copyright (C) 2008-2014 SonarSource
- * mailto:contact AT sonarsource DOT com
- *
- * SonarQube is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * SonarQube is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-package org.sonar.wsclient.unmarshallers;
-
-import org.apache.commons.io.IOUtils;
-import org.junit.BeforeClass;
-import org.sonar.wsclient.JdkUtils;
-import org.sonar.wsclient.services.WSUtils;
-
-import java.io.IOException;
-
-public abstract class UnmarshallerTestCase {
-
-  @BeforeClass
-  public static void setupWsUtils() {
-    WSUtils.setInstance(new JdkUtils());
-  }
-
-  public static String loadFile(String path) {
-    try {
-      return IOUtils.toString(UnmarshallerTestCase.class.getResourceAsStream(path));
-    } catch (IOException e) {
-      throw new RuntimeException(e);
-    }
-  }
-
-}
diff --git a/server/sonar-ws-client/src/test/java/org/sonar/wsclient/unmarshallers/UnmarshallersTest.java b/server/sonar-ws-client/src/test/java/org/sonar/wsclient/unmarshallers/UnmarshallersTest.java
deleted file mode 100644 (file)
index 8b32b8f..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * SonarQube, open source software quality management tool.
- * Copyright (C) 2008-2014 SonarSource
- * mailto:contact AT sonarsource DOT com
- *
- * SonarQube is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * SonarQube is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-package org.sonar.wsclient.unmarshallers;
-
-import org.junit.Test;
-import org.sonar.wsclient.services.Metric;
-import org.sonar.wsclient.services.Model;
-
-import static org.hamcrest.Matchers.nullValue;
-import static org.hamcrest.Matchers.instanceOf;
-import static org.junit.Assert.assertThat;
-
-public class UnmarshallersTest {
-
-  @Test
-  public void forModel() {
-    assertThat(Unmarshallers.forModel(Metric.class), instanceOf(MetricUnmarshaller.class));
-    assertThat(Unmarshallers.forModel(Model.class), nullValue());
-  }
-
-}
diff --git a/server/sonar-ws-client/src/test/resources/authentication/authentication_invalid.json b/server/sonar-ws-client/src/test/resources/authentication/authentication_invalid.json
deleted file mode 100644 (file)
index 032d6e5..0000000
+++ /dev/null
@@ -1 +0,0 @@
-{"valid":false}
\ No newline at end of file
diff --git a/server/sonar-ws-client/src/test/resources/authentication/authentication_valid.json b/server/sonar-ws-client/src/test/resources/authentication/authentication_valid.json
deleted file mode 100644 (file)
index a9d0d8f..0000000
+++ /dev/null
@@ -1 +0,0 @@
-{"valid":true}
\ No newline at end of file
diff --git a/server/sonar-ws-client/src/test/resources/dependencies/many.json b/server/sonar-ws-client/src/test/resources/dependencies/many.json
deleted file mode 100644 (file)
index b366f30..0000000
+++ /dev/null
@@ -1,137 +0,0 @@
-[
-  {
-    "id": 1649,
-    "fi": 33,
-    "ti": 45,
-    "fk":"org.apache.shiro:shiro-core:org.apache.shiro.authc.pam",
-    "tk":"org.apache.shiro:shiro-core:org.apache.shiro.realm",
-    "u":"USES",
-    "w":5
-  },
-  {
-    "id": 1686,
-    "fi": 333,
-    "ti": 453,
-    "fk":"org.apache.shiro:shiro-core:org.apache.shiro.realm",
-    "tk":"org.apache.shiro:shiro-core:org.apache.shiro.authz.permission",
-    "u":"USES",
-    "w":3
-  },
-  {
-    "id": 1690,
-    "fi": 334,
-    "ti": 454,
-    "fk":"org.apache.shiro:shiro-core:org.apache.shiro.realm",
-    "tk":"org.apache.shiro:shiro-core:org.apache.shiro.util",
-    "u":"USES",
-    "w":2
-  },
-  {
-    "id": 1693,
-    "fi": 335,
-    "ti": 455,
-    "fk":"org.apache.shiro:shiro-core:org.apache.shiro.realm",
-    "tk":"org.apache.shiro:shiro-core:org.apache.shiro.authc.credential",
-    "u":"USES",
-    "w":3
-  },
-  {
-    "id": 1697,
-    "fi": 336,
-    "ti": 456,
-    "fk":"org.apache.shiro:shiro-core:org.apache.shiro.realm",
-    "tk":"org.apache.shiro:shiro-core:org.apache.shiro.authc",
-    "u":"USES",
-    "w":16
-  },
-  {
-    "id": 1714,
-    "fi": 337,
-    "ti": 457,
-    "fk":"org.apache.shiro:shiro-core:org.apache.shiro.realm",
-    "tk":"org.apache.shiro:shiro-core:org.apache.shiro.cache",
-    "u":"USES",
-    "w":6
-  },
-  {
-    "id": 1721,
-    "fi": 3338,
-    "ti": 4258,
-    "fk":"org.apache.shiro:shiro-core:org.apache.shiro.realm",
-    "tk":"org.apache.shiro:shiro-core:org.apache.shiro.authz",
-    "u":"USES",
-    "w":9
-  },
-  {
-    "id": 1731,
-    "fi": 343,
-    "ti": 4445,
-    "fk":"org.apache.shiro:shiro-core:org.apache.shiro.realm",
-    "tk":"org.apache.shiro:shiro-core:org.apache.shiro.subject",
-    "u":"USES",
-    "w":3
-  },
-  {
-    "id": 1735,
-    "fi": 3443,
-    "ti": 455,
-    "fk":"org.apache.shiro:shiro-core:org.apache.shiro.realm.ldap",
-    "tk":"org.apache.shiro:shiro-core:org.apache.shiro.realm",
-    "u":"USES",
-    "w":1
-  },
-  {
-    "id": 1775,
-    "fi": 373,
-    "ti": 6645,
-    "fk":"org.apache.shiro:shiro-core:org.apache.shiro.mgt",
-    "tk":"org.apache.shiro:shiro-core:org.apache.shiro.realm",
-    "u":"USES",
-    "w":2
-  },
-  {
-    "id": 1886,
-    "fi": 339,
-    "ti": 495,
-    "fk":"org.apache.shiro:shiro-core:org.apache.shiro.realm.jdbc",
-    "tk":"org.apache.shiro:shiro-core:org.apache.shiro.realm",
-    "u":"USES",
-    "w":1
-  },
-  {
-    "id": 1962,
-    "fi": 373,
-    "ti": 485,
-    "fk":"org.apache.shiro:shiro-core:org.apache.shiro.config",
-    "tk":"org.apache.shiro:shiro-core:org.apache.shiro.realm",
-    "u":"USES",
-    "w":4
-  },
-  {
-    "id": 1995,
-    "fi": 363,
-    "ti": 445,
-    "fk":"org.apache.shiro:shiro-core:org.apache.shiro.realm.jndi",
-    "tk":"org.apache.shiro:shiro-core:org.apache.shiro.realm",
-    "u":"USES",
-    "w":2
-  },
-  {
-    "id": 2098,
-    "fi": 333,
-    "ti": 415,
-    "fk":"org.apache.shiro:shiro-core:org.apache.shiro.realm.text",
-    "tk":"org.apache.shiro:shiro-core:org.apache.shiro.realm",
-    "u":"USES",
-    "w":1
-  },
-  {
-    "id": 2119,
-    "fi": 332,
-    "ti": 451,
-    "fk":"org.apache.shiro:shiro-core:org.apache.shiro.authz",
-    "tk":"org.apache.shiro:shiro-core:org.apache.shiro.realm",
-    "u":"USES",
-    "w":1
-  }
-]
\ No newline at end of file
diff --git a/server/sonar-ws-client/src/test/resources/dependencies/single.json b/server/sonar-ws-client/src/test/resources/dependencies/single.json
deleted file mode 100644 (file)
index 84e8567..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-[
-  {
-    "id": 1649,
-    "fi": 33,
-    "ti": 45,
-    "fk":"org.apache.shiro:shiro-core:org.apache.shiro.authc.pam",
-    "tk":"org.apache.shiro:shiro-core:org.apache.shiro.realm",
-    "u":"USES",
-    "w":5,
-    "fn": "pam",
-    "fq": "PAC",
-    "tn": "realm",
-    "tq": "PAC"
-  }
-]
\ No newline at end of file
diff --git a/server/sonar-ws-client/src/test/resources/dependency_tree/many_depths.json b/server/sonar-ws-client/src/test/resources/dependency_tree/many_depths.json
deleted file mode 100644 (file)
index 9a9ccb6..0000000
+++ /dev/null
@@ -1 +0,0 @@
-[{"did":"12345","rid":"2000","n":"Logback","s":"LIB","q":"LIB","w":1,"u":"compile","v":"1.4","to":[{"did":"12346","rid":"2001","n":"SLF4J","s":"LIB","q":"LIB","w":1,"u":"compile","v":"0.9"},{"did":"12347","rid":"2002","n":"Commons Lang","s":"LIB","q":"LIB","w":1,"u":"compile","v":"1.4"}]}]
\ No newline at end of file
diff --git a/server/sonar-ws-client/src/test/resources/dependency_tree/single_depth.json b/server/sonar-ws-client/src/test/resources/dependency_tree/single_depth.json
deleted file mode 100644 (file)
index 434a2da..0000000
+++ /dev/null
@@ -1 +0,0 @@
-[{"did":"12345","rid":"2000","n":"Commons Lang","s":"PRJ","q":"LIB","w":1,"u":"compile","v":"1.4"},{"did":"12346","rid":"2001","n":"Commons IO","s":"PRJ","q":"LIB","w":1,"u":"compile","v":"2.4"}]
\ No newline at end of file
diff --git a/server/sonar-ws-client/src/test/resources/events/events.json b/server/sonar-ws-client/src/test/resources/events/events.json
deleted file mode 100644 (file)
index a762609..0000000
+++ /dev/null
@@ -1 +0,0 @@
-[{"id": "10", "n": "foo", "ds": "desc", "c": "categ", "dt": "2009-12-25T15:59:23+0000"}]
diff --git a/server/sonar-ws-client/src/test/resources/manual_measures/all_measures.json b/server/sonar-ws-client/src/test/resources/manual_measures/all_measures.json
deleted file mode 100644 (file)
index 2adfa72..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-[
-  {
-    "id":1,
-    "metric":"burned_budget",
-    "resource":"org.apache.struts:struts-parent",
-    "val":302.1,
-    "created_at":"2011-07-27T10:22:34+0200",
-    "updated_at":"2011-07-27T10:22:34+0200",
-    "login":"admin",
-    "username":"Administrator"
-  },
-  {
-    "id":2,
-    "metric":"team_size",
-    "resource":"org.apache.struts:struts-parent",
-    "val":555,
-    "created_at":"2011-07-27T10:53:33+0200",
-    "updated_at":"2011-07-27T10:53:33+0200",
-    "login":"admin",
-    "username":"Administrator"
-  }
-]
diff --git a/server/sonar-ws-client/src/test/resources/manual_measures/single_measure.json b/server/sonar-ws-client/src/test/resources/manual_measures/single_measure.json
deleted file mode 100644 (file)
index 587d63b..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-[
-  {
-    "id":1,
-    "metric":"burned_budget",
-    "resource":"org.apache.struts:struts-parent",
-    "val":302.5,
-    "created_at":"2011-06-27T10:22:34+0200",
-    "updated_at":"2011-07-03T12:02:12+0200",
-    "login":"admin",
-    "username":"Administrator"
-  }
-]
\ No newline at end of file
diff --git a/server/sonar-ws-client/src/test/resources/metrics/many_metrics.json b/server/sonar-ws-client/src/test/resources/metrics/many_metrics.json
deleted file mode 100644 (file)
index e7104a6..0000000
+++ /dev/null
@@ -1 +0,0 @@
-[{"key":"packages","name":"Packages","description":"Packages","domain":"Size","qualitative":false,"user_managed":false,"direction":-1,"val_type":"INT"},{"key":"classes","name":"Classes","description":"Classes","domain":"Size","qualitative":false,"user_managed":false,"direction":-1,"val_type":"INT"},{"key":"ncloc","name":"Lines of code","description":"Non Commenting Lines of Code","domain":"Size","qualitative":false,"user_managed":false,"direction":-1,"val_type":"INT"},{"key":"functions","name":"Methods","description":"Methods","domain":"Size","qualitative":false,"user_managed":false,"direction":-1,"val_type":"INT"},{"key":"duplicated_lines","name":"Duplicated lines","description":"Duplicated lines","domain":"Duplication","qualitative":false,"user_managed":false,"direction":-1,"val_type":"INT"},{"key":"test_errors","name":"Unit test errors","description":"Number of unit test errors","domain":"Tests","qualitative":false,"user_managed":false,"direction":-1,"val_type":"INT"},{"key":"skipped_tests","name":"Skipped unit tests","description":"Number of skipped unit tests","domain":"Tests","qualitative":false,"user_managed":false,"direction":-1,"val_type":"INT"},{"key":"test_failures","name":"Unit test failures","description":"Number of unit test failures","domain":"Tests","qualitative":false,"user_managed":false,"direction":-1,"val_type":"INT"},{"key":"tests","name":"Unit tests","description":"Number of unit tests","domain":"Tests","qualitative":false,"user_managed":false,"direction":-1,"val_type":"INT"},{"key":"test_execution_time","name":"Unit tests duration","description":"Execution duration of unit tests ","domain":"Tests","qualitative":false,"user_managed":false,"direction":-1,"val_type":"MILLISEC"}]
\ No newline at end of file
diff --git a/server/sonar-ws-client/src/test/resources/metrics/one_metric.json b/server/sonar-ws-client/src/test/resources/metrics/one_metric.json
deleted file mode 100644 (file)
index 17a163b..0000000
+++ /dev/null
@@ -1 +0,0 @@
-[{"key":"ncloc","name":"Lines of code","description":"Non Commenting Lines of Code","domain":"Size","qualitative":false,"user_managed":false,"direction":-1,"val_type":"INT","hidden":true}]
\ No newline at end of file
diff --git a/server/sonar-ws-client/src/test/resources/org/sonar/wsclient/issue/internal/DefaultIssueClientTest/add_comment_result.json b/server/sonar-ws-client/src/test/resources/org/sonar/wsclient/issue/internal/DefaultIssueClientTest/add_comment_result.json
deleted file mode 100644 (file)
index 7329cc8..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-{
-  "comment": {
-    "key": "COMMENT-123",
-    "htmlText": "this is my comment",
-    "login": "admin",
-    "createdAt": "2013-05-18T13:45:34+0200"
-  }
-}
\ No newline at end of file
diff --git a/server/sonar-ws-client/src/test/resources/org/sonar/wsclient/issue/internal/IssueJsonParserTest/bulk-change.json b/server/sonar-ws-client/src/test/resources/org/sonar/wsclient/issue/internal/IssueJsonParserTest/bulk-change.json
deleted file mode 100644 (file)
index 9180ebf..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-{
-  "issuesChanged": {
-    "total": 3
-  },
-  "issuesNotChanged": {
-    "total": 2,
-    "issues": ["06ed4db6-fd96-450a-bcb0-e0184db50105", "06ed4db6-fd96-450a-bcb0-e0184db50654"]
-  }
-}
\ No newline at end of file
diff --git a/server/sonar-ws-client/src/test/resources/org/sonar/wsclient/issue/internal/IssueJsonParserTest/changelog-with-only-new-technical-debt.json b/server/sonar-ws-client/src/test/resources/org/sonar/wsclient/issue/internal/IssueJsonParserTest/changelog-with-only-new-technical-debt.json
deleted file mode 100644 (file)
index 645c9eb..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-{
-  "changelog": [
-    {
-      "user": "julien",
-      "creationDate": "2013-10-31T07:50:35+0100",
-      "diffs": [
-        {
-          "key": "technicalDebt",
-          "newValue": "2d1h"
-        }
-      ]
-    }
-  ]
-}
-
diff --git a/server/sonar-ws-client/src/test/resources/org/sonar/wsclient/issue/internal/IssueJsonParserTest/changelog-with-technical-debt.json b/server/sonar-ws-client/src/test/resources/org/sonar/wsclient/issue/internal/IssueJsonParserTest/changelog-with-technical-debt.json
deleted file mode 100644 (file)
index 3989c98..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-{
-  "changelog": [
-    {
-      "user": "julien",
-      "creationDate": "2013-10-31T07:50:35+0100",
-      "diffs": [
-        {
-          "key": "technicalDebt",
-          "oldValue": "3d10min",
-          "newValue": "2d1h"
-        }
-      ]
-    }
-  ]
-}
-
diff --git a/server/sonar-ws-client/src/test/resources/org/sonar/wsclient/issue/internal/IssueJsonParserTest/changelog.json b/server/sonar-ws-client/src/test/resources/org/sonar/wsclient/issue/internal/IssueJsonParserTest/changelog.json
deleted file mode 100644 (file)
index cbd9c6e..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
-{
-  "changelog": [
-    {
-      "user": "julien",
-      "creationDate": "2013-10-31T07:50:35+0100",
-      "diffs": [
-        {
-          "key": "actionPlan",
-          "newValue": "1.0"
-        }
-      ]
-    },
-    {
-      "user": "simon",
-      "creationDate": "2013-10-31T07:50:39+0100",
-      "diffs": [
-        {
-          "key": "severity",
-          "newValue": "INFO",
-          "oldValue": "BLOCKER"
-        },
-        {
-          "key": "status",
-          "newValue": "REOPEN",
-          "oldValue": "RESOLVED"
-        }
-      ]
-    }
-  ]
-}
-
diff --git a/server/sonar-ws-client/src/test/resources/org/sonar/wsclient/issue/internal/IssueJsonParserTest/empty.json b/server/sonar-ws-client/src/test/resources/org/sonar/wsclient/issue/internal/IssueJsonParserTest/empty.json
deleted file mode 100644 (file)
index b3712e0..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-{
-  "paging": {
-    "pageIndex": 1,
-    "pageSize": 100,
-    "total": 0,
-    "pages": 0
-  },
-  "maxResultsReached": false
-}
\ No newline at end of file
diff --git a/server/sonar-ws-client/src/test/resources/org/sonar/wsclient/issue/internal/IssueJsonParserTest/getTransitions.json b/server/sonar-ws-client/src/test/resources/org/sonar/wsclient/issue/internal/IssueJsonParserTest/getTransitions.json
deleted file mode 100644 (file)
index 0451945..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-{
-  "transitions": [
-    "resolve",
-    "falsepositive"
-  ]
-}
\ No newline at end of file
diff --git a/server/sonar-ws-client/src/test/resources/org/sonar/wsclient/issue/internal/IssueJsonParserTest/issue-with-action-plans.json b/server/sonar-ws-client/src/test/resources/org/sonar/wsclient/issue/internal/IssueJsonParserTest/issue-with-action-plans.json
deleted file mode 100644 (file)
index 46718d5..0000000
+++ /dev/null
@@ -1,71 +0,0 @@
-{
-  "issues": [
-    {
-      "key": "ABCDE",
-      "component": "struts:Action.java",
-      "project": "struts",
-      "rule": "squid:CycleBetweenPackages",
-      "severity": "CRITICAL",
-      "status": "OPEN",
-      "actionPlan": "9450b10c-e725-48b8-bf01-acdec751c491",
-      "comments": [
-        {
-          "key": "COMMENT-1",
-          "login": "morgan",
-          "htmlText": "the first comment",
-          "createdAt": "2013-05-18T13:45:34+0200"
-        },
-        {
-          "key": "COMMENT-2",
-          "login": "arthur",
-          "htmlText": "the second comment",
-          "createdAt": "2013-06-19T00:02:03+0100"
-        }
-      ]
-    }
-  ],
-  "rules": [
-    {
-
-      "key": "squid:CycleBetweenPackages",
-      "name": "Avoid cycle between java packages",
-      "desc": "<p>\nWhen several packages are involved in a cycle (package A > package B > package C > package A where \">\" means \"depends upon\"),\nthat means that those packages are highly coupled and that there is no way to reuse/extract one of those packages without importing all the other packages.\nSuch cycle could quickly increase the effort required to maintain an application and to embrace business change.\nSonar not only detect cycles between packages but also determines what is the minimum effort to break those cycles.\nThis rule log a violation on each source file having an outgoing dependency to be but in order to break a cycle.\n</p>\n"
-
-    }
-  ],
-  "components": [
-    {
-      "key": "struts:Action.java",
-      "name": "Action",
-      "qualifier": "CLA",
-      "longName": "org.struts.Action"
-    }
-  ],
-  "projects": [
-    {
-      "key": "struts",
-      "name": "Struts",
-      "qualifier": "TRK",
-      "longName": "org.struts"
-    }
-  ],
-  "actionPlans": [
-    {
-      "key": "9450b10c-e725-48b8-bf01-acdec751c491",
-      "name": "3.6",
-      "status": "OPEN",
-      "project": "struts",
-      "userLogin": "arthur",
-      "deadLine": "2013-05-31T00:00:00+0200",
-      "createdAt": "2013-05-29T13:55:20+0200",
-      "updatedAt": "2013-05-29T13:55:20+0200"
-    }
-  ],
-  "paging": {
-    "pageIndex": 1,
-    "pageSize": 100,
-    "total": 2,
-    "pages": 1
-  },
-  "maxResultsReached": false
-}
\ No newline at end of file
diff --git a/server/sonar-ws-client/src/test/resources/org/sonar/wsclient/issue/internal/IssueJsonParserTest/issue-with-comments.json b/server/sonar-ws-client/src/test/resources/org/sonar/wsclient/issue/internal/IssueJsonParserTest/issue-with-comments.json
deleted file mode 100644 (file)
index 860014b..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-{
-    "issues": [
-        {
-            "key": "ABCDE",
-            "component": "Action.java",
-            "project": "struts",
-            "rule": "squid:CycleBetweenPackages",
-            "severity": "CRITICAL",
-            "status": "OPEN",
-            "comments": [
-                {
-                    "key": "COMMENT-1",
-                    "login": "morgan",
-                    "htmlText": "the first comment",
-                    "createdAt": "2013-05-18T13:45:34+0200"
-                },
-                {
-                    "key": "COMMENT-2",
-                    "login": "arthur",
-                    "htmlText": "the second comment",
-                    "createdAt": "2013-06-19T12:02:03+0100"
-                }
-            ]
-        }
-    ],
-    "rules": [
-        {
-
-            "key": "squid:CycleBetweenPackages",
-            "name": "Avoid cycle between java packages",
-            "desc": "<p>\nWhen several packages are involved in a cycle (package A > package B > package C > package A where \">\" means \"depends upon\"),\nthat means that those packages are highly coupled and that there is no way to reuse/extract one of those packages without importing all the other packages.\nSuch cycle could quickly increase the effort required to maintain an application and to embrace business change.\nSonar not only detect cycles between packages but also determines what is the minimum effort to break those cycles.\nThis rule log a violation on each source file having an outgoing dependency to be but in order to break a cycle.\n</p>\n"
-
-        }
-    ],
-    "paging": {
-        "pageIndex": 1,
-        "pageSize": 100,
-        "total": 2,
-        "pages": 1
-    },
-    "maxResultsReached": false
-}
\ No newline at end of file
diff --git a/server/sonar-ws-client/src/test/resources/org/sonar/wsclient/issue/internal/IssueJsonParserTest/issue-with-components.json b/server/sonar-ws-client/src/test/resources/org/sonar/wsclient/issue/internal/IssueJsonParserTest/issue-with-components.json
deleted file mode 100644 (file)
index 685063b..0000000
+++ /dev/null
@@ -1,54 +0,0 @@
-{
-  "issues": [
-    {
-      "key": "ABCDE",
-      "component": "struts:Action.java",
-      "componentId": 10,
-      "project": "struts",
-      "rule": "squid:CycleBetweenPackages",
-      "severity": "CRITICAL",
-      "status": "OPEN",
-      "comments": [
-        {
-          "key": "COMMENT-1",
-          "login": "morgan",
-          "htmlText": "the first comment",
-          "createdAt": "2013-05-18T13:45:34+0200"
-        },
-        {
-          "key": "COMMENT-2",
-          "login": "arthur",
-          "htmlText": "the second comment",
-          "createdAt": "2013-06-19T00:02:03+0100"
-        }
-      ]
-    }
-  ],
-  "rules": [
-    {
-
-      "key": "squid:CycleBetweenPackages",
-      "name": "Avoid cycle between java packages",
-      "desc": "<p>\nWhen several packages are involved in a cycle (package A > package B > package C > package A where \">\" means \"depends upon\"),\nthat means that those packages are highly coupled and that there is no way to reuse/extract one of those packages without importing all the other packages.\nSuch cycle could quickly increase the effort required to maintain an application and to embrace business change.\nSonar not only detect cycles between packages but also determines what is the minimum effort to break those cycles.\nThis rule log a violation on each source file having an outgoing dependency to be but in order to break a cycle.\n</p>\n"
-
-    }
-  ],
-  "components": [
-    {
-      "key": "struts:Action.java",
-      "id": 10,
-      "name": "Action",
-      "qualifier": "CLA",
-      "longName": "org.struts.Action",
-      "subProjectId" : 2,
-      "projectId" : 1
-    }
-  ],
-  "paging": {
-    "pageIndex": 1,
-    "pageSize": 100,
-    "total": 2,
-    "pages": 1
-  },
-  "maxResultsReached": false
-}
diff --git a/server/sonar-ws-client/src/test/resources/org/sonar/wsclient/issue/internal/IssueJsonParserTest/issue-with-projects.json b/server/sonar-ws-client/src/test/resources/org/sonar/wsclient/issue/internal/IssueJsonParserTest/issue-with-projects.json
deleted file mode 100644 (file)
index a5e4ea7..0000000
+++ /dev/null
@@ -1,58 +0,0 @@
-{
-  "issues": [
-    {
-      "key": "ABCDE",
-      "component": "struts:Action.java",
-      "project": "struts",
-      "rule": "squid:CycleBetweenPackages",
-      "severity": "CRITICAL",
-      "status": "OPEN",
-      "comments": [
-        {
-          "key": "COMMENT-1",
-          "login": "morgan",
-          "htmlText": "the first comment",
-          "createdAt": "2013-05-18T13:45:34+0200"
-        },
-        {
-          "key": "COMMENT-2",
-          "login": "arthur",
-          "htmlText": "the second comment",
-          "createdAt": "2013-06-19T00:02:03+0100"
-        }
-      ]
-    }
-  ],
-  "rules": [
-    {
-
-      "key": "squid:CycleBetweenPackages",
-      "name": "Avoid cycle between java packages",
-      "desc": "<p>\nWhen several packages are involved in a cycle (package A > package B > package C > package A where \">\" means \"depends upon\"),\nthat means that those packages are highly coupled and that there is no way to reuse/extract one of those packages without importing all the other packages.\nSuch cycle could quickly increase the effort required to maintain an application and to embrace business change.\nSonar not only detect cycles between packages but also determines what is the minimum effort to break those cycles.\nThis rule log a violation on each source file having an outgoing dependency to be but in order to break a cycle.\n</p>\n"
-
-    }
-  ],
-  "components": [
-    {
-      "key": "struts:Action.java",
-      "name": "Action",
-      "qualifier": "CLA",
-      "longName": "org.struts.Action"
-    }
-  ],
-  "projects": [
-    {
-      "key": "struts",
-      "name": "Struts",
-      "qualifier": "TRK",
-      "longName": "org.struts"
-    }
-  ],
-  "paging": {
-    "pageIndex": 1,
-    "pageSize": 100,
-    "total": 2,
-    "pages": 1
-  },
-  "maxResultsReached": false
-}
\ No newline at end of file
diff --git a/server/sonar-ws-client/src/test/resources/org/sonar/wsclient/issue/internal/IssueJsonParserTest/issue-with-technical-debt.json b/server/sonar-ws-client/src/test/resources/org/sonar/wsclient/issue/internal/IssueJsonParserTest/issue-with-technical-debt.json
deleted file mode 100644 (file)
index 1da214f..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-{
-    "issues": [
-        {
-            "key": "ABCDE",
-            "component": "Action.java",
-            "project": "struts",
-            "rule": "squid:CycleBetweenPackages",
-            "severity": "CRITICAL",
-            "status": "OPEN",
-            "debt": "3d10min"
-        }
-    ],
-    "rules": [
-        {
-
-            "key": "squid:CycleBetweenPackages",
-            "name": "Avoid cycle between java packages",
-            "desc": "<p>\nWhen several packages are involved in a cycle (package A > package B > package C > package A where \">\" means \"depends upon\"),\nthat means that those packages are highly coupled and that there is no way to reuse/extract one of those packages without importing all the other packages.\nSuch cycle could quickly increase the effort required to maintain an application and to embrace business change.\nSonar not only detect cycles between packages but also determines what is the minimum effort to break those cycles.\nThis rule log a violation on each source file having an outgoing dependency to be but in order to break a cycle.\n</p>\n"
-
-        }
-    ],
-    "paging": {
-        "pageIndex": 1,
-        "pageSize": 100,
-        "total": 2,
-        "pages": 1
-    },
-    "maxResultsReached": false
-}
diff --git a/server/sonar-ws-client/src/test/resources/org/sonar/wsclient/issue/internal/IssueJsonParserTest/issue-with-users.json b/server/sonar-ws-client/src/test/resources/org/sonar/wsclient/issue/internal/IssueJsonParserTest/issue-with-users.json
deleted file mode 100644 (file)
index 7d8bc65..0000000
+++ /dev/null
@@ -1,56 +0,0 @@
-{
-    "issues": [
-        {
-            "key": "ABCDE",
-            "component": "Action.java",
-            "project": "struts",
-            "rule": "squid:CycleBetweenPackages",
-            "severity": "CRITICAL",
-            "status": "OPEN",
-            "comments": [
-                {
-                    "key": "COMMENT-1",
-                    "login": "morgan",
-                    "htmlText": "the first comment",
-                    "createdAt": "2013-05-18T13:45:34+0200"
-                },
-                {
-                    "key": "COMMENT-2",
-                    "login": "arthur",
-                    "htmlText": "the second comment",
-                    "createdAt": "2013-06-19T00:02:03+0100"
-                }
-            ]
-        }
-    ],
-    "rules": [
-        {
-
-            "key": "squid:CycleBetweenPackages",
-            "name": "Avoid cycle between java packages",
-            "desc": "<p>\nWhen several packages are involved in a cycle (package A > package B > package C > package A where \">\" means \"depends upon\"),\nthat means that those packages are highly coupled and that there is no way to reuse/extract one of those packages without importing all the other packages.\nSuch cycle could quickly increase the effort required to maintain an application and to embrace business change.\nSonar not only detect cycles between packages but also determines what is the minimum effort to break those cycles.\nThis rule log a violation on each source file having an outgoing dependency to be but in order to break a cycle.\n</p>\n"
-
-        }
-    ],
-    "users": [
-      {
-        "login": "morgan",
-        "name": "Morgan",
-        "active": true,
-        "email": "mor@gan.bzh"
-      },
-      {
-        "login": "arthur",
-        "name": "Arthur",
-        "active": false,
-        "email": "ar@thur.bzh"
-      }
-    ],
-    "paging": {
-        "pageIndex": 1,
-        "pageSize": 100,
-        "total": 2,
-        "pages": 1
-    },
-    "maxResultsReached": false
-}
\ No newline at end of file
diff --git a/server/sonar-ws-client/src/test/resources/org/sonar/wsclient/issue/internal/IssueJsonParserTest/search.json b/server/sonar-ws-client/src/test/resources/org/sonar/wsclient/issue/internal/IssueJsonParserTest/search.json
deleted file mode 100644 (file)
index 85235b4..0000000
+++ /dev/null
@@ -1,57 +0,0 @@
-{
-  "issues": [
-    {
-      "key": "ABCDE",
-      "component": "Action.java",
-      "componentId": 5,
-      "project": "struts",
-      "rule": "squid:CycleBetweenPackages",
-      "severity": "CRITICAL",
-      "line": 10,
-      "resolution": "FIXED",
-      "status": "OPEN",
-      "assignee": "karadoc",
-      "message": "the message",
-      "title": "the title",
-      "reporter": "perceval",
-      "author": "pirlouis",
-      "actionPlan": "9450b10c-e725-48b8-bf01-acdec751c491",
-      "creationDate": "2013-05-18T12:45:34+0200",
-      "updateDate": "2013-05-18T13:45:34+0200",
-      "closeDate": "2013-05-18T14:45:34+0200",
-      "attr": {
-        "JIRA": "FOO-1234"
-      }
-    },
-    {
-      "key": "FGHIJ",
-      "component": "Filter.java",
-      "project": "struts",
-      "rule": "checkstyle:com.puppycrawl.tools.checkstyle.checks.imports.UnusedImportsCheck",
-      "severity": "BLOCKER",
-      "resolution": "FIXED",
-      "status": "OPEN"
-    }
-  ],
-  "rules": [
-    {
-
-      "key": "squid:CycleBetweenPackages",
-      "name": "Avoid cycle between java packages",
-      "desc": "<p>\nWhen several packages are involved in a cycle (package A > package B > package C > package A where \">\" means \"depends upon\"),\nthat means that those packages are highly coupled and that there is no way to reuse/extract one of those packages without importing all the other packages.\nSuch cycle could quickly increase the effort required to maintain an application and to embrace business change.\nSonar not only detect cycles between packages but also determines what is the minimum effort to break those cycles.\nThis rule log a violation on each source file having an outgoing dependency to be but in order to break a cycle.\n</p>\n"
-
-    },
-    {
-      "key": "checkstyle:com.puppycrawl.tools.checkstyle.checks.imports.UnusedImportsCheck",
-      "name": "Unused Imports",
-      "desc": "Checks for unused import statements."
-    }
-  ],
-  "paging": {
-    "pageIndex": 1,
-    "pageSize": 100,
-    "total": 2,
-    "pages": 1
-  },
-  "maxResultsReached": true
-}
diff --git a/server/sonar-ws-client/src/test/resources/plugins/plugins.json b/server/sonar-ws-client/src/test/resources/plugins/plugins.json
deleted file mode 100644 (file)
index d762cf6..0000000
+++ /dev/null
@@ -1 +0,0 @@
-[{"key": "foo", "name": "Foo", "version": "1.0"}]
diff --git a/server/sonar-ws-client/src/test/resources/profiles/profile.json b/server/sonar-ws-client/src/test/resources/profiles/profile.json
deleted file mode 100644 (file)
index e3bdff1..0000000
+++ /dev/null
@@ -1 +0,0 @@
-[{"name":"Sonar way","language":"java","default":true,"rules":[{"key":"com.puppycrawl.tools.checkstyle.checks.coding.InnerAssignmentCheck","repo":"checkstyle","severity":"MAJOR"},{"key":"com.puppycrawl.tools.checkstyle.checks.coding.SimplifyBooleanReturnCheck","repo":"checkstyle","severity":"MAJOR"},{"key":"EmptyStaticInitializer","repo":"pmd","severity":"MAJOR"},{"key":"com.puppycrawl.tools.checkstyle.checks.naming.LocalFinalVariableNameCheck","repo":"checkstyle","severity":"MAJOR","params":[{"key":"format","value":"^[a-z][a-zA-Z0-9]*$"}]},{"key":"com.puppycrawl.tools.checkstyle.checks.coding.StringLiteralEqualityCheck","repo":"checkstyle","severity":"MAJOR"},{"key":"com.puppycrawl.tools.checkstyle.checks.coding.EmptyStatementCheck","repo":"checkstyle","severity":"MINOR"},{"key":"com.puppycrawl.tools.checkstyle.checks.modifier.ModifierOrderCheck","repo":"checkstyle","severity":"MINOR"},{"key":"com.puppycrawl.tools.checkstyle.checks.metrics.BooleanExpressionComplexityCheck","repo":"checkstyle","severity":"MAJOR"},{"key":"com.puppycrawl.tools.checkstyle.checks.design.HideUtilityClassConstructorCheck","repo":"checkstyle","severity":"MAJOR"},{"key":"com.puppycrawl.tools.checkstyle.checks.sizes.AnonInnerLengthCheck","repo":"checkstyle","severity":"MAJOR"},{"key":"com.puppycrawl.tools.checkstyle.checks.imports.UnusedImportsCheck","repo":"checkstyle","severity":"INFO"},{"key":"com.puppycrawl.tools.checkstyle.checks.naming.LocalVariableNameCheck","repo":"checkstyle","severity":"MAJOR","params":[{"key":"format","value":"^[a-z][a-zA-Z0-9]*$"}]},{"key":"com.puppycrawl.tools.checkstyle.checks.naming.PackageNameCheck","repo":"checkstyle","severity":"MAJOR","params":[{"key":"format","value":"^[a-z]+(\\.[a-zA-Z_][a-zA-Z0-9_]*)*$"}]},{"key":"com.puppycrawl.tools.checkstyle.checks.metrics.CyclomaticComplexityCheck","repo":"checkstyle","severity":"MAJOR","params":[{"key":"max","value":"10"}]},{"key":"com.puppycrawl.tools.checkstyle.checks.naming.MethodNameCheck","repo":"checkstyle","severity":"MAJOR","params":[{"key":"format","value":"^[a-z][a-zA-Z0-9]*$"},{"key":"allowClassName","value":"false"}]},{"key":"com.puppycrawl.tools.checkstyle.checks.naming.MemberNameCheck","repo":"checkstyle","severity":"MAJOR","params":[{"key":"format","value":"^[a-z][a-zA-Z0-9]*$"},{"key":"applyToPrivate","value":"true"},{"key":"applyToPackage","value":"true"},{"key":"applyToProtected","value":"true"},{"key":"applyToPublic","value":"true"}]},{"key":"com.puppycrawl.tools.checkstyle.checks.naming.ParameterNameCheck","repo":"checkstyle","severity":"MAJOR","params":[{"key":"format","value":"^[a-z][a-zA-Z0-9]*$"}]},{"key":"com.puppycrawl.tools.checkstyle.checks.design.DesignForExtensionCheck","repo":"checkstyle","severity":"MINOR"},{"key":"com.puppycrawl.tools.checkstyle.checks.coding.HiddenFieldCheck","repo":"checkstyle","severity":"MAJOR","params":[{"key":"ignoreAbstractMethods","value":"true"},{"key":"ignoreSetter","value":"true"},{"key":"ignoreConstructorParameter","value":"true"},{"key":"tokens","value":"VARIABLE_DEF"}]},{"key":"com.puppycrawl.tools.checkstyle.checks.coding.IllegalThrowsCheck","repo":"checkstyle","severity":"MAJOR"},{"key":"com.puppycrawl.tools.checkstyle.checks.design.VisibilityModifierCheck","repo":"checkstyle","severity":"MAJOR"},{"key":"com.puppycrawl.tools.checkstyle.checks.modifier.RedundantModifierCheck","repo":"checkstyle","severity":"MINOR"},{"key":"com.puppycrawl.tools.checkstyle.checks.coding.DoubleCheckedLockingCheck","repo":"checkstyle","severity":"MAJOR"},{"key":"com.puppycrawl.tools.checkstyle.checks.coding.EqualsHashCodeCheck","repo":"checkstyle","severity":"CRITICAL"},{"key":"com.puppycrawl.tools.checkstyle.checks.coding.SimplifyBooleanExpressionCheck","repo":"checkstyle","severity":"MAJOR"},{"key":"com.puppycrawl.tools.checkstyle.checks.coding.RedundantThrowsCheck","repo":"checkstyle","severity":"MINOR"},{"key":"com.puppycrawl.tools.checkstyle.checks.naming.StaticVariableNameCheck","repo":"checkstyle","severity":"MAJOR","params":[{"key":"format","value":"^[a-z][a-zA-Z0-9]*$"},{"key":"applyToPrivate","value":"true"},{"key":"applyToPackage","value":"true"},{"key":"applyToProtected","value":"true"},{"key":"applyToPublic","value":"true"}]},{"key":"com.puppycrawl.tools.checkstyle.checks.coding.ParameterAssignmentCheck","repo":"checkstyle","severity":"MAJOR"},{"key":"com.puppycrawl.tools.checkstyle.checks.coding.DefaultComesLastCheck","repo":"checkstyle","severity":"MAJOR"},{"key":"com.puppycrawl.tools.checkstyle.checks.naming.ConstantNameCheck","repo":"checkstyle","severity":"MINOR","params":[{"key":"format","value":"^[A-Z][A-Z0-9]*(_[A-Z0-9]+)*$"},{"key":"applyToPrivate","value":"true"},{"key":"applyToPackage","value":"true"},{"key":"applyToProtected","value":"true"},{"key":"applyToPublic","value":"true"}]},{"key":"com.puppycrawl.tools.checkstyle.checks.design.FinalClassCheck","repo":"checkstyle","severity":"MAJOR"},{"key":"com.puppycrawl.tools.checkstyle.checks.coding.MagicNumberCheck","repo":"checkstyle","severity":"MINOR"},{"key":"EmptyFinalizer","repo":"pmd","severity":"MAJOR"},{"key":"IfElseStmtsMustUseBraces","repo":"pmd","severity":"MAJOR"},{"key":"UseCorrectExceptionLogging","repo":"pmd","severity":"MAJOR"},{"key":"SingularField","repo":"pmd","severity":"MINOR"},{"key":"AvoidAssertAsIdentifier","repo":"pmd","severity":"MAJOR"},{"key":"AvoidRethrowingException","repo":"pmd","severity":"MAJOR"},{"key":"DontImportJavaLang","repo":"pmd","severity":"MINOR"},{"key":"UnusedPrivateField","repo":"pmd","severity":"MAJOR"},{"key":"UnusedFormalParameter","repo":"pmd","severity":"MAJOR"},{"key":"StringToString","repo":"pmd","severity":"MAJOR"},{"key":"BigIntegerInstantiation","repo":"pmd","severity":"MAJOR"},{"key":"StringBufferInstantiationWithChar","repo":"pmd","severity":"MAJOR"},{"key":"CloneThrowsCloneNotSupportedException","repo":"pmd","severity":"MAJOR"},{"key":"ReplaceEnumerationWithIterator","repo":"pmd","severity":"MAJOR"},{"key":"StringInstantiation","repo":"pmd","severity":"MAJOR"},{"key":"UselessStringValueOf","repo":"pmd","severity":"MINOR"},{"key":"NcssTypeCount","repo":"pmd","severity":"MAJOR","params":[{"key":"minimum","value":"800"}]},{"key":"MissingStaticMethodInNonInstantiatableClass","repo":"pmd","severity":"MAJOR"},{"key":"ClassCastExceptionWithToArray","repo":"pmd","severity":"MAJOR"},{"key":"AvoidDuplicateLiterals","repo":"pmd","severity":"MAJOR"},{"key":"UseArraysAsList","repo":"pmd","severity":"MAJOR"},{"key":"MethodWithSameNameAsEnclosingClass","repo":"pmd","severity":"MAJOR"},{"key":"FinalFieldCouldBeStatic","repo":"pmd","severity":"MINOR"},{"key":"AvoidDollarSigns","repo":"pmd","severity":"MINOR"},{"key":"BooleanInstantiation","repo":"pmd","severity":"MAJOR"},{"key":"CompareObjectsWithEquals","repo":"pmd","severity":"MAJOR"},{"key":"CollapsibleIfStatements","repo":"pmd","severity":"MINOR"},{"key":"SuspiciousConstantFieldName","repo":"pmd","severity":"MAJOR"},{"key":"UseStringBufferLength","repo":"pmd","severity":"MINOR"},{"key":"WhileLoopsMustUseBraces","repo":"pmd","severity":"MAJOR"},{"key":"PreserveStackTrace","repo":"pmd","severity":"MAJOR"},{"key":"DontImportSun","repo":"pmd","severity":"MINOR"},{"key":"FinalizeOverloaded","repo":"pmd","severity":"MAJOR"},{"key":"CloneMethodMustImplementCloneable","repo":"pmd","severity":"MAJOR"},{"key":"UnusedLocalVariable","repo":"pmd","severity":"MAJOR"},{"key":"EmptySynchronizedBlock","repo":"pmd","severity":"CRITICAL"},{"key":"EmptyIfStmt","repo":"pmd","severity":"CRITICAL"},{"key":"UnnecessaryCaseChange","repo":"pmd","severity":"MINOR"},{"key":"EmptySwitchStatements","repo":"pmd","severity":"MAJOR"},{"key":"UnusedModifier","repo":"pmd","severity":"INFO"},{"key":"LooseCoupling","repo":"pmd","severity":"MAJOR"},{"key":"SignatureDeclareThrowsException","repo":"pmd","severity":"MAJOR"},{"key":"UnusedPrivateMethod","repo":"pmd","severity":"MAJOR"},{"key":"AvoidThrowingRawExceptionTypes","repo":"pmd","severity":"MAJOR"},{"key":"NcssMethodCount","repo":"pmd","severity":"MAJOR","params":[{"key":"minimum","value":"50"}]},{"key":"ExceptionAsFlowControl","repo":"pmd","severity":"MAJOR"},{"key":"ArrayIsStoredDirectly","repo":"pmd","severity":"CRITICAL"},{"key":"ClassNamingConventions","repo":"pmd","severity":"MAJOR"},{"key":"ReplaceHashtableWithMap","repo":"pmd","severity":"MAJOR"},{"key":"CloseResource","repo":"pmd","severity":"MAJOR"},{"key":"FinalizeDoesNotCallSuperFinalize","repo":"pmd","severity":"MAJOR"},{"key":"AvoidCatchingThrowable","repo":"pmd","severity":"CRITICAL"},{"key":"EmptyTryBlock","repo":"pmd","severity":"MAJOR"},{"key":"EmptyFinallyBlock","repo":"pmd","severity":"CRITICAL"},{"key":"ConstructorCallsOverridableMethod","repo":"pmd","severity":"MAJOR"},{"key":"AvoidInstanceofChecksInCatchClause","repo":"pmd","severity":"MINOR"},{"key":"AvoidThrowingNullPointerException","repo":"pmd","severity":"MAJOR"},{"key":"IfStmtsMustUseBraces","repo":"pmd","severity":"MAJOR"},{"key":"UnconditionalIfStatement","repo":"pmd","severity":"CRITICAL"},{"key":"EmptyWhileStmt","repo":"pmd","severity":"CRITICAL"},{"key":"AvoidCatchingNPE","repo":"pmd","severity":"MAJOR"},{"key":"AvoidDecimalLiteralsInBigDecimalConstructor","repo":"pmd","severity":"MAJOR"},{"key":"AvoidCallingFinalize","repo":"pmd","severity":"MAJOR"},{"key":"ReplaceVectorWithList","repo":"pmd","severity":"MAJOR"},{"key":"SuspiciousEqualsMethodName","repo":"pmd","severity":"CRITICAL"},{"key":"IdempotentOperations","repo":"pmd","severity":"MAJOR"},{"key":"AvoidPrintStackTrace","repo":"pmd","severity":"MAJOR"},{"key":"ForLoopsMustUseBraces","repo":"pmd","severity":"MAJOR"},{"key":"AvoidArrayLoops","repo":"pmd","severity":"MAJOR"},{"key":"UnnecessaryLocalBeforeReturn","repo":"pmd","severity":"MAJOR"},{"key":"UselessOperationOnImmutable","repo":"pmd","severity":"CRITICAL"},{"key":"InefficientStringBuffering","repo":"pmd","severity":"MAJOR"},{"key":"SuspiciousHashcodeMethodName","repo":"pmd","severity":"MAJOR"},{"key":"UseArrayListInsteadOfVector","repo":"pmd","severity":"MAJOR"},{"key":"UseIndexOfChar","repo":"pmd","severity":"MAJOR"},{"key":"InstantiationToGetClass","repo":"pmd","severity":"MAJOR"},{"key":"UnusedNullCheckInEquals","repo":"pmd","severity":"MAJOR"},{"key":"SystemPrintln","repo":"pmd","severity":"MAJOR"},{"key":"IntegerInstantiation","repo":"pmd","severity":"MAJOR"},{"key":"EqualsNull","repo":"pmd","severity":"CRITICAL"},{"key":"UselessOverridingMethod","repo":"pmd","severity":"MAJOR"},{"key":"AvoidEnumAsIdentifier","repo":"pmd","severity":"MAJOR"},{"key":"SimplifyConditional","repo":"pmd","severity":"MAJOR"},{"key":"BrokenNullCheck","repo":"pmd","severity":"CRITICAL"}]}]
\ No newline at end of file
diff --git a/server/sonar-ws-client/src/test/resources/properties/many.json b/server/sonar-ws-client/src/test/resources/properties/many.json
deleted file mode 100644 (file)
index 87d57bf..0000000
+++ /dev/null
@@ -1 +0,0 @@
-[{"key":"myprop","value":"myvalue"},{"key":"myprop2","value":"myvalue2"},{"key":"myprop3","value":"myvalue3"}]
\ No newline at end of file
diff --git a/server/sonar-ws-client/src/test/resources/properties/single.json b/server/sonar-ws-client/src/test/resources/properties/single.json
deleted file mode 100644 (file)
index f1f0be4..0000000
+++ /dev/null
@@ -1 +0,0 @@
-[{"key":"myprop","value":"myvalue"}]
\ No newline at end of file
diff --git a/server/sonar-ws-client/src/test/resources/resources/many-resources-with-measures.json b/server/sonar-ws-client/src/test/resources/resources/many-resources-with-measures.json
deleted file mode 100644 (file)
index 2812849..0000000
+++ /dev/null
@@ -1 +0,0 @@
-[{"id":38909,"key":"org.codehaus.sonar:sonar-plugin-api","name":"Sonar API","scope":"PRJ","qualifier":"BRC","date":"2010-01-01T22:27:25+0000","lang":"java","version":"1.13-SNAPSHOT","description":"Embrace Quality","msr":[{"key":"ncloc","val":9955.0,"frmt_val":"9,955"},{"key":"lines","val":19679.0,"frmt_val":"19,679"}]},{"id":94156,"key":"org.codehaus.sonar:sonar-squid","name":"Sonar Squid","scope":"PRJ","qualifier":"BRC","date":"2010-01-01T22:29:42+0000","lang":"java","version":"1.13-SNAPSHOT","description":"Embrace Quality","msr":[{"key":"ncloc","val":4757.0,"frmt_val":"4,757"},{"key":"lines","val":8279.0,"frmt_val":"8,279"}]},{"id":182945,"key":"org.codehaus.sonar:sonar-colorizer","name":"Sonar Code Colorizer","scope":"PRJ","qualifier":"BRC","date":"2010-01-01T22:32:32+0000","lang":"java","version":"1.13-SNAPSHOT","description":"Embrace Quality","msr":[{"key":"ncloc","val":829.0,"frmt_val":"829"},{"key":"lines","val":1566.0,"frmt_val":"1,566"}]},{"id":39023,"key":"org.codehaus.sonar:sonar-core","name":"Sonar core","scope":"PRJ","qualifier":"BRC","date":"2010-01-01T22:32:57+0000","lang":"java","version":"1.13-SNAPSHOT","description":"Embrace Quality","msr":[{"key":"ncloc","val":2471.0,"frmt_val":"2,471"},{"key":"lines","val":3830.0,"frmt_val":"3,830"}]},{"id":88480,"key":"org.codehaus.sonar.runtime:sonar-core-maven-plugin","name":"Sonar batch","scope":"PRJ","qualifier":"BRC","date":"2010-01-01T22:33:57+0000","lang":"java","version":"1.13-SNAPSHOT","description":"Sonar batch","msr":[{"key":"ncloc","val":1790.0,"frmt_val":"1,790"},{"key":"lines","val":2835.0,"frmt_val":"2,835"}]},{"id":39141,"key":"org.codehaus.sonar:sonar-web","name":"Sonar web","scope":"PRJ","qualifier":"BRC","date":"2010-01-01T22:34:42+0000","lang":"java","version":"1.13-SNAPSHOT","description":"Embrace Quality","msr":[{"key":"ncloc","val":1359.0,"frmt_val":"1,359"},{"key":"lines","val":1992.0,"frmt_val":"1,992"}]},{"id":39212,"key":"org.codehaus.sonar:sonar-application","name":"Sonar application","scope":"PRJ","qualifier":"BRC","date":"2010-01-01T22:35:38+0000","lang":"java","version":"1.13-SNAPSHOT","description":"Package the standalone distribution","msr":[{"key":"ncloc","val":163.0,"frmt_val":"163"},{"key":"lines","val":230.0,"frmt_val":"230"}]},{"id":48696,"key":"org.codehaus.sonar.plugins:sonar-plugin-core","name":"Sonar plugin core","scope":"PRJ","qualifier":"BRC","date":"2010-01-01T22:35:53+0000","lang":"java","version":"1.13-SNAPSHOT","description":"Embrace Quality","msr":[{"key":"ncloc","val":1913.0,"frmt_val":"1,913"},{"key":"lines","val":3318.0,"frmt_val":"3,318"}]},{"id":39200,"key":"org.codehaus.sonar.plugins:sonar-plugin-checkstyle","name":"Sonar Checkstyle plugin","scope":"PRJ","qualifier":"BRC","date":"2010-01-01T22:39:05+0000","lang":"java","version":"1.13-SNAPSHOT","description":"Embrace Quality","msr":[{"key":"ncloc","val":488.0,"frmt_val":"488"},{"key":"lines","val":770.0,"frmt_val":"770"}]},{"id":39218,"key":"org.codehaus.sonar.plugins:sonar-plugin-pmd","name":"Sonar PMD plugin","scope":"PRJ","qualifier":"BRC","date":"2010-01-01T22:39:21+0000","lang":"java","version":"1.13-SNAPSHOT","description":"Embrace Quality","msr":[{"key":"ncloc","val":478.0,"frmt_val":"478"},{"key":"lines","val":762.0,"frmt_val":"762"}]},{"id":48767,"key":"org.codehaus.sonar.plugins:sonar-plugin-cobertura","name":"Sonar Cobertura plugin","scope":"PRJ","qualifier":"BRC","date":"2010-01-01T22:39:37+0000","lang":"java","version":"1.13-SNAPSHOT","description":"Embrace Quality","msr":[{"key":"ncloc","val":286.0,"frmt_val":"286"},{"key":"lines","val":396.0,"frmt_val":"396"}]},{"id":48774,"key":"org.codehaus.sonar.plugins:sonar-plugin-clover","name":"Sonar Clover plugin","scope":"PRJ","qualifier":"BRC","date":"2010-01-01T22:39:52+0000","lang":"java","version":"1.13-SNAPSHOT","description":"Embrace Quality","msr":[{"key":"ncloc","val":471.0,"frmt_val":"471"},{"key":"lines","val":727.0,"frmt_val":"727"}]},{"id":48796,"key":"org.codehaus.sonar.plugins:sonar-plugin-surefire","name":"Sonar Surefire plugin","scope":"PRJ","qualifier":"BRC","date":"2010-01-01T22:40:08+0000","lang":"java","version":"1.13-SNAPSHOT","description":"Embrace Quality","msr":[{"key":"ncloc","val":393.0,"frmt_val":"393"},{"key":"lines","val":575.0,"frmt_val":"575"}]},{"id":48806,"key":"org.codehaus.sonar.plugins:sonar-plugin-googleanalytics","name":"Sonar Google analytics plugin","scope":"PRJ","qualifier":"BRC","date":"2010-01-01T22:40:21+0000","lang":"java","version":"1.13-SNAPSHOT","description":"Embrace Quality","msr":[{"key":"ncloc","val":65.0,"frmt_val":"65"},{"key":"lines","val":120.0,"frmt_val":"120"}]},{"id":48810,"key":"org.codehaus.sonar.plugins:sonar-plugin-findbugs","name":"Sonar Findbugs plugin","scope":"PRJ","qualifier":"BRC","date":"2010-01-01T22:40:29+0000","lang":"java","version":"1.13-SNAPSHOT","description":"Embrace Quality","msr":[{"key":"ncloc","val":862.0,"frmt_val":"862"},{"key":"lines","val":1447.0,"frmt_val":"1,447"}]},{"id":48790,"key":"org.codehaus.sonar.plugins:sonar-plugin-cpd","name":"Sonar CPD plugin","scope":"PRJ","qualifier":"BRC","date":"2010-01-01T22:40:47+0000","lang":"java","version":"1.13-SNAPSHOT","description":"Embrace Quality","msr":[{"key":"ncloc","val":347.0,"frmt_val":"347"},{"key":"lines","val":552.0,"frmt_val":"552"}]},{"id":94200,"key":"org.codehaus.sonar.plugins:sonar-plugin-squid","name":"Sonar Squid plugin","scope":"PRJ","qualifier":"BRC","date":"2010-01-01T22:40:59+0000","lang":"java","version":"1.13-SNAPSHOT","description":"Embrace Quality","msr":[{"key":"ncloc","val":439.0,"frmt_val":"439"},{"key":"lines","val":720.0,"frmt_val":"720"}]}]
\ No newline at end of file
diff --git a/server/sonar-ws-client/src/test/resources/resources/many-resources.json b/server/sonar-ws-client/src/test/resources/resources/many-resources.json
deleted file mode 100644 (file)
index 680d413..0000000
+++ /dev/null
@@ -1 +0,0 @@
-[{"id":38909,"key":"org.codehaus.sonar:sonar-plugin-api","name":"Sonar API","scope":"PRJ","qualifier":"BRC","date":"2010-01-01T22:27:25+0000","creationDate":"2009-01-01T22:27:25+0000","lang":"java","version":"1.13-SNAPSHOT","description":"Embrace Quality"},{"id":94156,"key":"org.codehaus.sonar:sonar-squid","name":"Sonar Squid","scope":"PRJ","qualifier":"BRC","date":"2010-01-01T22:29:42+0000","creationDate":"2009-01-01T22:27:25+0000","lang":"java","version":"1.13-SNAPSHOT","description":"Embrace Quality"},{"id":182945,"key":"org.codehaus.sonar:sonar-colorizer","name":"Sonar Code Colorizer","scope":"PRJ","qualifier":"BRC","date":"2010-01-01T22:32:32+0000","creationDate":"2009-01-01T22:27:25+0000","lang":"java","version":"1.13-SNAPSHOT","description":"Embrace Quality"},{"id":222615,"key":"org.codehaus.sonar:sonar-client","name":"Sonar Client","scope":"PRJ","qualifier":"BRC","date":"2010-01-01T22:32:50+0000","creationDate":"2009-01-01T22:27:25+0000","lang":"java","version":"1.13-SNAPSHOT","description":"Embrace Quality"},{"id":172279,"key":"org.codehaus.sonar.archetypes:sonar-archetypes","name":"Sonar archetypes","scope":"PRJ","qualifier":"BRC","date":"2010-01-01T22:32:53+0000","creationDate":"2009-01-01T22:27:25+0000","lang":"java","version":"1.13-SNAPSHOT","description":"Embrace Quality"},{"id":39023,"key":"org.codehaus.sonar:sonar-core","name":"Sonar core","scope":"PRJ","qualifier":"BRC","date":"2010-01-01T22:32:57+0000","creationDate":"2009-01-01T22:27:25+0000","lang":"java","version":"1.13-SNAPSHOT","description":"Embrace Quality"},{"id":88480,"key":"org.codehaus.sonar.runtime:sonar-core-maven-plugin","name":"Sonar batch","scope":"PRJ","qualifier":"BRC","date":"2010-01-01T22:33:57+0000","creationDate":"2009-01-01T22:27:25+0000","lang":"java","version":"1.13-SNAPSHOT","description":"Sonar batch"},{"id":39141,"key":"org.codehaus.sonar:sonar-web","name":"Sonar web","scope":"PRJ","qualifier":"BRC","date":"2010-01-01T22:34:42+0000","creationDate":"2009-01-01T22:27:25+0000","lang":"java","version":"1.13-SNAPSHOT","description":"Embrace Quality"},{"id":39212,"key":"org.codehaus.sonar:sonar-application","name":"Sonar application","scope":"PRJ","qualifier":"BRC","date":"2010-01-01T22:35:38+0000","creationDate":"2009-01-01T22:27:25+0000","lang":"java","version":"1.13-SNAPSHOT","description":"Package the standalone distribution"},{"id":48696,"key":"org.codehaus.sonar.plugins:sonar-plugin-core","name":"Sonar plugin core","scope":"PRJ","qualifier":"BRC","date":"2010-01-01T22:35:53+0000","creationDate":"2009-01-01T22:27:25+0000","lang":"java","version":"1.13-SNAPSHOT","description":"Embrace Quality"},{"id":39200,"key":"org.codehaus.sonar.plugins:sonar-plugin-checkstyle","name":"Sonar Checkstyle plugin","scope":"PRJ","qualifier":"BRC","date":"2010-01-01T22:39:05+0000","creationDate":"2009-01-01T22:27:25+0000","lang":"java","version":"1.13-SNAPSHOT","description":"Embrace Quality"},{"id":39218,"key":"org.codehaus.sonar.plugins:sonar-plugin-pmd","name":"Sonar PMD plugin","scope":"PRJ","qualifier":"BRC","date":"2010-01-01T22:39:21+0000","creationDate":"2009-01-01T22:27:25+0000","lang":"java","version":"1.13-SNAPSHOT","description":"Embrace Quality"},{"id":48767,"key":"org.codehaus.sonar.plugins:sonar-plugin-cobertura","name":"Sonar Cobertura plugin","scope":"PRJ","qualifier":"BRC","date":"2010-01-01T22:39:37+0000","creationDate":"2009-01-01T22:27:25+0000","lang":"java","version":"1.13-SNAPSHOT","description":"Embrace Quality"},{"id":48774,"key":"org.codehaus.sonar.plugins:sonar-plugin-clover","name":"Sonar Clover plugin","scope":"PRJ","qualifier":"BRC","date":"2010-01-01T22:39:52+0000","creationDate":"2009-01-01T22:27:25+0000","lang":"java","version":"1.13-SNAPSHOT","description":"Embrace Quality"},{"id":48796,"key":"org.codehaus.sonar.plugins:sonar-plugin-surefire","name":"Sonar Surefire plugin","scope":"PRJ","qualifier":"BRC","date":"2010-01-01T22:40:08+0000","creationDate":"2009-01-01T22:27:25+0000","lang":"java","version":"1.13-SNAPSHOT","description":"Embrace Quality"},{"id":48806,"key":"org.codehaus.sonar.plugins:sonar-plugin-googleanalytics","name":"Sonar Google analytics plugin","scope":"PRJ","qualifier":"BRC","date":"2010-01-01T22:40:21+0000","creationDate":"2009-01-01T22:27:25+0000","lang":"java","version":"1.13-SNAPSHOT","description":"Embrace Quality"},{"id":48810,"key":"org.codehaus.sonar.plugins:sonar-plugin-findbugs","name":"Sonar Findbugs plugin","scope":"PRJ","qualifier":"BRC","date":"2010-01-01T22:40:29+0000","creationDate":"2009-01-01T22:27:25+0000","lang":"java","version":"1.13-SNAPSHOT","description":"Embrace Quality"},{"id":48790,"key":"org.codehaus.sonar.plugins:sonar-plugin-cpd","name":"Sonar CPD plugin","scope":"PRJ","qualifier":"BRC","date":"2010-01-01T22:40:47+0000","creationDate":"2009-01-01T22:27:25+0000","lang":"java","version":"1.13-SNAPSHOT","description":"Embrace Quality"},{"id":94200,"key":"org.codehaus.sonar.plugins:sonar-plugin-squid","name":"Sonar Squid plugin","scope":"PRJ","qualifier":"BRC","date":"2010-01-01T22:40:59+0000","creationDate":"2009-01-01T22:27:25+0000","lang":"java","version":"1.13-SNAPSHOT","description":"Embrace Quality"}]
\ No newline at end of file
diff --git a/server/sonar-ws-client/src/test/resources/resources/search.json b/server/sonar-ws-client/src/test/resources/resources/search.json
deleted file mode 100644 (file)
index f0946f2..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-{"total":4, "page":1, "page_size":10, "data":[
-  {
-    "id":8,
-    "key":"org.apache.commons:commons-i18n:org.apache.commons.i18n.JdbcMessageProvider",
-    "nm":"org.apache.commons.i18n.JdbcMessageProvider",
-    "q":"CLA"
-  },
-  {
-    "id":15,
-    "key":"org.apache.commons:commons-i18n:org.apache.commons.i18n.MessageProvider",
-    "nm":"org.apache.commons.i18n.MessageProvider",
-    "q":"CLA"
-  },
-  {
-    "id":16,
-    "key":"org.apache.commons:commons-i18n:org.apache.commons.i18n.ResourceBundleMessageProvider",
-    "nm":"org.apache.commons.i18n.ResourceBundleMessageProvider",
-    "q":"CLA"
-  },
-  {
-    "id":17,
-    "key":"org.apache.commons:commons-i18n:org.apache.commons.i18n.XMLMessageProvider",
-    "nm":"org.apache.commons.i18n.XMLMessageProvider",
-    "q":"CLA"
-  }
-]}
\ No newline at end of file
diff --git a/server/sonar-ws-client/src/test/resources/resources/single-resource-with-measures.json b/server/sonar-ws-client/src/test/resources/resources/single-resource-with-measures.json
deleted file mode 100644 (file)
index 704359e..0000000
+++ /dev/null
@@ -1 +0,0 @@
-[{"id":48569,"key":"org.codehaus.sonar:sonar","name":"Sonar","scope":"PRJ","qualifier":"TRK","date":"2010-01-01T22:27:25+0000","creationDate":"2009-01-01T22:27:25+0000","lang":"java","version":"1.13-SNAPSHOT","description":"Embrace Quality","msr":[{"key":"lines","val":47798.0,"frmt_val":"47,798"},{"key":"ncloc","val":27066.0,"frmt_val":"27,066"}]}]
\ No newline at end of file
diff --git a/server/sonar-ws-client/src/test/resources/resources/single-resource.json b/server/sonar-ws-client/src/test/resources/resources/single-resource.json
deleted file mode 100644 (file)
index 3fa95cc..0000000
+++ /dev/null
@@ -1 +0,0 @@
-[{"id":48569,"key":"org.codehaus.sonar:sonar","name":"Sonar","scope":"PRJ","qualifier":"TRK","date":"2010-01-01T22:27:25+0000","creationDate":"2009-01-01T22:27:25+0000","lang":"java","version":"1.13-SNAPSHOT","description":"Embrace Quality"}]
\ No newline at end of file
diff --git a/server/sonar-ws-client/src/test/resources/server/server.json b/server/sonar-ws-client/src/test/resources/server/server.json
deleted file mode 100644 (file)
index c772e90..0000000
+++ /dev/null
@@ -1 +0,0 @@
-{"id":"123456789", "version":"2.0-SNAPSHOT", "status":"UP", "status_msg":"everything is under control"}
diff --git a/server/sonar-ws-client/src/test/resources/server/status_missing.json b/server/sonar-ws-client/src/test/resources/server/status_missing.json
deleted file mode 100644 (file)
index a68e4ce..0000000
+++ /dev/null
@@ -1 +0,0 @@
-{"id":"123456789", "version":"2.0-SNAPSHOT"}
diff --git a/server/sonar-ws-client/src/test/resources/server_setup/ko.json b/server/sonar-ws-client/src/test/resources/server_setup/ko.json
deleted file mode 100644 (file)
index 3cbef3d..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-{
-  "status" : "ko",
-  "msg": "error"
-}
\ No newline at end of file
diff --git a/server/sonar-ws-client/src/test/resources/server_setup/ok.json b/server/sonar-ws-client/src/test/resources/server_setup/ok.json
deleted file mode 100644 (file)
index 6518b73..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-{
-  "status" : "ok"
-}
\ No newline at end of file
diff --git a/server/sonar-ws-client/src/test/resources/sources/from_line_to_line.json b/server/sonar-ws-client/src/test/resources/sources/from_line_to_line.json
deleted file mode 100644 (file)
index 6900ebc..0000000
+++ /dev/null
@@ -1 +0,0 @@
-[{"3":" * Copyright (C) 2008-2014 SonarSource","4":" * mailto:contact AT sonarsource DOT com","5":" *","6":" * SonarQube is free software; you can redistribute it and\/or","7":" * modify it under the terms of the GNU Lesser General Public","8":" * License as published by the Free Software Foundation; either","9":" * version 3 of the License, or (at your option) any later version.","10":" *","11":" * SonarQube is distributed in the hope that it will be useful,","12":" * but WITHOUT ANY WARRANTY; without even the implied warranty of","13":" * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU","14":" * Lesser General Public License for more details.","15":" *","16":" * You should have received a copy of the GNU Lesser General Public License","17":" * along with this program; if not, write to the Free Software Foundation,"}]
\ No newline at end of file
diff --git a/server/sonar-ws-client/src/test/resources/sources/source.json b/server/sonar-ws-client/src/test/resources/sources/source.json
deleted file mode 100644 (file)
index a562b47..0000000
+++ /dev/null
@@ -1 +0,0 @@
-[{"1":"\/*","2":" * SonarQube, open source software quality management tool.","3":" * Copyright (C) 2008-2014 SonarSource","4":" * mailto:contact AT sonarsource DOT com","5":" *","6":" * SonarQube is free software; you can redistribute it and\/or","7":" * modify it under the terms of the GNU Lesser General Public","8":" * License as published by the Free Software Foundation; either","9":" * version 3 of the License, or (at your option) any later version.","10":" *","11":" * SonarQube is distributed in the hope that it will be useful,","12":" * but WITHOUT ANY WARRANTY; without even the implied warranty of","13":" * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU","14":" * Lesser General Public License for more details.","15":" *","16":" * You should have received a copy of the GNU Lesser General Public License","17":" * along with this program; if not, write to the Free Software Foundation,","18":" * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.","19":" *\/","20":"package org.sonar.api.utils;","21":"","22":"import com.google.common.collect.Multiset;","23":"import org.apache.commons.collections.Bag;","24":"import org.apache.commons.lang.StringUtils;","25":"import org.apache.commons.lang.math.NumberUtils;","26":"import org.sonar.api.rules.RulePriority;","27":"import org.slf4j.LoggerFactory;","28":"","29":"import java.util.HashMap;","30":"import java.util.Map;","31":"","32":"\/**","33":" * Util class to format key\/value data. Output is a string representation ready to be","34":" * injected into the database","35":" *","36":" * @since 1.10","37":" *\/","38":"public final class KeyValueFormat {","39":"","40":"  private KeyValueFormat() {","41":"  }","42":"","43":"  \/**","44":"   * Transforms a string with the following format : &quot;key1=value1;key2=value2...&quot;","45":"   * into a Map&lt;KEY, VALUE&gt;. Requires to implement the transform(key,value) method","46":"   *","47":"   * @param data        the input string","48":"   * @param transformer the interface to implement","49":"   * @return a Map of &lt;key, value&gt;","50":"   *\/","51":"  public static &lt;KEY, VALUE&gt; Map&lt;KEY, VALUE&gt; parse(String data, Transformer&lt;KEY, VALUE&gt; transformer) {","52":"    Map&lt;String, String&gt; rawData = parse(data);","53":"    Map&lt;KEY, VALUE&gt; map = new HashMap&lt;KEY, VALUE&gt;();","54":"    for (Map.Entry&lt;String, String&gt; entry : rawData.entrySet()) {","55":"      KeyValue&lt;KEY, VALUE&gt; keyVal = transformer.transform(entry.getKey(), entry.getValue());","56":"      if (keyVal != null) {","57":"        map.put(keyVal.getKey(), keyVal.getValue());","58":"      }","59":"    }","60":"    return map;","61":"  }","62":"","63":"  \/**","64":"   * Transforms a string with the following format : &quot;key1=value1;key2=value2...&quot;","65":"   * into a Map&lt;String,String&gt;","66":"   *","67":"   * @param data the string to parse","68":"   * @return a map","69":"   *\/","70":"  public static Map&lt;String, String&gt; parse(String data) {","71":"    Map&lt;String, String&gt; map = new HashMap&lt;String, String&gt;();","72":"    String[] pairs = StringUtils.split(data, &quot;;&quot;);","73":"    for (String pair : pairs) {","74":"      String[] keyValue = StringUtils.split(pair, &quot;=&quot;);","75":"      String key = keyValue[0];","76":"      String value = (keyValue.length == 2 ? keyValue[1] : &quot;&quot;);","77":"      map.put(key, value);","78":"    }","79":"    return map;","80":"  }","81":"","82":"  \/**","83":"   * Transforms a map&lt;KEY,VALUE&gt; into a string with the format : &quot;key1=value1;key2=value2...&quot;","84":"   *","85":"   * @param map the map to transform","86":"   * @return the formatted string","87":"   *\/","88":"  public static &lt;KEY, VALUE&gt; String format(Map&lt;KEY, VALUE&gt; map) {","89":"    StringBuilder sb = new StringBuilder();","90":"    boolean first = true;","91":"    for (Map.Entry&lt;?, ?&gt; entry : map.entrySet()) {","92":"      if (!first) {","93":"        sb.append(&quot;;&quot;);","94":"      }","95":"      sb.append(entry.getKey().toString());","96":"      sb.append(&quot;=&quot;);","97":"      if (entry.getValue() != null) {","98":"        sb.append(entry.getValue());","99":"      }","100":"      first = false;","101":"    }","102":"","103":"    return sb.toString();","104":"  }","105":"","106":"  \/**","107":"   * @since 1.11","108":"   * @deprecated use Multiset from google collections instead of commons-collections bags","109":"   *\/","110":"  public static String format(Bag bag) {","111":"    return format(bag, 0);","112":"  }","113":"","114":"  \/**","115":"   * @since 1.11","116":"   * @deprecated use Multiset from google collections instead of commons-collections bags","117":"   *\/","118":"  public static String format(Bag bag, int var) {","119":"    StringBuilder sb = new StringBuilder();","120":"    boolean first = true;","121":"    for (Object obj : bag.uniqueSet()) {","122":"      if (!first) {","123":"        sb.append(&quot;;&quot;);","124":"      }","125":"      sb.append(obj.toString());","126":"      sb.append(&quot;=&quot;);","127":"      sb.append(bag.getCount(obj) + var);","128":"      first = false;","129":"    }","130":"","131":"    return sb.toString();","132":"  }","133":"","134":"  \/**","135":"   * Transforms a Multiset&lt;?&gt; into a string with the format : &quot;key1=count1;key2=count2...&quot;","136":"   *","137":"   * @param set the set to transform","138":"   * @return the formatted string","139":"   *\/","140":"  public static String format(Multiset&lt;?&gt; set) {","141":"    StringBuilder sb = new StringBuilder();","142":"    boolean first = true;","143":"    for (Multiset.Entry&lt;?&gt; entry : set.entrySet()) {","144":"      if (!first) {","145":"        sb.append(&quot;;&quot;);","146":"      }","147":"      sb.append(entry.getElement().toString());","148":"      sb.append(&quot;=&quot;);","149":"      sb.append(entry.getCount());","150":"      first = false;","151":"    }","152":"    return sb.toString();","153":"  }","154":"","155":"  \/**","156":"   * Transforms a Object... into a string with the format : &quot;object1=object2;object3=object4...&quot;","157":"   *","158":"   * @param objects the object list to transform","159":"   * @return the formatted string","160":"   *\/","161":"  public static String format(Object... objects) {","162":"    StringBuilder sb = new StringBuilder();","163":"    boolean first = true;","164":"    if (objects != null) {","165":"      for (int i = 0; i &lt; objects.length; i++) {","166":"        if (!first) {","167":"          sb.append(&quot;;&quot;);","168":"        }","169":"        sb.append(objects[i++].toString());","170":"        sb.append(&quot;=&quot;);","171":"        sb.append(objects[i]);","172":"        first = false;","173":"      }","174":"    }","175":"    return sb.toString();","176":"  }","177":"","178":"  public interface Transformer&lt;KEY, VALUE&gt; {","179":"    KeyValue&lt;KEY, VALUE&gt; transform(String key, String value);","180":"  }","181":"","182":"  \/**","183":"   * Implementation of Transformer&lt;String, Double&gt;","184":"   *\/","185":"  public static class StringNumberPairTransformer implements Transformer&lt;String, Double&gt; {","186":"","187":"    public KeyValue&lt;String, Double&gt; transform(String key, String value) {","188":"      return new KeyValue&lt;String, Double&gt;(key, toDouble(value));","189":"    }","190":"  }","191":"","192":"  \/**","193":"   * Implementation of Transformer&lt;Double, Double&gt;","194":"   *\/","195":"  public static class DoubleNumbersPairTransformer implements Transformer&lt;Double, Double&gt; {","196":"","197":"    public KeyValue&lt;Double, Double&gt; transform(String key, String value) {","198":"      return new KeyValue&lt;Double, Double&gt;(toDouble(key), toDouble(value));","199":"    }","200":"  }","201":"","202":"  \/**","203":"   * Implementation of Transformer&lt;Integer, Integer&gt;","204":"   *\/","205":"  public static class IntegerNumbersPairTransformer implements Transformer&lt;Integer, Integer&gt; {","206":"","207":"    public KeyValue&lt;Integer, Integer&gt; transform(String key, String value) {","208":"      return new KeyValue&lt;Integer, Integer&gt;(toInteger(key), toInteger(value));","209":"    }","210":"  }","211":"","212":"  \/**","213":"   * Implementation of Transformer&lt;RulePriority, Integer&gt;","214":"   *\/","215":"  public static class RulePriorityNumbersPairTransformer implements Transformer&lt;RulePriority, Integer&gt; {","216":"","217":"    public KeyValue&lt;RulePriority, Integer&gt; transform(String key, String value) {","218":"      try {","219":"        if (StringUtils.isBlank(value)) { value = &quot;0&quot;; }","220":"        return new KeyValue&lt;RulePriority, Integer&gt;(RulePriority.valueOf(key.toUpperCase()), Integer.parseInt(value));","221":"      }","222":"      catch (Exception e) {","223":"        LoggerFactory.getLogger(RulePriorityNumbersPairTransformer.class).warn(&quot;Property &quot; + key + &quot; has invalid value: &quot; + value, e);","224":"        return null;","225":"      }","226":"    }","227":"  }","228":"","229":"  private static Double toDouble(String value) {","230":"    return StringUtils.isBlank(value) ? null : NumberUtils.toDouble(value);","231":"  }","232":"","233":"  private static Integer toInteger(String value) {","234":"    return StringUtils.isBlank(value) ? null : NumberUtils.toInt(value);","235":"  }","236":"}"}]
\ No newline at end of file
diff --git a/server/sonar-ws-client/src/test/resources/timemachine/null-values.json b/server/sonar-ws-client/src/test/resources/timemachine/null-values.json
deleted file mode 100644 (file)
index 394d008..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-[
-  {
-    "cols":[
-      {
-        "metric":"ncloc"
-      },
-      {
-        "metric":"coverage"
-      }
-    ],
-    "cells":[
-      {
-        "d":"2010-10-19T00:01:00+0200",
-        "v":[null,80.0]
-      },
-      {
-        "d":"2010-10-21T00:01:00+0100",
-        "v":[29.0,null]
-      },
-      {
-        "d":"2010-10-25T00:04:00+0100",
-        "v":[22.6,null]
-      }
-    ]
-  }
-]
\ No newline at end of file
diff --git a/server/sonar-ws-client/src/test/resources/timemachine/timemachine.json b/server/sonar-ws-client/src/test/resources/timemachine/timemachine.json
deleted file mode 100644 (file)
index c9610fb..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-[
-  {
-    "cols":[
-      {
-        "metric":"ncloc"
-      },
-      {
-        "metric":"coverage"
-      }
-    ],
-    "cells":[
-      {
-        "d":"2010-10-19T13:00:00+0200",
-        "v":[21.0,80.0]
-      },
-      {
-        "d":"2010-10-21T12:00:00+0100",
-        "v":[29.0,70.0]
-      },
-      {
-        "d":"2010-10-25T13:00:00+0100",
-        "v":[22.6,75.0]
-      }
-    ]
-  }
-]
\ No newline at end of file
diff --git a/server/sonar-ws-client/src/test/resources/timemachine/typed-values.json b/server/sonar-ws-client/src/test/resources/timemachine/typed-values.json
deleted file mode 100644 (file)
index b33d948..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-[
-  {
-    "cols":[
-      {
-        "metric":"profile"
-      },
-      {
-        "metric":"coverage"
-      }
-    ],
-    "cells":[
-      {
-        "d":"2010-10-19T00:01:00+0200",
-        "v":["Sonar way",80.0]
-      },
-      {
-        "d":"2010-10-21T00:01:00+0100",
-        "v":["Sonar way",70.0]
-      },
-      {
-        "d":"2010-10-25T00:04:00+0100",
-        "v":["Sun checks",75.0]
-      }
-    ]
-  }
-]
\ No newline at end of file
diff --git a/server/sonar-ws-client/src/test/resources/violations/false-positive.json b/server/sonar-ws-client/src/test/resources/violations/false-positive.json
deleted file mode 100644 (file)
index ee32930..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-[
-  {"id":1,"message":"throw java.lang.Exception","switchedOff": true, "priority":"MAJOR","rule":{"key":"pmd:SignatureDeclareThrowsException","name":"Signature Declare Throws Exception","category":"Maintainability"},"resource":{"key":"org.apache.excalibur.components:excalibur-pool-instrumented:org.apache.avalon.excalibur.pool.TraceableResourceLimitingPool","name":"TraceableResourceLimitingPool","scope":"FIL","qualifier":"CLA","language":"java"}}
-]
\ No newline at end of file
diff --git a/server/sonar-ws-client/src/test/resources/violations/violation-with-incorrect-line.json b/server/sonar-ws-client/src/test/resources/violations/violation-with-incorrect-line.json
deleted file mode 100644 (file)
index aa6b51c..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-[
-       {
-               "id":1,
-               "message":"1 branches need to be covered by unit tests to reach the minimum threshold of 65.0% branch coverage.",
-               "line":0,
-               "priority":"MAJOR",
-               "createdAt":"2011-03-07T16:21:39+0000",
-               "rule":{
-                       "key":"sqale-java:BranchCoverageCheck",
-                       "name":"Insufficient branch coverage by unit tests"
-               },
-               "resource":{
-                       "key":"org.codehaus.sonar.plugins:sonar-pmd-plugin:org.sonar.plugins.pmd.PmdRuleRepository",
-                       "name":"PmdRuleRepository",
-                       "scope":"FIL",
-                       "qualifier":"CLA",
-                       "language":"java"
-               }
-       }
-]
diff --git a/server/sonar-ws-client/src/test/resources/violations/violation-without-optional-fields.json b/server/sonar-ws-client/src/test/resources/violations/violation-without-optional-fields.json
deleted file mode 100644 (file)
index c787433..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-[
-  {"id":1,"message":"throw java.lang.Exception","priority":"MAJOR","rule":{"key":"pmd:SignatureDeclareThrowsException","name":"Signature Declare Throws Exception","category":"Maintainability"},"resource":{"key":"org.apache.excalibur.components:excalibur-pool-instrumented:org.apache.avalon.excalibur.pool.TraceableResourceLimitingPool","name":"TraceableResourceLimitingPool","scope":"FIL","qualifier":"CLA","language":"java"}}
-]
\ No newline at end of file
diff --git a/server/sonar-ws-client/src/test/resources/violations/violations.json b/server/sonar-ws-client/src/test/resources/violations/violations.json
deleted file mode 100644 (file)
index 06c97ee..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-[
-  {"message":"throw java.lang.Exception","line":97,"createdAt":"2010-12-01T13:55:22+0300","priority":"MAJOR","rule":{"key":"pmd:SignatureDeclareThrowsException","name":"Signature Declare Throws Exception","category":"Maintainability"},"resource":{"key":"org.apache.excalibur.components:excalibur-pool-instrumented:org.apache.avalon.excalibur.pool.TraceableResourceLimitingPool","name":"TraceableResourceLimitingPool","qualifier":"CLA"}},
-  {"message":"The user-supplied array 'threads' is stored directly.","line":242,"createdAt":"2010-12-01T13:55:22+0300","priority":"MAJOR","rule":{"key":"pmd:ArrayIsStoredDirectly","name":"Security - Array is stored directly","category":"Reliability"},"resource":{"key":"org.apache.excalibur.components:excalibur-pool-instrumented:org.apache.avalon.excalibur.pool.TraceableResourceLimitingPool","name":"TraceableResourceLimitingPool","qualifier":"CLA"}}
-]
\ No newline at end of file
index 4a2b1b40f900759b562f03828d2b3634f07a4e72..d0a816d282e908c7f8d5ac1bac7e5e521fbadc87 100644 (file)
       <groupId>commons-dbutils</groupId>
       <artifactId>commons-dbutils</artifactId>
     </dependency>
-    <dependency>
-      <groupId>com.googlecode.json-simple</groupId>
-      <artifactId>json-simple</artifactId>
-    </dependency>
     <dependency>
       <groupId>org.codehaus.sonar</groupId>
       <artifactId>sonar-graph</artifactId>