geronimo-xbean-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rmannibu...@apache.org
Subject svn commit: r1664436 - in /geronimo/xbean/trunk/xbean-blueprint: ./ src/main/java/org/apache/xbean/blueprint/context/impl/ src/test/java/org/apache/xbean/blueprint/context/ src/test/resources/org/apache/xbean/blueprint/context/
Date Thu, 05 Mar 2015 17:57:43 GMT
Author: rmannibucau
Date: Thu Mar  5 17:57:43 2015
New Revision: 1664436

URL: http://svn.apache.org/r1664436
Log:
XBEAN-278 XBEAN-279 Blueprint Namespace Handler improperly parsed flat-collections + PropertyEditors
called too soon. Patch from Daniel Kulp, thanks a lot

Modified:
    geronimo/xbean/trunk/xbean-blueprint/pom.xml
    geronimo/xbean/trunk/xbean-blueprint/src/main/java/org/apache/xbean/blueprint/context/impl/XBeanNamespaceHandler.java
    geronimo/xbean/trunk/xbean-blueprint/src/test/java/org/apache/xbean/blueprint/context/BeerUsingBlueprintTest.java
    geronimo/xbean/trunk/xbean-blueprint/src/test/java/org/apache/xbean/blueprint/context/BlueprintTestSupport.java
    geronimo/xbean/trunk/xbean-blueprint/src/test/java/org/apache/xbean/blueprint/context/ComponentTest.java
    geronimo/xbean/trunk/xbean-blueprint/src/test/java/org/apache/xbean/blueprint/context/FlatMapTest.java
    geronimo/xbean/trunk/xbean-blueprint/src/test/java/org/apache/xbean/blueprint/context/KegXBeanTest.java
    geronimo/xbean/trunk/xbean-blueprint/src/test/java/org/apache/xbean/blueprint/context/SoupUsingXBeanTest.java
    geronimo/xbean/trunk/xbean-blueprint/src/test/resources/org/apache/xbean/blueprint/context/beer-xbean-ns.xml
    geronimo/xbean/trunk/xbean-blueprint/src/test/resources/org/apache/xbean/blueprint/context/soup-xbean.xml

Modified: geronimo/xbean/trunk/xbean-blueprint/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/xbean/trunk/xbean-blueprint/pom.xml?rev=1664436&r1=1664435&r2=1664436&view=diff
==============================================================================
--- geronimo/xbean/trunk/xbean-blueprint/pom.xml (original)
+++ geronimo/xbean/trunk/xbean-blueprint/pom.xml Thu Mar  5 17:57:43 2015
@@ -40,18 +40,17 @@
 
     </properties>
     <dependencies>
-
-        <dependency>
-            <groupId>org.apache.aries.blueprint</groupId>
-            <artifactId>org.apache.aries.blueprint.api</artifactId>
-            <version>1.0.0</version>
-            <scope>provided</scope>
-        </dependency>
         <dependency>
             <groupId>org.apache.aries.blueprint</groupId>
             <artifactId>org.apache.aries.blueprint.cm</artifactId>
             <version>1.0.0</version>
             <scope>provided</scope>
+            <exclusions>
+                <exclusion>
+                    <groupId>org.apache.aries.blueprint</groupId>
+                    <artifactId>org.apache.aries.blueprint.core</artifactId>
+                </exclusion>
+            </exclusions>
         </dependency>
 
         <dependency>
@@ -118,6 +117,12 @@
             <scope>provided</scope>
         </dependency>
 
+        <dependency>
+        	<groupId>org.apache.aries.blueprint</groupId>
+        	<artifactId>org.apache.aries.blueprint.noosgi</artifactId>
+        	<version>1.1.0-SNAPSHOT</version>
+        	<scope>provided</scope>
+        </dependency>
     </dependencies>
 
     <build>
@@ -187,6 +192,41 @@
                 </configuration>
             </plugin>
         </plugins>
+        <pluginManagement>
+        	<plugins>
+        		<!--This plugin's configuration is used to store Eclipse m2e settings only.
It has no influence on the Maven build itself.-->
+        		<plugin>
+        			<groupId>org.eclipse.m2e</groupId>
+        			<artifactId>lifecycle-mapping</artifactId>
+        			<version>1.0.0</version>
+        			<configuration>
+        				<lifecycleMappingMetadata>
+        					<pluginExecutions>
+        						<pluginExecution>
+        							<pluginExecutionFilter>
+        								<groupId>
+        									org.apache.maven.plugins
+        								</groupId>
+        								<artifactId>
+        									maven-antrun-plugin
+        								</artifactId>
+        								<versionRange>
+        									[1.6,)
+        								</versionRange>
+        								<goals>
+        									<goal>run</goal>
+        								</goals>
+        							</pluginExecutionFilter>
+        							<action>
+        								<ignore></ignore>
+        							</action>
+        						</pluginExecution>
+        					</pluginExecutions>
+        				</lifecycleMappingMetadata>
+        			</configuration>
+        		</plugin>
+        	</plugins>
+        </pluginManagement>
     </build>
 
 </project>

Modified: geronimo/xbean/trunk/xbean-blueprint/src/main/java/org/apache/xbean/blueprint/context/impl/XBeanNamespaceHandler.java
URL: http://svn.apache.org/viewvc/geronimo/xbean/trunk/xbean-blueprint/src/main/java/org/apache/xbean/blueprint/context/impl/XBeanNamespaceHandler.java?rev=1664436&r1=1664435&r2=1664436&view=diff
==============================================================================
--- geronimo/xbean/trunk/xbean-blueprint/src/main/java/org/apache/xbean/blueprint/context/impl/XBeanNamespaceHandler.java
(original)
+++ geronimo/xbean/trunk/xbean-blueprint/src/main/java/org/apache/xbean/blueprint/context/impl/XBeanNamespaceHandler.java
Thu Mar  5 17:57:43 2015
@@ -346,6 +346,7 @@ public class XBeanNamespaceHandler imple
                 PropertyDescriptor pd = getPropertyDescriptor(mappingMetaData.getClassName(beanTypeName),
childName);
                 Class propertyType = pd == null ? null : pd.getPropertyType();
                 String propertyName = mappingMetaData.getNestedListProperty(beanTypeName,
childName);
+                boolean isList = false;
                 //explicit list
                 if (propertyName != null || isCollectionType(propertyType)) {
                     propertyName = propertyName == null ? childName : propertyName;
@@ -361,6 +362,7 @@ public class XBeanNamespaceHandler imple
                     } else {
                         listMeta = (MutableCollectionMetadata) list.getValue();
                     }
+                    isList = true;
                     listMeta.addValue(elementMetadata);
                 } else if ((propertyName = mappingMetaData.getNestedProperty(beanTypeName,
childName)) != null) {
                     // lets find the first child bean that parses fine
@@ -374,7 +376,7 @@ public class XBeanNamespaceHandler imple
                     childMetadata = tryParseNestedPropertyViaIntrospection(beanMetadata,
className, child, parserContext);
                     propertyName = childName;
                 }
-                if (childMetadata == null) {
+                if (childMetadata == null && !isList) {
                     String text = getElementText(child);
                     if (text != null) {
                         MutableValueMetadata m = parserContext.createMetadata(MutableValueMetadata.class);
@@ -703,19 +705,20 @@ public class XBeanNamespaceHandler imple
         //
         // Neither null nor a reference
         //
-        MutableValueMetadata metadata = parserContext.createMetadata(MutableValueMetadata.class);
         if (propertyEditorName != null) {
-            PropertyEditor propertyEditor;
-            try {
-                propertyEditor = propertyEditors.get(propertyEditorName).newInstance();
-            } catch (InstantiationException e) {
-                throw new ComponentDefinitionException("Could not create a " + propertyEditorName
+ " to convert value " + value + " for namespace " + namespace);
-            } catch (IllegalAccessException e) {
-                throw new ComponentDefinitionException("Could not create a " + propertyEditorName
+ " to convert value " + value + " for namespace " + namespace);
-            }
-            propertyEditor.setAsText(value);
-            value = propertyEditor.getAsText();
+            MutableBeanMetadata factory = parserContext.createMetadata(MutableBeanMetadata.class);
+            factory.setRuntimeClass(propertyEditors.get(propertyEditorName));
+
+            MutableValueMetadata metadata = parserContext.createMetadata(MutableValueMetadata.class);
+            metadata.setStringValue(value);
+            factory.addProperty("asText", metadata);
+            
+            MutableBeanMetadata bean = parserContext.createMetadata(MutableBeanMetadata.class);
+            bean.setFactoryComponent(factory);
+            bean.setFactoryMethod("getValue");
+            return bean;
         }
+        MutableValueMetadata metadata = parserContext.createMetadata(MutableValueMetadata.class);
         metadata.setStringValue(value);
         return metadata;
     }

Modified: geronimo/xbean/trunk/xbean-blueprint/src/test/java/org/apache/xbean/blueprint/context/BeerUsingBlueprintTest.java
URL: http://svn.apache.org/viewvc/geronimo/xbean/trunk/xbean-blueprint/src/test/java/org/apache/xbean/blueprint/context/BeerUsingBlueprintTest.java?rev=1664436&r1=1664435&r2=1664436&view=diff
==============================================================================
--- geronimo/xbean/trunk/xbean-blueprint/src/test/java/org/apache/xbean/blueprint/context/BeerUsingBlueprintTest.java
(original)
+++ geronimo/xbean/trunk/xbean-blueprint/src/test/java/org/apache/xbean/blueprint/context/BeerUsingBlueprintTest.java
Thu Mar  5 17:57:43 2015
@@ -16,8 +16,7 @@
  */
 package org.apache.xbean.blueprint.context;
 
-import org.apache.aries.blueprint.ComponentDefinitionRegistry;
-import org.apache.aries.blueprint.reflect.BeanMetadataImpl;
+import org.apache.xbean.blueprint.example.BeerService;
 
 /**
  * @author James Strachan
@@ -27,10 +26,10 @@ import org.apache.aries.blueprint.reflec
 public class BeerUsingBlueprintTest extends BlueprintTestSupport {
     
     public void testBeer() throws Exception {
-        BeanMetadataImpl meta = (BeanMetadataImpl) reg.getComponentDefinition("beerService");
-        checkPropertyValue("name", "Stella", meta);
-        checkPropertyValue("id", "123", meta);
-        assertEquals("id", "beerService", meta.getId());
+        BeerService o = (BeerService)container.getComponentInstance("beerService");
+        assertNotNull(o);
+        assertEquals("name", "Stella", o.getName());
+        assertEquals("id", "123", o.getId());
     }
 
     protected String getPlan() {

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=1664436&r1=1664435&r2=1664436&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
Thu Mar  5 17:57:43 2015
@@ -29,14 +29,17 @@ 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.container.BlueprintContainerImpl;
+import org.apache.aries.blueprint.container.SimpleNamespaceHandlerSet;
 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;
@@ -48,6 +51,7 @@ import org.osgi.service.blueprint.reflec
 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;
 
 /**
@@ -63,17 +67,23 @@ public abstract class BlueprintTestSuppo
     private static final URI QNAME_URI = URI.create("http://xbean.apache.org/schemas/javax.xml.namespace.QName");
 
     protected ComponentDefinitionRegistryImpl reg;
-
+    protected BlueprintContainerImpl container;
+    
     protected void setUp() throws Exception {
-        reg = parse(getPlan());
+        container = parse(getPlan(), getSchema());
+        reg = container.getComponentDefinitionRegistry();
+    }
+    protected abstract String getPlan();
+    protected String getSchema() {
+        return "META-INF/services/org/apache/xbean/blueprint/http/xbean.apache.org/schemas/pizza";
     }
 
-    protected static ComponentDefinitionRegistryImpl parse(String plan) throws Exception
{
+    protected static BlueprintContainerImpl parse(String plan) throws Exception {
         String schema = "META-INF/services/org/apache/xbean/blueprint/http/xbean.apache.org/schemas/pizza";
         return parse(plan, schema);
     }
 
-    protected static ComponentDefinitionRegistryImpl parse(String plan, String schema) throws
Exception {
+    protected static BlueprintContainerImpl parse(String plan, String schema) throws Exception
{
         Properties properties = new Properties();
         URL propUrl = BlueprintTestSupport.class.getClassLoader().getResource(schema);
         InputStream in = propUrl.openStream();
@@ -99,51 +109,26 @@ 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();
-        NamespaceHandlerSet handlers = new NamespaceHandlerSet() {
-            public Set<URI> getNamespaces() {
-                return new HashSet<URI>(Arrays.asList(NAMESPACE_URI, QNAME_URI));
-            }
-
-            public NamespaceHandler getNamespaceHandler(URI namespace) {
-                if (NAMESPACE_URI.equals(namespace)) {
-                    return xbeanHandler;
-                } else if (QNAME_URI.equals(namespace)){
-                    return qnameHandler;
-                }
-                return null;
-            }
-
-            public void removeListener(Listener listener) {
-            }
-
-            public Schema getSchema() throws SAXException, IOException {
-                return null;
-            }
-
-            public boolean isComplete() {
-                return false;
-            }
-
-            public void addListener(Listener listener) {
-            }
-
-            public void destroy() {
-            }
-        };
+        SimpleNamespaceHandlerSet handlers = new SimpleNamespaceHandlerSet();
+        handlers.addNamespace(NAMESPACE_URI, xbeanHandler.getSchemaLocation(NAMESPACE_URI.toString()),
xbeanHandler);
+        handlers.addNamespace(QNAME_URI,  xbeanHandler.getSchemaLocation(NAMESPACE_URI.toString()),
qnameHandler);
+        
         return parse(plan, handlers);
     }
 
     // from aries blueprint core AbstractBlueprintTest
-    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)));
-        parser.populate(handlers, registry);
-        return registry;
+    protected static BlueprintContainerImpl parse(String plan, final NamespaceHandlerSet
handlers) throws Exception {
+        List<URL> list = Collections.singletonList(BlueprintTestSupport.class.getClassLoader().getResource(plan));
+        
+        BlueprintContainerImpl container = new BlueprintContainerImpl(BlueprintTestSupport.class.getClassLoader(),
list, false) {
+            protected NamespaceHandlerSet createNamespaceHandlerSet(Set<URI> namespaces)
{
+                return handlers;
+            }
+        };
+        container.init(false);
+        return container;
     }
 
-    protected abstract String getPlan();
-
     protected static void checkPropertyValue(String name, Object expectedValued, BeanMetadataImpl
meta) {
         BeanProperty prop = propertyByName(name, meta);
         assertEquals(expectedValued, ((ValueMetadata) prop.getValue()).getStringValue());

Modified: geronimo/xbean/trunk/xbean-blueprint/src/test/java/org/apache/xbean/blueprint/context/ComponentTest.java
URL: http://svn.apache.org/viewvc/geronimo/xbean/trunk/xbean-blueprint/src/test/java/org/apache/xbean/blueprint/context/ComponentTest.java?rev=1664436&r1=1664435&r2=1664436&view=diff
==============================================================================
--- geronimo/xbean/trunk/xbean-blueprint/src/test/java/org/apache/xbean/blueprint/context/ComponentTest.java
(original)
+++ geronimo/xbean/trunk/xbean-blueprint/src/test/java/org/apache/xbean/blueprint/context/ComponentTest.java
Thu Mar  5 17:57:43 2015
@@ -39,7 +39,7 @@ public class ComponentTest extends TestC
     }
     
     protected void test(String file) throws Exception {
-        ComponentDefinitionRegistry f = BlueprintTestSupport.parse(file);
+        ComponentDefinitionRegistry f = BlueprintTestSupport.parse(file).getComponentDefinitionRegistry();
         BeanMetadataImpl meta = (BeanMetadataImpl) f.getComponentDefinition("container");
         assertNotNull(meta);
         CollectionMetadata list = (CollectionMetadata) BlueprintTestSupport.propertyByName("beans",
meta).getValue();

Modified: geronimo/xbean/trunk/xbean-blueprint/src/test/java/org/apache/xbean/blueprint/context/FlatMapTest.java
URL: http://svn.apache.org/viewvc/geronimo/xbean/trunk/xbean-blueprint/src/test/java/org/apache/xbean/blueprint/context/FlatMapTest.java?rev=1664436&r1=1664435&r2=1664436&view=diff
==============================================================================
--- geronimo/xbean/trunk/xbean-blueprint/src/test/java/org/apache/xbean/blueprint/context/FlatMapTest.java
(original)
+++ geronimo/xbean/trunk/xbean-blueprint/src/test/java/org/apache/xbean/blueprint/context/FlatMapTest.java
Thu Mar  5 17:57:43 2015
@@ -16,13 +16,11 @@
  */
 package org.apache.xbean.blueprint.context;
 
+import java.util.List;
+import java.util.Map;
+
+import org.apache.xbean.blueprint.example.FlatMapService;
 import org.apache.xbean.blueprint.example.KegService;
-import org.apache.aries.blueprint.reflect.BeanMetadataImpl;
-import org.osgi.service.blueprint.reflect.CollectionMetadata;
-import org.osgi.service.blueprint.reflect.MapEntry;
-import org.osgi.service.blueprint.reflect.MapMetadata;
-import org.osgi.service.blueprint.reflect.Metadata;
-import org.osgi.service.blueprint.reflect.ValueMetadata;
 
 /**
  * @author gnodet
@@ -30,34 +28,37 @@ import org.osgi.service.blueprint.reflec
 public class FlatMapTest extends BlueprintTestSupport {
 
     public void testFlatMap() {
-        BeanMetadataImpl meta = (BeanMetadataImpl) reg.getComponentDefinition("flat-map");
-        MapMetadata c = (MapMetadata) propertyByName("services", meta).getValue();
-        assertEquals(3, c.getEntries().size());
-        MapEntry me = c.getEntries().get(0);
-        assertEquals("key1", ((ValueMetadata) me.getKey()).getStringValue());
-        CollectionMetadata l = (CollectionMetadata) me.getValue();
-        assertEquals(2, l.getValues().size());
-        checkEntry(l.getValues().get(0), "1000");
-        checkEntry(l.getValues().get(1), "8750");
-
-        me = c.getEntries().get(1);
-        assertEquals("key2", ((ValueMetadata) me.getKey()).getStringValue());
-        l = (CollectionMetadata) me.getValue();
-        assertEquals(1, l.getValues().size());
-        checkEntry(l.getValues().get(0), "20000");
-
-        me = c.getEntries().get(2);
-        assertEquals("others", ((ValueMetadata) me.getKey()).getStringValue());
-        l = (CollectionMetadata) me.getValue();
-        assertEquals(1, l.getValues().size());
-        checkEntry(l.getValues().get(0), "0");
-    }
-
-    private void checkEntry(Metadata me, String value) {
-        BeanMetadataImpl beanMetadata = (BeanMetadataImpl) me;
-        assertEquals(KegService.class.getName(), beanMetadata.getClassName());
-        assertEquals(1, beanMetadata.getProperties().size());
-        assertEquals(value, ((ValueMetadata) beanMetadata.getProperties().get(0).getValue()).getStringValue());
+        FlatMapService map = (FlatMapService)container.getComponentInstance("flat-map");
+        Map<?, ?> services = map.getServices();
+        assertNotNull(services);
+        assertEquals(3, services.size());
+        for (Map.Entry<?, ?> ent : services.entrySet()) {
+            String key = ent.getKey().toString();
+            if (key.equals("key1")) {
+                List<?> list = (List<?>)ent.getValue();
+                assertEquals(2, list.size());
+                KegService keg = (KegService)list.get(0);
+                assertNotNull(keg);
+                assertEquals(1000, keg.getRemaining());
+                keg = (KegService)list.get(1);
+                assertNotNull(keg);
+                assertEquals(8750, keg.getRemaining());
+            } else if (key.equals("key2")) {
+                List<?> list = (List<?>)ent.getValue();
+                assertEquals(1, list.size());
+                KegService keg = (KegService)list.get(0);
+                assertNotNull(keg);
+                assertEquals(20000, keg.getRemaining());
+            } else if (key.equals("others")) {
+                List<?> list = (List<?>)ent.getValue();
+                assertEquals(1, list.size());
+                KegService keg = (KegService)list.get(0);
+                assertNotNull(keg);
+                assertEquals(0, keg.getRemaining());
+            } else {
+                fail("Unexpected key " + key);
+            }
+        }
     }
 
     protected String getPlan() {

Modified: geronimo/xbean/trunk/xbean-blueprint/src/test/java/org/apache/xbean/blueprint/context/KegXBeanTest.java
URL: http://svn.apache.org/viewvc/geronimo/xbean/trunk/xbean-blueprint/src/test/java/org/apache/xbean/blueprint/context/KegXBeanTest.java?rev=1664436&r1=1664435&r2=1664436&view=diff
==============================================================================
--- geronimo/xbean/trunk/xbean-blueprint/src/test/java/org/apache/xbean/blueprint/context/KegXBeanTest.java
(original)
+++ geronimo/xbean/trunk/xbean-blueprint/src/test/java/org/apache/xbean/blueprint/context/KegXBeanTest.java
Thu Mar  5 17:57:43 2015
@@ -29,20 +29,22 @@ import org.apache.aries.blueprint.reflec
 public class KegXBeanTest extends BlueprintTestSupport {
 
     public void testBeer() throws Exception {
-        //TODO blueprint value conversion using units??
-        BeanMetadataImpl ml1000 = (BeanMetadataImpl) reg.getComponentDefinition("ml1000");
-        BeanMetadataImpl empty = (BeanMetadataImpl) reg.getComponentDefinition("empty");
-        BeanMetadataImpl pints5 = (BeanMetadataImpl) reg.getComponentDefinition("pints5");
-        BeanMetadataImpl liter20 = (BeanMetadataImpl) reg.getComponentDefinition("liter20");
         
-        checkPropertyValue("remaining", "1000", ml1000);
-        checkPropertyValue("remaining", "0", empty);
-        checkPropertyValue("remaining", "8750", pints5);
-        checkPropertyValue("remaining", "20000", liter20);
-//        checkPropertyValue("remaining", "1000", ml1000);
-//        checkPropertyValue("remaining", "0", empty);
-//        checkPropertyValue("remaining", "8750", pints5);
-//        checkPropertyValue("remaining", "20000", liter20);
+        KegService keg = (KegService)container.getComponentInstance("ml1000");
+        assertNotNull(keg);
+        assertEquals(1000, keg.getRemaining());
+        
+        keg = (KegService)container.getComponentInstance("empty");
+        assertNotNull(keg);
+        assertEquals(0, keg.getRemaining());
+
+        keg = (KegService)container.getComponentInstance("pints5");
+        assertNotNull(keg);
+        assertEquals(8750, keg.getRemaining());
+
+        keg = (KegService)container.getComponentInstance("liter20");
+        assertNotNull(keg);
+        assertEquals(20000, keg.getRemaining());
 
     }
 

Modified: geronimo/xbean/trunk/xbean-blueprint/src/test/java/org/apache/xbean/blueprint/context/SoupUsingXBeanTest.java
URL: http://svn.apache.org/viewvc/geronimo/xbean/trunk/xbean-blueprint/src/test/java/org/apache/xbean/blueprint/context/SoupUsingXBeanTest.java?rev=1664436&r1=1664435&r2=1664436&view=diff
==============================================================================
--- geronimo/xbean/trunk/xbean-blueprint/src/test/java/org/apache/xbean/blueprint/context/SoupUsingXBeanTest.java
(original)
+++ geronimo/xbean/trunk/xbean-blueprint/src/test/java/org/apache/xbean/blueprint/context/SoupUsingXBeanTest.java
Thu Mar  5 17:57:43 2015
@@ -23,11 +23,9 @@ package org.apache.xbean.blueprint.conte
  */
 public class SoupUsingXBeanTest extends SoupUsingBlueprintTest {
 
-    @Override
-    protected void setUp() throws Exception {
-        reg = parse(getPlan(), "META-INF/services/org/apache/xbean/blueprint/http/xbean.apache.org/schemas/soup");
+    protected String getSchema() {
+        return "META-INF/services/org/apache/xbean/blueprint/http/xbean.apache.org/schemas/soup";
     }
-
     protected String getPlan() {
         return "org/apache/xbean/blueprint/context/soup-xbean.xml";
     }

Modified: geronimo/xbean/trunk/xbean-blueprint/src/test/resources/org/apache/xbean/blueprint/context/beer-xbean-ns.xml
URL: http://svn.apache.org/viewvc/geronimo/xbean/trunk/xbean-blueprint/src/test/resources/org/apache/xbean/blueprint/context/beer-xbean-ns.xml?rev=1664436&r1=1664435&r2=1664436&view=diff
==============================================================================
--- geronimo/xbean/trunk/xbean-blueprint/src/test/resources/org/apache/xbean/blueprint/context/beer-xbean-ns.xml
(original)
+++ geronimo/xbean/trunk/xbean-blueprint/src/test/resources/org/apache/xbean/blueprint/context/beer-xbean-ns.xml
Thu Mar  5 17:57:43 2015
@@ -22,7 +22,7 @@
        xmlns:s="http://www.osgi.org/xmlns/blueprint/v1.0.0"
        xmlns="http://xbean.apache.org/schemas/pizza">
 
-  <beer b:id="123" id="beerService" name="Stella"/>
+  <beer b:id="123" s:id="beerService" name="Stella"/>
 
 </s:blueprint>
 <!-- END SNIPPET: xml -->

Modified: geronimo/xbean/trunk/xbean-blueprint/src/test/resources/org/apache/xbean/blueprint/context/soup-xbean.xml
URL: http://svn.apache.org/viewvc/geronimo/xbean/trunk/xbean-blueprint/src/test/resources/org/apache/xbean/blueprint/context/soup-xbean.xml?rev=1664436&r1=1664435&r2=1664436&view=diff
==============================================================================
--- geronimo/xbean/trunk/xbean-blueprint/src/test/resources/org/apache/xbean/blueprint/context/soup-xbean.xml
(original)
+++ geronimo/xbean/trunk/xbean-blueprint/src/test/resources/org/apache/xbean/blueprint/context/soup-xbean.xml
Thu Mar  5 17:57:43 2015
@@ -20,9 +20,9 @@
 <!-- START SNIPPET: xml -->
 <b:blueprint xmlns:b="http://www.osgi.org/xmlns/blueprint/v1.0.0" xmlns:s="http://xbean.apache.org/schemas/pizza">
 
-  <s:soup b:id="soupService" s:id="soupService" s:type="French Onion"/>
+  <s:soup b:id="soupService" s:type="French Onion"/>
 
-  <s:soup b:id="nestedBean" s:id="nestedBean">
+  <s:soup b:id="nestedBean" >
     <s:type>
       <b:bean class="java.lang.String">
         <b:argument index="0" value="French Onion"/>
@@ -30,7 +30,7 @@
     </s:type>
   </s:soup>
 
-  <s:soup b:id="nestedValue" s:id="nestedValue">
+  <s:soup b:id="nestedValue">
     <s:type>
       <b:value>French Onion</b:value>
     </s:type>



Mime
View raw message