geronimo-xbean-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gno...@apache.org
Subject svn commit: r1393098 - in /geronimo/xbean/trunk/xbean-blueprint: pom.xml src/main/java/org/apache/xbean/blueprint/cm/CmNamespaceHandler.java src/test/java/org/apache/xbean/blueprint/context/BlueprintTestSupport.java
Date Tue, 02 Oct 2012 19:01:41 GMT
Author: gnodet
Date: Tue Oct  2 19:01:41 2012
New Revision: 1393098

URL: http://svn.apache.org/viewvc?rev=1393098&view=rev
Log:
[XBEAN-228] Support aries blueprint 1.0

Modified:
    geronimo/xbean/trunk/xbean-blueprint/pom.xml
    geronimo/xbean/trunk/xbean-blueprint/src/main/java/org/apache/xbean/blueprint/cm/CmNamespaceHandler.java
    geronimo/xbean/trunk/xbean-blueprint/src/test/java/org/apache/xbean/blueprint/context/BlueprintTestSupport.java

Modified: geronimo/xbean/trunk/xbean-blueprint/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/xbean/trunk/xbean-blueprint/pom.xml?rev=1393098&r1=1393097&r2=1393098&view=diff
==============================================================================
--- geronimo/xbean/trunk/xbean-blueprint/pom.xml (original)
+++ geronimo/xbean/trunk/xbean-blueprint/pom.xml Tue Oct  2 19:01:41 2012
@@ -44,13 +44,13 @@
         <dependency>
             <groupId>org.apache.aries.blueprint</groupId>
             <artifactId>org.apache.aries.blueprint.api</artifactId>
-            <version>0.3.1</version>
+            <version>1.0.0</version>
             <scope>provided</scope>
         </dependency>
         <dependency>
             <groupId>org.apache.aries.blueprint</groupId>
             <artifactId>org.apache.aries.blueprint.cm</artifactId>
-            <version>0.3</version>
+            <version>1.0.0</version>
             <scope>provided</scope>
         </dependency>
 

Modified: geronimo/xbean/trunk/xbean-blueprint/src/main/java/org/apache/xbean/blueprint/cm/CmNamespaceHandler.java
URL: http://svn.apache.org/viewvc/geronimo/xbean/trunk/xbean-blueprint/src/main/java/org/apache/xbean/blueprint/cm/CmNamespaceHandler.java?rev=1393098&r1=1393097&r2=1393098&view=diff
==============================================================================
--- geronimo/xbean/trunk/xbean-blueprint/src/main/java/org/apache/xbean/blueprint/cm/CmNamespaceHandler.java
(original)
+++ geronimo/xbean/trunk/xbean-blueprint/src/main/java/org/apache/xbean/blueprint/cm/CmNamespaceHandler.java
Tue Oct  2 19:01:41 2012
@@ -30,8 +30,7 @@ import java.util.Set;
 import org.apache.aries.blueprint.ComponentDefinitionRegistry;
 import org.apache.aries.blueprint.NamespaceHandler;
 import org.apache.aries.blueprint.ParserContext;
-import org.apache.aries.blueprint.ext.ExtNamespaceHandler;
-import org.apache.aries.blueprint.ext.PlaceholdersUtils;
+import org.apache.aries.blueprint.ext.impl.ExtNamespaceHandler;
 import org.apache.aries.blueprint.mutable.MutableBeanMetadata;
 import org.apache.aries.blueprint.mutable.MutableCollectionMetadata;
 import org.apache.aries.blueprint.mutable.MutableComponentMetadata;
@@ -40,7 +39,6 @@ import org.apache.aries.blueprint.mutabl
 import org.apache.aries.blueprint.mutable.MutableRefMetadata;
 import org.apache.aries.blueprint.mutable.MutableReferenceMetadata;
 import org.apache.aries.blueprint.mutable.MutableValueMetadata;
-import org.osgi.service.blueprint.container.BlueprintContainer;
 import org.osgi.service.blueprint.container.ComponentDefinitionException;
 import org.osgi.service.blueprint.reflect.BeanMetadata;
 import org.osgi.service.blueprint.reflect.BeanProperty;
@@ -179,13 +177,13 @@ public class CmNamespaceHandler implemen
         if (defaultsRef != null) {
             metadata.addProperty("defaultProperties", createRef(context, defaultsRef));
         }
-        String ignoreMissingLocations = element.hasAttributeNS(ExtNamespaceHandler.BLUEPRINT_EXT_NAMESPACE,
ExtNamespaceHandler.IGNORE_MISSING_LOCATIONS_ATTRIBUTE)
-                ? element.getAttributeNS(ExtNamespaceHandler.BLUEPRINT_EXT_NAMESPACE, ExtNamespaceHandler.IGNORE_MISSING_LOCATIONS_ATTRIBUTE)
: null;
+        String ignoreMissingLocations = element.hasAttributeNS(ExtNamespaceHandler.BLUEPRINT_EXT_NAMESPACE_V1_0,
ExtNamespaceHandler.IGNORE_MISSING_LOCATIONS_ATTRIBUTE)
+                ? element.getAttributeNS(ExtNamespaceHandler.BLUEPRINT_EXT_NAMESPACE_V1_0,
ExtNamespaceHandler.IGNORE_MISSING_LOCATIONS_ATTRIBUTE) : null;
         if (ignoreMissingLocations != null) {
             metadata.addProperty("ignoreMissingLocations", createValue(context, ignoreMissingLocations));
         }
-        String systemProperties = element.hasAttributeNS(ExtNamespaceHandler.BLUEPRINT_EXT_NAMESPACE,
ExtNamespaceHandler.SYSTEM_PROPERTIES_ATTRIBUTE)
-                ? element.getAttributeNS(ExtNamespaceHandler.BLUEPRINT_EXT_NAMESPACE, ExtNamespaceHandler.SYSTEM_PROPERTIES_ATTRIBUTE)
: null;
+        String systemProperties = element.hasAttributeNS(ExtNamespaceHandler.BLUEPRINT_EXT_NAMESPACE_V1_0,
ExtNamespaceHandler.SYSTEM_PROPERTIES_ATTRIBUTE)
+                ? element.getAttributeNS(ExtNamespaceHandler.BLUEPRINT_EXT_NAMESPACE_V1_0,
ExtNamespaceHandler.SYSTEM_PROPERTIES_ATTRIBUTE) : null;
         if (systemProperties == null) {
             systemProperties = ExtNamespaceHandler.SYSTEM_PROPERTIES_NEVER;
         }
@@ -205,7 +203,7 @@ public class CmNamespaceHandler implemen
                         Metadata props = parseDefaultProperties(context, metadata, e);
                         metadata.addProperty("defaultProperties", props);
                     }
-                } else if (ExtNamespaceHandler.BLUEPRINT_EXT_NAMESPACE.equals(e.getNamespaceURI()))
{
+                } else if (ExtNamespaceHandler.BLUEPRINT_EXT_NAMESPACE_V1_0.equals(e.getNamespaceURI()))
{
                     if (nodeNameEquals(e, ExtNamespaceHandler.LOCATION_ELEMENT)) {
                         locations.add(getTextValue(e));
                     }

Modified: geronimo/xbean/trunk/xbean-blueprint/src/test/java/org/apache/xbean/blueprint/context/BlueprintTestSupport.java
URL: http://svn.apache.org/viewvc/geronimo/xbean/trunk/xbean-blueprint/src/test/java/org/apache/xbean/blueprint/context/BlueprintTestSupport.java?rev=1393098&r1=1393097&r2=1393098&view=diff
==============================================================================
--- geronimo/xbean/trunk/xbean-blueprint/src/test/java/org/apache/xbean/blueprint/context/BlueprintTestSupport.java
(original)
+++ geronimo/xbean/trunk/xbean-blueprint/src/test/java/org/apache/xbean/blueprint/context/BlueprintTestSupport.java
Tue Oct  2 19:01:41 2012
@@ -16,27 +16,6 @@
  */
 package org.apache.xbean.blueprint.context;
 
-import junit.framework.TestCase;
-import org.apache.aries.blueprint.NamespaceHandler;
-import org.apache.aries.blueprint.reflect.BeanMetadataImpl;
-import org.apache.aries.blueprint.container.NamespaceHandlerRegistry;
-import org.apache.aries.blueprint.container.Parser;
-import org.apache.aries.blueprint.namespace.ComponentDefinitionRegistryImpl;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.apache.xbean.blueprint.context.impl.QNameNamespaceHandler;
-import org.apache.xbean.blueprint.context.impl.XBeanNamespaceHandler;
-import org.apache.xbean.blueprint.example.MilliLittersPropertyEditor;
-import org.xml.sax.SAXException;
-import org.osgi.service.blueprint.reflect.BeanProperty;
-import org.osgi.service.blueprint.reflect.ValueMetadata;
-import org.osgi.service.blueprint.reflect.BeanArgument;
-import org.osgi.service.blueprint.reflect.Metadata;
-import org.osgi.service.blueprint.reflect.BeanMetadata;
-
-import javax.xml.validation.Schema;
-import javax.xml.namespace.QName;
-
 import java.beans.PropertyEditor;
 import java.io.IOException;
 import java.io.InputStream;
@@ -46,10 +25,30 @@ import java.util.Arrays;
 import java.util.Collections;
 import java.util.HashMap;
 import java.util.HashSet;
-import java.util.Properties;
-import java.util.Set;
 import java.util.List;
 import java.util.Map;
+import java.util.Properties;
+import java.util.Set;
+import javax.xml.namespace.QName;
+import javax.xml.validation.Schema;
+
+import junit.framework.TestCase;
+import org.apache.aries.blueprint.NamespaceHandler;
+import org.apache.aries.blueprint.parser.ComponentDefinitionRegistryImpl;
+import org.apache.aries.blueprint.parser.NamespaceHandlerSet;
+import org.apache.aries.blueprint.parser.Parser;
+import org.apache.aries.blueprint.reflect.BeanMetadataImpl;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.xbean.blueprint.context.impl.QNameNamespaceHandler;
+import org.apache.xbean.blueprint.context.impl.XBeanNamespaceHandler;
+import org.apache.xbean.blueprint.example.MilliLittersPropertyEditor;
+import org.osgi.service.blueprint.reflect.BeanArgument;
+import org.osgi.service.blueprint.reflect.BeanMetadata;
+import org.osgi.service.blueprint.reflect.BeanProperty;
+import org.osgi.service.blueprint.reflect.Metadata;
+import org.osgi.service.blueprint.reflect.ValueMetadata;
+import org.xml.sax.SAXException;
 
 /**
  * A useful base class for testing spring based utilities.
@@ -100,7 +99,7 @@ public abstract class BlueprintTestSuppo
         propertyEditors.put(MilliLittersPropertyEditor.class.getName(), MilliLittersPropertyEditor.class);
         final NamespaceHandler xbeanHandler = new XBeanNamespaceHandler(NAMESPACE_URI.toString(),
BlueprintTestSupport.class.getClassLoader().getResource("restaurant.xsd"), classes, propertyEditors,
properties);
         final NamespaceHandler qnameHandler = new QNameNamespaceHandler();
-        NamespaceHandlerRegistry.NamespaceHandlerSet handlers = new NamespaceHandlerRegistry.NamespaceHandlerSet()
{
+        NamespaceHandlerSet handlers = new NamespaceHandlerSet() {
             public Set<URI> getNamespaces() {
                 return new HashSet<URI>(Arrays.asList(NAMESPACE_URI, QNAME_URI));
             }
@@ -114,7 +113,7 @@ public abstract class BlueprintTestSuppo
                 return null;
             }
 
-            public void removeListener(NamespaceHandlerRegistry.Listener listener) {
+            public void removeListener(Listener listener) {
             }
 
             public Schema getSchema() throws SAXException, IOException {
@@ -125,7 +124,7 @@ public abstract class BlueprintTestSuppo
                 return false;
             }
 
-            public void addListener(NamespaceHandlerRegistry.Listener listener) {
+            public void addListener(Listener listener) {
             }
 
             public void destroy() {
@@ -135,7 +134,7 @@ public abstract class BlueprintTestSuppo
     }
 
     // from aries blueprint core AbstractBlueprintTest
-    protected static ComponentDefinitionRegistryImpl parse(String plan, NamespaceHandlerRegistry.NamespaceHandlerSet
handlers) throws Exception {
+    protected static ComponentDefinitionRegistryImpl parse(String plan, NamespaceHandlerSet
handlers) throws Exception {
         ComponentDefinitionRegistryImpl registry = new ComponentDefinitionRegistryImpl();
         Parser parser = new Parser();
         parser.parse(Collections.singletonList(BlueprintTestSupport.class.getClassLoader().getResource(plan)));



Mime
View raw message