incubator-sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cziege...@apache.org
Subject svn commit: r676955 - /incubator/sling/trunk/commons/osgi/src/test/java/org/apache/sling/commons/osgi/ManifestHeaderTest.java
Date Tue, 15 Jul 2008 16:31:07 GMT
Author: cziegeler
Date: Tue Jul 15 09:31:07 2008
New Revision: 676955

URL: http://svn.apache.org/viewvc?rev=676955&view=rev
Log:
Add a test case with several directives and multiple lines.

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=676955&r1=676954&r2=676955&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 Jul 15 09:31:07 2008
@@ -86,4 +86,24 @@
         assertEquals("1", entry.getEntries()[0].getDirectives()[0].getValue());
         assertEquals("2", entry.getEntries()[0].getDirectives()[1].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);
+        assertEquals(2, entry.getEntries().length);
+        assertEquals("SLING-INF/content/etc", entry.getEntries()[0].getValue());
+        assertEquals(2, entry.getEntries()[0].getDirectives().length);
+        assertEquals(0, entry.getEntries()[0].getAttributes().length);
+        assertEquals("checkin", entry.getEntries()[0].getDirectives()[0].getName());
+        assertEquals("path", entry.getEntries()[0].getDirectives()[1].getName());
+        assertEquals("true", entry.getEntries()[0].getDirectives()[0].getValue());
+        assertEquals("/etc", entry.getEntries()[0].getDirectives()[1].getValue());
+        assertEquals("SLING-INF/content/libs", entry.getEntries()[1].getValue());
+        assertEquals(2, entry.getEntries()[1].getDirectives().length);
+        assertEquals(0, entry.getEntries()[1].getAttributes().length);
+        assertEquals("overwrite", entry.getEntries()[1].getDirectives()[0].getName());
+        assertEquals("path", entry.getEntries()[1].getDirectives()[1].getName());
+        assertEquals("true", entry.getEntries()[1].getDirectives()[0].getValue());
+        assertEquals("/libs", entry.getEntries()[1].getDirectives()[1].getValue());
+    }
 }



Mime
View raw message