geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ga...@apache.org
Subject svn commit: r768869 - in /geronimo/sandbox/blueprint: ./ blueprint-core/ blueprint-core/src/main/java/org/apache/geronimo/blueprint/context/ blueprint-core/src/test/java/org/apache/geronimo/blueprint/ blueprint-core/src/test/java/org/apache/geronimo/bl...
Date Mon, 27 Apr 2009 04:52:48 GMT
Author: gawor
Date: Mon Apr 27 04:52:46 2009
New Revision: 768869

URL: http://svn.apache.org/viewvc?rev=768869&view=rev
Log:
some testing and constructor injection improvments

Added:
    geronimo/sandbox/blueprint/blueprint-core/src/test/java/org/apache/geronimo/blueprint/TestBlueprintContext.java
  (with props)
    geronimo/sandbox/blueprint/blueprint-core/src/test/java/org/apache/geronimo/blueprint/TestBundleContext.java
  (with props)
    geronimo/sandbox/blueprint/blueprint-core/src/test/java/org/apache/geronimo/blueprint/pojos/Multiple.java
  (with props)
Modified:
    geronimo/sandbox/blueprint/blueprint-core/pom.xml
    geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/context/BlueprintObjectRecipe.java
    geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/context/Instanciator.java
    geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/context/ValueRecipe.java
    geronimo/sandbox/blueprint/blueprint-core/src/test/java/org/apache/geronimo/blueprint/WiringTest.java
    geronimo/sandbox/blueprint/blueprint-core/src/test/java/org/apache/geronimo/blueprint/pojos/BeanC.java
    geronimo/sandbox/blueprint/blueprint-core/src/test/java/org/apache/geronimo/blueprint/pojos/BeanD.java
    geronimo/sandbox/blueprint/blueprint-core/src/test/resources/test-constructor.xml
    geronimo/sandbox/blueprint/pom.xml

Modified: geronimo/sandbox/blueprint/blueprint-core/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/sandbox/blueprint/blueprint-core/pom.xml?rev=768869&r1=768868&r2=768869&view=diff
==============================================================================
--- geronimo/sandbox/blueprint/blueprint-core/pom.xml (original)
+++ geronimo/sandbox/blueprint/blueprint-core/pom.xml Mon Apr 27 04:52:46 2009
@@ -57,6 +57,11 @@
           <groupId>org.slf4j</groupId>
           <artifactId>slf4j-api</artifactId>
       </dependency>
+      <dependency>
+          <groupId>org.slf4j</groupId>
+          <artifactId>slf4j-simple</artifactId>
+          <scope>test</scope>
+      </dependency>
   </dependencies>
 
     <build>

Modified: geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/context/BlueprintObjectRecipe.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/context/BlueprintObjectRecipe.java?rev=768869&r1=768868&r2=768869&view=diff
==============================================================================
--- geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/context/BlueprintObjectRecipe.java
(original)
+++ geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/context/BlueprintObjectRecipe.java
Mon Apr 27 04:52:46 2009
@@ -137,14 +137,15 @@
         List<Object> args = new ArrayList<Object>();
         for (int i = 0; beanArguments != null && i < beanArguments.size(); i++)
{
             BeanArgument argument = beanArguments.get(i);
+            Class type = loadClass(argument.getValueType());
             Object obj = arguments.get(i);
-            if (obj instanceof Recipe) {
-                if (shouldPreinstantiate(argument.getValue())) {
+            if (obj instanceof Recipe) {                
+                if (type != null || shouldPreinstantiate(argument.getValue())) {
                     obj = RecipeHelper.convert(Object.class, obj, refAllowed);
-                    obj = convert(obj, argument.getValueType());
+                    obj = convert(obj, type);
                 }
             } else {
-                obj = convert(obj, argument.getValueType());
+                obj = convert(obj, type);
             }
             args.add(obj);
         }
@@ -160,13 +161,18 @@
         return true;
     }
     
-    private Object convert(Object source, String typeName) throws ConstructionException {
-        Class type = null;
+    private Class loadClass(String typeName) throws ConstructionException {
+        if (typeName == null) {
+            return null;
+        }
         try {
-            type = Instanciator.loadClass(blueprintContext, typeName);
+            return Instanciator.loadClass(blueprintContext, typeName);
         } catch (ClassNotFoundException e) {
             throw new ConstructionException("Unable to load type class " + typeName);
         }
+    }
+    
+    private Object convert(Object source, Class type) throws ConstructionException {
         if (type != null && blueprintContext != null) {
             try {
                 source = blueprintContext.getConversionService().convert(source, type);
@@ -206,7 +212,7 @@
         
         Set<ArgumentsMatcher.Option> options = getArgumentsMatcherOptions();
         List<Object> arguments = getInitialArguments(refAllowed);
-                
+        
         if (factory != null) {
             // look for instance method on factory object
             Object factoryObj = RecipeHelper.convert(Object.class, factory, refAllowed);
@@ -255,6 +261,11 @@
     }
     
     @Override
+    public List<Recipe> getConstructorRecipes() {
+        return getNestedRecipes();
+    }
+    
+    @Override
     protected Object internalCreate(Type expectedType, boolean lazyRefAllowed) throws ConstructionException
{
         
         final Object obj = getInstance(lazyRefAllowed);

Modified: geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/context/Instanciator.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/context/Instanciator.java?rev=768869&r1=768868&r2=768869&view=diff
==============================================================================
--- geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/context/Instanciator.java
(original)
+++ geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/context/Instanciator.java
Mon Apr 27 04:52:46 2009
@@ -199,7 +199,6 @@
 
     private BlueprintObjectRecipe createBeanRecipe(BeanMetadata local) throws Exception {
         BlueprintObjectRecipe recipe = new BlueprintObjectRecipe(blueprintContext, loadClass(local.getClassName()));
-        recipe.allow(Option.PRIVATE_PROPERTIES);
         recipe.setName(local.getId());
         recipe.setExplicitDependencies(local.getExplicitDependencies());
         for (BeanProperty property : local.getProperties()) {

Modified: geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/context/ValueRecipe.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/context/ValueRecipe.java?rev=768869&r1=768868&r2=768869&view=diff
==============================================================================
--- geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/context/ValueRecipe.java
(original)
+++ geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/context/ValueRecipe.java
Mon Apr 27 04:52:46 2009
@@ -72,7 +72,15 @@
     }
 
     public boolean canCreate(Type expectedType) {
-        return true;
+        // XXX: this is expensive but that's what spec wants
+        Class myType = determineType(type, groupingType, RecipeHelper.toClass(expectedType));
+        
+        try {
+            conversionService.convert(value.getStringValue(), myType);
+            return true;
+        } catch (Exception e) {
+            return false;
+        }
     }
 
 }

Added: geronimo/sandbox/blueprint/blueprint-core/src/test/java/org/apache/geronimo/blueprint/TestBlueprintContext.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/blueprint/blueprint-core/src/test/java/org/apache/geronimo/blueprint/TestBlueprintContext.java?rev=768869&view=auto
==============================================================================
--- geronimo/sandbox/blueprint/blueprint-core/src/test/java/org/apache/geronimo/blueprint/TestBlueprintContext.java
(added)
+++ geronimo/sandbox/blueprint/blueprint-core/src/test/java/org/apache/geronimo/blueprint/TestBlueprintContext.java
Mon Apr 27 04:52:46 2009
@@ -0,0 +1,34 @@
+/*
+ * 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.geronimo.blueprint;
+
+import org.apache.geronimo.blueprint.context.BlueprintContextImpl;
+
+public class TestBlueprintContext extends BlueprintContextImpl {
+
+    public TestBlueprintContext() {
+        super(new TestBundleContext(), null, null, null, null);
+    }
+    
+    @Override
+    public ClassLoader getClassLoader() {
+        return Thread.currentThread().getContextClassLoader();
+    }
+    
+}

Propchange: geronimo/sandbox/blueprint/blueprint-core/src/test/java/org/apache/geronimo/blueprint/TestBlueprintContext.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/sandbox/blueprint/blueprint-core/src/test/java/org/apache/geronimo/blueprint/TestBlueprintContext.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/sandbox/blueprint/blueprint-core/src/test/java/org/apache/geronimo/blueprint/TestBlueprintContext.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/sandbox/blueprint/blueprint-core/src/test/java/org/apache/geronimo/blueprint/TestBundleContext.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/blueprint/blueprint-core/src/test/java/org/apache/geronimo/blueprint/TestBundleContext.java?rev=768869&view=auto
==============================================================================
--- geronimo/sandbox/blueprint/blueprint-core/src/test/java/org/apache/geronimo/blueprint/TestBundleContext.java
(added)
+++ geronimo/sandbox/blueprint/blueprint-core/src/test/java/org/apache/geronimo/blueprint/TestBundleContext.java
Mon Apr 27 04:52:46 2009
@@ -0,0 +1,144 @@
+/*
+ * 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.geronimo.blueprint;
+
+import java.io.File;
+import java.io.InputStream;
+import java.util.Dictionary;
+
+import org.osgi.framework.Bundle;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.BundleException;
+import org.osgi.framework.BundleListener;
+import org.osgi.framework.Filter;
+import org.osgi.framework.FrameworkListener;
+import org.osgi.framework.InvalidSyntaxException;
+import org.osgi.framework.ServiceListener;
+import org.osgi.framework.ServiceReference;
+import org.osgi.framework.ServiceRegistration;
+
+public class TestBundleContext implements BundleContext {
+
+    public void addBundleListener(BundleListener arg0) {
+        // TODO Auto-generated method stub
+    }
+
+    public void addFrameworkListener(FrameworkListener arg0) {
+        // TODO Auto-generated method stub
+    }
+
+    public void addServiceListener(ServiceListener arg0) {
+        // TODO Auto-generated method stub
+    }
+
+    public void addServiceListener(ServiceListener arg0, String arg1)
+        throws InvalidSyntaxException {
+        // TODO Auto-generated method stub
+    }
+
+    public Filter createFilter(String arg0) throws InvalidSyntaxException {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+    public ServiceReference[] getAllServiceReferences(String arg0, String arg1)
+        throws InvalidSyntaxException {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+    public Bundle getBundle() {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+    public Bundle getBundle(long arg0) {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+    public Bundle[] getBundles() {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+    public File getDataFile(String arg0) {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+    public String getProperty(String arg0) {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+    public Object getService(ServiceReference arg0) {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+    public ServiceReference getServiceReference(String arg0) {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+    public ServiceReference[] getServiceReferences(String arg0, String arg1)
+    throws InvalidSyntaxException {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+    public Bundle installBundle(String arg0) throws BundleException {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+    public Bundle installBundle(String arg0, InputStream arg1) throws BundleException {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+    public ServiceRegistration registerService(String[] arg0, Object arg1, Dictionary arg2)
{
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+    public ServiceRegistration registerService(String arg0, Object arg1, Dictionary arg2)
{
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+    public void removeBundleListener(BundleListener arg0) {
+        // TODO Auto-generated method stub
+    }
+
+    public void removeFrameworkListener(FrameworkListener arg0) {
+        // TODO Auto-generated method stub
+    }
+
+    public void removeServiceListener(ServiceListener arg0) {
+        // TODO Auto-generated method stub
+    }
+
+    public boolean ungetService(ServiceReference arg0) {
+        // TODO Auto-generated method stub
+        return false;
+    }
+
+}

Propchange: geronimo/sandbox/blueprint/blueprint-core/src/test/java/org/apache/geronimo/blueprint/TestBundleContext.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/sandbox/blueprint/blueprint-core/src/test/java/org/apache/geronimo/blueprint/TestBundleContext.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/sandbox/blueprint/blueprint-core/src/test/java/org/apache/geronimo/blueprint/TestBundleContext.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: geronimo/sandbox/blueprint/blueprint-core/src/test/java/org/apache/geronimo/blueprint/WiringTest.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/blueprint/blueprint-core/src/test/java/org/apache/geronimo/blueprint/WiringTest.java?rev=768869&r1=768868&r2=768869&view=diff
==============================================================================
--- geronimo/sandbox/blueprint/blueprint-core/src/test/java/org/apache/geronimo/blueprint/WiringTest.java
(original)
+++ geronimo/sandbox/blueprint/blueprint-core/src/test/java/org/apache/geronimo/blueprint/WiringTest.java
Mon Apr 27 04:52:46 2009
@@ -23,23 +23,21 @@
 import java.util.concurrent.atomic.AtomicBoolean;
 
 import org.apache.geronimo.blueprint.context.Instanciator;
-import org.apache.geronimo.blueprint.convert.ConversionServiceImpl;
 import org.apache.geronimo.blueprint.namespace.ComponentDefinitionRegistryImpl;
-import org.apache.geronimo.blueprint.pojos.PojoA;
-import org.apache.geronimo.blueprint.pojos.PojoB;
 import org.apache.geronimo.blueprint.pojos.BeanC;
 import org.apache.geronimo.blueprint.pojos.BeanD;
+import org.apache.geronimo.blueprint.pojos.Multiple;
+import org.apache.geronimo.blueprint.pojos.PojoA;
+import org.apache.geronimo.blueprint.pojos.PojoB;
 import org.apache.xbean.recipe.ObjectGraph;
 import org.apache.xbean.recipe.Repository;
 import org.osgi.framework.ServiceRegistration;
-import org.osgi.service.blueprint.convert.ConversionService;
-import org.osgi.service.blueprint.namespace.ComponentDefinitionRegistry;
 
 public class WiringTest extends AbstractBlueprintTest {
 
     public void testWiring() throws Exception {
         ComponentDefinitionRegistryImpl registry = parse("/test-wiring.xml");
-        Instanciator i = new TestInstanciator();
+        Instanciator i = new Instanciator(new TestBlueprintContext());
         Repository repository = i.createRepository(registry);
         ObjectGraph graph = new ObjectGraph(repository);
         
@@ -134,7 +132,7 @@
         };
 
         ComponentDefinitionRegistryImpl registry = parse("/test-depends-on.xml");
-        Instanciator i = new TestInstanciator();
+        Instanciator i = new Instanciator(new TestBlueprintContext());
         Repository repository = i.createRepository(registry);
         ObjectGraph graph = new ObjectGraph(repository);
         graph.createAll("c", "d");
@@ -142,7 +140,7 @@
 
     public void testConstructor() throws Exception {
         ComponentDefinitionRegistryImpl registry = parse("/test-constructor.xml");
-        Instanciator i = new TestInstanciator();
+        Instanciator i = new Instanciator(new TestBlueprintContext());
         Repository repository = i.createRepository(registry);
         ObjectGraph graph = new ObjectGraph(repository);
         
@@ -185,20 +183,31 @@
         
         assertEquals(URI.create("urn:myuri-dynamic"), pojob.getUri());
         assertEquals(20, pojob.getNumber());
-
-    }
-    
-    private static class TestInstanciator extends Instanciator {
-        ConversionServiceImpl conversionService = new ConversionServiceImpl();
-
-        public TestInstanciator() {
-            super(null);
-        }
         
-        @Override
-        public ConversionService getConversionService() {
-            return conversionService;
+        try {
+            graph.create("multipleFail");
+            fail("Did not throw exception");
+        } catch (RuntimeException e) {
+            // we expect exception 
         }
         
+        Object obj6 = graph.create("multipleInt");
+        assertNotNull(obj6);
+        assertTrue(obj6 instanceof Multiple);
+        assertEquals(123, ((Multiple)obj6).getInt());
+        assertNull(((Multiple)obj6).getString());
+        
+        Object obj7 = graph.create("multipleString");
+        assertNotNull(obj7);
+        assertTrue(obj7 instanceof Multiple);
+        assertEquals(-1, ((Multiple)obj7).getInt());
+        assertEquals("123", ((Multiple)obj7).getString());
+        
+        Object obj8 = graph.create("multipleStringConvertable");
+        assertNotNull(obj8);
+        assertTrue(obj8 instanceof Multiple);
+        assertEquals(-1, ((Multiple)obj8).getInt());
+        assertEquals("hello", ((Multiple)obj8).getString());
     }
+     
 }

Modified: geronimo/sandbox/blueprint/blueprint-core/src/test/java/org/apache/geronimo/blueprint/pojos/BeanC.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/blueprint/blueprint-core/src/test/java/org/apache/geronimo/blueprint/pojos/BeanC.java?rev=768869&r1=768868&r2=768869&view=diff
==============================================================================
--- geronimo/sandbox/blueprint/blueprint-core/src/test/java/org/apache/geronimo/blueprint/pojos/BeanC.java
(original)
+++ geronimo/sandbox/blueprint/blueprint-core/src/test/java/org/apache/geronimo/blueprint/pojos/BeanC.java
Mon Apr 27 04:52:46 2009
@@ -1,3 +1,21 @@
+/*
+ * 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.geronimo.blueprint.pojos;
 
 public class BeanC {

Modified: geronimo/sandbox/blueprint/blueprint-core/src/test/java/org/apache/geronimo/blueprint/pojos/BeanD.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/blueprint/blueprint-core/src/test/java/org/apache/geronimo/blueprint/pojos/BeanD.java?rev=768869&r1=768868&r2=768869&view=diff
==============================================================================
--- geronimo/sandbox/blueprint/blueprint-core/src/test/java/org/apache/geronimo/blueprint/pojos/BeanD.java
(original)
+++ geronimo/sandbox/blueprint/blueprint-core/src/test/java/org/apache/geronimo/blueprint/pojos/BeanD.java
Mon Apr 27 04:52:46 2009
@@ -1,3 +1,21 @@
+/*
+ * 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.geronimo.blueprint.pojos;
 
 public class BeanD {

Added: geronimo/sandbox/blueprint/blueprint-core/src/test/java/org/apache/geronimo/blueprint/pojos/Multiple.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/blueprint/blueprint-core/src/test/java/org/apache/geronimo/blueprint/pojos/Multiple.java?rev=768869&view=auto
==============================================================================
--- geronimo/sandbox/blueprint/blueprint-core/src/test/java/org/apache/geronimo/blueprint/pojos/Multiple.java
(added)
+++ geronimo/sandbox/blueprint/blueprint-core/src/test/java/org/apache/geronimo/blueprint/pojos/Multiple.java
Mon Apr 27 04:52:46 2009
@@ -0,0 +1,41 @@
+/*
+ * 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.geronimo.blueprint.pojos;
+
+public class Multiple {
+
+    private int intValue = -1;
+    private String stringValue = null;
+
+    public Multiple(String arg) {   
+        stringValue = arg;
+    }
+
+    public Multiple(int arg) {   
+        intValue = arg;
+    }
+
+    public int getInt() {
+        return intValue;
+    }
+
+    public String getString() {
+        return stringValue;
+    }
+}

Propchange: geronimo/sandbox/blueprint/blueprint-core/src/test/java/org/apache/geronimo/blueprint/pojos/Multiple.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/sandbox/blueprint/blueprint-core/src/test/java/org/apache/geronimo/blueprint/pojos/Multiple.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/sandbox/blueprint/blueprint-core/src/test/java/org/apache/geronimo/blueprint/pojos/Multiple.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: geronimo/sandbox/blueprint/blueprint-core/src/test/resources/test-constructor.xml
URL: http://svn.apache.org/viewvc/geronimo/sandbox/blueprint/blueprint-core/src/test/resources/test-constructor.xml?rev=768869&r1=768868&r2=768869&view=diff
==============================================================================
--- geronimo/sandbox/blueprint/blueprint-core/src/test/resources/test-constructor.xml (original)
+++ geronimo/sandbox/blueprint/blueprint-core/src/test/resources/test-constructor.xml Mon
Apr 27 04:52:46 2009
@@ -35,4 +35,20 @@
         <argument value="urn:myuri" />
     </bean>
     
+    <bean id="multipleFail" class="org.apache.geronimo.blueprint.pojos.Multiple">
+        <argument value="123"/>
+    </bean>
+    
+    <bean id="multipleInt" class="org.apache.geronimo.blueprint.pojos.Multiple">
+        <argument type="int" value="123"/>
+    </bean>
+    
+    <bean id="multipleString" class="org.apache.geronimo.blueprint.pojos.Multiple">
+        <argument type="java.lang.String" value="123"/>
+    </bean>
+    
+    <bean id="multipleStringConvertable" class="org.apache.geronimo.blueprint.pojos.Multiple">
+        <argument value="hello"/>
+    </bean>
+    
 </blueprint>

Modified: geronimo/sandbox/blueprint/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/sandbox/blueprint/pom.xml?rev=768869&r1=768868&r2=768869&view=diff
==============================================================================
--- geronimo/sandbox/blueprint/pom.xml (original)
+++ geronimo/sandbox/blueprint/pom.xml Mon Apr 27 04:52:46 2009
@@ -99,6 +99,11 @@
                 <version>1.5.6</version>
             </dependency>
             <dependency>
+                <groupId>org.slf4j</groupId>
+                <artifactId>slf4j-simple</artifactId>
+                <version>1.5.6</version>
+            </dependency>
+            <dependency>
                 <groupId>org.apache.servicemix.kernel.testing</groupId>
                 <artifactId>org.apache.servicemix.kernel.testing.support</artifactId>
                 <version>1.1.0</version>



Mime
View raw message