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 07b69ff89fd7331c85a99bce156a15f37875b666
Author: Carsten Ziegeler <[email protected]>
AuthorDate: Tue Jul 15 16:31:07 2008 +0000

    Add a test case with several directives and multiple lines.
    
    git-svn-id: 
https://svn.apache.org/repos/asf/incubator/sling/trunk/commons/osgi@676955 
13f79535-47bb-0310-9956-ffa450edef68
---
 .../sling/commons/osgi/ManifestHeaderTest.java       | 20 ++++++++++++++++++++
 1 file changed, 20 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 da43902..27b7439 100644
--- a/src/test/java/org/apache/sling/commons/osgi/ManifestHeaderTest.java
+++ b/src/test/java/org/apache/sling/commons/osgi/ManifestHeaderTest.java
@@ -86,4 +86,24 @@ public class ManifestHeaderTest extends TestCase {
         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());
+    }
 }

-- 
To stop receiving notification emails like this one, please contact
"[email protected]" <[email protected]>.

Reply via email to