From f0f55945b8c05cfb3feda3d06ceea4173467c31a Mon Sep 17 00:00:00 2001 From: =?utf8?q?S=C3=A9bastien=20Lesaint?= Date: Wed, 28 Aug 2019 16:52:53 +0200 Subject: [PATCH] use testFixtures instead of test configuration of webserver-ws --- build.gradle | 1 + server/sonar-webserver-core/build.gradle | 2 +- server/sonar-webserver-webapi/build.gradle | 2 +- server/sonar-webserver-ws/build.gradle | 16 ++-------------- .../java/org/sonar/server/ws/DumbResponse.java | 0 .../java/org/sonar/server/ws/TestRequest.java | 0 .../java/org/sonar/server/ws/TestResponse.java | 0 .../java/org/sonar/server/ws/WsActionTester.java | 0 8 files changed, 5 insertions(+), 16 deletions(-) rename server/sonar-webserver-ws/src/{test => testFixtures}/java/org/sonar/server/ws/DumbResponse.java (100%) rename server/sonar-webserver-ws/src/{test => testFixtures}/java/org/sonar/server/ws/TestRequest.java (100%) rename server/sonar-webserver-ws/src/{test => testFixtures}/java/org/sonar/server/ws/TestResponse.java (100%) rename server/sonar-webserver-ws/src/{test => testFixtures}/java/org/sonar/server/ws/WsActionTester.java (100%) diff --git a/build.gradle b/build.gradle index a967d1a6267..1cb2102ad0f 100644 --- a/build.gradle +++ b/build.gradle @@ -95,6 +95,7 @@ subprojects { apply plugin: 'io.spring.dependency-management' apply plugin: 'jacoco' apply plugin: 'java' + apply plugin: 'java-test-fixtures' apply plugin: 'idea' apply plugin: 'org.owasp.dependencycheck' diff --git a/server/sonar-webserver-core/build.gradle b/server/sonar-webserver-core/build.gradle index 9e1d57fa1d7..ea21d81838d 100644 --- a/server/sonar-webserver-core/build.gradle +++ b/server/sonar-webserver-core/build.gradle @@ -75,7 +75,7 @@ dependencies { testCompile project(path: ":server:sonar-server-common", configuration: "tests") testCompile project(path: ":server:sonar-webserver-auth", configuration: "tests") testCompile project(path: ":server:sonar-webserver-es", configuration: "tests") - testCompile project(path: ":server:sonar-webserver-ws", configuration: "tests") + testCompile testFixtures(project(':server:sonar-webserver-ws')) testCompile project(':sonar-testing-harness') runtime 'io.jsonwebtoken:jjwt-jackson' diff --git a/server/sonar-webserver-webapi/build.gradle b/server/sonar-webserver-webapi/build.gradle index b1428c97c94..58b5f8e7064 100644 --- a/server/sonar-webserver-webapi/build.gradle +++ b/server/sonar-webserver-webapi/build.gradle @@ -37,7 +37,7 @@ dependencies { testCompile project(path: ":server:sonar-server-common", configuration: "tests") testCompile project(path: ":server:sonar-webserver-auth", configuration: "tests") testCompile project(path: ":server:sonar-webserver-es", configuration: "tests") - testCompile project(path: ":server:sonar-webserver-ws", configuration: "tests") + testCompile testFixtures(project(':server:sonar-webserver-ws')) testCompile project(':sonar-testing-harness') } diff --git a/server/sonar-webserver-ws/build.gradle b/server/sonar-webserver-ws/build.gradle index 7fa56ae5c0b..33d0249b7f1 100644 --- a/server/sonar-webserver-ws/build.gradle +++ b/server/sonar-webserver-ws/build.gradle @@ -6,12 +6,6 @@ sonarqube { } } -configurations { - tests - - testCompile.extendsFrom tests -} - dependencies { // please keep the list grouped by configuration and ordered by name @@ -30,14 +24,8 @@ dependencies { testCompile 'javax.servlet:javax.servlet-api' testCompile 'org.apache.tomcat.embed:tomcat-embed-core' testCompile 'org.mockito:mockito-core' - testCompile project(':sonar-testing-harness') -} -task testJar(type: Jar) { - classifier = 'tests' - from sourceSets.test.output -} + testFixturesApi project(':sonar-testing-harness') -artifacts { - tests testJar + testFixturesCompileOnly 'com.google.code.findbugs:jsr305' } diff --git a/server/sonar-webserver-ws/src/test/java/org/sonar/server/ws/DumbResponse.java b/server/sonar-webserver-ws/src/testFixtures/java/org/sonar/server/ws/DumbResponse.java similarity index 100% rename from server/sonar-webserver-ws/src/test/java/org/sonar/server/ws/DumbResponse.java rename to server/sonar-webserver-ws/src/testFixtures/java/org/sonar/server/ws/DumbResponse.java diff --git a/server/sonar-webserver-ws/src/test/java/org/sonar/server/ws/TestRequest.java b/server/sonar-webserver-ws/src/testFixtures/java/org/sonar/server/ws/TestRequest.java similarity index 100% rename from server/sonar-webserver-ws/src/test/java/org/sonar/server/ws/TestRequest.java rename to server/sonar-webserver-ws/src/testFixtures/java/org/sonar/server/ws/TestRequest.java diff --git a/server/sonar-webserver-ws/src/test/java/org/sonar/server/ws/TestResponse.java b/server/sonar-webserver-ws/src/testFixtures/java/org/sonar/server/ws/TestResponse.java similarity index 100% rename from server/sonar-webserver-ws/src/test/java/org/sonar/server/ws/TestResponse.java rename to server/sonar-webserver-ws/src/testFixtures/java/org/sonar/server/ws/TestResponse.java diff --git a/server/sonar-webserver-ws/src/test/java/org/sonar/server/ws/WsActionTester.java b/server/sonar-webserver-ws/src/testFixtures/java/org/sonar/server/ws/WsActionTester.java similarity index 100% rename from server/sonar-webserver-ws/src/test/java/org/sonar/server/ws/WsActionTester.java rename to server/sonar-webserver-ws/src/testFixtures/java/org/sonar/server/ws/WsActionTester.java -- 2.39.5