From 3508c6d6aaf24f2484709fc1839f74f5e5225482 Mon Sep 17 00:00:00 2001 From: =?utf8?q?S=C3=A9bastien=20Lesaint?= Date: Tue, 29 Nov 2016 10:20:39 +0100 Subject: [PATCH] SONAR-8335 drop dead code ServerLogging#getCurrentLogFile --- .../org/sonar/server/platform/ServerLogging.java | 7 ------- .../sonar/server/platform/ServerLoggingTest.java | 13 +------------ 2 files changed, 1 insertion(+), 19 deletions(-) diff --git a/server/sonar-server/src/main/java/org/sonar/server/platform/ServerLogging.java b/server/sonar-server/src/main/java/org/sonar/server/platform/ServerLogging.java index 2f996b7bca1..9dd8c447592 100644 --- a/server/sonar-server/src/main/java/org/sonar/server/platform/ServerLogging.java +++ b/server/sonar-server/src/main/java/org/sonar/server/platform/ServerLogging.java @@ -83,11 +83,4 @@ public class ServerLogging { return new File(settings.getString(ProcessProperties.PATH_LOGS)); } - /** - * The file sonar.log, may not exist. - */ - public File getCurrentLogFile() { - return new File(getLogsDir(), "sonar.log"); - } - } diff --git a/server/sonar-server/src/test/java/org/sonar/server/platform/ServerLoggingTest.java b/server/sonar-server/src/test/java/org/sonar/server/platform/ServerLoggingTest.java index 04ed0957618..4092a0cce72 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/platform/ServerLoggingTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/platform/ServerLoggingTest.java @@ -22,7 +22,6 @@ package org.sonar.server.platform; import ch.qos.logback.classic.Level; import java.io.File; import java.io.IOException; -import org.apache.commons.io.FileUtils; import org.junit.Rule; import org.junit.Test; import org.junit.rules.ExpectedException; @@ -31,8 +30,8 @@ import org.sonar.api.config.MapSettings; import org.sonar.api.config.Settings; import org.sonar.api.utils.log.LogTester; import org.sonar.api.utils.log.LoggerLevel; -import org.sonar.process.logging.LogbackHelper; import org.sonar.process.ProcessProperties; +import org.sonar.process.logging.LogbackHelper; import static org.assertj.core.api.Assertions.assertThat; import static org.mockito.Mockito.mock; @@ -67,16 +66,6 @@ public class ServerLoggingTest { assertThat(underTest.getRootLoggerLevel()).isEqualTo(LoggerLevel.TRACE); } - @Test - public void getCurrentLogFile() throws IOException { - File dir = temp.newFolder(); - File logFile = new File(dir, "sonar.log"); - FileUtils.touch(logFile); - settings.setProperty(ProcessProperties.PATH_LOGS, dir.getAbsolutePath()); - - assertThat(underTest.getCurrentLogFile()).isEqualTo(logFile); - } - @Test public void configureHardcodedLevels() { LogbackHelper logbackHelper = mock(LogbackHelper.class); -- 2.39.5