aboutsummaryrefslogtreecommitdiffstats
path: root/src/test
diff options
context:
space:
mode:
Diffstat (limited to 'src/test')
-rw-r--r--src/test/java/org/sonar/api/utils/MessageException.java2
-rw-r--r--src/test/java/org/sonarsource/scanner/cli/CliTest.java2
-rw-r--r--src/test/java/org/sonarsource/scanner/cli/ConfTest.java11
-rw-r--r--src/test/java/org/sonarsource/scanner/cli/MainTest.java28
-rw-r--r--src/test/java/org/sonarsource/scanner/cli/PropertyResolverTest.java2
-rw-r--r--src/test/java/org/sonarsource/scanner/cli/ScannerEngineBootstrapperFactoryTest.java2
-rw-r--r--src/test/java/org/sonarsource/scanner/cli/StatsTest.java2
-rw-r--r--src/test/java/org/sonarsource/scanner/cli/SystemInfoTest.java2
-rw-r--r--src/test/java/testutils/ConcurrentListAppender.java2
-rw-r--r--src/test/java/testutils/LogTester.java2
-rw-r--r--src/test/resources/org/sonarsource/scanner/cli/ConfTest/shouldHandleNonLatinChars/project/sonar-project.properties1
11 files changed, 20 insertions, 36 deletions
diff --git a/src/test/java/org/sonar/api/utils/MessageException.java b/src/test/java/org/sonar/api/utils/MessageException.java
index e388c9d..b4fcc5f 100644
--- a/src/test/java/org/sonar/api/utils/MessageException.java
+++ b/src/test/java/org/sonar/api/utils/MessageException.java
@@ -1,6 +1,6 @@
/*
* SonarScanner CLI
- * Copyright (C) 2011-2024 SonarSource SA
+ * Copyright (C) 2011-2025 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
diff --git a/src/test/java/org/sonarsource/scanner/cli/CliTest.java b/src/test/java/org/sonarsource/scanner/cli/CliTest.java
index 5cb05d8..dcf84d7 100644
--- a/src/test/java/org/sonarsource/scanner/cli/CliTest.java
+++ b/src/test/java/org/sonarsource/scanner/cli/CliTest.java
@@ -1,6 +1,6 @@
/*
* SonarScanner CLI
- * Copyright (C) 2011-2024 SonarSource SA
+ * Copyright (C) 2011-2025 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
diff --git a/src/test/java/org/sonarsource/scanner/cli/ConfTest.java b/src/test/java/org/sonarsource/scanner/cli/ConfTest.java
index 82bd955..0c737b5 100644
--- a/src/test/java/org/sonarsource/scanner/cli/ConfTest.java
+++ b/src/test/java/org/sonarsource/scanner/cli/ConfTest.java
@@ -1,6 +1,6 @@
/*
* SonarScanner CLI
- * Copyright (C) 2011-2024 SonarSource SA
+ * Copyright (C) 2011-2025 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
@@ -289,4 +289,13 @@ class ConfTest {
assertThat(properties).containsEntry("sonar.prop", "expected");
}
+ @Test
+ void should_handle_non_latin_characters() throws Exception {
+ Path home = Paths.get(getClass().getResource("ConfTest/shouldHandleNonLatinChars/project").toURI());
+ args.setProperty("project.home", home.toAbsolutePath().toString());
+
+ Properties properties = conf.properties();
+ assertThat(properties).containsEntry("project.nonlatin", "Non Latin ÇŞĞIİÖÜ");
+ }
+
}
diff --git a/src/test/java/org/sonarsource/scanner/cli/MainTest.java b/src/test/java/org/sonarsource/scanner/cli/MainTest.java
index 48b2ed3..746f5c9 100644
--- a/src/test/java/org/sonarsource/scanner/cli/MainTest.java
+++ b/src/test/java/org/sonarsource/scanner/cli/MainTest.java
@@ -1,6 +1,6 @@
/*
* SonarScanner CLI
- * Copyright (C) 2011-2024 SonarSource SA
+ * Copyright (C) 2011-2025 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
@@ -227,32 +227,6 @@ class MainTest {
}
@Test
- void shouldLogServerVersion() {
- when(engine.isSonarCloud()).thenReturn(false);
- when(engine.getServerVersion()).thenReturn("5.5");
- Properties p = new Properties();
- when(cli.isDisplayVersionOnly()).thenReturn(true);
- when(cli.getInvokedFrom()).thenReturn("");
- when(conf.properties()).thenReturn(p);
-
- Main main = new Main(exit, cli, conf, scannerEngineBootstrapperFactory);
- main.analyze();
- assertThat(logTester.logs(Level.INFO)).contains("Communicating with SonarQube Server 5.5");
- }
-
- @Test
- void should_log_SonarCloud_server() {
- when(engine.isSonarCloud()).thenReturn(true);
- Properties p = new Properties();
- when(conf.properties()).thenReturn(p);
- when(cli.getInvokedFrom()).thenReturn("");
-
- Main main = new Main(exit, cli, conf, scannerEngineBootstrapperFactory);
- main.analyze();
- assertThat(logTester.logs(Level.INFO)).contains("Communicating with SonarCloud");
- }
-
- @Test
void should_configure_logging() {
Properties analysisProps = testLogging("sonar.verbose", "true");
assertThat(analysisProps.getProperty("sonar.verbose")).isEqualTo("true");
diff --git a/src/test/java/org/sonarsource/scanner/cli/PropertyResolverTest.java b/src/test/java/org/sonarsource/scanner/cli/PropertyResolverTest.java
index a22f9f6..f5c2792 100644
--- a/src/test/java/org/sonarsource/scanner/cli/PropertyResolverTest.java
+++ b/src/test/java/org/sonarsource/scanner/cli/PropertyResolverTest.java
@@ -1,6 +1,6 @@
/*
* SonarScanner CLI
- * Copyright (C) 2011-2024 SonarSource SA
+ * Copyright (C) 2011-2025 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
diff --git a/src/test/java/org/sonarsource/scanner/cli/ScannerEngineBootstrapperFactoryTest.java b/src/test/java/org/sonarsource/scanner/cli/ScannerEngineBootstrapperFactoryTest.java
index c25ddb1..f1842ae 100644
--- a/src/test/java/org/sonarsource/scanner/cli/ScannerEngineBootstrapperFactoryTest.java
+++ b/src/test/java/org/sonarsource/scanner/cli/ScannerEngineBootstrapperFactoryTest.java
@@ -1,6 +1,6 @@
/*
* SonarScanner CLI
- * Copyright (C) 2011-2024 SonarSource SA
+ * Copyright (C) 2011-2025 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
diff --git a/src/test/java/org/sonarsource/scanner/cli/StatsTest.java b/src/test/java/org/sonarsource/scanner/cli/StatsTest.java
index 174acbc..fa888a6 100644
--- a/src/test/java/org/sonarsource/scanner/cli/StatsTest.java
+++ b/src/test/java/org/sonarsource/scanner/cli/StatsTest.java
@@ -1,6 +1,6 @@
/*
* SonarScanner CLI
- * Copyright (C) 2011-2024 SonarSource SA
+ * Copyright (C) 2011-2025 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
diff --git a/src/test/java/org/sonarsource/scanner/cli/SystemInfoTest.java b/src/test/java/org/sonarsource/scanner/cli/SystemInfoTest.java
index b372d9c..da00b00 100644
--- a/src/test/java/org/sonarsource/scanner/cli/SystemInfoTest.java
+++ b/src/test/java/org/sonarsource/scanner/cli/SystemInfoTest.java
@@ -1,6 +1,6 @@
/*
* SonarScanner CLI
- * Copyright (C) 2011-2024 SonarSource SA
+ * Copyright (C) 2011-2025 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
diff --git a/src/test/java/testutils/ConcurrentListAppender.java b/src/test/java/testutils/ConcurrentListAppender.java
index b31e34e..f8b9ed0 100644
--- a/src/test/java/testutils/ConcurrentListAppender.java
+++ b/src/test/java/testutils/ConcurrentListAppender.java
@@ -1,6 +1,6 @@
/*
* SonarScanner CLI
- * Copyright (C) 2011-2024 SonarSource SA
+ * Copyright (C) 2011-2025 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
diff --git a/src/test/java/testutils/LogTester.java b/src/test/java/testutils/LogTester.java
index 1708479..4b87c52 100644
--- a/src/test/java/testutils/LogTester.java
+++ b/src/test/java/testutils/LogTester.java
@@ -1,6 +1,6 @@
/*
* SonarScanner CLI
- * Copyright (C) 2011-2024 SonarSource SA
+ * Copyright (C) 2011-2025 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
diff --git a/src/test/resources/org/sonarsource/scanner/cli/ConfTest/shouldHandleNonLatinChars/project/sonar-project.properties b/src/test/resources/org/sonarsource/scanner/cli/ConfTest/shouldHandleNonLatinChars/project/sonar-project.properties
new file mode 100644
index 0000000..24ced59
--- /dev/null
+++ b/src/test/resources/org/sonarsource/scanner/cli/ConfTest/shouldHandleNonLatinChars/project/sonar-project.properties
@@ -0,0 +1 @@
+project.nonlatin=Non Latin ÇŞĞIİÖÜ