Return-Path: Delivered-To: apmail-incubator-sling-commits-archive@locus.apache.org Received: (qmail 42823 invoked from network); 15 Jul 2008 16:31:28 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 15 Jul 2008 16:31:28 -0000 Received: (qmail 12265 invoked by uid 500); 15 Jul 2008 16:31:28 -0000 Delivered-To: apmail-incubator-sling-commits-archive@incubator.apache.org Received: (qmail 12228 invoked by uid 500); 15 Jul 2008 16:31:28 -0000 Mailing-List: contact sling-commits-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: sling-dev@incubator.apache.org Delivered-To: mailing list sling-commits@incubator.apache.org Received: (qmail 12219 invoked by uid 99); 15 Jul 2008 16:31:28 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 15 Jul 2008 09:31:28 -0700 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 15 Jul 2008 16:30:44 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 1D05A2388A0A; Tue, 15 Jul 2008 09:31:08 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit 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 -0000 To: sling-commits@incubator.apache.org From: cziegeler@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20080715163108.1D05A2388A0A@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org 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()); + } }