Add a test case for the blueprint component in the bundle plugin
git-svn-id: https://svn.apache.org/repos/asf/felix/trunk@810782 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/bundleplugin/src/test/java/org/apache/felix/bnd/BlueprintComponentTest.java b/bundleplugin/src/test/java/org/apache/felix/bnd/BlueprintComponentTest.java
new file mode 100644
index 0000000..014610e
--- /dev/null
+++ b/bundleplugin/src/test/java/org/apache/felix/bnd/BlueprintComponentTest.java
@@ -0,0 +1,37 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.felix.bnd;
+
+import java.util.Set;
+
+import aQute.lib.spring.XMLType;
+import junit.framework.TestCase;
+
+public class BlueprintComponentTest extends TestCase {
+
+ public void testPackages() throws Exception {
+ XMLType t = new XMLType(getClass().getResource("blueprint.xsl"), null, ".*\\.xml");
+ Set<String> s = t.analyze(getClass().getResourceAsStream("bp.xml"));
+ assertEquals(14, s.size());
+ assertTrue(s.contains("java.lang"));
+ for (int i = 1; i <= 13; i++) {
+ assertTrue(s.contains("p" + i));
+ }
+ }
+}
diff --git a/bundleplugin/src/test/resources/org/apache/felix/bnd/bp.xml b/bundleplugin/src/test/resources/org/apache/felix/bnd/bp.xml
new file mode 100644
index 0000000..ec74f7d
--- /dev/null
+++ b/bundleplugin/src/test/resources/org/apache/felix/bnd/bp.xml
@@ -0,0 +1,38 @@
+<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0">
+ <type-converters>
+ <bean class="p1.Foo">
+ <argument type="java.lang.Integer[]" value="0 1"/>
+ </bean>
+ </type-converters>
+
+ <bean class="p2.Foo">
+ <property name="bar">
+ <bean class="p3.Foo"/>
+ </property>
+ </bean>
+
+ <reference interface="p4.Foo" />
+
+ <reference-list interface="p5.Foo">
+ </reference-list>
+
+ <service interface="p6.Foo">
+ </service>
+
+ <service>
+ <interfaces>
+ <value>p7.Foo</value>
+ </interfaces>
+ <bean class="p8.Foo">
+ <argument type="p9.Foo[][]"><null/></argument>
+ <property name="bar">
+ <list value-type="p10.Foo">
+ <map key-type="p11.Foo" value-type="p12.Foo">
+ </map>
+ <set value-type="p13.Foo[]"/>
+ </list>
+ </property>
+ </bean>
+ </service>
+
+</blueprint>
\ No newline at end of file