aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-testing-harness/src/test
diff options
context:
space:
mode:
authorSimon Brandhof <simon.brandhof@gmail.com>2011-09-16 16:32:00 +0200
committerSimon Brandhof <simon.brandhof@gmail.com>2011-09-16 16:33:05 +0200
commitfd8267753b78b9567234ec5e83d660222ac7eb38 (patch)
treeea37b9d26d13ee78fbb109b9d98825b78a695ad6 /sonar-testing-harness/src/test
parent1e6739da59f879a8e77a1afda57455a49244c7f6 (diff)
downloadsonarqube-fd8267753b78b9567234ec5e83d660222ac7eb38.tar.gz
sonarqube-fd8267753b78b9567234ec5e83d660222ac7eb38.zip
SONAR-2693 the list of missing translations must be copyable and must contain english values
Diffstat (limited to 'sonar-testing-harness/src/test')
-rw-r--r--sonar-testing-harness/src/test/java/org/sonar/test/i18n/BundleSynchronizedTest.java13
1 files changed, 7 insertions, 6 deletions
diff --git a/sonar-testing-harness/src/test/java/org/sonar/test/i18n/BundleSynchronizedTest.java b/sonar-testing-harness/src/test/java/org/sonar/test/i18n/BundleSynchronizedTest.java
index 9eee351687a..6568ff16101 100644
--- a/sonar-testing-harness/src/test/java/org/sonar/test/i18n/BundleSynchronizedTest.java
+++ b/sonar-testing-harness/src/test/java/org/sonar/test/i18n/BundleSynchronizedTest.java
@@ -29,6 +29,7 @@ import static org.sonar.test.i18n.I18nMatchers.isBundleUpToDate;
import java.io.File;
import java.util.Collection;
+import java.util.SortedMap;
import org.junit.Before;
import org.junit.Test;
@@ -55,14 +56,14 @@ public class BundleSynchronizedTest {
assertThat("myPlugin_fr.properties", isBundleUpToDate());
assertTrue(new File("target/l10n/myPlugin_fr.properties.report.txt").exists());
} catch (AssertionError e) {
- assertThat(e.getMessage(), containsString("Missing keys are:\n\t- second.prop"));
+ assertThat(e.getMessage(), containsString("Missing translations are:\nsecond.prop"));
}
// unnecessary many keys
try {
assertThat("myPlugin_fr_QB.properties", isBundleUpToDate());
assertTrue(new File("target/l10n/myPlugin_fr_QB.properties.report.txt").exists());
} catch (AssertionError e) {
- assertThat(e.getMessage(), containsString("The following keys do not exist in the default bundle:\n\t- fourth.prop"));
+ assertThat(e.getMessage(), containsString("The following translations do not exist in the reference bundle:\nfourth.prop"));
}
}
@@ -75,7 +76,7 @@ public class BundleSynchronizedTest {
try {
assertThat("core_fr.properties", new BundleSynchronizedMatcher(null, GITHUB_RAW_FILE_PATH));
} catch (AssertionError e) {
- assertThat(e.getMessage(), containsString("Missing keys are:\n\t- second.prop"));
+ assertThat(e.getMessage(), containsString("Missing translations are:\nsecond.prop"));
}
}
@@ -120,11 +121,11 @@ public class BundleSynchronizedTest {
File frBundle = TestUtils.getResource(BundleSynchronizedMatcher.L10N_PATH + "myPlugin_fr.properties");
File qbBundle = TestUtils.getResource(BundleSynchronizedMatcher.L10N_PATH + "myPlugin_fr_QB.properties");
- Collection<String> diffs = matcher.retrieveMissingKeys(frBundle, defaultBundle);
+ SortedMap<String, String> diffs = matcher.retrieveMissingTranslations(frBundle, defaultBundle);
assertThat(diffs.size(), is(1));
- assertThat(diffs, hasItem("second.prop"));
+ assertThat(diffs.keySet(), hasItem("second.prop"));
- diffs = matcher.retrieveMissingKeys(qbBundle, defaultBundle);
+ diffs = matcher.retrieveMissingTranslations(qbBundle, defaultBundle);
assertThat(diffs.size(), is(0));
}