felix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From clem...@apache.org
Subject svn commit: r1450158 [7/9] - in /felix/trunk/ipojo/runtime/composite-it: ./ src/ src/it/ src/it/ipojo-composite-import-export-test/ src/it/ipojo-composite-import-export-test/src/ src/it/ipojo-composite-import-export-test/src/main/ src/it/ipojo-composit...
Date Tue, 26 Feb 2013 13:02:40 GMT
Added: felix/trunk/ipojo/runtime/composite-it/src/it/ipojo-composite-runtime-test/src/test/java/org/apache/felix/ipojo/runtime/core/ServiceRangeTest.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/runtime/composite-it/src/it/ipojo-composite-runtime-test/src/test/java/org/apache/felix/ipojo/runtime/core/ServiceRangeTest.java?rev=1450158&view=auto
==============================================================================
--- felix/trunk/ipojo/runtime/composite-it/src/it/ipojo-composite-runtime-test/src/test/java/org/apache/felix/ipojo/runtime/core/ServiceRangeTest.java (added)
+++ felix/trunk/ipojo/runtime/composite-it/src/it/ipojo-composite-runtime-test/src/test/java/org/apache/felix/ipojo/runtime/core/ServiceRangeTest.java Tue Feb 26 13:02:34 2013
@@ -0,0 +1,510 @@
+/* 
+ * 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.felix.ipojo.runtime.core;
+
+import org.apache.felix.ipojo.ComponentInstance;
+import org.apache.felix.ipojo.Factory;
+import org.apache.felix.ipojo.ServiceContext;
+import org.apache.felix.ipojo.runtime.core.services.CheckService;
+import org.apache.felix.ipojo.runtime.core.services.FooService;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+import org.osgi.framework.InvalidSyntaxException;
+import org.osgi.framework.ServiceReference;
+
+import java.util.Properties;
+
+import static org.junit.Assert.*;
+
+public class ServiceRangeTest extends Common {
+
+    private Factory emptyFactory;
+    private ComponentInstance empty;
+
+
+    @Before
+    public void setUp() {
+        emptyFactory = ipojoHelper.getFactory("composite.empty");
+        Properties props = new Properties();
+        props.put("instance.name", "empty-1");
+        try {
+            empty = emptyFactory.createComponentInstance(props);
+        } catch (Exception e) {
+            fail("Cannot create empty instance " + e.getMessage());
+        }
+    }
+
+    @After
+    public void tearDown() {
+        empty.dispose();
+        empty = null;
+    }
+
+    @Test
+    public void testLevelOne1() {
+        ServiceContext sc2 = getServiceContext(empty);
+
+        Factory fact1 = ipojoHelper.getFactory(sc2, "COMPO-SimpleCheckServiceProvider");
+        Properties props = new Properties();
+        props.put("instance.name", "client");
+        ComponentInstance client = null;
+        try {
+            client = fact1.createComponentInstance(props);
+        } catch (Exception e) {
+            fail("Cannot instantiate the client : " + e.getMessage());
+        }
+
+        Factory fact2 = ipojoHelper.getFactory(sc2, "COMPO-FooProviderType-1");
+        Properties props2 = new Properties();
+        props2.put("instance.name", "provider");
+        ComponentInstance provider = null;
+        try {
+            provider = fact2.createComponentInstance(props2);
+        } catch (Exception e) {
+            fail("Cannot instantiate the provider : " + e.getMessage());
+        }
+
+        ServiceReference ref = sc2.getServiceReference(CheckService.class.getName());
+        CheckService check = (CheckService) sc2.getService(ref);
+
+        assertTrue("Check invocation", check.check());
+
+        sc2.ungetService(ref);
+
+        // Check visibility 
+        assertNotNull("Check foo service visible inside the composite", sc2.getServiceReference(FooService.class.getName()));
+        assertNotNull("Check check service visible inside the composite", sc2.getServiceReference(CheckService.class.getName()));
+        // Check invisibilty
+        assertNull("Check foo service invisible inside the context", getContext().getServiceReference(FooService.class.getName()));
+        try {
+            assertNull("Check check service invisible inside the context", getContext().getServiceReferences(CheckService.class.getName(), "(instance.name=client)"));
+        } catch (InvalidSyntaxException e) {
+            fail("Invalid filter : " + e);
+        }
+
+        provider.dispose();
+        client.dispose();
+
+        assertNull("Check foo service invisible inside the composite", sc2.getServiceReference(FooService.class.getName()));
+        assertNull("Check check service invisible inside the composite", sc2.getServiceReference(CheckService.class.getName()));
+        assertNull("Check foo service invisible from the context", getContext().getServiceReference(FooService.class.getName()));
+        try {
+            assertNull("Check check service invisible inside the context", getContext().getServiceReferences(CheckService.class.getName(), "(instance.name=client)"));
+        } catch (InvalidSyntaxException e) {
+            fail("Invalid filter : " + e);
+        }
+    }
+
+    @Test
+    public void testLevelOne2() {
+        ServiceContext sc2 = getServiceContext(empty);
+
+        Factory fact1 = ipojoHelper.getFactory(sc2, "COMPO-SimpleCheckServiceProvider");
+        Properties props = new Properties();
+        props.put("instance.name", "client");
+        ComponentInstance client = null;
+        try {
+            client = fact1.createComponentInstance(props, sc2);
+        } catch (Exception e) {
+            fail("Cannot instantiate the client : " + e.getMessage());
+        }
+
+        Factory fact2 = ipojoHelper.getFactory(sc2, "COMPO-FooProviderType-1");
+        Properties props2 = new Properties();
+        props2.put("instance.name", "provider");
+        ComponentInstance provider = null;
+        try {
+            provider = fact2.createComponentInstance(props2, sc2);
+        } catch (Exception e) {
+            fail("Cannot instantiate the provider : " + e.getMessage());
+        }
+
+        ServiceReference ref = sc2.getServiceReference(CheckService.class.getName());
+        CheckService check = (CheckService) sc2.getService(ref);
+
+        assertTrue("Check invocation", check.check());
+
+        sc2.ungetService(ref);
+
+        // Check visibility 
+        assertNotNull("Check foo service visible inside the composite", sc2.getServiceReference(FooService.class.getName()));
+        assertNotNull("Check check service visible inside the composite", sc2.getServiceReference(CheckService.class.getName()));
+        // Check invisibilty
+        assertNull("Check foo service invisible inside the context", getContext().getServiceReference(FooService.class.getName()));
+        try {
+            assertNull("Check check service invisible inside the context", getContext().getServiceReferences(CheckService.class.getName(), "(instance.name=client)"));
+        } catch (InvalidSyntaxException e) {
+            fail("Invalid filter : " + e);
+        }
+
+        client.dispose();
+        provider.dispose();
+
+        assertNull("Check foo service visible inside the composite 2", sc2.getServiceReference(FooService.class.getName()));
+        assertNull("Check check service visible inside the composite 2", sc2.getServiceReference(CheckService.class.getName()));
+        assertNull("Check foo service invisible inside the global", getContext().getServiceReference(FooService.class.getName()));
+        try {
+            assertNull("Check check service invisible inside the context", getContext().getServiceReferences(CheckService.class.getName(), "(instance.name=client)"));
+        } catch (InvalidSyntaxException e) {
+            fail("Invalid filter : " + e);
+        }
+    }
+
+    @Test
+    public void testLevelOne3() {
+        ServiceContext sc2 = getServiceContext(empty);
+
+        Factory fact1 = ipojoHelper.getFactory("COMPO-SimpleCheckServiceProvider");
+        Properties props = new Properties();
+        props.put("instance.name", "client");
+        ComponentInstance client = null;
+        try {
+            client = fact1.createComponentInstance(props, sc2);
+        } catch (Exception e) {
+            fail("Cannot instantiate the client : " + e.getMessage());
+        }
+
+        Factory fact2 = ipojoHelper.getFactory("COMPO-FooProviderType-1");
+        Properties props2 = new Properties();
+        props2.put("instance.name", "provider");
+        ComponentInstance provider = null;
+        try {
+            provider = fact2.createComponentInstance(props2, sc2);
+        } catch (Exception e) {
+            fail("Cannot instantiate the provider : " + e.getMessage());
+        }
+
+        ServiceReference ref = sc2.getServiceReference(CheckService.class.getName());
+        CheckService check = (CheckService) sc2.getService(ref);
+
+        assertTrue("Check invocation", check.check());
+
+        sc2.ungetService(ref);
+
+        // Check visibility 
+        assertNotNull("Check foo service visible inside the composite", sc2.getServiceReference(FooService.class.getName()));
+        assertNotNull("Check check service visible inside the composite", sc2.getServiceReference(CheckService.class.getName()));
+        // Check invisibilty
+        assertNull("Check foo service invisible inside the context", getContext().getServiceReference(FooService.class.getName()));
+        try {
+            assertNull("Check check service invisible inside the context", getContext().getServiceReferences(CheckService.class.getName(), "(instance.name=client)"));
+        } catch (InvalidSyntaxException e) {
+            fail("Invalid filter : " + e);
+        }
+
+        client.dispose();
+        provider.dispose();
+
+        assertNull("Check foo service visible inside the composite 2", sc2.getServiceReference(FooService.class.getName()));
+        assertNull("Check check service visible inside the composite 2", sc2.getServiceReference(CheckService.class.getName()));
+        assertNull("Check foo service invisible inside the global", getContext().getServiceReference(FooService.class.getName()));
+        try {
+            assertNull("Check check service invisible inside the context", getContext().getServiceReferences(CheckService.class.getName(), "(instance.name=client)"));
+        } catch (InvalidSyntaxException e) {
+            fail("Invalid filter : " + e);
+        }
+    }
+
+    @Test
+    public void testLevelTwo1() {
+        ServiceContext sc1 = getServiceContext(empty);
+        Factory fact = ipojoHelper.getFactory(sc1, "composite.empty");
+        Properties p = new Properties();
+        p.put("instance.name", "empty2");
+        ComponentInstance empty2 = null;
+        try {
+            empty2 = fact.createComponentInstance(p);
+        } catch (Exception e) {
+            fail("Cannot instantiate empty2 instance : " + e.getMessage());
+        }
+
+        ServiceContext sc2 = getServiceContext(empty2);
+
+        Factory fact1 = ipojoHelper.getFactory(sc2, "COMPO-SimpleCheckServiceProvider");
+        Properties props = new Properties();
+        props.put("instance.name", "client");
+        ComponentInstance client = null;
+        try {
+            client = fact1.createComponentInstance(props);
+        } catch (Exception e) {
+            fail("Cannot instantiate the client : " + e.getMessage());
+        }
+
+        Factory fact2 = ipojoHelper.getFactory(sc2, "COMPO-FooProviderType-1");
+        Properties props2 = new Properties();
+        props2.put("instance.name", "provider");
+        ComponentInstance provider = null;
+        try {
+            provider = fact2.createComponentInstance(props2);
+        } catch (Exception e) {
+            fail("Cannot instantiate the provider : " + e.getMessage());
+        }
+
+        ServiceReference ref = sc2.getServiceReference(CheckService.class.getName());
+        CheckService check = (CheckService) sc2.getService(ref);
+
+        assertTrue("Check invocation", check.check());
+
+        sc2.ungetService(ref);
+
+        //	Check visibility 
+        assertNotNull("Check foo service visible inside the composite 2", sc2.getServiceReference(FooService.class.getName()));
+        assertNotNull("Check check service visible inside the composite 2", sc2.getServiceReference(CheckService.class.getName()));
+        // Check invisibilty
+        assertNull("Check foo service invisible inside the composite 1", sc1.getServiceReference(FooService.class.getName()));
+        assertNull("Check check service invisible inside the composite 1", sc1.getServiceReference(CheckService.class.getName()));
+        assertNull("Check foo service invisible inside the global", getContext().getServiceReference(FooService.class.getName()));
+        try {
+            assertNull("Check check service invisible inside the context", getContext().getServiceReferences(CheckService.class.getName(), "(instance.name=client)"));
+        } catch (InvalidSyntaxException e) {
+            fail("Invalid filter : " + e);
+        }
+
+        client.dispose();
+        provider.dispose();
+
+        assertNull("Check foo service visible inside the composite 2", sc2.getServiceReference(FooService.class.getName()));
+        assertNull("Check check service visible inside the composite 2", sc2.getServiceReference(CheckService.class.getName()));
+        assertNull("Check foo service invisible inside the composite 1", sc1.getServiceReference(FooService.class.getName()));
+        assertNull("Check check service invisible inside the composite 1", sc1.getServiceReference(CheckService.class.getName()));
+        assertNull("Check foo service invisible inside the global", getContext().getServiceReference(FooService.class.getName()));
+        try {
+            assertNull("Check check service invisible inside the context", getContext().getServiceReferences(CheckService.class.getName(), "(instance.name=client)"));
+        } catch (InvalidSyntaxException e) {
+            fail("Invalid filter : " + e);
+        }
+        empty2.dispose();
+    }
+
+    @Test
+    public void testLevelTwo2() {
+        ServiceContext sc1 = getServiceContext(empty);
+        Factory fact = ipojoHelper.getFactory(sc1, "composite.empty");
+        Properties p = new Properties();
+        p.put("instance.name", "empty2");
+        ComponentInstance empty2 = null;
+        try {
+            empty2 = fact.createComponentInstance(p);
+        } catch (Exception e) {
+            fail("Cannot instantiate empty2 instance : " + e.getMessage());
+        }
+
+        ServiceContext sc2 = getServiceContext(empty2);
+
+        Factory fact1 = ipojoHelper.getFactory(sc1, "COMPO-SimpleCheckServiceProvider");
+        Properties props = new Properties();
+        props.put("instance.name", "client");
+        ComponentInstance client = null;
+        try {
+            client = fact1.createComponentInstance(props, sc2);
+        } catch (Exception e) {
+            fail("Cannot instantiate the client : " + e.getMessage());
+        }
+
+        Factory fact2 = ipojoHelper.getFactory(sc1, "COMPO-FooProviderType-1");
+        Properties props2 = new Properties();
+        props2.put("instance.name", "provider");
+        ComponentInstance provider = null;
+        try {
+            provider = fact2.createComponentInstance(props2, sc2);
+        } catch (Exception e) {
+            fail("Cannot instantiate the provider : " + e.getMessage());
+        }
+
+        ServiceReference ref = sc2.getServiceReference(CheckService.class.getName());
+        CheckService check = (CheckService) sc2.getService(ref);
+
+        assertTrue("Check invocation", check.check());
+
+        sc2.ungetService(ref);
+
+        //	Check visibility 
+        assertNotNull("Check foo service visible inside the composite 2", sc2.getServiceReference(FooService.class.getName()));
+        assertNotNull("Check check service visible inside the composite 2", sc2.getServiceReference(CheckService.class.getName()));
+        // Check invisibilty
+        assertNull("Check foo service invisible inside the composite 1", sc1.getServiceReference(FooService.class.getName()));
+        assertNull("Check check service invisible inside the composite 1", sc1.getServiceReference(CheckService.class.getName()));
+        assertNull("Check foo service invisible inside the global", getContext().getServiceReference(FooService.class.getName()));
+        try {
+            assertNull("Check check service invisible inside the context", getContext().getServiceReferences(CheckService.class.getName(), "(instance.name=client)"));
+        } catch (InvalidSyntaxException e) {
+            fail("Invalid filter : " + e);
+        }
+
+        client.dispose();
+        provider.dispose();
+
+        assertNull("Check foo service visible inside the composite 2", sc2.getServiceReference(FooService.class.getName()));
+        assertNull("Check check service visible inside the composite 2", sc2.getServiceReference(CheckService.class.getName()));
+        assertNull("Check foo service invisible inside the composite 1", sc1.getServiceReference(FooService.class.getName()));
+        assertNull("Check check service invisible inside the composite 1", sc1.getServiceReference(CheckService.class.getName()));
+        assertNull("Check foo service invisible inside the global", getContext().getServiceReference(FooService.class.getName()));
+        try {
+            assertNull("Check check service invisible inside the context", getContext().getServiceReferences(CheckService.class.getName(), "(instance.name=client)"));
+        } catch (InvalidSyntaxException e) {
+            fail("Invalid filter : " + e);
+        }
+        empty2.dispose();
+    }
+
+    @Test
+    public void testLevelTwo3() {
+        ServiceContext sc1 = getServiceContext(empty);
+        Factory fact = ipojoHelper.getFactory(sc1, "composite.empty");
+        Properties p = new Properties();
+        p.put("instance.name", "empty2");
+        ComponentInstance empty2 = null;
+        try {
+            empty2 = fact.createComponentInstance(p);
+        } catch (Exception e) {
+            fail("Cannot instantiate empty2 instance : " + e.getMessage());
+        }
+
+        ServiceContext sc2 = getServiceContext(empty2);
+
+        Factory fact1 = ipojoHelper.getFactory("COMPO-SimpleCheckServiceProvider");
+        Properties props = new Properties();
+        props.put("instance.name", "client");
+        ComponentInstance client = null;
+        try {
+            client = fact1.createComponentInstance(props, sc2);
+        } catch (Exception e) {
+            fail("Cannot instantiate the client : " + e.getMessage());
+        }
+
+        Factory fact2 = ipojoHelper.getFactory("COMPO-FooProviderType-1");
+        Properties props2 = new Properties();
+        props2.put("instance.name", "provider");
+        ComponentInstance provider = null;
+        try {
+            provider = fact2.createComponentInstance(props2, sc2);
+        } catch (Exception e) {
+            fail("Cannot instantiate the provider : " + e.getMessage());
+        }
+
+        ServiceReference ref = sc2.getServiceReference(CheckService.class.getName());
+        CheckService check = (CheckService) sc2.getService(ref);
+
+        assertTrue("Check invocation", check.check());
+
+        sc2.ungetService(ref);
+
+        //	Check visibility 
+        assertNotNull("Check foo service visible inside the composite 2", sc2.getServiceReference(FooService.class.getName()));
+        assertNotNull("Check check service visible inside the composite 2", sc2.getServiceReference(CheckService.class.getName()));
+        // Check invisibilty
+        assertNull("Check foo service invisible inside the composite 1", sc1.getServiceReference(FooService.class.getName()));
+        assertNull("Check check service invisible inside the composite 1", sc1.getServiceReference(CheckService.class.getName()));
+        assertNull("Check foo service invisible inside the global", getContext().getServiceReference(FooService.class.getName()));
+        try {
+            assertNull("Check check service invisible inside the context", getContext().getServiceReferences(CheckService.class.getName(), "(instance.name=client)"));
+        } catch (InvalidSyntaxException e) {
+            fail("Invalid filter : " + e);
+        }
+
+        client.dispose();
+        provider.dispose();
+
+        assertNull("Check foo service visible inside the composite 2", sc2.getServiceReference(FooService.class.getName()));
+        assertNull("Check check service visible inside the composite 2", sc2.getServiceReference(CheckService.class.getName()));
+        assertNull("Check foo service invisible inside the composite 1", sc1.getServiceReference(FooService.class.getName()));
+        assertNull("Check check service invisible inside the composite 1", sc1.getServiceReference(CheckService.class.getName()));
+        assertNull("Check foo service invisible inside the global", getContext().getServiceReference(FooService.class.getName()));
+        try {
+            assertNull("Check check service invisible inside the context", getContext().getServiceReferences(CheckService.class.getName(), "(instance.name=client)"));
+        } catch (InvalidSyntaxException e) {
+            fail("Invalid filter : " + e);
+        }
+        empty2.dispose();
+    }
+
+    @Test
+    public void testLevelTwo4() {
+        ServiceContext sc1 = getServiceContext(empty);
+        Factory fact = ipojoHelper.getFactory(sc1, "composite.empty");
+        Properties p = new Properties();
+        p.put("instance.name", "empty2");
+        ComponentInstance empty2 = null;
+        try {
+            empty2 = fact.createComponentInstance(p);
+        } catch (Exception e) {
+            fail("Cannot instantiate empty2 instance : " + e.getMessage());
+        }
+
+        ServiceContext sc2 = getServiceContext(empty2);
+
+        Factory fact1 = ipojoHelper.getFactory(sc2, "COMPO-SimpleCheckServiceProvider");
+        Properties props = new Properties();
+        props.put("instance.name", "client");
+        ComponentInstance client = null;
+        try {
+            client = fact1.createComponentInstance(props, sc2);
+        } catch (Exception e) {
+            fail("Cannot instantiate the client : " + e.getMessage());
+        }
+
+        Factory fact2 = ipojoHelper.getFactory(sc2, "COMPO-FooProviderType-1");
+        Properties props2 = new Properties();
+        props2.put("instance.name", "provider");
+        ComponentInstance provider = null;
+        try {
+            provider = fact2.createComponentInstance(props2, sc2);
+        } catch (Exception e) {
+            fail("Cannot instantiate the provider : " + e.getMessage());
+        }
+
+        ServiceReference ref = sc2.getServiceReference(CheckService.class.getName());
+        CheckService check = (CheckService) sc2.getService(ref);
+
+        assertTrue("Check invocation", check.check());
+
+        sc2.ungetService(ref);
+
+        //	Check visibility 
+        assertNotNull("Check foo service visible inside the composite 2", sc2.getServiceReference(FooService.class.getName()));
+        assertNotNull("Check check service visible inside the composite 2", sc2.getServiceReference(CheckService.class.getName()));
+        // Check invisibilty
+        assertNull("Check foo service invisible inside the composite 1", sc1.getServiceReference(FooService.class.getName()));
+        assertNull("Check check service invisible inside the composite 1", sc1.getServiceReference(CheckService.class.getName()));
+        assertNull("Check foo service invisible inside the global", getContext().getServiceReference(FooService.class.getName()));
+        try {
+            assertNull("Check check service invisible inside the context", getContext().getServiceReferences(CheckService.class.getName(), "(instance.name=client)"));
+        } catch (InvalidSyntaxException e) {
+            fail("Invalid filter : " + e);
+        }
+
+        client.dispose();
+        provider.dispose();
+
+        assertNull("Check foo service visible inside the composite 2", sc2.getServiceReference(FooService.class.getName()));
+        assertNull("Check check service visible inside the composite 2", sc2.getServiceReference(CheckService.class.getName()));
+        assertNull("Check foo service invisible inside the composite 1", sc1.getServiceReference(FooService.class.getName()));
+        assertNull("Check check service invisible inside the composite 1", sc1.getServiceReference(CheckService.class.getName()));
+        assertNull("Check foo service invisible inside the global", getContext().getServiceReference(FooService.class.getName()));
+        try {
+            assertNull("Check check service invisible inside the context", getContext().getServiceReferences(CheckService.class.getName(), "(instance.name=client)"));
+        } catch (InvalidSyntaxException e) {
+            fail("Invalid filter : " + e);
+        }
+        empty2.dispose();
+    }
+
+
+}

Added: felix/trunk/ipojo/runtime/composite-it/src/it/ipojo-composite-runtime-test/src/test/java/org/apache/felix/ipojo/runtime/core/ServiceRegistryTest.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/runtime/composite-it/src/it/ipojo-composite-runtime-test/src/test/java/org/apache/felix/ipojo/runtime/core/ServiceRegistryTest.java?rev=1450158&view=auto
==============================================================================
--- felix/trunk/ipojo/runtime/composite-it/src/it/ipojo-composite-runtime-test/src/test/java/org/apache/felix/ipojo/runtime/core/ServiceRegistryTest.java (added)
+++ felix/trunk/ipojo/runtime/composite-it/src/it/ipojo-composite-runtime-test/src/test/java/org/apache/felix/ipojo/runtime/core/ServiceRegistryTest.java Tue Feb 26 13:02:34 2013
@@ -0,0 +1,282 @@
+/* 
+ * 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.felix.ipojo.runtime.core;
+
+import org.apache.felix.ipojo.ComponentFactory;
+import org.apache.felix.ipojo.ComponentInstance;
+import org.apache.felix.ipojo.InstanceStateListener;
+import org.apache.felix.ipojo.architecture.ComponentTypeDescription;
+import org.apache.felix.ipojo.architecture.InstanceDescription;
+import org.apache.felix.ipojo.context.ServiceRegistry;
+import org.apache.felix.ipojo.runtime.core.services.BarService;
+import org.junit.Test;
+import org.osgi.framework.*;
+
+import java.util.Dictionary;
+import java.util.Hashtable;
+import java.util.Properties;
+
+import static org.junit.Assert.*;
+
+public class ServiceRegistryTest extends Common {
+
+    private class svcListener implements ServiceListener {
+        public int registration = 0;
+        public int unregistration = 0;
+        public int modification = 0;
+
+        public void serviceChanged(ServiceEvent ev) {
+            if (ev.getType() == ServiceEvent.REGISTERED) {
+                registration++;
+            }
+            if (ev.getType() == ServiceEvent.UNREGISTERING) {
+                unregistration++;
+            }
+            if (ev.getType() == ServiceEvent.MODIFIED) {
+                modification++;
+            }
+        }
+    }
+
+    private class barProvider implements BarService {
+
+        public boolean bar() {
+            return true;
+        }
+
+        public Properties getProps() {
+            return null;
+        }
+
+    }
+
+    private class FakeComponent implements ComponentInstance {
+
+        public ComponentTypeDescription getComponentDescription() {
+            return null;
+        }
+
+        public BundleContext getContext() {
+            return null;
+        }
+
+        public ComponentFactory getFactory() {
+            return null;
+        }
+
+        public InstanceDescription getInstanceDescription() {
+            return null;
+        }
+
+        public String getInstanceName() {
+            return null;
+        }
+
+        public int getState() {
+            return 0;
+        }
+
+        public boolean isStarted() {
+            return false;
+        }
+
+        public void reconfigure(Dictionary dictionary) {
+        }
+
+        public void start() {
+        }
+
+        public void stop() {
+        }
+
+        public void dispose() {
+        }
+
+        public void addInstanceStateListener(InstanceStateListener arg0) {
+        }
+
+        public void removeInstanceStateListener(InstanceStateListener arg0) {
+        }
+
+    }
+
+    @Test
+    public void testRegistrationAndListener() {
+        ComponentInstance im = new FakeComponent();
+        ComponentInstance im2 = new FakeComponent();
+        ServiceRegistry registry = new ServiceRegistry(getContext());
+        assertNotNull("Assert registry not null", registry);
+        svcListener all = new svcListener();
+        try {
+            assertNull("Check that there is no available service", registry.getServiceReferences(null, null));
+        } catch (InvalidSyntaxException e) {
+            fail("Cannot query the registry : " + e.getMessage());
+        }
+        registry.addServiceListener(all);
+
+        ServiceRegistration reg1 = registry.registerService(im, BarService.class.getName(), new barProvider(), null);
+
+        try {
+            assertEquals("Check number of registred service", 1, registry.getServiceReferences(null, null).length);
+        } catch (InvalidSyntaxException e) {
+            fail("Cannot query the registry : " + e.getMessage());
+        }
+
+        ServiceRegistration reg2 = registry.registerService(im2, BarService.class.getName(), new barProvider(), null);
+
+        try {
+            assertEquals("Check number of registred service", 2, registry.getServiceReferences(null, null).length);
+        } catch (InvalidSyntaxException e) {
+            fail("Cannot query the registry : " + e.getMessage());
+        }
+
+        assertEquals("Check the number of registration", 2, all.registration);
+
+        Dictionary<String, String> props = new Hashtable<String, String>();
+        props.put("foo", "bar");
+        reg1.setProperties(props);
+        assertEquals("Check the number of modification", 1, all.modification);
+
+        reg1.unregister();
+        assertEquals("Check the number of unregistration", 1, all.unregistration);
+
+        reg2.setProperties(props);
+        assertEquals("Check the number of modification", 2, all.modification);
+
+        reg2.unregister();
+        assertEquals("Check the number of unregistration", 2, all.unregistration);
+
+        registry.removeServiceListener(all);
+    }
+
+    @Test
+    public void testRegistrationAndFilter() {
+        ComponentInstance im = new FakeComponent();
+        ComponentInstance im2 = new FakeComponent();
+        ServiceRegistry registry = new ServiceRegistry(getContext());
+        svcListener filtered = new svcListener();
+
+        try {
+            assertNull("Check that there is no available service", registry.getServiceReferences(null, null));
+        } catch (InvalidSyntaxException e) {
+            fail("Cannot query the registry : " + e.getMessage());
+        }
+
+        registry.addServiceListener(filtered, "(foo=bar)");
+
+        Dictionary<String, String> props = new Hashtable<String, String>();
+        props.put("foo", "bar");
+        ServiceRegistration reg1 = registry.registerService(im, BarService.class.getName(), new barProvider(), props);
+
+        try {
+            assertEquals("Check number of registred service", 1, registry.getServiceReferences(null, null).length);
+        } catch (InvalidSyntaxException e) {
+            fail("Cannot query the registry : " + e.getMessage());
+        }
+
+        ServiceRegistration reg2 = registry.registerService(im2, BarService.class.getName(), new barProvider(), null);
+
+        try {
+            assertEquals("Check number of registred service", 2, registry.getServiceReferences(null, null).length);
+        } catch (InvalidSyntaxException e) {
+            fail("Cannot query the registry : " + e.getMessage());
+        }
+
+        assertEquals("Check the number of registration", 1, filtered.registration);
+
+        reg2.setProperties(props);
+        assertEquals("Check the number of modification", 1, filtered.modification);
+        // Follow the OSGi semantics of filters
+
+        reg1.unregister();
+        reg2.unregister();
+        assertEquals("Check the number of unregistration", 2, filtered.unregistration);
+        registry.removeServiceListener(filtered);
+    }
+
+    @Test
+    public void testGetService() {
+        ComponentInstance im = new FakeComponent();
+        ComponentInstance im2 = new FakeComponent();
+        ServiceRegistry registry = new ServiceRegistry(getContext());
+
+        try {
+            assertNull("Check that there is no available service", registry.getServiceReferences(null, null));
+        } catch (InvalidSyntaxException e) {
+            fail("Cannot query the registry : " + e.getMessage());
+        }
+
+        Properties props = new Properties();
+        props.put("foo", "bar");
+        ServiceRegistration reg1 = registry.registerService(im, BarService.class.getName(), new barProvider(), props);
+
+        ServiceReference ref = registry.getServiceReference(BarService.class.getName());
+        assertNotNull("Check ref not null", ref);
+        assertEquals("Test property", ref.getProperty("foo"), "bar");
+        BarService bar = (BarService) registry.getService(im2, ref);
+        assertTrue("Test invocation", bar.bar());
+
+        reg1.unregister();
+        ref = registry.getServiceReference(BarService.class.getName());
+        assertNull("Check ref null", ref);
+    }
+
+    @Test
+    public void testGetFilteredService() {
+        ComponentInstance im = new FakeComponent();
+        ComponentInstance im2 = new FakeComponent();
+        ServiceRegistry registry = new ServiceRegistry(getContext());
+
+        try {
+            assertNull("Check that there is no available service", registry.getServiceReferences(null, null));
+        } catch (InvalidSyntaxException e) {
+            fail("Cannot query the registry : " + e.getMessage());
+        }
+
+        Properties props = new Properties();
+        props.put("foo", "bar");
+        ServiceRegistration reg1 = registry.registerService(im, BarService.class.getName(), new barProvider(), props);
+        ServiceRegistration reg2 = registry.registerService(im2, BarService.class.getName(), new barProvider(), null);
+
+        ServiceReference[] ref = null;
+        try {
+            ref = registry.getServiceReferences(BarService.class.getName(), "(foo=bar)");
+        } catch (InvalidSyntaxException e) {
+            fail("Registry query fail : " + e.getMessage());
+        }
+        assertNotNull("Check ref not null", ref);
+        assertEquals("Check ref count", ref.length, 1);
+        assertEquals("Test property", ref[0].getProperty("foo"), "bar");
+        BarService bar = (BarService) registry.getService(im2, ref[0]);
+        assertTrue("Test invocation", bar.bar());
+
+        ref = null;
+        reg1.unregister();
+        try {
+            ref = registry.getServiceReferences(BarService.class.getName(), "(bar=foo)");
+        } catch (InvalidSyntaxException e) {
+            fail("Registry query fail : " + e.getMessage());
+        }
+        assertNull("Check ref null", ref);
+
+        reg2.unregister();
+    }
+
+
+}

Propchange: felix/trunk/ipojo/runtime/composite-it/src/it/ipojo-composite-service-providing-test/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Tue Feb 26 13:02:34 2013
@@ -0,0 +1,3 @@
+target
+*.iml
+.idea

Added: felix/trunk/ipojo/runtime/composite-it/src/it/ipojo-composite-service-providing-test/pom.xml
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/runtime/composite-it/src/it/ipojo-composite-service-providing-test/pom.xml?rev=1450158&view=auto
==============================================================================
--- felix/trunk/ipojo/runtime/composite-it/src/it/ipojo-composite-service-providing-test/pom.xml (added)
+++ felix/trunk/ipojo/runtime/composite-it/src/it/ipojo-composite-service-providing-test/pom.xml Tue Feb 26 13:02:34 2013
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+
+    <parent>
+        <groupId>org.apache.felix</groupId>
+        <artifactId>org.apache.felix.ipojo.runtime.composite-it</artifactId>
+        <version>1.9.0-SNAPSHOT</version>
+        <relativePath>../../../pom.xml</relativePath>
+    </parent>
+
+    <modelVersion>4.0.0</modelVersion>
+
+    <groupId>org.apache.felix</groupId>
+    <artifactId>ipojo-composite-service-providing-test</artifactId>
+
+    <name>${project.artifactId}</name>
+    
+</project>
\ No newline at end of file

Added: felix/trunk/ipojo/runtime/composite-it/src/it/ipojo-composite-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/components/Baz2CheckProvider.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/runtime/composite-it/src/it/ipojo-composite-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/components/Baz2CheckProvider.java?rev=1450158&view=auto
==============================================================================
--- felix/trunk/ipojo/runtime/composite-it/src/it/ipojo-composite-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/components/Baz2CheckProvider.java (added)
+++ felix/trunk/ipojo/runtime/composite-it/src/it/ipojo-composite-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/components/Baz2CheckProvider.java Tue Feb 26 13:02:34 2013
@@ -0,0 +1,81 @@
+/* 
+ * 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.felix.ipojo.runtime.core.components;
+
+import org.apache.felix.ipojo.runtime.core.services.BazService;
+import org.apache.felix.ipojo.runtime.core.services.CheckService;
+import org.apache.felix.ipojo.runtime.core.services.FooService;
+import org.osgi.framework.ServiceReference;
+
+import java.util.Properties;
+
+public class Baz2CheckProvider implements CheckService {
+	
+	BazService fs;
+	
+	int simpleB = 0;
+	int objectB = 0;
+	int refB = 0;
+	int simpleU = 0;
+	int objectU = 0;
+	int refU = 0;
+
+	public boolean check() {
+		return fs.foo();
+	}
+
+	public Properties getProps() {
+		Properties props = new Properties();
+		props.put("result", new Boolean(fs.foo()));
+		props.put("voidB", new Integer(simpleB));
+		props.put("objectB", new Integer(objectB));
+		props.put("refB", new Integer(refB));
+		props.put("voidU", new Integer(simpleU));
+		props.put("objectU", new Integer(objectU));
+		props.put("refU", new Integer(refU));
+		props.put("boolean", new Boolean(fs.getBoolean()));
+		props.put("int", new Integer(fs.getInt()));
+		props.put("long", new Long(fs.getLong()));
+		props.put("double", new Double(fs.getDouble()));
+		if(fs.getObject() != null) { props.put("object", fs.getObject()); }
+		
+		return props;
+	}
+	
+	private void voidBind() {
+		simpleB++;
+	}
+	private void voidUnbind() {
+		simpleU++;
+	}
+	
+	protected void objectBind(Object o) {
+		if(o != null && o instanceof FooService) { objectB++; }
+	}
+	protected void objectUnbind(Object o) {
+		if(o != null && o instanceof FooService) { objectU++; }
+	}
+	
+	public void refBind(ServiceReference sr) {
+		if(sr != null) { refB++; }
+	}
+	public void refUnbind(ServiceReference sr) {
+		if(sr != null) { refU++; }
+	}
+}

Added: felix/trunk/ipojo/runtime/composite-it/src/it/ipojo-composite-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/components/BazProviderType1.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/runtime/composite-it/src/it/ipojo-composite-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/components/BazProviderType1.java?rev=1450158&view=auto
==============================================================================
--- felix/trunk/ipojo/runtime/composite-it/src/it/ipojo-composite-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/components/BazProviderType1.java (added)
+++ felix/trunk/ipojo/runtime/composite-it/src/it/ipojo-composite-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/components/BazProviderType1.java Tue Feb 26 13:02:34 2013
@@ -0,0 +1,51 @@
+/* 
+ * 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.felix.ipojo.runtime.core.components;
+
+import org.apache.felix.ipojo.runtime.core.services.BazService;
+
+import java.util.Properties;
+
+public class BazProviderType1 implements BazService {
+	
+	private int m_bar;
+	private String m_foo;
+
+	public boolean foo() {
+		return true;
+	}
+
+	public Properties fooProps() {
+		Properties p = new Properties();
+		p.put("bar", new Integer(m_bar));
+		p.put("foo", m_foo);
+		return p;
+	}
+	
+	public boolean getBoolean() { return true; }
+
+	public double getDouble() { return 1.0; }
+
+	public int getInt() { return 1; }
+
+	public long getLong() { return 1; }
+
+	public Boolean getObject() { return new Boolean(true); }
+
+}

Added: felix/trunk/ipojo/runtime/composite-it/src/it/ipojo-composite-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/components/CheckProviderParentClass.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/runtime/composite-it/src/it/ipojo-composite-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/components/CheckProviderParentClass.java?rev=1450158&view=auto
==============================================================================
--- felix/trunk/ipojo/runtime/composite-it/src/it/ipojo-composite-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/components/CheckProviderParentClass.java (added)
+++ felix/trunk/ipojo/runtime/composite-it/src/it/ipojo-composite-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/components/CheckProviderParentClass.java Tue Feb 26 13:02:34 2013
@@ -0,0 +1,51 @@
+/* 
+ * 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.felix.ipojo.runtime.core.components;
+
+import org.apache.felix.ipojo.runtime.core.services.FooService;
+import org.osgi.framework.ServiceReference;
+
+public abstract class CheckProviderParentClass {
+    
+    int simpleU = 0;
+    int objectU = 0;
+    int refU = 0;
+    int bothU = 0;
+    
+    
+    public void bothUnbind(FooService o, ServiceReference sr) {
+        if(sr != null && o != null && o instanceof FooService) { bothU++; }
+    }
+    
+    public void refUnbind(ServiceReference sr) {
+        if(sr != null) { refU++; }
+    }
+    
+    public void objectUnbind(FooService o) {
+        if(o != null && o instanceof FooService) { objectU++; }
+        else {
+            System.err.println("Unbind null : " + o);
+        }
+    }
+    
+    public void voidUnbind() {
+        simpleU++;
+    }
+
+}

Added: felix/trunk/ipojo/runtime/composite-it/src/it/ipojo-composite-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/components/CheckServiceProvider.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/runtime/composite-it/src/it/ipojo-composite-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/components/CheckServiceProvider.java?rev=1450158&view=auto
==============================================================================
--- felix/trunk/ipojo/runtime/composite-it/src/it/ipojo-composite-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/components/CheckServiceProvider.java (added)
+++ felix/trunk/ipojo/runtime/composite-it/src/it/ipojo-composite-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/components/CheckServiceProvider.java Tue Feb 26 13:02:34 2013
@@ -0,0 +1,83 @@
+/* 
+ * 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.felix.ipojo.runtime.core.components;
+
+import org.apache.felix.ipojo.runtime.core.services.CheckService;
+import org.apache.felix.ipojo.runtime.core.services.FooService;
+import org.osgi.framework.ServiceReference;
+
+import java.util.Properties;
+
+public class CheckServiceProvider extends CheckProviderParentClass implements CheckService {
+    
+	FooService fs;
+	
+	int simpleB = 0;
+	int objectB = 0;
+	int refB = 0;
+	int bothB = 0;
+
+	public boolean check() {
+		return fs.foo();
+	}
+
+	public Properties getProps() {
+		Properties props = new Properties();
+		props.put("voidB", new Integer(simpleB));
+		props.put("objectB", new Integer(objectB));
+		props.put("refB", new Integer(refB));
+		props.put("bothB", new Integer(bothB));
+		props.put("voidU", new Integer(simpleU));
+		props.put("objectU", new Integer(objectU));
+		props.put("refU", new Integer(refU));
+		props.put("bothU", new Integer(bothU));
+		if (fs != null) {
+		    props.put("result", new Boolean(fs.foo()));
+		    props.put("boolean", new Boolean(fs.getBoolean()));
+		    props.put("int", new Integer(fs.getInt()));
+		    props.put("long", new Long(fs.getLong()));
+		    props.put("double", new Double(fs.getDouble()));
+		    if(fs.getObject() != null) { props.put("object", fs.getObject()); }
+		}
+        props.put("static", CheckService.foo);
+        props.put("class", CheckService.class.getName());
+		return props;
+	}
+	
+	private void voidBind() {
+		simpleB++;
+	}
+	
+	protected void objectBind(FooService o) {
+	    if (o == null) {
+	        System.err.println("Bind receive null !!! ");
+	        return;
+	    }
+		if(o != null && o instanceof FooService) { objectB++; }
+	}
+	
+	public void refBind(ServiceReference sr) {
+		if(sr != null) { refB++; }
+	}
+	
+    public void bothBind(FooService o, ServiceReference sr) {
+	    if(sr != null && o != null && o instanceof FooService) { bothB++; }
+	}
+
+}

Added: felix/trunk/ipojo/runtime/composite-it/src/it/ipojo-composite-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/components/FooBarProviderType1.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/runtime/composite-it/src/it/ipojo-composite-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/components/FooBarProviderType1.java?rev=1450158&view=auto
==============================================================================
--- felix/trunk/ipojo/runtime/composite-it/src/it/ipojo-composite-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/components/FooBarProviderType1.java (added)
+++ felix/trunk/ipojo/runtime/composite-it/src/it/ipojo-composite-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/components/FooBarProviderType1.java Tue Feb 26 13:02:34 2013
@@ -0,0 +1,54 @@
+/* 
+ * 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.felix.ipojo.runtime.core.components;
+
+import org.apache.felix.ipojo.runtime.core.services.BarService;
+import org.apache.felix.ipojo.runtime.core.services.FooService;
+
+import java.util.Properties;
+
+public class FooBarProviderType1 implements FooService, BarService {
+
+	public boolean foo() {
+		return true;
+	}
+
+	public Properties fooProps() {
+		return new Properties();
+	}
+
+	public boolean bar() {
+		return true;
+	}
+
+	public Properties getProps() {
+		return new Properties();
+	}
+
+	public boolean getBoolean() { return true; }
+
+	public double getDouble() { return 1.0; }
+
+	public int getInt() { return 1; }
+
+	public long getLong() { return 1; }
+
+	public Boolean getObject() { return new Boolean(true); }
+
+}

Added: felix/trunk/ipojo/runtime/composite-it/src/it/ipojo-composite-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/components/FooProviderType1.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/runtime/composite-it/src/it/ipojo-composite-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/components/FooProviderType1.java?rev=1450158&view=auto
==============================================================================
--- felix/trunk/ipojo/runtime/composite-it/src/it/ipojo-composite-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/components/FooProviderType1.java (added)
+++ felix/trunk/ipojo/runtime/composite-it/src/it/ipojo-composite-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/components/FooProviderType1.java Tue Feb 26 13:02:34 2013
@@ -0,0 +1,92 @@
+/* 
+ * 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.felix.ipojo.runtime.core.components;
+
+import org.apache.felix.ipojo.runtime.core.services.FooService;
+import org.osgi.framework.BundleContext;
+
+import java.util.Properties;
+
+public class FooProviderType1 implements FooService {
+	
+	private int m_bar;
+	private String m_foo;
+    
+    private BundleContext m_context;
+    
+    private static FooProviderType1 singleton;
+    private static int count = 0;
+    
+    public FooProviderType1(BundleContext bc) {
+        if (bc ==null) {
+            throw new RuntimeException("Injected bundle context null");
+        }
+        m_context = bc;
+    }
+
+	public boolean foo() {
+		return true;
+	}
+
+	public Properties fooProps() {
+		Properties p = new Properties();
+		p.put("bar", new Integer(m_bar));
+        if(m_foo != null) {
+            p.put("foo", m_foo);
+        }
+        p.put("context", m_context);
+        
+        p.put("count", new Integer(count));
+		return p;
+	}
+    
+	public void testException() throws Exception {
+        String a = "foobarbaz";
+	    throw new Exception("foo"+a);
+    }
+    
+    public void testTry() {
+            String a = "foo";
+            a.charAt(0);
+    }
+    
+    public void testTry2(String s) {
+            String a = "foo";
+            a.charAt(0);
+    }
+    
+    private void nexttry(String  s) {
+        try {
+            s += "foo";
+        } catch(RuntimeException e) {
+            
+        }
+    }
+    
+	public boolean getBoolean() { return true; }
+
+	public double getDouble() { return 1.0; }
+
+	public int getInt() { return 1; }
+
+	public long getLong() { return 1; }
+
+	public Boolean getObject() { return new Boolean(true); }
+
+}

Added: felix/trunk/ipojo/runtime/composite-it/src/it/ipojo-composite-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/components/FooProviderTypeDyn.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/runtime/composite-it/src/it/ipojo-composite-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/components/FooProviderTypeDyn.java?rev=1450158&view=auto
==============================================================================
--- felix/trunk/ipojo/runtime/composite-it/src/it/ipojo-composite-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/components/FooProviderTypeDyn.java (added)
+++ felix/trunk/ipojo/runtime/composite-it/src/it/ipojo-composite-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/components/FooProviderTypeDyn.java Tue Feb 26 13:02:34 2013
@@ -0,0 +1,63 @@
+/* 
+ * 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.felix.ipojo.runtime.core.components;
+
+import org.apache.felix.ipojo.runtime.core.services.FooService;
+
+import java.util.Properties;
+
+public class FooProviderTypeDyn implements FooService {
+	
+	private int intProp;	
+	private String strProp;
+	private String[] strAProp;
+	private int[] intAProp;
+	private boolean boolProp;
+
+	public boolean foo() {
+		intProp = 3;
+		boolProp = true;
+		if(strProp.equals("foo")) { strProp = "bar"; }
+		else { strProp = "foo"; }
+		strAProp = new String[] {"foo", "bar", "baz"};
+		intAProp = new int[] {3, 2, 1};
+		return true;
+	}
+
+	public Properties fooProps() {
+		Properties p = new Properties();
+		p.put("intProp", new Integer(intProp));
+		p.put("boolProp", new Boolean(boolProp));
+		p.put("strProp", strProp);
+		p.put("strAProp", strAProp);
+		p.put("intAProp", intAProp);
+		return p;
+	}
+	
+	public boolean getBoolean() { return true; }
+
+	public double getDouble() { return 1.0; }
+
+	public int getInt() { return 1; }
+
+	public long getLong() { return 1; }
+
+	public Boolean getObject() { return new Boolean(true); }
+
+}

Added: felix/trunk/ipojo/runtime/composite-it/src/it/ipojo-composite-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/components/FooProviderTypeDyn2.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/runtime/composite-it/src/it/ipojo-composite-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/components/FooProviderTypeDyn2.java?rev=1450158&view=auto
==============================================================================
--- felix/trunk/ipojo/runtime/composite-it/src/it/ipojo-composite-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/components/FooProviderTypeDyn2.java (added)
+++ felix/trunk/ipojo/runtime/composite-it/src/it/ipojo-composite-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/components/FooProviderTypeDyn2.java Tue Feb 26 13:02:34 2013
@@ -0,0 +1,58 @@
+/* 
+ * 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.felix.ipojo.runtime.core.components;
+
+import org.apache.felix.ipojo.runtime.core.services.FooService;
+
+import java.util.Properties;
+
+public class FooProviderTypeDyn2 implements FooService {
+	
+	private int intProp = 2;
+	private boolean boolProp = true;
+	private String strProp = "foo";
+	private String[] strAProp = new String[] {"foo", "bar"};
+	private int[] intAProp = new int[] {1, 2, 3};
+
+	public boolean foo() {
+		intAProp = null;
+		return true;
+	}
+
+	public Properties fooProps() {
+		Properties p = new Properties();
+		p.put("intProp", new Integer(intProp));
+		p.put("boolProp", new Boolean(boolProp));
+		p.put("strProp", strProp);
+		p.put("strAProp", strAProp);
+		p.put("intAProp", intAProp);
+		return p;
+	}
+	
+	public boolean getBoolean() { return true; }
+
+	public double getDouble() { return 1.0; }
+
+	public int getInt() { return 1; }
+
+	public long getLong() { return 1; }
+
+	public Boolean getObject() { return new Boolean(true); }
+
+}

Added: felix/trunk/ipojo/runtime/composite-it/src/it/ipojo-composite-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/components/ServiceConsumer.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/runtime/composite-it/src/it/ipojo-composite-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/components/ServiceConsumer.java?rev=1450158&view=auto
==============================================================================
--- felix/trunk/ipojo/runtime/composite-it/src/it/ipojo-composite-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/components/ServiceConsumer.java (added)
+++ felix/trunk/ipojo/runtime/composite-it/src/it/ipojo-composite-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/components/ServiceConsumer.java Tue Feb 26 13:02:34 2013
@@ -0,0 +1,27 @@
+package org.apache.felix.ipojo.runtime.core.components;
+
+import org.apache.felix.ipojo.runtime.core.services.CheckService;
+import org.apache.felix.ipojo.runtime.core.services.Service;
+
+import java.util.Properties;
+
+public class ServiceConsumer implements CheckService {
+
+    private Service service;
+    private Properties props = new Properties();
+
+    public ServiceConsumer() {
+        props.put("1", new Integer(service.count()));
+        props.put("2", new Integer(service.count()));
+        props.put("3", new Integer(service.count()));
+    }
+
+    public boolean check() {
+        return service.count() > 0;
+    }
+
+    public Properties getProps() {
+        return props;
+    }
+
+}

Added: felix/trunk/ipojo/runtime/composite-it/src/it/ipojo-composite-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/components/ServiceProvider.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/runtime/composite-it/src/it/ipojo-composite-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/components/ServiceProvider.java?rev=1450158&view=auto
==============================================================================
--- felix/trunk/ipojo/runtime/composite-it/src/it/ipojo-composite-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/components/ServiceProvider.java (added)
+++ felix/trunk/ipojo/runtime/composite-it/src/it/ipojo-composite-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/components/ServiceProvider.java Tue Feb 26 13:02:34 2013
@@ -0,0 +1,15 @@
+package org.apache.felix.ipojo.runtime.core.components;
+
+import org.apache.felix.ipojo.runtime.core.services.Service;
+
+
+public class ServiceProvider implements Service {
+
+    private int i = 0;
+
+    public int count() {
+        i++;
+        return i;
+    }
+
+}

Added: felix/trunk/ipojo/runtime/composite-it/src/it/ipojo-composite-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/components/TataProvider.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/runtime/composite-it/src/it/ipojo-composite-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/components/TataProvider.java?rev=1450158&view=auto
==============================================================================
--- felix/trunk/ipojo/runtime/composite-it/src/it/ipojo-composite-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/components/TataProvider.java (added)
+++ felix/trunk/ipojo/runtime/composite-it/src/it/ipojo-composite-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/components/TataProvider.java Tue Feb 26 13:02:34 2013
@@ -0,0 +1,222 @@
+/* 
+ * 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.felix.ipojo.runtime.core.components;
+
+import org.apache.felix.ipojo.runtime.core.services.Tata;
+
+import java.util.Properties;
+
+
+public class TataProvider implements Tata {
+    
+    int tata = 0;
+    int tataStr = 0;
+    int tataStrs = 0;
+    int tata_2 = 0;
+    int tata_3 = 0;
+    int tata1 = 0;
+    int tata1_1 = 0;
+    int tata5 = 0;
+    int tata5_1 = 0;
+    int tata5_2 = 0;
+    int tataBoolean = 0;
+    int tataBooleans = 0;
+    int tataByte = 0;
+    int tataBytes = 0;
+    private int add;
+    private int tataShorts;
+    private int tataShort;
+    private int tataLongs;
+    private int tataLong;
+    private int tataInts;
+    private int tataInt;
+    private int tataFloat;
+    private int tataFloats;
+    private int tataDoubles;
+    private int tataDouble;
+    private int tataChars;
+    private int tataChar;
+    
+    public Properties getPropsTata() {
+        Properties props = new Properties();
+        props.put("tata", new Integer(tata));
+        props.put("tataStr", new Integer(tataStr));
+        props.put("tataStrs", new Integer(tataStrs));
+        props.put("tata_2", new Integer(tata_2));
+        props.put("tata_3", new Integer(tata_3));
+        props.put("tata1", new Integer(tata1));
+        props.put("tata1_1", new Integer(tata1_1));
+        props.put("tata5", new Integer(tata5));
+        props.put("tata5_1", new Integer(tata5_1));
+        props.put("tata5_2", new Integer(tata5_2));
+        props.put("add", new Integer(add));
+        props.put("tataBoolean", new Integer(tataBoolean));
+        props.put("tataBoolean", new Integer(tataBoolean));
+        props.put("tataByte", new Integer(tataByte));
+        props.put("tataBytes", new Integer(tataBytes));
+        props.put("tataShort", new Integer(tataShort));
+        props.put("tataShorts", new Integer(tataShorts));
+        props.put("tataLongs", new Integer(tataLongs));
+        props.put("tataLong", new Integer(tataLong));
+        props.put("tataInt", new Integer(tataInt));
+        props.put("tataInts", new Integer(tataInts));
+        props.put("tataFloat", new Integer(tataFloat));
+        props.put("tataFloats", new Integer(tataFloats));
+        props.put("tataDouble", new Integer(tataDouble));
+        props.put("tataDoubles", new Integer(tataDoubles));
+        props.put("tataChar", new Integer(tataChar));
+        props.put("tataChars", new Integer(tataChars));
+        return props;
+    }
+
+    public void tata() {
+        tata++;
+    }
+
+    public String tataStr() {
+        tataStr++;
+        return "Tata";
+    }
+
+    public String[] tataStrs() {
+        tataStrs++;
+        return new String[] {"T", "A", "T", "A"};
+    }
+
+    public void tata(int i, int j) {
+        tata_2++;        
+    }
+
+    public void tata(String s) {
+        tata_3++;
+    }
+
+    public String tata1(String a) {
+        tata1++;
+       return a;
+    }
+
+    public String tata1(char[] a) {
+        tata1_1++;
+        String s = new String(a);
+        return s;
+    }
+
+    public String tata5(String a, int i) {
+       tata5++;
+       return a+i;
+    }
+
+    public String tata5(String[] a, int i) {
+       tata5_1++;
+       return ""+a.length + i;
+    }
+
+    public String tata5(String a, int[] i) {
+        tata5_2++;
+        return a + i.length;
+    }
+
+    public boolean tataBoolean(boolean b) {
+        tataBoolean++;
+        return b;
+    }
+
+    public boolean[] tataBooleans(boolean[] b) {
+        tataBooleans++;
+       return b;
+    }
+
+    public byte tataByte(byte b) {
+        tataByte++;
+        return b;
+    }
+
+    public byte[] tataBytes(byte[] b) {
+        tataBytes++;
+        return b;
+    }
+
+    public char tataChar(char c) {
+       tataChar++;
+       return c;
+    }
+
+    public char[] tataChars(char[] c) {
+        tataChars++;
+        return c;
+    }
+
+    public double tataDouble(double d) {
+        tataDouble++;
+        return d;
+    }
+
+    public double[] tataDoubles(double[] d) {
+        tataDoubles++;
+        return d;
+    }
+
+    public float tataFloat(float f) {
+        tataFloat++;
+        return f;
+    }
+
+    public float[] tataFloats(float[] f) {
+        tataFloats++;
+        return f;
+    }
+
+    public int tataInt(int i) {
+        tataInt++;
+        return i;
+    }
+
+    public int[] tataInts(int[] its) {
+        tataInts++;
+        return its;
+    }
+
+    public long tataLong(long l) {
+        tataLong++;
+        return l;
+    }
+
+    public long[] tataLongs(long[] l) {
+        tataLongs++;
+        return l;
+    }
+
+    public short tataShort(short s) {
+        tataShort++;
+        return s;
+    }
+
+    public short[] tataShorts(short[] s) {
+        tataShorts++;
+        return s;
+    }
+
+    public long add(int i, int j, int k) {
+        add++;
+        return i + j + k;
+    }
+
+
+}

Added: felix/trunk/ipojo/runtime/composite-it/src/it/ipojo-composite-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/components/TotoProvider.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/runtime/composite-it/src/it/ipojo-composite-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/components/TotoProvider.java?rev=1450158&view=auto
==============================================================================
--- felix/trunk/ipojo/runtime/composite-it/src/it/ipojo-composite-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/components/TotoProvider.java (added)
+++ felix/trunk/ipojo/runtime/composite-it/src/it/ipojo-composite-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/components/TotoProvider.java Tue Feb 26 13:02:34 2013
@@ -0,0 +1,73 @@
+/* 
+ * 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.felix.ipojo.runtime.core.components;
+
+import org.apache.felix.ipojo.runtime.core.services.Toto;
+
+import java.util.Properties;
+
+
+public class TotoProvider implements Toto {
+    
+    private int i = 0;
+    public static int toto = 0;
+    public static int toto_2 = 0;
+    public static int toto_3 = 0;
+    public static int toto_4 = 0;
+    public static int toto1 = 0;
+    
+    public int count() {
+        return i;
+    }
+    
+    public void toto() {
+        toto++;        
+    }
+
+    public void toto(int i, int j) {
+        toto_2++;
+    }
+
+    public String toto(String a) {
+        toto_3++;
+        return a;
+    }
+
+    public String toto(String[] a) {
+        toto_4++;
+        return "toto";
+    }
+
+    public void toto1(String j) {
+        i++;
+        toto1++;        
+    }
+
+    public Properties getProps() {
+        Properties props = new Properties();
+        props.put("i", new Integer(i));
+        props.put("toto", new Integer(toto));
+        props.put("toto_2", new Integer(toto_2));
+        props.put("toto_3", new Integer(toto_3));
+        props.put("toto_4", new Integer(toto_4));
+        props.put("toto1", new Integer(toto1));
+        return props;
+    }
+
+}

Added: felix/trunk/ipojo/runtime/composite-it/src/it/ipojo-composite-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/components/TotoProviderGlue.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/runtime/composite-it/src/it/ipojo-composite-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/components/TotoProviderGlue.java?rev=1450158&view=auto
==============================================================================
--- felix/trunk/ipojo/runtime/composite-it/src/it/ipojo-composite-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/components/TotoProviderGlue.java (added)
+++ felix/trunk/ipojo/runtime/composite-it/src/it/ipojo-composite-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/components/TotoProviderGlue.java Tue Feb 26 13:02:34 2013
@@ -0,0 +1,81 @@
+/* 
+ * 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.felix.ipojo.runtime.core.components;
+
+import org.apache.felix.ipojo.runtime.core.services.Toto;
+
+import java.util.Properties;
+
+
+public class TotoProviderGlue implements Toto {
+    
+    Toto m_toto;
+    
+    private int i = 0;
+    public static int toto = 0;
+    public static int toto_2 = 0;
+    public static int toto_3 = 0;
+    public static int toto_4 = 0;
+    public static int toto1 = 0;
+    
+    public int count() {
+        return i;
+    }
+    
+    public void toto() {
+        toto++;
+        m_toto.toto();
+    }
+
+    public void toto(int i, int j) {
+        toto_2++;
+        m_toto.toto(i, j);
+    }
+
+    public String toto(String a) {
+        toto_3++;
+        return a;
+    }
+
+    public String toto(String[] a) {
+        toto_4++;
+        return "toto";
+    }
+
+    public void toto1(String j) {
+        i++;
+        toto1++;
+        m_toto.toto1(j);
+    }
+
+    public Properties getProps() {
+        Properties props = new Properties();
+        props.put("i", new Integer(i));
+        props.put("gtoto", new Integer(toto));
+        props.put("gtoto_2", new Integer(toto_2));
+        props.put("gtoto_3", new Integer(toto_3));
+        props.put("gtoto_4", new Integer(toto_4));
+        props.put("gtoto1", new Integer(toto1));
+        props.put("glue", "glue");
+        Properties p2 = m_toto.getProps();
+        props.putAll(p2);
+        return props;
+    }
+
+}

Added: felix/trunk/ipojo/runtime/composite-it/src/it/ipojo-composite-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/services/A123/CheckService2.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/runtime/composite-it/src/it/ipojo-composite-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/services/A123/CheckService2.java?rev=1450158&view=auto
==============================================================================
--- felix/trunk/ipojo/runtime/composite-it/src/it/ipojo-composite-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/services/A123/CheckService2.java (added)
+++ felix/trunk/ipojo/runtime/composite-it/src/it/ipojo-composite-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/services/A123/CheckService2.java Tue Feb 26 13:02:34 2013
@@ -0,0 +1,25 @@
+/* 
+ * 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.felix.ipojo.runtime.core.services.A123;
+
+public interface CheckService2 {
+	
+	public boolean check();
+
+}

Added: felix/trunk/ipojo/runtime/composite-it/src/it/ipojo-composite-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/services/BarService.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/runtime/composite-it/src/it/ipojo-composite-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/services/BarService.java?rev=1450158&view=auto
==============================================================================
--- felix/trunk/ipojo/runtime/composite-it/src/it/ipojo-composite-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/services/BarService.java (added)
+++ felix/trunk/ipojo/runtime/composite-it/src/it/ipojo-composite-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/services/BarService.java Tue Feb 26 13:02:34 2013
@@ -0,0 +1,29 @@
+/* 
+ * 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.felix.ipojo.runtime.core.services;
+
+import java.util.Properties;
+
+public interface BarService {
+	
+	public boolean bar();
+	
+	public Properties getProps();
+
+}

Added: felix/trunk/ipojo/runtime/composite-it/src/it/ipojo-composite-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/services/BazService.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/runtime/composite-it/src/it/ipojo-composite-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/services/BazService.java?rev=1450158&view=auto
==============================================================================
--- felix/trunk/ipojo/runtime/composite-it/src/it/ipojo-composite-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/services/BazService.java (added)
+++ felix/trunk/ipojo/runtime/composite-it/src/it/ipojo-composite-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/services/BazService.java Tue Feb 26 13:02:34 2013
@@ -0,0 +1,39 @@
+/* 
+ * 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.felix.ipojo.runtime.core.services;
+
+import java.util.Properties;
+
+public interface BazService {
+
+	boolean foo();
+	
+	Properties fooProps();
+	
+	Boolean getObject();
+	
+	boolean getBoolean();
+	
+	int getInt();
+	
+	long getLong();
+	
+	double getDouble();
+	
+}

Added: felix/trunk/ipojo/runtime/composite-it/src/it/ipojo-composite-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/services/CheckService.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/runtime/composite-it/src/it/ipojo-composite-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/services/CheckService.java?rev=1450158&view=auto
==============================================================================
--- felix/trunk/ipojo/runtime/composite-it/src/it/ipojo-composite-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/services/CheckService.java (added)
+++ felix/trunk/ipojo/runtime/composite-it/src/it/ipojo-composite-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/services/CheckService.java Tue Feb 26 13:02:34 2013
@@ -0,0 +1,31 @@
+/* 
+ * 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.felix.ipojo.runtime.core.services;
+
+import java.util.Properties;
+
+public interface CheckService {
+    
+    public static final String foo = "foo";
+	
+	public boolean check();
+	
+	public Properties getProps();
+
+}

Added: felix/trunk/ipojo/runtime/composite-it/src/it/ipojo-composite-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/services/FooService.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/runtime/composite-it/src/it/ipojo-composite-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/services/FooService.java?rev=1450158&view=auto
==============================================================================
--- felix/trunk/ipojo/runtime/composite-it/src/it/ipojo-composite-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/services/FooService.java (added)
+++ felix/trunk/ipojo/runtime/composite-it/src/it/ipojo-composite-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/services/FooService.java Tue Feb 26 13:02:34 2013
@@ -0,0 +1,39 @@
+/* 
+ * 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.felix.ipojo.runtime.core.services;
+
+import java.util.Properties;
+
+public interface FooService {
+
+	boolean foo();
+	
+	Properties fooProps();
+	
+	Boolean getObject();
+	
+	boolean getBoolean();
+	
+	int getInt();
+	
+	long getLong();
+	
+	double getDouble();
+	
+}

Added: felix/trunk/ipojo/runtime/composite-it/src/it/ipojo-composite-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/services/Service.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/runtime/composite-it/src/it/ipojo-composite-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/services/Service.java?rev=1450158&view=auto
==============================================================================
--- felix/trunk/ipojo/runtime/composite-it/src/it/ipojo-composite-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/services/Service.java (added)
+++ felix/trunk/ipojo/runtime/composite-it/src/it/ipojo-composite-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/services/Service.java Tue Feb 26 13:02:34 2013
@@ -0,0 +1,7 @@
+package org.apache.felix.ipojo.runtime.core.services;
+
+public interface Service {
+    
+    public int count();
+
+}



Mime
View raw message