You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@aries.apache.org by dk...@apache.org on 2011/11/17 20:10:01 UTC
svn commit: r1203334 - in /aries/trunk/blueprint:
blueprint-testbundlea/src/main/java/org/apache/aries/blueprint/testbundlea/
blueprint-testbundlea/src/main/resources/OSGI-INF/blueprint/
blueprint-testbundlea/src/main/resources/org/apache/aries/bluepri...
Author: dkulp
Date: Thu Nov 17 19:10:01 2011
New Revision: 1203334
URL: http://svn.apache.org/viewvc?rev=1203334&view=rev
Log:
Add another testcase for ARIES-626 when using qualified elements.
Need to register the namespace handler for all the namespaces.
Added:
aries/trunk/blueprint/blueprint-testbundlea/src/main/java/org/apache/aries/blueprint/testbundlea/NSHandlerFive.java
- copied, changed from r1203307, aries/trunk/blueprint/blueprint-testbundlea/src/main/java/org/apache/aries/blueprint/testbundlea/NSHandlerFour.java
aries/trunk/blueprint/blueprint-testbundlea/src/main/resources/org/apache/aries/blueprint/testbundlea/nshandlerfive.xsd (with props)
aries/trunk/blueprint/blueprint-testbundlea/src/main/resources/org/apache/aries/blueprint/testbundlea/nshandlerfiveimport.xsd (with props)
Modified:
aries/trunk/blueprint/blueprint-testbundlea/src/main/java/org/apache/aries/blueprint/testbundlea/NSHandlerFour.java
aries/trunk/blueprint/blueprint-testbundlea/src/main/resources/OSGI-INF/blueprint/config.xml
aries/trunk/blueprint/blueprint-testbundleb/src/main/resources/OSGI-INF/blueprint/config.xml
Copied: aries/trunk/blueprint/blueprint-testbundlea/src/main/java/org/apache/aries/blueprint/testbundlea/NSHandlerFive.java (from r1203307, aries/trunk/blueprint/blueprint-testbundlea/src/main/java/org/apache/aries/blueprint/testbundlea/NSHandlerFour.java)
URL: http://svn.apache.org/viewvc/aries/trunk/blueprint/blueprint-testbundlea/src/main/java/org/apache/aries/blueprint/testbundlea/NSHandlerFive.java?p2=aries/trunk/blueprint/blueprint-testbundlea/src/main/java/org/apache/aries/blueprint/testbundlea/NSHandlerFive.java&p1=aries/trunk/blueprint/blueprint-testbundlea/src/main/java/org/apache/aries/blueprint/testbundlea/NSHandlerFour.java&r1=1203307&r2=1203334&rev=1203334&view=diff
==============================================================================
--- aries/trunk/blueprint/blueprint-testbundlea/src/main/java/org/apache/aries/blueprint/testbundlea/NSHandlerFour.java (original)
+++ aries/trunk/blueprint/blueprint-testbundlea/src/main/java/org/apache/aries/blueprint/testbundlea/NSHandlerFive.java Thu Nov 17 19:10:01 2011
@@ -35,14 +35,14 @@ import org.w3c.dom.Attr;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
-public class NSHandlerFour implements NamespaceHandler{
- public static String NSURI = "http://ns.handler.four";
- private static String ELT_NAME = "nshandlerfour";
+public class NSHandlerFive implements NamespaceHandler{
+ public static String NSURI = "http://ns.handler.five";
+ private static String ELT_NAME = "nshandlerfive";
private static String ATTRIB_ID = "id";
- public static class Four {
- public Four() {
+ public static class Five {
+ public Five() {
}
}
//process elements
@@ -52,7 +52,8 @@ public class NSHandlerFour implements Na
final String id = element.getAttributeNS(NSURI, ATTRIB_ID);
MutableBeanMetadata bm = context.createMetadata(MutableBeanMetadata.class);
bm.setId(id);
- bm.setClassName(Four.class.getName());
+ bm.setScope("PROTOTYPE");
+ bm.setClassName(Five.class.getName());
retval = bm;
}
return retval;
@@ -60,11 +61,15 @@ public class NSHandlerFour implements Na
//supply schema back to blueprint.
public URL getSchemaLocation(String namespace) {
- return this.getClass().getResource("nshandlerfour.xsd");
+ System.out.println("Schemans: " + namespace);
+ if (NSURI.equals(namespace)) {
+ return this.getClass().getResource("nshandlerfive.xsd");
+ }
+ return this.getClass().getResource("nshandlerfiveimport.xsd");
}
public Set<Class> getManagedClasses() {
- Class cls = Four.class;
+ Class cls = Five.class;
return Collections.singleton(cls);
}
Modified: aries/trunk/blueprint/blueprint-testbundlea/src/main/java/org/apache/aries/blueprint/testbundlea/NSHandlerFour.java
URL: http://svn.apache.org/viewvc/aries/trunk/blueprint/blueprint-testbundlea/src/main/java/org/apache/aries/blueprint/testbundlea/NSHandlerFour.java?rev=1203334&r1=1203333&r2=1203334&view=diff
==============================================================================
--- aries/trunk/blueprint/blueprint-testbundlea/src/main/java/org/apache/aries/blueprint/testbundlea/NSHandlerFour.java (original)
+++ aries/trunk/blueprint/blueprint-testbundlea/src/main/java/org/apache/aries/blueprint/testbundlea/NSHandlerFour.java Thu Nov 17 19:10:01 2011
@@ -52,6 +52,7 @@ public class NSHandlerFour implements Na
final String id = element.getAttributeNS(NSURI, ATTRIB_ID);
MutableBeanMetadata bm = context.createMetadata(MutableBeanMetadata.class);
bm.setId(id);
+ bm.setScope("PROTOTYPE");
bm.setClassName(Four.class.getName());
retval = bm;
}
Modified: aries/trunk/blueprint/blueprint-testbundlea/src/main/resources/OSGI-INF/blueprint/config.xml
URL: http://svn.apache.org/viewvc/aries/trunk/blueprint/blueprint-testbundlea/src/main/resources/OSGI-INF/blueprint/config.xml?rev=1203334&r1=1203333&r2=1203334&view=diff
==============================================================================
--- aries/trunk/blueprint/blueprint-testbundlea/src/main/resources/OSGI-INF/blueprint/config.xml (original)
+++ aries/trunk/blueprint/blueprint-testbundlea/src/main/resources/OSGI-INF/blueprint/config.xml Thu Nov 17 19:10:01 2011
@@ -25,10 +25,10 @@
<bean id="NSHandlerTwo" class="org.apache.aries.blueprint.testbundlea.NSHandlerTwo">
</bean>
- <bean id="NSHandlerThree" class="org.apache.aries.blueprint.testbundlea.NSHandlerThree">
- </bean>
- <bean id="NSHandlerFour" class="org.apache.aries.blueprint.testbundlea.NSHandlerFour">
- </bean>
+ <bean id="NSHandlerThree" class="org.apache.aries.blueprint.testbundlea.NSHandlerThree"/>
+
+ <bean id="NSHandlerFour" class="org.apache.aries.blueprint.testbundlea.NSHandlerFour"/>
+ <bean id="NSHandlerFive" class="org.apache.aries.blueprint.testbundlea.NSHandlerFive"/>
<service interface="org.apache.aries.blueprint.NamespaceHandler" ref="NSHandlerOne">
<service-properties>
@@ -52,6 +52,16 @@
<entry key="osgi.service.blueprint.namespace" value="http://ns.handler.four"/>
</service-properties>
</service>
+ <service interface="org.apache.aries.blueprint.NamespaceHandler" ref="NSHandlerFive">
+ <service-properties>
+ <entry key="osgi.service.blueprint.namespace">
+ <list>
+ <value>http://ns.handler.five</value>
+ <value>http://ns.handler.five.import</value>
+ </list>
+ </entry>
+ </service-properties>
+ </service>
</blueprint>
Added: aries/trunk/blueprint/blueprint-testbundlea/src/main/resources/org/apache/aries/blueprint/testbundlea/nshandlerfive.xsd
URL: http://svn.apache.org/viewvc/aries/trunk/blueprint/blueprint-testbundlea/src/main/resources/org/apache/aries/blueprint/testbundlea/nshandlerfive.xsd?rev=1203334&view=auto
==============================================================================
--- aries/trunk/blueprint/blueprint-testbundlea/src/main/resources/org/apache/aries/blueprint/testbundlea/nshandlerfive.xsd (added)
+++ aries/trunk/blueprint/blueprint-testbundlea/src/main/resources/org/apache/aries/blueprint/testbundlea/nshandlerfive.xsd Thu Nov 17 19:10:01 2011
@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ 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.
+-->
+<schema xmlns="http://www.w3.org/2001/XMLSchema"
+ targetNamespace="http://ns.handler.five"
+ xmlns:tns="http://ns.handler.five"
+ xmlns:imp="http://ns.handler.five.import"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ elementFormDefault="qualified"
+ attributeFormDefault="qualified" >
+ <import schemaLocation="nshandlerfiveimport.xsd"
+ namespace="http://ns.handler.five.import"/>
+ <element name="nshandlerfive">
+ <complexType>
+ <sequence>
+ <element name="stuff" type="imp:Imported"/>
+ </sequence>
+ <attribute name="id" type="xsd:string"/>
+ <attribute ref="imp:attrib"/>
+ </complexType>
+ </element>
+</schema>
\ No newline at end of file
Propchange: aries/trunk/blueprint/blueprint-testbundlea/src/main/resources/org/apache/aries/blueprint/testbundlea/nshandlerfive.xsd
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: aries/trunk/blueprint/blueprint-testbundlea/src/main/resources/org/apache/aries/blueprint/testbundlea/nshandlerfive.xsd
------------------------------------------------------------------------------
svn:keywords = Rev Date
Propchange: aries/trunk/blueprint/blueprint-testbundlea/src/main/resources/org/apache/aries/blueprint/testbundlea/nshandlerfive.xsd
------------------------------------------------------------------------------
svn:mime-type = text/xml
Added: aries/trunk/blueprint/blueprint-testbundlea/src/main/resources/org/apache/aries/blueprint/testbundlea/nshandlerfiveimport.xsd
URL: http://svn.apache.org/viewvc/aries/trunk/blueprint/blueprint-testbundlea/src/main/resources/org/apache/aries/blueprint/testbundlea/nshandlerfiveimport.xsd?rev=1203334&view=auto
==============================================================================
--- aries/trunk/blueprint/blueprint-testbundlea/src/main/resources/org/apache/aries/blueprint/testbundlea/nshandlerfiveimport.xsd (added)
+++ aries/trunk/blueprint/blueprint-testbundlea/src/main/resources/org/apache/aries/blueprint/testbundlea/nshandlerfiveimport.xsd Thu Nov 17 19:10:01 2011
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ 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.
+-->
+<schema xmlns="http://www.w3.org/2001/XMLSchema"
+ targetNamespace="http://ns.handler.five.import"
+ xmlns:tns="http://ns.handler.five.import"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ elementFormDefault="qualified"
+ attributeFormDefault="qualified" >
+
+ <complexType name="Imported">
+ <sequence>
+ <element name="stuff" type="xsd:string"/>
+ </sequence>
+ </complexType>
+ <attribute name="attrib" type="xsd:string"/>
+</schema>
\ No newline at end of file
Propchange: aries/trunk/blueprint/blueprint-testbundlea/src/main/resources/org/apache/aries/blueprint/testbundlea/nshandlerfiveimport.xsd
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: aries/trunk/blueprint/blueprint-testbundlea/src/main/resources/org/apache/aries/blueprint/testbundlea/nshandlerfiveimport.xsd
------------------------------------------------------------------------------
svn:keywords = Rev Date
Propchange: aries/trunk/blueprint/blueprint-testbundlea/src/main/resources/org/apache/aries/blueprint/testbundlea/nshandlerfiveimport.xsd
------------------------------------------------------------------------------
svn:mime-type = text/xml
Modified: aries/trunk/blueprint/blueprint-testbundleb/src/main/resources/OSGI-INF/blueprint/config.xml
URL: http://svn.apache.org/viewvc/aries/trunk/blueprint/blueprint-testbundleb/src/main/resources/OSGI-INF/blueprint/config.xml?rev=1203334&r1=1203333&r2=1203334&view=diff
==============================================================================
--- aries/trunk/blueprint/blueprint-testbundleb/src/main/resources/OSGI-INF/blueprint/config.xml (original)
+++ aries/trunk/blueprint/blueprint-testbundleb/src/main/resources/OSGI-INF/blueprint/config.xml Thu Nov 17 19:10:01 2011
@@ -23,6 +23,8 @@
xmlns:three="http://ns.handler.three"
xmlns:four="http://ns.handler.four"
xmlns:fourim="http://ns.handler.four.import"
+ xmlns:five="http://ns.handler.five"
+ xmlns:fiveim="http://ns.handler.five.import"
default-availability="optional">
<!-- Default test.. no other ns interaction. -->
@@ -71,6 +73,12 @@
<stuff xmlns="">foo</stuff>
</four:stuff>
</four:nshandlerfour>
+ <!-- NShandler four test, make sure the schema can be parsed - ARIES-626 Part 2 -->
+ <five:nshandlerfive five:id="FIVE" fiveim:attrib="foo">
+ <five:stuff>
+ <fiveim:stuff>foo</fiveim:stuff>
+ </five:stuff>
+ </five:nshandlerfive>
</blueprint>