aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFlorian Waibel2010-08-05 14:19:05 (EDT)
committerSteve Powell2010-08-05 14:24:41 (EDT)
commit185b36ba4e4094b42f13ce89c3d83588df83f6e0 (patch)
treec3be89c98622913e81b9add68bcb1e3c4f5f4b60
parenta2791cee58be187e3ef358a345c90ff873ad3694 (diff)
downloadorg.eclipse.virgo.util-185b36ba4e4094b42f13ce89c3d83588df83f6e0.zip
org.eclipse.virgo.util-185b36ba4e4094b42f13ce89c3d83588df83f6e0.tar.gz
org.eclipse.virgo.util-185b36ba4e4094b42f13ce89c3d83588df83f6e0.tar.bz2
Add tests for package attribute names.
-rw-r--r--org.eclipse.virgo.util.io/.classpath2
-rw-r--r--org.eclipse.virgo.util.osgi/src/test/java/org/eclipse/virgo/util/osgi/manifest/parse/standard/StandardHeaderParserTests.java26
2 files changed, 25 insertions, 3 deletions
diff --git a/org.eclipse.virgo.util.io/.classpath b/org.eclipse.virgo.util.io/.classpath
index edde594..e3e65b9 100644
--- a/org.eclipse.virgo.util.io/.classpath
+++ b/org.eclipse.virgo.util.io/.classpath
@@ -24,6 +24,6 @@
<classpathentry combineaccessrules="false" kind="src" path="/org.eclipse.virgo.util.common"/>
<classpathentry combineaccessrules="false" kind="src" path="/org.eclipse.virgo.util.math"/>
<classpathentry kind="var" path="UTIL_IVY_CACHE/org.junit/com.springsource.org.junit/4.7.0/com.springsource.org.junit-4.7.0.jar" sourcepath="/UTIL_IVY_CACHE/org.junit/com.springsource.org.junit/4.7.0/com.springsource.org.junit-sources-4.7.0.jar"/>
- <classpathentry kind="var" path="UTIL_IVY_CACHE/org.slf4j/com.springsource.slf4j.api/1.5.10/com.springsource.slf4j.api-1.5.10.jar"/>
+ <classpathentry kind="var" path="UTIL_IVY_CACHE/org.slf4j/com.springsource.slf4j.api/1.6.1/com.springsource.slf4j.api-1.6.1.jar" sourcepath="/UTIL_IVY_CACHE/org.slf4j/com.springsource.slf4j.api/1.6.1/com.springsource.slf4j.api-sources-1.6.1.jar"/>
<classpathentry kind="output" path="target/classes"/>
</classpath>
diff --git a/org.eclipse.virgo.util.osgi/src/test/java/org/eclipse/virgo/util/osgi/manifest/parse/standard/StandardHeaderParserTests.java b/org.eclipse.virgo.util.osgi/src/test/java/org/eclipse/virgo/util/osgi/manifest/parse/standard/StandardHeaderParserTests.java
index e9a9ba5..26a6072 100644
--- a/org.eclipse.virgo.util.osgi/src/test/java/org/eclipse/virgo/util/osgi/manifest/parse/standard/StandardHeaderParserTests.java
+++ b/org.eclipse.virgo.util.osgi/src/test/java/org/eclipse/virgo/util/osgi/manifest/parse/standard/StandardHeaderParserTests.java
@@ -1,4 +1,4 @@
-/*******************************************************************************
+/*
* Copyright (c) 2008, 2010 VMware Inc.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
@@ -7,7 +7,7 @@
*
* Contributors:
* VMware Inc. - initial contribution
- *******************************************************************************/
+ */
package org.eclipse.virgo.util.osgi.manifest.parse.standard;
@@ -49,6 +49,28 @@ public class StandardHeaderParserTests extends TestCase {
private static final char aeDipthong = '\u00c6';
+ public void testValidPackageAttributeName() throws Exception {
+ String test = "package;test_split=split";
+ List<HeaderDeclaration> packageDeclarations = parseTestHeader(test);
+ assertNotNull(packageDeclarations);
+ assertEquals(1, packageDeclarations.size());
+
+ HeaderDeclaration decl = packageDeclarations.get(0);
+ assertEquals("package", decl.getNames().get(0));
+ assertEquals("split", decl.getAttributes().get("test_split"));
+ }
+
+ public void testInvalidPackageAttributeName() throws Exception {
+ String test = "package;test.split=split";
+ List<HeaderDeclaration> packageDeclarations = parseTestHeader(test);
+ assertNotNull(packageDeclarations);
+ assertEquals(1, packageDeclarations.size());
+
+ HeaderDeclaration decl = packageDeclarations.get(0);
+ assertEquals("package", decl.getNames().get(0));
+ assertEquals("split", decl.getAttributes().get("test.split"));
+ }
+
public void testParseGeneralHeaderError() {
checkGeneralHeaderFailure("a\"wibble\"", HeaderProblemKind.EXPECTED_SEMICOLON_OR_COMMA);
checkGeneralHeaderFailure("a\"wibble\"/", HeaderProblemKind.EXPECTED_SEMICOLON_OR_COMMA);