You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by kw...@apache.org on 2018/01/23 14:28:22 UTC

[sling-org-apache-sling-i18n] branch master updated: SLING-7421 add IT for basename handling

This is an automated email from the ASF dual-hosted git repository.

kwin pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-i18n.git


The following commit(s) were added to refs/heads/master by this push:
     new b1ab32b  SLING-7421 add IT for basename handling
b1ab32b is described below

commit b1ab32bc1c470e5509c915ae97530ea933989219
Author: Konrad Windszus <kw...@apache.org>
AuthorDate: Tue Jan 23 15:28:07 2018 +0100

    SLING-7421 add IT for basename handling
---
 .../org/apache/sling/i18n/it/ResourceBundleProviderIT.java | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)

diff --git a/src/test/java/org/apache/sling/i18n/it/ResourceBundleProviderIT.java b/src/test/java/org/apache/sling/i18n/it/ResourceBundleProviderIT.java
index f412d49..4cf2f7d 100644
--- a/src/test/java/org/apache/sling/i18n/it/ResourceBundleProviderIT.java
+++ b/src/test/java/org/apache/sling/i18n/it/ResourceBundleProviderIT.java
@@ -62,7 +62,7 @@ public class ResourceBundleProviderIT {
     public static final String MSG_KEY2 = "foo2";
     public static final String MSG_KEY3 = "foo3";
 
-    public static final String BASENAME = "basename";
+    public static final String BASENAME = "my-basename";
 
     @Inject
     private SlingRepository repository;
@@ -351,6 +351,18 @@ public class ResourceBundleProviderIT {
     }
 
     @Test
+    public void testGetResourceWithBasename() throws RepositoryException {
+        // set a key which available in the en dictionary without the basename
+        setMessage(enRoot, MSG_KEY1, "regular");
+        session.save();
+        // default key must be returned, as the one set above did not have the basename
+        assertMessage(MSG_KEY1, Locale.ENGLISH, BASENAME, MSG_KEY1);
+        setMessage(enBasenameRoot, MSG_KEY1, "overwritten");
+        session.save();
+        assertMessage(MSG_KEY1, Locale.ENGLISH, BASENAME, "overwritten");
+    }
+
+    @Test
     public void testChangesDetection() throws RepositoryException {
         // set a key which is only available in the en dictionary
         setMessage(enRoot, MSG_KEY2, "EN_message");

-- 
To stop receiving notification emails like this one, please contact
kwin@apache.org.