diff options
author | Julien Lancelot <julien.lancelot@sonarsource.com> | 2014-06-04 09:39:48 +0200 |
---|---|---|
committer | Julien Lancelot <julien.lancelot@sonarsource.com> | 2014-06-04 09:39:48 +0200 |
commit | ca4f0a47bc7e60bbcc74f05e495cad95eaee7a09 (patch) | |
tree | a29cac134851af86d1f66add5b2d617cb7fbf6d1 /sonar-ws-client | |
parent | 1c2fbb8af7561f726c282638641256185868ba69 (diff) | |
download | sonarqube-ca4f0a47bc7e60bbcc74f05e495cad95eaee7a09.tar.gz sonarqube-ca4f0a47bc7e60bbcc74f05e495cad95eaee7a09.zip |
SONAR-5338 rename actions "plan" to "covered_files" and "testable" to "test_cases" in /api/tests WS
Diffstat (limited to 'sonar-ws-client')
-rw-r--r-- | sonar-ws-client/src/main/java/org/sonar/wsclient/test/TestClient.java | 4 | ||||
-rw-r--r-- | sonar-ws-client/src/main/java/org/sonar/wsclient/test/internal/DefaultTestClient.java | 8 | ||||
-rw-r--r-- | sonar-ws-client/src/test/java/org/sonar/wsclient/test/internal/DefaultTestClientTest.java | 18 | ||||
-rw-r--r-- | sonar-ws-client/src/test/resources/org/sonar/wsclient/test/internal/DefaultTestClientTest/covered_files.json (renamed from sonar-ws-client/src/test/resources/org/sonar/wsclient/test/internal/DefaultTestClientTest/show_plan.json) | 0 | ||||
-rw-r--r-- | sonar-ws-client/src/test/resources/org/sonar/wsclient/test/internal/DefaultTestClientTest/test_cases.json (renamed from sonar-ws-client/src/test/resources/org/sonar/wsclient/test/internal/DefaultTestClientTest/show_testable.json) | 0 |
5 files changed, 15 insertions, 15 deletions
diff --git a/sonar-ws-client/src/main/java/org/sonar/wsclient/test/TestClient.java b/sonar-ws-client/src/main/java/org/sonar/wsclient/test/TestClient.java index adf070c7151..14d575f645c 100644 --- a/sonar-ws-client/src/main/java/org/sonar/wsclient/test/TestClient.java +++ b/sonar-ws-client/src/main/java/org/sonar/wsclient/test/TestClient.java @@ -37,10 +37,10 @@ public interface TestClient { /** * Return list of test cases covering a files' line */ - TestableTestCases testable(String fileKey, Integer line); + TestableTestCases testCases(String fileKey, Integer line); /** * Return the list of files covered by a test plan's test case */ - List<CoveredFile> plan(String testPlanKey, String testCase); + List<CoveredFile> coveredFiles(String testPlanKey, String testCase); } diff --git a/sonar-ws-client/src/main/java/org/sonar/wsclient/test/internal/DefaultTestClient.java b/sonar-ws-client/src/main/java/org/sonar/wsclient/test/internal/DefaultTestClient.java index c65df73a97e..c6c1f055462 100644 --- a/sonar-ws-client/src/main/java/org/sonar/wsclient/test/internal/DefaultTestClient.java +++ b/sonar-ws-client/src/main/java/org/sonar/wsclient/test/internal/DefaultTestClient.java @@ -78,9 +78,9 @@ public class DefaultTestClient implements TestClient { } @Override - public List<CoveredFile> plan(String testPlanKey, String testCase) { + public List<CoveredFile> coveredFiles(String testPlanKey, String testCase) { Map<String, Object> params = EncodingUtils.toMap("key", testPlanKey, "test", testCase); - String jsonResult = requestFactory.get("/api/tests/plan", params); + String jsonResult = requestFactory.get("/api/tests/covered_files", params); List<CoveredFile> files = new ArrayList<CoveredFile>(); Map jRoot = (Map) JSONValue.parse(jsonResult); @@ -109,10 +109,10 @@ public class DefaultTestClient implements TestClient { } @Override - public TestableTestCases testable(String fileKey, Integer line) { + public TestableTestCases testCases(String fileKey, Integer line) { Map<String, Object> params = EncodingUtils.toMap("key", fileKey); params.put("line", line); - String jsonResult = requestFactory.get("/api/tests/testable", params); + String jsonResult = requestFactory.get("/api/tests/test_cases", params); Map jRoot = (Map) JSONValue.parse(jsonResult); final DefaultTestableTestCases testableTestCases = new DefaultTestableTestCases(); diff --git a/sonar-ws-client/src/test/java/org/sonar/wsclient/test/internal/DefaultTestClientTest.java b/sonar-ws-client/src/test/java/org/sonar/wsclient/test/internal/DefaultTestClientTest.java index bb88852e144..9c3d9178694 100644 --- a/sonar-ws-client/src/test/java/org/sonar/wsclient/test/internal/DefaultTestClientTest.java +++ b/sonar-ws-client/src/test/java/org/sonar/wsclient/test/internal/DefaultTestClientTest.java @@ -42,7 +42,7 @@ public class DefaultTestClientTest { public MockHttpServerInterceptor httpServer = new MockHttpServerInterceptor(); @Test - public void show_test_cases() throws IOException { + public void show_test_case() throws IOException { HttpRequestFactory requestFactory = new HttpRequestFactory(httpServer.url()); httpServer.stubResponseBody(Resources.toString(Resources.getResource(this.getClass(), "DefaultTestClientTest/show_test_case.json"), Charsets.UTF_8)); @@ -58,14 +58,14 @@ public class DefaultTestClientTest { } @Test - public void show_testable() throws IOException { + public void test_cases() throws IOException { HttpRequestFactory requestFactory = new HttpRequestFactory(httpServer.url()); - httpServer.stubResponseBody(Resources.toString(Resources.getResource(this.getClass(), "DefaultTestClientTest/show_testable.json"), Charsets.UTF_8)); + httpServer.stubResponseBody(Resources.toString(Resources.getResource(this.getClass(), "DefaultTestClientTest/test_cases.json"), Charsets.UTF_8)); TestClient client = new DefaultTestClient(requestFactory); - TestableTestCases coveringTestCases = client.testable("MyFile", 10); + TestableTestCases coveringTestCases = client.testCases("MyFile", 10); - assertThat(httpServer.requestedPath()).isEqualTo("/api/tests/testable?key=MyFile&line=10"); + assertThat(httpServer.requestedPath()).isEqualTo("/api/tests/test_cases?key=MyFile&line=10"); assertThat(coveringTestCases.tests()).hasSize(1); assertThat(coveringTestCases.files()).hasSize(1); @@ -80,14 +80,14 @@ public class DefaultTestClientTest { } @Test - public void show_plan() throws IOException { + public void covered_files() throws IOException { HttpRequestFactory requestFactory = new HttpRequestFactory(httpServer.url()); - httpServer.stubResponseBody(Resources.toString(Resources.getResource(this.getClass(), "DefaultTestClientTest/show_plan.json"), Charsets.UTF_8)); + httpServer.stubResponseBody(Resources.toString(Resources.getResource(this.getClass(), "DefaultTestClientTest/covered_files.json"), Charsets.UTF_8)); TestClient client = new DefaultTestClient(requestFactory); - List<CoveredFile> files = client.plan("MyTestFile", "find_by_params"); + List<CoveredFile> files = client.coveredFiles("MyTestFile", "find_by_params"); - assertThat(httpServer.requestedPath()).isEqualTo("/api/tests/plan?key=MyTestFile&test=find_by_params"); + assertThat(httpServer.requestedPath()).isEqualTo("/api/tests/covered_files?key=MyTestFile&test=find_by_params"); assertThat(files).hasSize(2); CoveredFile file = files.get(0); diff --git a/sonar-ws-client/src/test/resources/org/sonar/wsclient/test/internal/DefaultTestClientTest/show_plan.json b/sonar-ws-client/src/test/resources/org/sonar/wsclient/test/internal/DefaultTestClientTest/covered_files.json index ce75518aefa..ce75518aefa 100644 --- a/sonar-ws-client/src/test/resources/org/sonar/wsclient/test/internal/DefaultTestClientTest/show_plan.json +++ b/sonar-ws-client/src/test/resources/org/sonar/wsclient/test/internal/DefaultTestClientTest/covered_files.json diff --git a/sonar-ws-client/src/test/resources/org/sonar/wsclient/test/internal/DefaultTestClientTest/show_testable.json b/sonar-ws-client/src/test/resources/org/sonar/wsclient/test/internal/DefaultTestClientTest/test_cases.json index fd00ccea046..fd00ccea046 100644 --- a/sonar-ws-client/src/test/resources/org/sonar/wsclient/test/internal/DefaultTestClientTest/show_testable.json +++ b/sonar-ws-client/src/test/resources/org/sonar/wsclient/test/internal/DefaultTestClientTest/test_cases.json |