You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@felix.apache.org by gn...@apache.org on 2009/09/03 08:24:13 UTC
svn commit: r810782 - in /felix/trunk/bundleplugin/src/test:
java/org/apache/felix/bnd/ resources/org/ resources/org/apache/
resources/org/apache/felix/ resources/org/apache/felix/bnd/
Author: gnodet
Date: Thu Sep 3 06:24:13 2009
New Revision: 810782
URL: http://svn.apache.org/viewvc?rev=810782&view=rev
Log:
Add a test case for the blueprint component in the bundle plugin
Added:
felix/trunk/bundleplugin/src/test/java/org/apache/felix/bnd/
felix/trunk/bundleplugin/src/test/java/org/apache/felix/bnd/BlueprintComponentTest.java
felix/trunk/bundleplugin/src/test/resources/org/
felix/trunk/bundleplugin/src/test/resources/org/apache/
felix/trunk/bundleplugin/src/test/resources/org/apache/felix/
felix/trunk/bundleplugin/src/test/resources/org/apache/felix/bnd/
felix/trunk/bundleplugin/src/test/resources/org/apache/felix/bnd/bp.xml
Added: felix/trunk/bundleplugin/src/test/java/org/apache/felix/bnd/BlueprintComponentTest.java
URL: http://svn.apache.org/viewvc/felix/trunk/bundleplugin/src/test/java/org/apache/felix/bnd/BlueprintComponentTest.java?rev=810782&view=auto
==============================================================================
--- felix/trunk/bundleplugin/src/test/java/org/apache/felix/bnd/BlueprintComponentTest.java (added)
+++ felix/trunk/bundleplugin/src/test/java/org/apache/felix/bnd/BlueprintComponentTest.java Thu Sep 3 06:24:13 2009
@@ -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));
+ }
+ }
+}
Added: felix/trunk/bundleplugin/src/test/resources/org/apache/felix/bnd/bp.xml
URL: http://svn.apache.org/viewvc/felix/trunk/bundleplugin/src/test/resources/org/apache/felix/bnd/bp.xml?rev=810782&view=auto
==============================================================================
--- felix/trunk/bundleplugin/src/test/resources/org/apache/felix/bnd/bp.xml (added)
+++ felix/trunk/bundleplugin/src/test/resources/org/apache/felix/bnd/bp.xml Thu Sep 3 06:24:13 2009
@@ -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