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

[sling-org-apache-sling-commons-osgi] 10/24: Add more tests.

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

rombert pushed a commit to annotated tag org.apache.sling.commons.osgi-2.0.4-incubator
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-commons-osgi.git

commit 8869a120a97f95f33ec00812d2504de17b7736cf
Author: Carsten Ziegeler <cz...@apache.org>
AuthorDate: Tue Aug 26 12:29:10 2008 +0000

    Add more tests.
    
    git-svn-id: https://svn.apache.org/repos/asf/incubator/sling/trunk/commons/osgi@689047 13f79535-47bb-0310-9956-ffa450edef68
---
 .../sling/commons/osgi/ManifestHeaderTest.java     | 27 ++++++++++++++++++++++
 1 file changed, 27 insertions(+)

diff --git a/src/test/java/org/apache/sling/commons/osgi/ManifestHeaderTest.java b/src/test/java/org/apache/sling/commons/osgi/ManifestHeaderTest.java
index 27b7439..f1b0d5b 100644
--- a/src/test/java/org/apache/sling/commons/osgi/ManifestHeaderTest.java
+++ b/src/test/java/org/apache/sling/commons/osgi/ManifestHeaderTest.java
@@ -87,6 +87,33 @@ public class ManifestHeaderTest extends TestCase {
         assertEquals("2", entry.getEntries()[0].getDirectives()[1].getValue());
     }
 
+    public void testQuoting() {
+        String header = "one;a:=\"1,2\"";
+        final ManifestHeader entry = ManifestHeader.parse(header);
+        assertEquals(1, entry.getEntries().length);
+        assertEquals("one", entry.getEntries()[0].getValue());
+        assertEquals(1, entry.getEntries()[0].getDirectives().length);
+        assertEquals(0, entry.getEntries()[0].getAttributes().length);
+        assertEquals("a", entry.getEntries()[0].getDirectives()[0].getName());
+        assertEquals("1,2", entry.getEntries()[0].getDirectives()[0].getValue());
+    }
+
+    public void testQuoting2() {
+        String header = "CQ-INF/content/apps/xyz/docroot;overwrite:=true;path:=/apps/xyz/docroot;ignoreImportProviders:=\"json,xml\"";
+        final ManifestHeader entry = ManifestHeader.parse(header);
+        assertEquals(1, entry.getEntries().length);
+        assertEquals("CQ-INF/content/apps/xyz/docroot", entry.getEntries()[0].getValue());
+        assertEquals(3, entry.getEntries()[0].getDirectives().length);
+        assertEquals(0, entry.getEntries()[0].getAttributes().length);
+        assertEquals("overwrite", entry.getEntries()[0].getDirectives()[0].getName());
+        assertEquals("true", entry.getEntries()[0].getDirectives()[0].getValue());
+        assertEquals("path", entry.getEntries()[0].getDirectives()[1].getName());
+        assertEquals("/apps/xyz/docroot", entry.getEntries()[0].getDirectives()[1].getValue());
+        assertEquals("ignoreImportProviders", entry.getEntries()[0].getDirectives()[2].getName());
+        assertEquals("json,xml", entry.getEntries()[0].getDirectives()[2].getValue());
+    }
+
+
     public void testMultipleEntries() {
         String header = "SLING-INF/content/etc;checkin:=true;path:=/etc,\nSLING-INF/content/libs;overwrite:=true;path:=/libs";
         final ManifestHeader entry = ManifestHeader.parse(header);

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.