incubator-sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cziege...@apache.org
Subject svn commit: r689047 - /incubator/sling/trunk/commons/osgi/src/test/java/org/apache/sling/commons/osgi/ManifestHeaderTest.java
Date Tue, 26 Aug 2008 12:29:11 GMT
Author: cziegeler
Date: Tue Aug 26 05:29:10 2008
New Revision: 689047

URL: http://svn.apache.org/viewvc?rev=689047&view=rev
Log:
Add more tests.

Modified:
    incubator/sling/trunk/commons/osgi/src/test/java/org/apache/sling/commons/osgi/ManifestHeaderTest.java

Modified: incubator/sling/trunk/commons/osgi/src/test/java/org/apache/sling/commons/osgi/ManifestHeaderTest.java
URL: http://svn.apache.org/viewvc/incubator/sling/trunk/commons/osgi/src/test/java/org/apache/sling/commons/osgi/ManifestHeaderTest.java?rev=689047&r1=689046&r2=689047&view=diff
==============================================================================
--- incubator/sling/trunk/commons/osgi/src/test/java/org/apache/sling/commons/osgi/ManifestHeaderTest.java
(original)
+++ incubator/sling/trunk/commons/osgi/src/test/java/org/apache/sling/commons/osgi/ManifestHeaderTest.java
Tue Aug 26 05:29:10 2008
@@ -87,6 +87,33 @@
         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);



Mime
View raw message