aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-testing-harness/src/test
diff options
context:
space:
mode:
Diffstat (limited to 'sonar-testing-harness/src/test')
-rw-r--r--sonar-testing-harness/src/test/java/org/sonar/test/i18n/BundleSynchronizedMatcherTest.java7
-rw-r--r--sonar-testing-harness/src/test/resources/org/sonar/l10n/myPlugin_fr.properties3
2 files changed, 9 insertions, 1 deletions
diff --git a/sonar-testing-harness/src/test/java/org/sonar/test/i18n/BundleSynchronizedMatcherTest.java b/sonar-testing-harness/src/test/java/org/sonar/test/i18n/BundleSynchronizedMatcherTest.java
index 2eb97a82a6e..8795c79304f 100644
--- a/sonar-testing-harness/src/test/java/org/sonar/test/i18n/BundleSynchronizedMatcherTest.java
+++ b/sonar-testing-harness/src/test/java/org/sonar/test/i18n/BundleSynchronizedMatcherTest.java
@@ -58,12 +58,19 @@ public class BundleSynchronizedMatcherTest {
}
@Test
+ public void shouldMatchEvenWithAdditionalKeys() {
+ assertThat("myPlugin_fr_QB.properties", matcher);
+ assertFalse(new File("target/l10n/myPlugin_fr_CA.properties.report.txt").exists());
+ }
+
+ @Test
public void shouldNotMatch() {
try {
assertThat("myPlugin_fr.properties", matcher);
assertTrue(new File("target/l10n/myPlugin_fr.properties.report.txt").exists());
} catch (AssertionError e) {
assertThat(e.getMessage(), containsString("Missing translations are:\nsecond.prop"));
+ assertThat(e.getMessage(), containsString("The following translations do not exist in the reference bundle:\nfourth.prop"));
}
}
diff --git a/sonar-testing-harness/src/test/resources/org/sonar/l10n/myPlugin_fr.properties b/sonar-testing-harness/src/test/resources/org/sonar/l10n/myPlugin_fr.properties
index 79c32ed5e81..cd5063e7701 100644
--- a/sonar-testing-harness/src/test/resources/org/sonar/l10n/myPlugin_fr.properties
+++ b/sonar-testing-harness/src/test/resources/org/sonar/l10n/myPlugin_fr.properties
@@ -1,4 +1,5 @@
## -------- Test file for the BundleSynchronizedMatcher -------- ##
first.prop = C'est ma première propriété
#second.prop = C'est ma deuxième propriété
-third.prop = C'est ma troisième propriété \ No newline at end of file
+third.prop = C'est ma troisième propriété
+fourth.prop = C'est ma quatrième propriété \ No newline at end of file