You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by di...@apache.org on 2021/07/23 11:19:33 UTC

[sling-org-apache-sling-scripting-sightly-testing] branch issue/SLING-10654 created (now 133d4b2)

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

diru pushed a change to branch issue/SLING-10654
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-scripting-sightly-testing.git.


      at 133d4b2  add test case for icu plural format

This branch includes the following new commits:

     new 133d4b2  add test case for icu plural format

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


[sling-org-apache-sling-scripting-sightly-testing] 01/01: add test case for icu plural format

Posted by di...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

diru pushed a commit to branch issue/SLING-10654
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-scripting-sightly-testing.git

commit 133d4b226f1f3720a16a2f1ef9f318fee8c62c59
Author: Dirk Rudolph <dr...@adobe.com>
AuthorDate: Fri Jul 23 13:19:19 2021 +0200

    add test case for icu plural format
---
 .../sightly/it/SlingSpecificsSightlyIT.java        | 16 ++++++++++++++-
 src/test/provisioning/icu4j.txt                    | 23 ++++++++++++++++++++++
 2 files changed, 38 insertions(+), 1 deletion(-)

diff --git a/src/test/java/org/apache/sling/scripting/sightly/it/SlingSpecificsSightlyIT.java b/src/test/java/org/apache/sling/scripting/sightly/it/SlingSpecificsSightlyIT.java
index fd687c6..faf278e 100644
--- a/src/test/java/org/apache/sling/scripting/sightly/it/SlingSpecificsSightlyIT.java
+++ b/src/test/java/org/apache/sling/scripting/sightly/it/SlingSpecificsSightlyIT.java
@@ -381,7 +381,7 @@ public class SlingSpecificsSightlyIT {
     }
 
     @Test
-    public void testFormatWithPredefinedStyles() {
+    public void testFormatDateWithPredefinedStyles() {
         String url = launchpadURL + SLING_FORMAT;
         String pageContent = client.getStringContent(url, 200);
         assertEquals("01.12.1918", HTMLExtractor.innerHTML(url, pageContent, "#format-date-1"));
@@ -391,6 +391,20 @@ public class SlingSpecificsSightlyIT {
     }
 
     @Test
+    public void testFormatStringWithIcuPlural() {
+        String url = launchpadURL + SLING_FORMAT;
+        String pageContent = client.getStringContent(url, 200);
+        assertEquals("0 results", HTMLExtractor.innerHTML(url, pageContent, "#format-icu-plural-zero"));
+        assertEquals("1 result", HTMLExtractor.innerHTML(url, pageContent, "#format-icu-plural-one"));
+        assertEquals("3 results", HTMLExtractor.innerHTML(url, pageContent, "#format-icu-plural-few"));
+        assertEquals("15 results", HTMLExtractor.innerHTML(url, pageContent, "#format-icu-plural-many"));
+        assertEquals("0 v&yacute;sledků", HTMLExtractor.innerHTML(url, pageContent, "#format-icu-plural-zero-cs"));
+        assertEquals("1 v&yacute;sledek", HTMLExtractor.innerHTML(url, pageContent, "#format-icu-plural-one-cs"));
+        assertEquals("3 v&yacute;sledky", HTMLExtractor.innerHTML(url, pageContent, "#format-icu-plural-few-cs"));
+        assertEquals("15 v&yacute;sledků", HTMLExtractor.innerHTML(url, pageContent, "#format-icu-plural-many-cs"));
+    }
+
+    @Test
     public void testXSSAttributeEscaping() {
         String url = launchpadURL + TCK_XSS;
         String pageContent = client.getStringContent(url, 200);
diff --git a/src/test/provisioning/icu4j.txt b/src/test/provisioning/icu4j.txt
new file mode 100644
index 0000000..a96e038
--- /dev/null
+++ b/src/test/provisioning/icu4j.txt
@@ -0,0 +1,23 @@
+#
+#  Licensed to the Apache Software Foundation (ASF) under one
+#  or more contributor license agreements.  See the NOTICE file
+#  distributed with this work for additional information
+#  regarding copyright ownership.  The ASF licenses this file
+#  to you under the Apache License, Version 2.0 (the
+#  "License"); you may not use this file except in compliance
+#  with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+#  Unless required by applicable law or agreed to in writing,
+#  software distributed under the License is distributed on an
+#  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+#  KIND, either express or implied.  See the License for the
+#  specific language governing permissions and limitations
+#  under the License.
+#
+
+[feature name=icu4j]
+
+[artifacts]
+    com.ibm.icu/icu4j/69.1