Return-Path: Delivered-To: apmail-geronimo-scm-archive@www.apache.org Received: (qmail 91404 invoked from network); 22 Apr 2009 15:58:12 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 22 Apr 2009 15:58:12 -0000 Received: (qmail 55189 invoked by uid 500); 22 Apr 2009 15:58:12 -0000 Delivered-To: apmail-geronimo-scm-archive@geronimo.apache.org Received: (qmail 55143 invoked by uid 500); 22 Apr 2009 15:58:12 -0000 Mailing-List: contact scm-help@geronimo.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: Reply-To: dev@geronimo.apache.org List-Id: Delivered-To: mailing list scm@geronimo.apache.org Received: (qmail 55132 invoked by uid 99); 22 Apr 2009 15:58:12 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 22 Apr 2009 15:58:12 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 22 Apr 2009 15:58:01 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id BE1142388B99; Wed, 22 Apr 2009 15:57:41 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r767576 [4/4] - in /geronimo/sandbox/blueprint: blueprint-api/src/main/java/org/osgi/service/blueprint/context/ blueprint-api/src/main/java/org/osgi/service/blueprint/convert/ blueprint-api/src/main/java/org/osgi/service/blueprint/namespace... Date: Wed, 22 Apr 2009 15:57:38 -0000 To: scm@geronimo.apache.org From: gnodet@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20090422155741.BE1142388B99@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Modified: geronimo/sandbox/blueprint/blueprint-core/src/main/resources/org/apache/geronimo/blueprint/blueprint-compendium.xsd URL: http://svn.apache.org/viewvc/geronimo/sandbox/blueprint/blueprint-core/src/main/resources/org/apache/geronimo/blueprint/blueprint-compendium.xsd?rev=767576&r1=767575&r2=767576&view=diff ============================================================================== --- geronimo/sandbox/blueprint/blueprint-core/src/main/resources/org/apache/geronimo/blueprint/blueprint-compendium.xsd (original) +++ geronimo/sandbox/blueprint/blueprint-core/src/main/resources/org/apache/geronimo/blueprint/blueprint-compendium.xsd Wed Apr 22 15:57:35 2009 @@ -1,4 +1,23 @@ + - + - - - - - - - - - - - - - + + + + + + + + + + + + + + + + - - + + + - + - + - + @@ -59,12 +84,13 @@ - + + @@ -73,15 +99,16 @@ - - - - - - + + + + + + + Modified: geronimo/sandbox/blueprint/blueprint-core/src/main/resources/org/apache/geronimo/blueprint/blueprint.xsd URL: http://svn.apache.org/viewvc/geronimo/sandbox/blueprint/blueprint-core/src/main/resources/org/apache/geronimo/blueprint/blueprint.xsd?rev=767576&r1=767575&r2=767576&view=diff ============================================================================== --- geronimo/sandbox/blueprint/blueprint-core/src/main/resources/org/apache/geronimo/blueprint/blueprint.xsd (original) +++ geronimo/sandbox/blueprint/blueprint-core/src/main/resources/org/apache/geronimo/blueprint/blueprint.xsd Wed Apr 22 15:57:35 2009 @@ -1,4 +1,23 @@ + - - - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - + - + + + - - - + - - - - - - - - - - + + + + + + - + - - - - - - - - - - + - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + - + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - - - - - - + + + + + + + + + + + + + + + + + + - - - - - - - - - - + + - - + - - + + - - - - + + + + - - - - - - - + + + + + + + + - - + + + - - - - - - - + + + - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + - + - + @@ -327,32 +184,84 @@ - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - + + + + + + + @@ -361,108 +270,174 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - \ No newline at end of file + Modified: geronimo/sandbox/blueprint/blueprint-core/src/test/java/org/apache/geronimo/blueprint/ParserTest.java URL: http://svn.apache.org/viewvc/geronimo/sandbox/blueprint/blueprint-core/src/test/java/org/apache/geronimo/blueprint/ParserTest.java?rev=767576&r1=767575&r2=767576&view=diff ============================================================================== --- geronimo/sandbox/blueprint/blueprint-core/src/test/java/org/apache/geronimo/blueprint/ParserTest.java (original) +++ geronimo/sandbox/blueprint/blueprint-core/src/test/java/org/apache/geronimo/blueprint/ParserTest.java Wed Apr 22 15:57:35 2009 @@ -20,32 +20,25 @@ import java.net.URI; import java.net.URL; -import java.util.Collections; import java.util.List; -import java.util.Set; import org.w3c.dom.Attr; import org.w3c.dom.Element; import org.w3c.dom.Node; -import junit.framework.TestCase; -import org.apache.geronimo.blueprint.context.Parser; -import org.apache.geronimo.blueprint.namespace.ComponentDefinitionRegistryImpl; -import org.apache.geronimo.blueprint.reflect.LocalComponentMetadataImpl; +import org.apache.geronimo.blueprint.reflect.BeanMetadataImpl; import org.osgi.service.blueprint.namespace.ComponentDefinitionRegistry; import org.osgi.service.blueprint.namespace.NamespaceHandler; import org.osgi.service.blueprint.namespace.ParserContext; -import org.osgi.service.blueprint.reflect.ArrayValue; +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.CollectionMetadata; import org.osgi.service.blueprint.reflect.ComponentMetadata; -import org.osgi.service.blueprint.reflect.ComponentValue; -import org.osgi.service.blueprint.reflect.ConstructorInjectionMetadata; -import org.osgi.service.blueprint.reflect.LocalComponentMetadata; -import org.osgi.service.blueprint.reflect.NullValue; -import org.osgi.service.blueprint.reflect.ParameterSpecification; -import org.osgi.service.blueprint.reflect.PropertyInjectionMetadata; -import org.osgi.service.blueprint.reflect.ReferenceValue; -import org.osgi.service.blueprint.reflect.TypedStringValue; -import org.osgi.service.blueprint.reflect.Value; +import org.osgi.service.blueprint.reflect.Metadata; +import org.osgi.service.blueprint.reflect.NullMetadata; +import org.osgi.service.blueprint.reflect.RefMetadata; +import org.osgi.service.blueprint.reflect.ValueMetadata; /** * TODO: constructor injection @@ -58,69 +51,67 @@ assertNotNull(registry); ComponentMetadata component = registry.getComponentDefinition("pojoA"); assertNotNull(component); - assertEquals("pojoA", component.getName()); - Set deps = component.getExplicitDependencies(); + assertEquals("pojoA", component.getId()); + assertTrue(component instanceof BeanMetadata); + BeanMetadata local = (BeanMetadata) component; + List deps = local.getExplicitDependencies(); assertNotNull(deps); assertEquals(2, deps.size()); assertTrue(deps.contains("pojoB")); assertTrue(deps.contains("pojoC")); - assertTrue(component instanceof LocalComponentMetadata); - LocalComponentMetadata local = (LocalComponentMetadata) component; assertEquals("org.apache.geronimo.blueprint.pojos.PojoA", local.getClassName()); - ConstructorInjectionMetadata cns = local.getConstructorInjectionMetadata(); - assertNotNull(cns); - List params = cns.getParameterSpecifications(); + List params = local.getArguments(); assertNotNull(params); assertEquals(6, params.size()); - ParameterSpecification param = params.get(0); + BeanArgument param = params.get(0); assertNotNull(param); assertEquals(-1, param.getIndex()); - assertNull(param.getTypeName()); + assertNull(param.getValueType()); assertNotNull(param.getValue()); - assertTrue(param.getValue() instanceof TypedStringValue); - assertEquals("val0", ((TypedStringValue) param.getValue()).getStringValue()); - assertNull(((TypedStringValue) param.getValue()).getTypeName()); + assertTrue(param.getValue() instanceof ValueMetadata); + assertEquals("val0", ((ValueMetadata) param.getValue()).getStringValue()); + assertNull(((ValueMetadata) param.getValue()).getTypeName()); param = params.get(1); assertNotNull(param); assertEquals(-1, param.getIndex()); - assertNull(param.getTypeName()); + assertNull(param.getValueType()); assertNotNull(param.getValue()); - assertTrue(param.getValue() instanceof ReferenceValue); - assertEquals("val1", ((ReferenceValue) param.getValue()).getComponentName()); + assertTrue(param.getValue() instanceof RefMetadata); + assertEquals("val1", ((RefMetadata) param.getValue()).getComponentId()); param = params.get(2); assertNotNull(param); assertEquals(-1, param.getIndex()); - assertNull(param.getTypeName()); + assertNull(param.getValueType()); assertNotNull(param.getValue()); - assertTrue(param.getValue() instanceof NullValue); + assertTrue(param.getValue() instanceof NullMetadata); param = params.get(3); assertNotNull(param); assertEquals(-1, param.getIndex()); - assertEquals("java.lang.String", param.getTypeName()); + assertEquals("java.lang.String", param.getValueType()); assertNotNull(param.getValue()); - assertTrue(param.getValue() instanceof TypedStringValue); - assertEquals("val3", ((TypedStringValue) param.getValue()).getStringValue()); - assertNull(((TypedStringValue) param.getValue()).getTypeName()); + assertTrue(param.getValue() instanceof ValueMetadata); + assertEquals("val3", ((ValueMetadata) param.getValue()).getStringValue()); + assertNull(((ValueMetadata) param.getValue()).getTypeName()); param = params.get(4); assertNotNull(param); assertEquals(-1, param.getIndex()); - assertNull(param.getTypeName()); + assertNull(param.getValueType()); assertNotNull(param.getValue()); - assertTrue(param.getValue() instanceof ArrayValue); - ArrayValue array = (ArrayValue) param.getValue(); - assertNull(array.getValueType()); - assertNotNull(array.getArray()); - assertEquals(3, array.getArray().length); - assertTrue(array.getArray()[0] instanceof TypedStringValue); - assertTrue(array.getArray()[1] instanceof ComponentValue); - assertTrue(array.getArray()[2] instanceof NullValue); + assertTrue(param.getValue() instanceof CollectionMetadata); + CollectionMetadata array = (CollectionMetadata) param.getValue(); + assertNull(array.getValueTypeName()); + assertNotNull(array.getValues()); + assertEquals(3, array.getValues().size()); + assertTrue(array.getValues().get(0) instanceof ValueMetadata); + assertTrue(array.getValues().get(1) instanceof ComponentMetadata); + assertTrue(array.getValues().get(2) instanceof NullMetadata); param = params.get(5); assertNotNull(param); assertEquals(-1, param.getIndex()); - assertNull(param.getTypeName()); + assertNull(param.getValueType()); assertNotNull(param.getValue()); - assertTrue(param.getValue() instanceof ReferenceValue); - assertEquals("pojoB", ((ReferenceValue) param.getValue()).getComponentName()); + assertTrue(param.getValue() instanceof RefMetadata); + assertEquals("pojoB", ((RefMetadata) param.getValue()).getComponentId()); assertEquals(null, local.getInitMethodName()); assertEquals(null, local.getDestroyMethodName()); @@ -128,15 +119,13 @@ // test pojoB ComponentMetadata pojoB = registry.getComponentDefinition("pojoB"); assertNotNull(pojoB); - assertEquals("pojoB", pojoB.getName()); - assertTrue(pojoB instanceof LocalComponentMetadata); - LocalComponentMetadata pojoBLocal = (LocalComponentMetadata) pojoB; + assertEquals("pojoB", pojoB.getId()); + assertTrue(pojoB instanceof BeanMetadata); + BeanMetadata pojoBLocal = (BeanMetadata) pojoB; assertEquals("initPojo", pojoBLocal.getInitMethodName()); assertEquals("", pojoBLocal.getDestroyMethodName()); - cns = pojoBLocal.getConstructorInjectionMetadata(); - assertNotNull(cns); - params = cns.getParameterSpecifications(); + params = pojoBLocal.getArguments(); assertNotNull(params); assertEquals(2, params.size()); param = params.get(0); @@ -166,22 +155,20 @@ metadata = registry.getComponentDefinition("barService"); assertNotNull(metadata); - assertTrue(metadata instanceof LocalComponentMetadata); - LocalComponentMetadata comp2 = (LocalComponentMetadata) metadata; - assertEquals(1, comp2.getPropertyInjectionMetadata().size()); - PropertyInjectionMetadata propertyMetadata = (PropertyInjectionMetadata)comp2.getPropertyInjectionMetadata().iterator().next(); + assertTrue(metadata instanceof BeanMetadata); + BeanMetadata comp2 = (BeanMetadata) metadata; + assertEquals(1, comp2.getProperties().size()); + BeanProperty propertyMetadata = comp2.getProperties().get(0); assertEquals("localCache", propertyMetadata.getName()); - Value propertyValue = propertyMetadata.getValue(); - assertTrue(propertyValue instanceof ComponentValue); - ComponentValue componentValue = (ComponentValue) propertyValue; - assertTrue(componentValue.getComponentMetadata() instanceof LocalComponentMetadata); - LocalComponentMetadata innerComp = (LocalComponentMetadata) componentValue.getComponentMetadata(); + Metadata propertyValue = propertyMetadata.getValue(); + assertTrue(propertyValue instanceof BeanMetadata); + BeanMetadata innerComp = (BeanMetadata) propertyValue; assertEquals("org.apache.geronimo.CacheProperty", innerComp.getClassName()); metadata = registry.getComponentDefinition("myCache"); assertNotNull(metadata); - assertTrue(metadata instanceof LocalComponentMetadata); - LocalComponentMetadata comp3 = (LocalComponentMetadata) metadata; + assertTrue(metadata instanceof BeanMetadata); + BeanMetadata comp3 = (BeanMetadata) metadata; assertEquals("org.apache.geronimo.Cache", comp3.getClassName()); } @@ -206,11 +193,11 @@ public ComponentMetadata decorate(Node node, ComponentMetadata component, ParserContext context) { - //System.out.println("decorate: " + node + " " + component + " " + context.getEnclosingComponent().getName()); + //System.out.println("decorate: " + node + " " + component + " " + context.getEnclosingComponent().getId()); if (node instanceof Attr) { Attr attr = (Attr) node; - MyLocalComponentMetadata decoratedComp = new MyLocalComponentMetadata((LocalComponentMetadata)component); + MyLocalComponentMetadata decoratedComp = new MyLocalComponentMetadata((BeanMetadata)component); decoratedComp.setCacheReturnValues(Boolean.parseBoolean(attr.getValue())); return decoratedComp; } else if (node instanceof Element) { @@ -228,7 +215,7 @@ } public ComponentMetadata parse(Element element, ParserContext context) { - String comp = (context.getEnclosingComponent() == null) ? null : context.getEnclosingComponent().getName(); + String comp = (context.getEnclosingComponent() == null) ? null : context.getEnclosingComponent().getId(); //System.out.println("parse: " + element.getLocalName() + " " + comp); String className; @@ -238,8 +225,8 @@ className = "org.apache.geronimo.CacheProperty"; } - LocalComponentMetadataImpl p = new LocalComponentMetadataImpl(); - p.setName(element.getAttribute("id")); + BeanMetadataImpl p = new BeanMetadataImpl(); + p.setId(element.getAttribute("id")); p.setClassName(className); return p; @@ -247,12 +234,12 @@ } - private static class MyLocalComponentMetadata extends LocalComponentMetadataImpl { + private static class MyLocalComponentMetadata extends BeanMetadataImpl { private boolean cacheReturnValues; private String operation; - public MyLocalComponentMetadata(LocalComponentMetadata impl) { + public MyLocalComponentMetadata(BeanMetadata impl) { super(impl); } Modified: geronimo/sandbox/blueprint/blueprint-core/src/test/resources/test-custom-nodes.xml URL: http://svn.apache.org/viewvc/geronimo/sandbox/blueprint/blueprint-core/src/test/resources/test-custom-nodes.xml?rev=767576&r1=767575&r2=767576&view=diff ============================================================================== --- geronimo/sandbox/blueprint/blueprint-core/src/test/resources/test-custom-nodes.xml (original) +++ geronimo/sandbox/blueprint/blueprint-core/src/test/resources/test-custom-nodes.xml Wed Apr 22 15:57:35 2009 @@ -17,22 +17,22 @@ specific language governing permissions and limitations under the License. --> - + xsi:schemaLocation="http://www.osgi.org/xmlns/blueprint/v1.0.0 ../../main/resources/org/apache/geronimo/blueprint/blueprint.xsd"> - + - + - + - + - \ No newline at end of file + \ No newline at end of file Modified: geronimo/sandbox/blueprint/blueprint-core/src/test/resources/test-simple-component.xml URL: http://svn.apache.org/viewvc/geronimo/sandbox/blueprint/blueprint-core/src/test/resources/test-simple-component.xml?rev=767576&r1=767575&r2=767576&view=diff ============================================================================== --- geronimo/sandbox/blueprint/blueprint-core/src/test/resources/test-simple-component.xml (original) +++ geronimo/sandbox/blueprint/blueprint-core/src/test/resources/test-simple-component.xml Wed Apr 22 15:57:35 2009 @@ -1,40 +1,40 @@ - - - - - + + + + null value - - + + val3 - - + + val0 - + - - + + - + property val - + - - - - + + + + - \ No newline at end of file + \ No newline at end of file Modified: geronimo/sandbox/blueprint/blueprint-core/src/test/resources/test-wiring.xml URL: http://svn.apache.org/viewvc/geronimo/sandbox/blueprint/blueprint-core/src/test/resources/test-wiring.xml?rev=767576&r1=767575&r2=767576&view=diff ============================================================================== --- geronimo/sandbox/blueprint/blueprint-core/src/test/resources/test-wiring.xml (original) +++ geronimo/sandbox/blueprint/blueprint-core/src/test/resources/test-wiring.xml Wed Apr 22 15:57:35 2009 @@ -1,5 +1,5 @@ - - + - + - + - + - + @@ -75,6 +75,6 @@ 10 - + - \ No newline at end of file + \ No newline at end of file Modified: geronimo/sandbox/blueprint/blueprint-core/src/test/resources/test.xml URL: http://svn.apache.org/viewvc/geronimo/sandbox/blueprint/blueprint-core/src/test/resources/test.xml?rev=767576&r1=767575&r2=767576&view=diff ============================================================================== --- geronimo/sandbox/blueprint/blueprint-core/src/test/resources/test.xml (original) +++ geronimo/sandbox/blueprint/blueprint-core/src/test/resources/test.xml Wed Apr 22 15:57:35 2009 @@ -1,7 +1,7 @@ - @@ -9,27 +9,27 @@ - + - + - + - - - + + + - + - + - - - + + + - + @@ -42,8 +42,8 @@ - + - \ No newline at end of file + \ No newline at end of file Copied: geronimo/sandbox/blueprint/blueprint-itests/src/test/java/org/apache/geronimo/blueprint/itests/TestBlueprintContext.java (from r767394, geronimo/sandbox/blueprint/blueprint-itests/src/test/java/org/apache/geronimo/blueprint/itests/TestModuleContext.java) URL: http://svn.apache.org/viewvc/geronimo/sandbox/blueprint/blueprint-itests/src/test/java/org/apache/geronimo/blueprint/itests/TestBlueprintContext.java?p2=geronimo/sandbox/blueprint/blueprint-itests/src/test/java/org/apache/geronimo/blueprint/itests/TestBlueprintContext.java&p1=geronimo/sandbox/blueprint/blueprint-itests/src/test/java/org/apache/geronimo/blueprint/itests/TestModuleContext.java&r1=767394&r2=767576&rev=767576&view=diff ============================================================================== --- geronimo/sandbox/blueprint/blueprint-itests/src/test/java/org/apache/geronimo/blueprint/itests/TestModuleContext.java (original) +++ geronimo/sandbox/blueprint/blueprint-itests/src/test/java/org/apache/geronimo/blueprint/itests/TestBlueprintContext.java Wed Apr 22 15:57:35 2009 @@ -32,12 +32,12 @@ import org.osgi.framework.Bundle; import org.osgi.framework.ServiceRegistration; import org.osgi.framework.Constants; -import org.osgi.service.blueprint.context.ModuleContext; +import org.osgi.service.blueprint.context.BlueprintContext; import org.osgi.service.blueprint.context.ServiceUnavailableException; import org.springframework.core.io.Resource; import org.springframework.util.Assert; -public class TestModuleContext extends AbstractIntegrationTest { +public class TestBlueprintContext extends AbstractIntegrationTest { public void test() throws Exception { Resource res = locateBundle(getBundle("org.apache.geronimo", "blueprint-sample")); @@ -45,10 +45,10 @@ assertNotNull(bundle); bundle.start(); - ModuleContext moduleContext = getOsgiService(ModuleContext.class, 5000); - assertNotNull(moduleContext); + BlueprintContext blueprintContext = getOsgiService(BlueprintContext.class, 5000); + assertNotNull(blueprintContext); - Object obj = moduleContext.getComponent("bar"); + Object obj = blueprintContext.getComponent("bar"); assertNotNull(obj); assertEquals(Bar.class, obj.getClass()); Bar bar = (Bar) obj; @@ -58,7 +58,7 @@ assertEquals(2, bar.getList().size()); assertEquals("a list element", bar.getList().get(0)); assertEquals(Integer.valueOf(5), bar.getList().get(1)); - obj = moduleContext.getComponent("foo"); + obj = blueprintContext.getComponent("foo"); assertNotNull(obj); assertEquals(Foo.class, obj.getClass()); Foo foo = (Foo) obj; @@ -74,7 +74,7 @@ bundle.stop(); try { - moduleContext = getOsgiService(ModuleContext.class, 1); + blueprintContext = getOsgiService(BlueprintContext.class, 1); fail("ModuleContext should have been unregistered"); } catch (Exception e) { // Expected, as the module context should have been unregistered Modified: geronimo/sandbox/blueprint/blueprint-itests/src/test/java/org/apache/geronimo/blueprint/itests/TestReferences.java URL: http://svn.apache.org/viewvc/geronimo/sandbox/blueprint/blueprint-itests/src/test/java/org/apache/geronimo/blueprint/itests/TestReferences.java?rev=767576&r1=767575&r2=767576&view=diff ============================================================================== --- geronimo/sandbox/blueprint/blueprint-itests/src/test/java/org/apache/geronimo/blueprint/itests/TestReferences.java (original) +++ geronimo/sandbox/blueprint/blueprint-itests/src/test/java/org/apache/geronimo/blueprint/itests/TestReferences.java Wed Apr 22 15:57:35 2009 @@ -19,19 +19,16 @@ package org.apache.geronimo.blueprint.itests; import java.net.URLDecoder; -import java.util.Properties; import java.util.Hashtable; import java.util.List; -import org.apache.servicemix.kernel.testing.support.AbstractIntegrationTest; -import org.apache.geronimo.blueprint.sample.Foo; -import org.apache.geronimo.blueprint.sample.Bar; -import org.apache.geronimo.blueprint.sample.InterfaceA; import org.apache.geronimo.blueprint.sample.BindingListener; +import org.apache.geronimo.blueprint.sample.InterfaceA; +import org.apache.servicemix.kernel.testing.support.AbstractIntegrationTest; import org.osgi.framework.Bundle; -import org.osgi.framework.ServiceRegistration; import org.osgi.framework.Constants; -import org.osgi.service.blueprint.context.ModuleContext; +import org.osgi.framework.ServiceRegistration; +import org.osgi.service.blueprint.context.BlueprintContext; import org.osgi.service.blueprint.context.ServiceUnavailableException; import org.springframework.core.io.Resource; import org.springframework.util.Assert; @@ -39,14 +36,14 @@ public class TestReferences extends AbstractIntegrationTest { public void testUnaryReference() throws Exception { - ModuleContext moduleContext = getOsgiService(ModuleContext.class, 5000); - assertNotNull(moduleContext); + BlueprintContext blueprintContext = getOsgiService(BlueprintContext.class, 5000); + assertNotNull(blueprintContext); - BindingListener listener = (BindingListener) moduleContext.getComponent("bindingListener"); + BindingListener listener = (BindingListener) blueprintContext.getComponent("bindingListener"); assertNull(listener.getA()); assertNull(listener.getReference()); - InterfaceA a = (InterfaceA) moduleContext.getComponent("ref2"); + InterfaceA a = (InterfaceA) blueprintContext.getComponent("ref2"); try { a.hello("world"); fail("A ServiceUnavailableException should have been thrown"); @@ -91,14 +88,14 @@ } public void testListReferences() throws Exception { - ModuleContext moduleContext = getOsgiService(ModuleContext.class, 5000); - assertNotNull(moduleContext); + BlueprintContext blueprintContext = getOsgiService(BlueprintContext.class, 5000); + assertNotNull(blueprintContext); - BindingListener listener = (BindingListener) moduleContext.getComponent("listBindingListener"); + BindingListener listener = (BindingListener) blueprintContext.getComponent("listBindingListener"); assertNull(listener.getA()); assertNull(listener.getReference()); - List refs = (List) moduleContext.getComponent("ref-list"); + List refs = (List) blueprintContext.getComponent("ref-list"); assertNotNull(refs); assertTrue(refs.isEmpty()); Modified: geronimo/sandbox/blueprint/blueprint-sample/src/main/resources/OSGI-INF/blueprint/config.xml URL: http://svn.apache.org/viewvc/geronimo/sandbox/blueprint/blueprint-sample/src/main/resources/OSGI-INF/blueprint/config.xml?rev=767576&r1=767575&r2=767576&view=diff ============================================================================== --- geronimo/sandbox/blueprint/blueprint-sample/src/main/resources/OSGI-INF/blueprint/config.xml (original) +++ geronimo/sandbox/blueprint/blueprint-sample/src/main/resources/OSGI-INF/blueprint/config.xml Wed Apr 22 15:57:35 2009 @@ -1,15 +1,14 @@ - - + - + - + - + @@ -19,9 +18,9 @@ 2009.04.17 - + - + Hello FooBar @@ -30,9 +29,9 @@ 5 - + - + @@ -43,7 +42,7 @@ unregistration-method="serviceUnregistered"/> - + @@ -52,13 +51,13 @@ - + - + - +