was causing funky dependency tree for tests (almost loop) dependency was sometimes added for transitive dependencies module was super large yet hardly a couple classes were usedtags/8.0
testCompile project(':server:sonar-db-testing') | testCompile project(':server:sonar-db-testing') | ||||
testCompile project(':sonar-testing-harness') | testCompile project(':sonar-testing-harness') | ||||
testCompile project(path: ":server:sonar-ce-task", configuration: "tests") | testCompile project(path: ":server:sonar-ce-task", configuration: "tests") | ||||
testCompile project(path: ":server:sonar-server", configuration: "tests") | |||||
testCompile project(path: ":server:sonar-server-common", configuration: "tests") | testCompile project(path: ":server:sonar-server-common", configuration: "tests") | ||||
} | } | ||||
runtime 'io.jsonwebtoken:jjwt-jackson' | runtime 'io.jsonwebtoken:jjwt-jackson' | ||||
} | } | ||||
task testJar(type: Jar) { | |||||
classifier = 'tests' | |||||
from sourceSets.test.output | |||||
} | |||||
configurations { | |||||
tests | |||||
} | |||||
artifacts { | |||||
tests testJar | |||||
} |
/* | |||||
* SonarQube | |||||
* Copyright (C) 2009-2019 SonarSource SA | |||||
* mailto:info AT sonarsource DOT com | |||||
* | |||||
* This program 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. | |||||
* | |||||
* This program 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. | |||||
*/ | |||||
@ParametersAreNonnullByDefault | |||||
package org.sonar.server.telemetry; | |||||
import javax.annotation.ParametersAreNonnullByDefault; |
compile project(':server:sonar-ce-task') | compile project(':server:sonar-ce-task') | ||||
compile project(':server:sonar-db-dao') | compile project(':server:sonar-db-dao') | ||||
compile project(':server:sonar-process') | compile project(':server:sonar-process') | ||||
compile project(':server:sonar-server') | |||||
compile project(':server:sonar-webserver-auth') | compile project(':server:sonar-webserver-auth') | ||||
compile project(':server:sonar-webserver-es') | compile project(':server:sonar-webserver-es') | ||||
compile project(':server:sonar-webserver-ws') | compile project(':server:sonar-webserver-ws') | ||||
testCompile 'javax.servlet:javax.servlet-api' | testCompile 'javax.servlet:javax.servlet-api' | ||||
testCompile 'org.mockito:mockito-core' | testCompile 'org.mockito:mockito-core' | ||||
testCompile project(':server:sonar-db-testing') | testCompile project(':server:sonar-db-testing') | ||||
testCompile project(path: ":server:sonar-server", configuration: "tests") | |||||
testCompile project(path: ":server:sonar-server-common", configuration: "tests") | testCompile project(path: ":server:sonar-server-common", configuration: "tests") | ||||
testCompile project(path: ":server:sonar-webserver-auth", configuration: "tests") | testCompile project(path: ":server:sonar-webserver-auth", configuration: "tests") | ||||
testCompile project(path: ":server:sonar-webserver-common", configuration: "tests") | testCompile project(path: ":server:sonar-webserver-common", configuration: "tests") |
compileOnly 'com.google.code.findbugs:jsr305' | compileOnly 'com.google.code.findbugs:jsr305' | ||||
compileOnly 'junit:junit' | compileOnly 'junit:junit' | ||||
testCompile 'junit:junit' | |||||
testCompile 'com.google.code.findbugs:jsr305' | |||||
testCompileOnly 'com.google.code.findbugs:jsr305' | |||||
testCompile 'com.google.guava:guava' | |||||
testCompile 'com.tngtech.java:junit-dataprovider' | testCompile 'com.tngtech.java:junit-dataprovider' | ||||
testCompile 'junit:junit' | |||||
testCompile 'org.assertj:assertj-core' | testCompile 'org.assertj:assertj-core' | ||||
testCompile 'org.mockito:mockito-core' | testCompile 'org.mockito:mockito-core' | ||||
testCompile project(':server:sonar-server') | |||||
} | } | ||||
artifactoryPublish.skip = false | artifactoryPublish.skip = false |
import org.junit.rules.TemporaryFolder; | import org.junit.rules.TemporaryFolder; | ||||
import org.sonar.api.utils.log.LogTester; | import org.sonar.api.utils.log.LogTester; | ||||
import org.sonar.api.utils.log.LoggerLevel; | import org.sonar.api.utils.log.LoggerLevel; | ||||
import org.sonar.server.util.TempFolderCleaner; | |||||
import static org.assertj.core.api.Assertions.assertThat; | import static org.assertj.core.api.Assertions.assertThat; | ||||
File file = underTest.newFile(); | File file = underTest.newFile(); | ||||
assertThat(file).exists().isFile(); | assertThat(file).exists().isFile(); | ||||
new TempFolderCleaner(underTest).stop(); | |||||
underTest.clean(); | |||||
assertThat(rootTempFolder).doesNotExist(); | assertThat(rootTempFolder).doesNotExist(); | ||||
} | } | ||||
assertThat(dir).exists().isDirectory(); | assertThat(dir).exists().isDirectory(); | ||||
assertThat(new File(rootTempFolder, "sample")).isEqualTo(dir); | assertThat(new File(rootTempFolder, "sample")).isEqualTo(dir); | ||||
new TempFolderCleaner(underTest).stop(); | |||||
underTest.clean(); | |||||
assertThat(rootTempFolder).doesNotExist(); | assertThat(rootTempFolder).doesNotExist(); | ||||
} | } | ||||