felix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From clem...@apache.org
Subject svn commit: r579291 [7/12] - in /felix/sandbox/clement/Tests/Suite: ./ src/ src/main/ src/main/java/ src/main/java/org/ src/main/java/org/apache/ src/main/java/org/apache/felix/ src/main/java/org/apache/felix/ipojo/ src/main/java/org/apache/felix/ipojo...
Date Tue, 25 Sep 2007 15:07:18 GMT
Added: felix/sandbox/clement/Tests/Suite/src/main/java/org/apache/felix/ipojo/test/scenarios/configuration/TestBothProperties.java
URL: http://svn.apache.org/viewvc/felix/sandbox/clement/Tests/Suite/src/main/java/org/apache/felix/ipojo/test/scenarios/configuration/TestBothProperties.java?rev=579291&view=auto
==============================================================================
--- felix/sandbox/clement/Tests/Suite/src/main/java/org/apache/felix/ipojo/test/scenarios/configuration/TestBothProperties.java (added)
+++ felix/sandbox/clement/Tests/Suite/src/main/java/org/apache/felix/ipojo/test/scenarios/configuration/TestBothProperties.java Tue Sep 25 08:06:53 2007
@@ -0,0 +1,332 @@
+package org.apache.felix.ipojo.test.scenarios.configuration;
+
+import java.util.Properties;
+
+import org.apache.felix.ipojo.ComponentInstance;
+import org.apache.felix.ipojo.Factory;
+import org.apache.felix.ipojo.test.scenarios.service.CheckService;
+import org.apache.felix.ipojo.test.scenarios.util.Utils;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.ServiceReference;
+
+import fr.imag.adele.escoffier.utf.framework.TestCase;
+
+public class TestBothProperties extends TestCase {
+    
+    ComponentInstance instance;
+
+    public TestBothProperties(BundleContext arg0) {
+        super(arg0);
+    }
+    
+    public void setUp() {
+        Factory fact = Utils.getFactoryByName(context, "BothConfigurableCheckService");
+        Properties props = new Properties();
+        props.put("name", "under-test");
+        props.put("b", "1");
+        props.put("s", "1");
+        props.put("i", "1");
+        props.put("l", "1");
+        props.put("d", "1");
+        props.put("f", "1");
+        props.put("c", "a");
+        props.put("bool", "true");
+        props.put("bs", "{1,2,3}");
+        props.put("ss", "{1,2,3}");
+        props.put("is", "{1,2,3}");
+        props.put("ls", "{1,2,3}");
+        props.put("ds", "{1,2,3}");
+        props.put("fs", "{1,2,3}");
+        props.put("cs", "{a,b,c}");
+        props.put("bools", "{true,true,true}");
+        props.put("string", "foo");
+        props.put("strings", "{foo, bar, baz}");
+        
+        try {
+            instance = fact.createComponentInstance(props);
+        } catch(Exception e) {
+           fail("Cannot create the under-test instance : " + e.getMessage());
+        }
+        
+        
+    }
+    
+    public void tearDown() {
+        instance.dispose();
+        instance = null;
+    }
+    
+    public void testConfigurationPrimitive() {
+        ServiceReference ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance.getInstanceName());
+        assertNotNull("Test check service availability", ref);
+        CheckService check = (CheckService) context.getService(ref);
+        Properties props = check.getProps();
+        
+        Byte b = (Byte) props.get("b");
+        Short s = (Short) props.get("s");
+        Integer i = (Integer) props.get("i");
+        Long l = (Long) props.get("l");
+        Double d = (Double) props.get("d");
+        Float f = (Float) props.get("f");
+        Character c = (Character) props.get("c");
+        Boolean bool = (Boolean) props.get("bool");
+                
+        assertEquals("Check b", b, new Byte("1"));
+        assertEquals("Check s", s, new Short("1"));
+        assertEquals("Check i", i, new Integer("1"));
+        assertEquals("Check l", l, new Long("1"));
+        assertEquals("Check d", d, new Double("1"));
+        assertEquals("Check f", f, new Float("1"));
+        assertEquals("Check c", c, new Character('a'));
+        assertEquals("Check bool", bool, new Boolean("true"));
+        
+        Integer upb = (Integer) props.get("upb");
+        Integer ups = (Integer) props.get("ups");
+        Integer upi = (Integer) props.get("upi");
+        Integer upl = (Integer) props.get("upl");
+        Integer upd = (Integer) props.get("upd");
+        Integer upf = (Integer) props.get("upf");
+        Integer upc = (Integer) props.get("upc");
+        Integer upbool = (Integer) props.get("upbool");
+        
+        assertEquals("Check upb", upb, new Integer(1));
+        assertEquals("Check ups", ups, new Integer(1));
+        assertEquals("Check upi", upi, new Integer(1));
+        assertEquals("Check upl", upl, new Integer(1));
+        assertEquals("Check upd", upd, new Integer(1));
+        assertEquals("Check upf", upf, new Integer(1));
+        assertEquals("Check upc", upc, new Integer(1));
+        assertEquals("Check upbool", upbool, new Integer(1));
+        
+        reconfigure();
+        
+        ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance.getInstanceName());
+        assertNotNull("Test check service availability", ref);
+        check = (CheckService) context.getService(ref);
+        props = check.getProps();
+        
+        b = (Byte) props.get("b");
+        s = (Short) props.get("s");
+        i = (Integer) props.get("i");
+        l = (Long) props.get("l");
+        d = (Double) props.get("d");
+        f = (Float) props.get("f");
+        c = (Character) props.get("c");
+        bool = (Boolean) props.get("bool");
+        
+        assertEquals("2) Check b ("+b+")", b, new Byte("2"));
+        assertEquals("2) Check s", s, new Short("2"));
+        assertEquals("2) Check i", i, new Integer("2"));
+        assertEquals("2) Check l", l, new Long("2"));
+        assertEquals("2) Check d", d, new Double("2"));
+        assertEquals("2) Check f", f, new Float("2"));
+        assertEquals("2) Check c", c, new Character('b'));
+        assertEquals("2) Check bool", bool, new Boolean("false"));
+        
+        upb = (Integer) props.get("upb");
+        ups = (Integer) props.get("ups");
+        upi = (Integer) props.get("upi");
+        upl = (Integer) props.get("upl");
+        upd = (Integer) props.get("upd");
+        upf = (Integer) props.get("upf");
+        upc = (Integer) props.get("upc");
+        upbool = (Integer) props.get("upbool");
+        
+        assertEquals("2) Check upb", upb, new Integer(2));
+        assertEquals("2) Check ups", ups, new Integer(2));
+        assertEquals("2) Check upi", upi, new Integer(2));
+        assertEquals("2) Check upl", upl, new Integer(2));
+        assertEquals("2) Check upd", upd, new Integer(2));
+        assertEquals("2) Check upf", upf, new Integer(2));
+        assertEquals("2) Check upc", upc, new Integer(2));
+        assertEquals("2) Check upbool", upbool, new Integer(2));
+        
+    }
+    
+    public void testConfigurationPrimitiveArrays() {
+        ServiceReference ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance.getInstanceName());
+        assertNotNull("Test check service availability", ref);
+        CheckService check = (CheckService) context.getService(ref);
+        Properties props = check.getProps();
+        
+        byte[] b = (byte[]) props.get("bs");
+        short[] s = (short[]) props.get("ss");
+        int[] i = (int[]) props.get("is");
+        long[] l = (long[]) props.get("ls");
+        double[] d = (double[]) props.get("ds");
+        float[] f = (float[]) props.get("fs");
+        char[] c = (char[]) props.get("cs");
+        boolean[] bool = (boolean[]) props.get("bools");
+                
+        assertEquals("Check b 0", b[0], 1);
+        assertEquals("Check b 1", b[1], 2);
+        assertEquals("Check b 2", b[2], 3);
+        assertEquals("Check s 0", s[0], 1);
+        assertEquals("Check s 1", s[1], 2);
+        assertEquals("Check s 2", s[2], 3);
+        assertEquals("Check i 0", i[0], 1);
+        assertEquals("Check i 1", i[1], 2);
+        assertEquals("Check i 2", i[2], 3);
+        assertEquals("Check l 0", l[0], 1);
+        assertEquals("Check l 1", l[1], 2);
+        assertEquals("Check l 2", l[2], 3);
+        assertEquals("Check d 0", d[0], 1);
+        assertEquals("Check d 1", d[1], 2);
+        assertEquals("Check d 2", d[2], 3);
+        assertEquals("Check f 0", f[0], 1);
+        assertEquals("Check f 1", f[1], 2);
+        assertEquals("Check f 2", f[2], 3);
+        assertEquals("Check c 0", c[0], 'a');
+        assertEquals("Check c 1", c[1], 'b');
+        assertEquals("Check c 2", c[2], 'c');
+        assertTrue("Check bool 0", bool[0]);
+        assertTrue("Check bool 1", bool[0]);
+        assertTrue("Check bool 2", bool[0]);
+        
+        Integer upb = (Integer) props.get("upbs");
+        Integer ups = (Integer) props.get("upss");
+        Integer upi = (Integer) props.get("upis");
+        Integer upl = (Integer) props.get("upls");
+        Integer upd = (Integer) props.get("upds");
+        Integer upf = (Integer) props.get("upfs");
+        Integer upc = (Integer) props.get("upcs");
+        Integer upbool = (Integer) props.get("upbools");
+        
+        assertEquals("Check upb", upb, new Integer(1));
+        assertEquals("Check ups", ups, new Integer(1));
+        assertEquals("Check upi", upi, new Integer(1));
+        assertEquals("Check upl", upl, new Integer(1));
+        assertEquals("Check upd", upd, new Integer(1));
+        assertEquals("Check upf", upf, new Integer(1));
+        assertEquals("Check upc", upc, new Integer(1));
+        assertEquals("Check upbool", upbool, new Integer(1));
+        
+        reconfigure();
+        
+        ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance.getInstanceName());
+        assertNotNull("Test check service availability", ref);
+        check = (CheckService) context.getService(ref);
+        props = check.getProps();
+        
+        b = (byte[]) props.get("bs");
+        s = (short[]) props.get("ss");
+        i = (int[]) props.get("is");
+        l = (long[]) props.get("ls");
+        d = (double[]) props.get("ds");
+        f = (float[]) props.get("fs");
+        c = (char[]) props.get("cs");
+        bool = (boolean[]) props.get("bools");
+        
+        assertEquals("2) Check b 0", b[0], 3);
+        assertEquals("2) Check b 1", b[1], 2);
+        assertEquals("2) Check b 2", b[2], 1);
+        assertEquals("2) Check s 0", s[0], 3);
+        assertEquals("2) Check s 1", s[1], 2);
+        assertEquals("2) Check s 2", s[2], 1);
+        assertEquals("2) Check i 0", i[0], 3);
+        assertEquals("2) Check i 1", i[1], 2);
+        assertEquals("2) Check i 2", i[2], 1);
+        assertEquals("2) Check l 0", l[0], 3);
+        assertEquals("2) Check l 1", l[1], 2);
+        assertEquals("2) Check l 2", l[2], 1);
+        assertEquals("2) Check d 0", d[0], 3);
+        assertEquals("2) Check d 1", d[1], 2);
+        assertEquals("2) Check d 2", d[2], 1);
+        assertEquals("2) Check f 0", f[0], 3);
+        assertEquals("2) Check f 1", f[1], 2);
+        assertEquals("2) Check f 2", f[2], 1);
+        assertEquals("2) Check c 0", c[0], 'c');
+        assertEquals("2) Check c 1", c[1], 'b');
+        assertEquals("2) Check c 2", c[2], 'a');
+        assertFalse("2) Check bool 0", bool[0]);
+        assertFalse("2) Check bool 1", bool[0]);
+        assertFalse("2) Check bool 2", bool[0]);
+        
+        upb = (Integer) props.get("upbs");
+        ups = (Integer) props.get("upss");
+        upi = (Integer) props.get("upis");
+        upl = (Integer) props.get("upls");
+        upd = (Integer) props.get("upds");
+        upf = (Integer) props.get("upfs");
+        upc = (Integer) props.get("upcs");
+        upbool = (Integer) props.get("upbools");
+        
+        assertEquals("2) Check upb", upb, new Integer(2));
+        assertEquals("2) Check ups", ups, new Integer(2));
+        assertEquals("2) Check upi", upi, new Integer(2));
+        assertEquals("2) Check upl", upl, new Integer(2));
+        assertEquals("2) Check upd", upd, new Integer(2));
+        assertEquals("2) Check upf", upf, new Integer(2));
+        assertEquals("2) Check upc", upc, new Integer(2));
+        assertEquals("2) Check upbool", upbool, new Integer(2));
+        
+    }
+    
+    public void testConfigurationObj() {
+        ServiceReference ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance.getInstanceName());
+        assertNotNull("Test check service availability", ref);
+        CheckService check = (CheckService) context.getService(ref);
+        Properties props = check.getProps();
+        
+        String s = (String) props.get("string");
+        String[] ss = (String[]) props.get("strings");
+                
+        assertEquals("Check string", s, "foo");
+        assertEquals("Check strings 0", ss[0], "foo");
+        assertEquals("Check strings 1", ss[1], "bar");
+        assertEquals("Check strings 2", ss[2], "baz");
+        
+        Integer upString = (Integer) props.get("upstring");
+        Integer upStrings = (Integer) props.get("upstrings");
+        
+        assertEquals("Check upString", upString, new Integer(1));
+        assertEquals("Check upStrings", upStrings, new Integer(1));
+        
+        reconfigure();
+        
+        ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance.getInstanceName());
+        assertNotNull("Test check service availability", ref);
+        check = (CheckService) context.getService(ref);
+        props = check.getProps();
+        
+        s = (String) props.get("string");
+        ss = (String[]) props.get("strings");
+                
+        assertEquals("2) Check string", s, "bar");
+        assertEquals("2) Check strings 0", ss[0], "baz");
+        assertEquals("2) Check strings 1", ss[1], "bar");
+        assertEquals("2) Check strings 2", ss[2], "foo");
+        
+        upString = (Integer) props.get("upstring");
+        upStrings = (Integer) props.get("upstrings");
+        
+        assertEquals("2) Check upstring", upString, new Integer(2));
+        assertEquals("2) Check upstrings", upStrings, new Integer(2));
+    }
+    
+    private void reconfigure() {
+        Properties props2 = new Properties();
+        props2.put("name", "under-test");
+        props2.put("b", new Byte("2"));
+        props2.put("s", new Short("2"));
+        props2.put("i", new Integer("2"));
+        props2.put("l", new Long("2"));
+        props2.put("d", new Double("2"));
+        props2.put("f", new Float("2"));
+        props2.put("c", new Character('b'));
+        props2.put("bool", new Boolean(false));
+        props2.put("bs", new byte[]{(byte)3,(byte)2,(byte)1});
+        props2.put("ss", new short[]{(short)3,(short)2,(short)1});
+        props2.put("is", new int[]{3,2,1});
+        props2.put("ls", new long[]{3,2,1});
+        props2.put("ds", new double[]{3,2,1});
+        props2.put("fs", new float[]{3,2,1});
+        props2.put("cs", new char[]{'c','b','a'});
+        props2.put("bools", new boolean[]{false,false,false});
+        props2.put("string", "bar");
+        props2.put("strings", new String[]{"baz", "bar", "foo"});
+        
+        instance.reconfigure(props2);
+    }
+
+}

Added: felix/sandbox/clement/Tests/Suite/src/main/java/org/apache/felix/ipojo/test/scenarios/configuration/TestFieldProperties.java
URL: http://svn.apache.org/viewvc/felix/sandbox/clement/Tests/Suite/src/main/java/org/apache/felix/ipojo/test/scenarios/configuration/TestFieldProperties.java?rev=579291&view=auto
==============================================================================
--- felix/sandbox/clement/Tests/Suite/src/main/java/org/apache/felix/ipojo/test/scenarios/configuration/TestFieldProperties.java (added)
+++ felix/sandbox/clement/Tests/Suite/src/main/java/org/apache/felix/ipojo/test/scenarios/configuration/TestFieldProperties.java Tue Sep 25 08:06:53 2007
@@ -0,0 +1,248 @@
+package org.apache.felix.ipojo.test.scenarios.configuration;
+
+import java.util.Properties;
+
+import org.apache.felix.ipojo.ComponentInstance;
+import org.apache.felix.ipojo.Factory;
+import org.apache.felix.ipojo.test.scenarios.service.CheckService;
+import org.apache.felix.ipojo.test.scenarios.util.Utils;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.ServiceReference;
+
+import fr.imag.adele.escoffier.utf.framework.TestCase;
+
+public class TestFieldProperties extends TestCase {
+    
+    ComponentInstance instance;
+
+    public TestFieldProperties(BundleContext arg0) {
+        super(arg0);
+    }
+    
+    public void setUp() {
+        Factory fact = Utils.getFactoryByName(context, "FieldConfigurableCheckService");
+        Properties props = new Properties();
+        props.put("name", "under-test");
+        props.put("b", "1");
+        props.put("s", "1");
+        props.put("i", "1");
+        props.put("l", "1");
+        props.put("d", "1");
+        props.put("f", "1");
+        props.put("c", "a");
+        props.put("bool", "true");
+        props.put("bs", "{1,2,3}");
+        props.put("ss", "{1,2,3}");
+        props.put("is", "{1,2,3}");
+        props.put("ls", "{1,2,3}");
+        props.put("ds", "{1,2,3}");
+        props.put("fs", "{1,2,3}");
+        props.put("cs", "{a,b,c}");
+        props.put("bools", "{true,true,true}");
+        props.put("string", "foo");
+        props.put("strings", "{foo, bar, baz}");
+        
+        try {
+            instance = fact.createComponentInstance(props);
+        } catch(Exception e) {
+           fail("Cannot create the under-test instance : " + e.getMessage());
+        }
+        
+        
+    }
+    
+    public void tearDown() {
+        instance.dispose();
+        instance = null;
+    }
+    
+    public void testConfigurationPrimitive() {
+        ServiceReference ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance.getInstanceName());
+        assertNotNull("Test check service availability", ref);
+        CheckService check = (CheckService) context.getService(ref);
+        Properties props = check.getProps();
+        
+        Byte b = (Byte) props.get("b");
+        Short s = (Short) props.get("s");
+        Integer i = (Integer) props.get("i");
+        Long l = (Long) props.get("l");
+        Double d = (Double) props.get("d");
+        Float f = (Float) props.get("f");
+        Character c = (Character) props.get("c");
+        Boolean bool = (Boolean) props.get("bool");
+                
+        assertEquals("Check b", b, new Byte("1"));
+        assertEquals("Check s", s, new Short("1"));
+        assertEquals("Check i", i, new Integer("1"));
+        assertEquals("Check l", l, new Long("1"));
+        assertEquals("Check d", d, new Double("1"));
+        assertEquals("Check f", f, new Float("1"));
+        assertEquals("Check c", c, new Character('a'));
+        assertEquals("Check bool", bool, new Boolean("true"));
+        
+        reconfigure();
+        
+        ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance.getInstanceName());
+        assertNotNull("Test check service availability", ref);
+        check = (CheckService) context.getService(ref);
+        props = check.getProps();
+        
+        b = (Byte) props.get("b");
+        s = (Short) props.get("s");
+        i = (Integer) props.get("i");
+        l = (Long) props.get("l");
+        d = (Double) props.get("d");
+        f = (Float) props.get("f");
+        c = (Character) props.get("c");
+        bool = (Boolean) props.get("bool");
+        
+        assertEquals("2) Check b", b, new Byte("2"));
+        assertEquals("2) Check s", s, new Short("2"));
+        assertEquals("2) Check i", i, new Integer("2"));
+        assertEquals("2) Check l", l, new Long("2"));
+        assertEquals("2) Check d", d, new Double("2"));
+        assertEquals("2) Check f", f, new Float("2"));
+        assertEquals("2) Check c", c, new Character('b'));
+        assertEquals("2) Check bool", bool, new Boolean("false"));
+        
+    }
+    
+    public void testConfigurationPrimitiveArrays() {
+        ServiceReference ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance.getInstanceName());
+        assertNotNull("Test check service availability", ref);
+        CheckService check = (CheckService) context.getService(ref);
+        Properties props = check.getProps();
+        
+        byte[] b = (byte[]) props.get("bs");
+        short[] s = (short[]) props.get("ss");
+        int[] i = (int[]) props.get("is");
+        long[] l = (long[]) props.get("ls");
+        double[] d = (double[]) props.get("ds");
+        float[] f = (float[]) props.get("fs");
+        char[] c = (char[]) props.get("cs");
+        boolean[] bool = (boolean[]) props.get("bools");
+                
+        assertEquals("Check b 0", b[0], 1);
+        assertEquals("Check b 1", b[1], 2);
+        assertEquals("Check b 2", b[2], 3);
+        assertEquals("Check s 0", s[0], 1);
+        assertEquals("Check s 1", s[1], 2);
+        assertEquals("Check s 2", s[2], 3);
+        assertEquals("Check i 0", i[0], 1);
+        assertEquals("Check i 1", i[1], 2);
+        assertEquals("Check i 2", i[2], 3);
+        assertEquals("Check l 0", l[0], 1);
+        assertEquals("Check l 1", l[1], 2);
+        assertEquals("Check l 2", l[2], 3);
+        assertEquals("Check d 0", d[0], 1);
+        assertEquals("Check d 1", d[1], 2);
+        assertEquals("Check d 2", d[2], 3);
+        assertEquals("Check f 0", f[0], 1);
+        assertEquals("Check f 1", f[1], 2);
+        assertEquals("Check f 2", f[2], 3);
+        assertEquals("Check c 0", c[0], 'a');
+        assertEquals("Check c 1", c[1], 'b');
+        assertEquals("Check c 2", c[2], 'c');
+        assertTrue("Check bool 0", bool[0]);
+        assertTrue("Check bool 1", bool[0]);
+        assertTrue("Check bool 2", bool[0]);
+        
+        reconfigure();
+        
+        ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance.getInstanceName());
+        assertNotNull("Test check service availability", ref);
+        check = (CheckService) context.getService(ref);
+        props = check.getProps();
+        
+        b = (byte[]) props.get("bs");
+        s = (short[]) props.get("ss");
+        i = (int[]) props.get("is");
+        l = (long[]) props.get("ls");
+        d = (double[]) props.get("ds");
+        f = (float[]) props.get("fs");
+        c = (char[]) props.get("cs");
+        bool = (boolean[]) props.get("bools");
+        
+        assertEquals("2) Check b 0", b[0], 3);
+        assertEquals("2) Check b 1", b[1], 2);
+        assertEquals("2) Check b 2", b[2], 1);
+        assertEquals("2) Check s 0", s[0], 3);
+        assertEquals("2) Check s 1", s[1], 2);
+        assertEquals("2) Check s 2", s[2], 1);
+        assertEquals("2) Check i 0", i[0], 3);
+        assertEquals("2) Check i 1", i[1], 2);
+        assertEquals("2) Check i 2", i[2], 1);
+        assertEquals("2) Check l 0", l[0], 3);
+        assertEquals("2) Check l 1", l[1], 2);
+        assertEquals("2) Check l 2", l[2], 1);
+        assertEquals("2) Check d 0", d[0], 3);
+        assertEquals("2) Check d 1", d[1], 2);
+        assertEquals("2) Check d 2", d[2], 1);
+        assertEquals("2) Check f 0", f[0], 3);
+        assertEquals("2) Check f 1", f[1], 2);
+        assertEquals("2) Check f 2", f[2], 1);
+        assertEquals("2) Check c 0", c[0], 'c');
+        assertEquals("2) Check c 1", c[1], 'b');
+        assertEquals("2) Check c 2", c[2], 'a');
+        assertFalse("2) Check bool 0", bool[0]);
+        assertFalse("2) Check bool 1", bool[0]);
+        assertFalse("2) Check bool 2", bool[0]);
+        
+    }
+    
+    public void testConfigurationObj() {
+        ServiceReference ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance.getInstanceName());
+        assertNotNull("Test check service availability", ref);
+        CheckService check = (CheckService) context.getService(ref);
+        Properties props = check.getProps();
+        
+        String s = (String) props.get("string");
+        String[] ss = (String[]) props.get("strings");
+                
+        assertEquals("Check string", s, "foo");
+        assertEquals("Check strings 0", ss[0], "foo");
+        assertEquals("Check strings 1", ss[1], "bar");
+        assertEquals("Check strings 2", ss[2], "baz");
+        
+        reconfigure();
+        
+        ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance.getInstanceName());
+        assertNotNull("Test check service availability", ref);
+        check = (CheckService) context.getService(ref);
+        props = check.getProps();
+        
+        s = (String) props.get("string");
+        ss = (String[]) props.get("strings");
+                
+        assertEquals("2) Check string", s, "bar");
+        assertEquals("2) Check strings 0", ss[0], "baz");
+        assertEquals("2) Check strings 1", ss[1], "bar");
+        assertEquals("2) Check strings 2", ss[2], "foo");
+    }
+    
+    private void reconfigure() {
+        Properties props2 = new Properties();
+        props2.put("name", "under-test");
+        props2.put("b", new Byte("2"));
+        props2.put("s", new Short("2"));
+        props2.put("i", new Integer("2"));
+        props2.put("l", new Long("2"));
+        props2.put("d", new Double("2"));
+        props2.put("f", new Float("2"));
+        props2.put("c", new Character('b'));
+        props2.put("bool", new Boolean(false));
+        props2.put("bs", new byte[]{(byte)3,(byte)2,(byte)1});
+        props2.put("ss", new short[]{(short)3,(short)2,(short)1});
+        props2.put("is", new int[]{3,2,1});
+        props2.put("ls", new long[]{3,2,1});
+        props2.put("ds", new double[]{3,2,1});
+        props2.put("fs", new float[]{3,2,1});
+        props2.put("cs", new char[]{'c','b','a'});
+        props2.put("bools", new boolean[]{false,false,false});
+        props2.put("string", "bar");
+        props2.put("strings", new String[]{"baz", "bar", "foo"});
+        
+        instance.reconfigure(props2);
+    }
+
+}

Added: felix/sandbox/clement/Tests/Suite/src/main/java/org/apache/felix/ipojo/test/scenarios/configuration/TestMethodProperties.java
URL: http://svn.apache.org/viewvc/felix/sandbox/clement/Tests/Suite/src/main/java/org/apache/felix/ipojo/test/scenarios/configuration/TestMethodProperties.java?rev=579291&view=auto
==============================================================================
--- felix/sandbox/clement/Tests/Suite/src/main/java/org/apache/felix/ipojo/test/scenarios/configuration/TestMethodProperties.java (added)
+++ felix/sandbox/clement/Tests/Suite/src/main/java/org/apache/felix/ipojo/test/scenarios/configuration/TestMethodProperties.java Tue Sep 25 08:06:53 2007
@@ -0,0 +1,332 @@
+package org.apache.felix.ipojo.test.scenarios.configuration;
+
+import java.util.Properties;
+
+import org.apache.felix.ipojo.ComponentInstance;
+import org.apache.felix.ipojo.Factory;
+import org.apache.felix.ipojo.test.scenarios.service.CheckService;
+import org.apache.felix.ipojo.test.scenarios.util.Utils;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.ServiceReference;
+
+import fr.imag.adele.escoffier.utf.framework.TestCase;
+
+public class TestMethodProperties extends TestCase {
+    
+    ComponentInstance instance;
+
+    public TestMethodProperties(BundleContext arg0) {
+        super(arg0);
+    }
+    
+    public void setUp() {
+        Factory fact = Utils.getFactoryByName(context, "MethodConfigurableCheckService");
+        Properties props = new Properties();
+        props.put("name", "under-test");
+        props.put("b", "1");
+        props.put("s", "1");
+        props.put("i", "1");
+        props.put("l", "1");
+        props.put("d", "1");
+        props.put("f", "1");
+        props.put("c", "a");
+        props.put("bool", "true");
+        props.put("bs", "{1,2,3}");
+        props.put("ss", "{1,2,3}");
+        props.put("is", "{1,2,3}");
+        props.put("ls", "{1,2,3}");
+        props.put("ds", "{1,2,3}");
+        props.put("fs", "{1,2,3}");
+        props.put("cs", "{a,b,c}");
+        props.put("bools", "{true,true,true}");
+        props.put("string", "foo");
+        props.put("strings", "{foo, bar, baz}");
+        
+        try {
+            instance = fact.createComponentInstance(props);
+        } catch(Exception e) {
+           fail("Cannot create the under-test instance : " + e.getMessage());
+        }
+        
+        
+    }
+    
+    public void tearDown() {
+        instance.dispose();
+        instance = null;
+    }
+    
+    public void testConfigurationPrimitive() {
+        ServiceReference ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance.getInstanceName());
+        assertNotNull("Test check service availability", ref);
+        CheckService check = (CheckService) context.getService(ref);
+        Properties props = check.getProps();
+        
+        Byte b = (Byte) props.get("b");
+        Short s = (Short) props.get("s");
+        Integer i = (Integer) props.get("i");
+        Long l = (Long) props.get("l");
+        Double d = (Double) props.get("d");
+        Float f = (Float) props.get("f");
+        Character c = (Character) props.get("c");
+        Boolean bool = (Boolean) props.get("bool");
+                
+        assertEquals("Check b", b, new Byte("1"));
+        assertEquals("Check s", s, new Short("1"));
+        assertEquals("Check i", i, new Integer("1"));
+        assertEquals("Check l", l, new Long("1"));
+        assertEquals("Check d", d, new Double("1"));
+        assertEquals("Check f", f, new Float("1"));
+        assertEquals("Check c", c, new Character('a'));
+        assertEquals("Check bool", bool, new Boolean("true"));
+        
+        Integer upb = (Integer) props.get("upb");
+        Integer ups = (Integer) props.get("ups");
+        Integer upi = (Integer) props.get("upi");
+        Integer upl = (Integer) props.get("upl");
+        Integer upd = (Integer) props.get("upd");
+        Integer upf = (Integer) props.get("upf");
+        Integer upc = (Integer) props.get("upc");
+        Integer upbool = (Integer) props.get("upbool");
+        
+        assertEquals("Check upb", upb, new Integer(1));
+        assertEquals("Check ups", ups, new Integer(1));
+        assertEquals("Check upi", upi, new Integer(1));
+        assertEquals("Check upl", upl, new Integer(1));
+        assertEquals("Check upd", upd, new Integer(1));
+        assertEquals("Check upf", upf, new Integer(1));
+        assertEquals("Check upc", upc, new Integer(1));
+        assertEquals("Check upbool", upbool, new Integer(1));
+        
+        reconfigure();
+        
+        ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance.getInstanceName());
+        assertNotNull("Test check service availability", ref);
+        check = (CheckService) context.getService(ref);
+        props = check.getProps();
+        
+        b = (Byte) props.get("b");
+        s = (Short) props.get("s");
+        i = (Integer) props.get("i");
+        l = (Long) props.get("l");
+        d = (Double) props.get("d");
+        f = (Float) props.get("f");
+        c = (Character) props.get("c");
+        bool = (Boolean) props.get("bool");
+        
+        assertEquals("2) Check b ("+b+")", b, new Byte("2"));
+        assertEquals("2) Check s", s, new Short("2"));
+        assertEquals("2) Check i", i, new Integer("2"));
+        assertEquals("2) Check l", l, new Long("2"));
+        assertEquals("2) Check d", d, new Double("2"));
+        assertEquals("2) Check f", f, new Float("2"));
+        assertEquals("2) Check c", c, new Character('b'));
+        assertEquals("2) Check bool", bool, new Boolean("false"));
+        
+        upb = (Integer) props.get("upb");
+        ups = (Integer) props.get("ups");
+        upi = (Integer) props.get("upi");
+        upl = (Integer) props.get("upl");
+        upd = (Integer) props.get("upd");
+        upf = (Integer) props.get("upf");
+        upc = (Integer) props.get("upc");
+        upbool = (Integer) props.get("upbool");
+        
+        assertEquals("2) Check upb", upb, new Integer(2));
+        assertEquals("2) Check ups", ups, new Integer(2));
+        assertEquals("2) Check upi", upi, new Integer(2));
+        assertEquals("2) Check upl", upl, new Integer(2));
+        assertEquals("2) Check upd", upd, new Integer(2));
+        assertEquals("2) Check upf", upf, new Integer(2));
+        assertEquals("2) Check upc", upc, new Integer(2));
+        assertEquals("2) Check upbool", upbool, new Integer(2));
+        
+    }
+    
+    public void testConfigurationPrimitiveArrays() {
+        ServiceReference ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance.getInstanceName());
+        assertNotNull("Test check service availability", ref);
+        CheckService check = (CheckService) context.getService(ref);
+        Properties props = check.getProps();
+        
+        byte[] b = (byte[]) props.get("bs");
+        short[] s = (short[]) props.get("ss");
+        int[] i = (int[]) props.get("is");
+        long[] l = (long[]) props.get("ls");
+        double[] d = (double[]) props.get("ds");
+        float[] f = (float[]) props.get("fs");
+        char[] c = (char[]) props.get("cs");
+        boolean[] bool = (boolean[]) props.get("bools");
+                
+        assertEquals("Check b 0", b[0], 1);
+        assertEquals("Check b 1", b[1], 2);
+        assertEquals("Check b 2", b[2], 3);
+        assertEquals("Check s 0", s[0], 1);
+        assertEquals("Check s 1", s[1], 2);
+        assertEquals("Check s 2", s[2], 3);
+        assertEquals("Check i 0", i[0], 1);
+        assertEquals("Check i 1", i[1], 2);
+        assertEquals("Check i 2", i[2], 3);
+        assertEquals("Check l 0", l[0], 1);
+        assertEquals("Check l 1", l[1], 2);
+        assertEquals("Check l 2", l[2], 3);
+        assertEquals("Check d 0", d[0], 1);
+        assertEquals("Check d 1", d[1], 2);
+        assertEquals("Check d 2", d[2], 3);
+        assertEquals("Check f 0", f[0], 1);
+        assertEquals("Check f 1", f[1], 2);
+        assertEquals("Check f 2", f[2], 3);
+        assertEquals("Check c 0", c[0], 'a');
+        assertEquals("Check c 1", c[1], 'b');
+        assertEquals("Check c 2", c[2], 'c');
+        assertTrue("Check bool 0", bool[0]);
+        assertTrue("Check bool 1", bool[0]);
+        assertTrue("Check bool 2", bool[0]);
+        
+        Integer upb = (Integer) props.get("upbs");
+        Integer ups = (Integer) props.get("upss");
+        Integer upi = (Integer) props.get("upis");
+        Integer upl = (Integer) props.get("upls");
+        Integer upd = (Integer) props.get("upds");
+        Integer upf = (Integer) props.get("upfs");
+        Integer upc = (Integer) props.get("upcs");
+        Integer upbool = (Integer) props.get("upbools");
+        
+        assertEquals("Check upb", upb, new Integer(1));
+        assertEquals("Check ups", ups, new Integer(1));
+        assertEquals("Check upi", upi, new Integer(1));
+        assertEquals("Check upl", upl, new Integer(1));
+        assertEquals("Check upd", upd, new Integer(1));
+        assertEquals("Check upf", upf, new Integer(1));
+        assertEquals("Check upc", upc, new Integer(1));
+        assertEquals("Check upbool", upbool, new Integer(1));
+        
+        reconfigure();
+        
+        ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance.getInstanceName());
+        assertNotNull("Test check service availability", ref);
+        check = (CheckService) context.getService(ref);
+        props = check.getProps();
+        
+        b = (byte[]) props.get("bs");
+        s = (short[]) props.get("ss");
+        i = (int[]) props.get("is");
+        l = (long[]) props.get("ls");
+        d = (double[]) props.get("ds");
+        f = (float[]) props.get("fs");
+        c = (char[]) props.get("cs");
+        bool = (boolean[]) props.get("bools");
+        
+        assertEquals("2) Check b 0", b[0], 3);
+        assertEquals("2) Check b 1", b[1], 2);
+        assertEquals("2) Check b 2", b[2], 1);
+        assertEquals("2) Check s 0", s[0], 3);
+        assertEquals("2) Check s 1", s[1], 2);
+        assertEquals("2) Check s 2", s[2], 1);
+        assertEquals("2) Check i 0", i[0], 3);
+        assertEquals("2) Check i 1", i[1], 2);
+        assertEquals("2) Check i 2", i[2], 1);
+        assertEquals("2) Check l 0", l[0], 3);
+        assertEquals("2) Check l 1", l[1], 2);
+        assertEquals("2) Check l 2", l[2], 1);
+        assertEquals("2) Check d 0", d[0], 3);
+        assertEquals("2) Check d 1", d[1], 2);
+        assertEquals("2) Check d 2", d[2], 1);
+        assertEquals("2) Check f 0", f[0], 3);
+        assertEquals("2) Check f 1", f[1], 2);
+        assertEquals("2) Check f 2", f[2], 1);
+        assertEquals("2) Check c 0", c[0], 'c');
+        assertEquals("2) Check c 1", c[1], 'b');
+        assertEquals("2) Check c 2", c[2], 'a');
+        assertFalse("2) Check bool 0", bool[0]);
+        assertFalse("2) Check bool 1", bool[0]);
+        assertFalse("2) Check bool 2", bool[0]);
+        
+        upb = (Integer) props.get("upbs");
+        ups = (Integer) props.get("upss");
+        upi = (Integer) props.get("upis");
+        upl = (Integer) props.get("upls");
+        upd = (Integer) props.get("upds");
+        upf = (Integer) props.get("upfs");
+        upc = (Integer) props.get("upcs");
+        upbool = (Integer) props.get("upbools");
+        
+        assertEquals("2) Check upb", upb, new Integer(2));
+        assertEquals("2) Check ups", ups, new Integer(2));
+        assertEquals("2) Check upi", upi, new Integer(2));
+        assertEquals("2) Check upl", upl, new Integer(2));
+        assertEquals("2) Check upd", upd, new Integer(2));
+        assertEquals("2) Check upf", upf, new Integer(2));
+        assertEquals("2) Check upc", upc, new Integer(2));
+        assertEquals("2) Check upbool", upbool, new Integer(2));
+        
+    }
+    
+    public void testConfigurationObj() {
+        ServiceReference ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance.getInstanceName());
+        assertNotNull("Test check service availability", ref);
+        CheckService check = (CheckService) context.getService(ref);
+        Properties props = check.getProps();
+        
+        String s = (String) props.get("string");
+        String[] ss = (String[]) props.get("strings");
+                
+        assertEquals("Check string", s, "foo");
+        assertEquals("Check strings 0", ss[0], "foo");
+        assertEquals("Check strings 1", ss[1], "bar");
+        assertEquals("Check strings 2", ss[2], "baz");
+        
+        Integer upString = (Integer) props.get("upstring");
+        Integer upStrings = (Integer) props.get("upstrings");
+        
+        assertEquals("Check upString", upString, new Integer(1));
+        assertEquals("Check upStrings", upStrings, new Integer(1));
+        
+        reconfigure();
+        
+        ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance.getInstanceName());
+        assertNotNull("Test check service availability", ref);
+        check = (CheckService) context.getService(ref);
+        props = check.getProps();
+        
+        s = (String) props.get("string");
+        ss = (String[]) props.get("strings");
+                
+        assertEquals("2) Check string", s, "bar");
+        assertEquals("2) Check strings 0", ss[0], "baz");
+        assertEquals("2) Check strings 1", ss[1], "bar");
+        assertEquals("2) Check strings 2", ss[2], "foo");
+        
+        upString = (Integer) props.get("upstring");
+        upStrings = (Integer) props.get("upstrings");
+        
+        assertEquals("2) Check upString", upString, new Integer(2));
+        assertEquals("2) Check upStrings", upStrings, new Integer(2));
+    }
+    
+    private void reconfigure() {
+        Properties props2 = new Properties();
+        props2.put("name", "under-test");
+        props2.put("b", new Byte("2"));
+        props2.put("s", new Short("2"));
+        props2.put("i", new Integer("2"));
+        props2.put("l", new Long("2"));
+        props2.put("d", new Double("2"));
+        props2.put("f", new Float("2"));
+        props2.put("c", new Character('b'));
+        props2.put("bool", new Boolean(false));
+        props2.put("bs", new byte[]{(byte)3,(byte)2,(byte)1});
+        props2.put("ss", new short[]{(short)3,(short)2,(short)1});
+        props2.put("is", new int[]{3,2,1});
+        props2.put("ls", new long[]{3,2,1});
+        props2.put("ds", new double[]{3,2,1});
+        props2.put("fs", new float[]{3,2,1});
+        props2.put("cs", new char[]{'c','b','a'});
+        props2.put("bools", new boolean[]{false,false,false});
+        props2.put("string", "bar");
+        props2.put("strings", new String[]{"baz", "bar", "foo"});
+        
+        instance.reconfigure(props2);
+    }
+
+}

Added: felix/sandbox/clement/Tests/Suite/src/main/java/org/apache/felix/ipojo/test/scenarios/configuration/TestSuperMethodProperties.java
URL: http://svn.apache.org/viewvc/felix/sandbox/clement/Tests/Suite/src/main/java/org/apache/felix/ipojo/test/scenarios/configuration/TestSuperMethodProperties.java?rev=579291&view=auto
==============================================================================
--- felix/sandbox/clement/Tests/Suite/src/main/java/org/apache/felix/ipojo/test/scenarios/configuration/TestSuperMethodProperties.java (added)
+++ felix/sandbox/clement/Tests/Suite/src/main/java/org/apache/felix/ipojo/test/scenarios/configuration/TestSuperMethodProperties.java Tue Sep 25 08:06:53 2007
@@ -0,0 +1,333 @@
+package org.apache.felix.ipojo.test.scenarios.configuration;
+
+import java.util.Properties;
+
+import org.apache.felix.ipojo.ComponentInstance;
+import org.apache.felix.ipojo.Factory;
+import org.apache.felix.ipojo.test.scenarios.service.CheckService;
+import org.apache.felix.ipojo.test.scenarios.util.Utils;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.ServiceReference;
+
+import fr.imag.adele.escoffier.utf.framework.TestCase;
+
+public class TestSuperMethodProperties extends TestCase {
+    
+    ComponentInstance instance;
+
+
+    public TestSuperMethodProperties(BundleContext arg0) {
+        super(arg0);
+    }
+    
+    public void setUp() {
+        Factory fact = Utils.getFactoryByName(context, "ParentMethodConfigurableCheckService");
+        Properties props = new Properties();
+        props.put("name", "under-test");
+        props.put("b", "1");
+        props.put("s", "1");
+        props.put("i", "1");
+        props.put("l", "1");
+        props.put("d", "1");
+        props.put("f", "1");
+        props.put("c", "a");
+        props.put("bool", "true");
+        props.put("bs", "{1,2,3}");
+        props.put("ss", "{1,2,3}");
+        props.put("is", "{1,2,3}");
+        props.put("ls", "{1,2,3}");
+        props.put("ds", "{1,2,3}");
+        props.put("fs", "{1,2,3}");
+        props.put("cs", "{a,b,c}");
+        props.put("bools", "{true,true,true}");
+        props.put("string", "foo");
+        props.put("strings", "{foo, bar, baz}");
+        
+        try {
+            instance = fact.createComponentInstance(props);
+        } catch (Exception e) {
+           fail("Cannot create the under-test instance : " + e.getMessage());
+        }
+        
+        
+    }
+    
+    public void tearDown() {
+        instance.dispose();
+        instance = null;
+    }
+    
+    public void testConfigurationPrimitive() {
+        ServiceReference ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance.getInstanceName());
+        assertNotNull("Test check service availability", ref);
+        CheckService check = (CheckService) context.getService(ref);
+        Properties props = check.getProps();
+        
+        Byte b = (Byte) props.get("b");
+        Short s = (Short) props.get("s");
+        Integer i = (Integer) props.get("i");
+        Long l = (Long) props.get("l");
+        Double d = (Double) props.get("d");
+        Float f = (Float) props.get("f");
+        Character c = (Character) props.get("c");
+        Boolean bool = (Boolean) props.get("bool");
+                
+        assertEquals("Check b", b, new Byte("1"));
+        assertEquals("Check s", s, new Short("1"));
+        assertEquals("Check i", i, new Integer("1"));
+        assertEquals("Check l", l, new Long("1"));
+        assertEquals("Check d", d, new Double("1"));
+        assertEquals("Check f", f, new Float("1"));
+        assertEquals("Check c", c, new Character('a'));
+        assertEquals("Check bool", bool, new Boolean("true"));
+        
+        Integer upb = (Integer) props.get("upb");
+        Integer ups = (Integer) props.get("ups");
+        Integer upi = (Integer) props.get("upi");
+        Integer upl = (Integer) props.get("upl");
+        Integer upd = (Integer) props.get("upd");
+        Integer upf = (Integer) props.get("upf");
+        Integer upc = (Integer) props.get("upc");
+        Integer upbool = (Integer) props.get("upbool");
+        
+        assertEquals("Check upb", upb, new Integer(1));
+        assertEquals("Check ups", ups, new Integer(1));
+        assertEquals("Check upi", upi, new Integer(1));
+        assertEquals("Check upl", upl, new Integer(1));
+        assertEquals("Check upd", upd, new Integer(1));
+        assertEquals("Check upf", upf, new Integer(1));
+        assertEquals("Check upc", upc, new Integer(1));
+        assertEquals("Check upbool", upbool, new Integer(1));
+        
+        reconfigure();
+        
+        ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance.getInstanceName());
+        assertNotNull("Test check service availability", ref);
+        check = (CheckService) context.getService(ref);
+        props = check.getProps();
+        
+        b = (Byte) props.get("b");
+        s = (Short) props.get("s");
+        i = (Integer) props.get("i");
+        l = (Long) props.get("l");
+        d = (Double) props.get("d");
+        f = (Float) props.get("f");
+        c = (Character) props.get("c");
+        bool = (Boolean) props.get("bool");
+        
+        assertEquals("2) Check b ("+b+")", b, new Byte("2"));
+        assertEquals("2) Check s", s, new Short("2"));
+        assertEquals("2) Check i", i, new Integer("2"));
+        assertEquals("2) Check l", l, new Long("2"));
+        assertEquals("2) Check d", d, new Double("2"));
+        assertEquals("2) Check f", f, new Float("2"));
+        assertEquals("2) Check c", c, new Character('b'));
+        assertEquals("2) Check bool", bool, new Boolean("false"));
+        
+        upb = (Integer) props.get("upb");
+        ups = (Integer) props.get("ups");
+        upi = (Integer) props.get("upi");
+        upl = (Integer) props.get("upl");
+        upd = (Integer) props.get("upd");
+        upf = (Integer) props.get("upf");
+        upc = (Integer) props.get("upc");
+        upbool = (Integer) props.get("upbool");
+        
+        assertEquals("2) Check upb", upb, new Integer(2));
+        assertEquals("2) Check ups", ups, new Integer(2));
+        assertEquals("2) Check upi", upi, new Integer(2));
+        assertEquals("2) Check upl", upl, new Integer(2));
+        assertEquals("2) Check upd", upd, new Integer(2));
+        assertEquals("2) Check upf", upf, new Integer(2));
+        assertEquals("2) Check upc", upc, new Integer(2));
+        assertEquals("2) Check upbool", upbool, new Integer(2));
+        
+    }
+    
+    public void testConfigurationPrimitiveArrays() {
+        ServiceReference ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance.getInstanceName());
+        assertNotNull("Test check service availability", ref);
+        CheckService check = (CheckService) context.getService(ref);
+        Properties props = check.getProps();
+        
+        byte[] b = (byte[]) props.get("bs");
+        short[] s = (short[]) props.get("ss");
+        int[] i = (int[]) props.get("is");
+        long[] l = (long[]) props.get("ls");
+        double[] d = (double[]) props.get("ds");
+        float[] f = (float[]) props.get("fs");
+        char[] c = (char[]) props.get("cs");
+        boolean[] bool = (boolean[]) props.get("bools");
+                
+        assertEquals("Check b 0", b[0], 1);
+        assertEquals("Check b 1", b[1], 2);
+        assertEquals("Check b 2", b[2], 3);
+        assertEquals("Check s 0", s[0], 1);
+        assertEquals("Check s 1", s[1], 2);
+        assertEquals("Check s 2", s[2], 3);
+        assertEquals("Check i 0", i[0], 1);
+        assertEquals("Check i 1", i[1], 2);
+        assertEquals("Check i 2", i[2], 3);
+        assertEquals("Check l 0", l[0], 1);
+        assertEquals("Check l 1", l[1], 2);
+        assertEquals("Check l 2", l[2], 3);
+        assertEquals("Check d 0", d[0], 1);
+        assertEquals("Check d 1", d[1], 2);
+        assertEquals("Check d 2", d[2], 3);
+        assertEquals("Check f 0", f[0], 1);
+        assertEquals("Check f 1", f[1], 2);
+        assertEquals("Check f 2", f[2], 3);
+        assertEquals("Check c 0", c[0], 'a');
+        assertEquals("Check c 1", c[1], 'b');
+        assertEquals("Check c 2", c[2], 'c');
+        assertTrue("Check bool 0", bool[0]);
+        assertTrue("Check bool 1", bool[0]);
+        assertTrue("Check bool 2", bool[0]);
+        
+        Integer upb = (Integer) props.get("upbs");
+        Integer ups = (Integer) props.get("upss");
+        Integer upi = (Integer) props.get("upis");
+        Integer upl = (Integer) props.get("upls");
+        Integer upd = (Integer) props.get("upds");
+        Integer upf = (Integer) props.get("upfs");
+        Integer upc = (Integer) props.get("upcs");
+        Integer upbool = (Integer) props.get("upbools");
+        
+        assertEquals("Check upb", upb, new Integer(1));
+        assertEquals("Check ups", ups, new Integer(1));
+        assertEquals("Check upi", upi, new Integer(1));
+        assertEquals("Check upl", upl, new Integer(1));
+        assertEquals("Check upd", upd, new Integer(1));
+        assertEquals("Check upf", upf, new Integer(1));
+        assertEquals("Check upc", upc, new Integer(1));
+        assertEquals("Check upbool", upbool, new Integer(1));
+        
+        reconfigure();
+        
+        ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance.getInstanceName());
+        assertNotNull("Test check service availability", ref);
+        check = (CheckService) context.getService(ref);
+        props = check.getProps();
+        
+        b = (byte[]) props.get("bs");
+        s = (short[]) props.get("ss");
+        i = (int[]) props.get("is");
+        l = (long[]) props.get("ls");
+        d = (double[]) props.get("ds");
+        f = (float[]) props.get("fs");
+        c = (char[]) props.get("cs");
+        bool = (boolean[]) props.get("bools");
+        
+        assertEquals("2) Check b 0", b[0], 3);
+        assertEquals("2) Check b 1", b[1], 2);
+        assertEquals("2) Check b 2", b[2], 1);
+        assertEquals("2) Check s 0", s[0], 3);
+        assertEquals("2) Check s 1", s[1], 2);
+        assertEquals("2) Check s 2", s[2], 1);
+        assertEquals("2) Check i 0", i[0], 3);
+        assertEquals("2) Check i 1", i[1], 2);
+        assertEquals("2) Check i 2", i[2], 1);
+        assertEquals("2) Check l 0", l[0], 3);
+        assertEquals("2) Check l 1", l[1], 2);
+        assertEquals("2) Check l 2", l[2], 1);
+        assertEquals("2) Check d 0", d[0], 3);
+        assertEquals("2) Check d 1", d[1], 2);
+        assertEquals("2) Check d 2", d[2], 1);
+        assertEquals("2) Check f 0", f[0], 3);
+        assertEquals("2) Check f 1", f[1], 2);
+        assertEquals("2) Check f 2", f[2], 1);
+        assertEquals("2) Check c 0", c[0], 'c');
+        assertEquals("2) Check c 1", c[1], 'b');
+        assertEquals("2) Check c 2", c[2], 'a');
+        assertFalse("2) Check bool 0", bool[0]);
+        assertFalse("2) Check bool 1", bool[0]);
+        assertFalse("2) Check bool 2", bool[0]);
+        
+        upb = (Integer) props.get("upbs");
+        ups = (Integer) props.get("upss");
+        upi = (Integer) props.get("upis");
+        upl = (Integer) props.get("upls");
+        upd = (Integer) props.get("upds");
+        upf = (Integer) props.get("upfs");
+        upc = (Integer) props.get("upcs");
+        upbool = (Integer) props.get("upbools");
+        
+        assertEquals("2) Check upb", upb, new Integer(2));
+        assertEquals("2) Check ups", ups, new Integer(2));
+        assertEquals("2) Check upi", upi, new Integer(2));
+        assertEquals("2) Check upl", upl, new Integer(2));
+        assertEquals("2) Check upd", upd, new Integer(2));
+        assertEquals("2) Check upf", upf, new Integer(2));
+        assertEquals("2) Check upc", upc, new Integer(2));
+        assertEquals("2) Check upbool", upbool, new Integer(2));
+        
+    }
+    
+    public void testConfigurationObj() {
+        ServiceReference ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance.getInstanceName());
+        assertNotNull("Test check service availability", ref);
+        CheckService check = (CheckService) context.getService(ref);
+        Properties props = check.getProps();
+        
+        String s = (String) props.get("string");
+        String[] ss = (String[]) props.get("strings");
+                
+        assertEquals("Check string", s, "foo");
+        assertEquals("Check strings 0", ss[0], "foo");
+        assertEquals("Check strings 1", ss[1], "bar");
+        assertEquals("Check strings 2", ss[2], "baz");
+        
+        Integer upString = (Integer) props.get("upstring");
+        Integer upStrings = (Integer) props.get("upstrings");
+        
+        assertEquals("Check upString", upString, new Integer(1));
+        assertEquals("Check upStrings", upStrings, new Integer(1));
+        
+        reconfigure();
+        
+        ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance.getInstanceName());
+        assertNotNull("Test check service availability", ref);
+        check = (CheckService) context.getService(ref);
+        props = check.getProps();
+        
+        s = (String) props.get("string");
+        ss = (String[]) props.get("strings");
+                
+        assertEquals("2) Check string", s, "bar");
+        assertEquals("2) Check strings 0", ss[0], "baz");
+        assertEquals("2) Check strings 1", ss[1], "bar");
+        assertEquals("2) Check strings 2", ss[2], "foo");
+        
+        upString = (Integer) props.get("upstring");
+        upStrings = (Integer) props.get("upstrings");
+        
+        assertEquals("2) Check upString", upString, new Integer(2));
+        assertEquals("2) Check upStrings", upStrings, new Integer(2));
+    }
+    
+    private void reconfigure() {
+        Properties props2 = new Properties();
+        props2.put("name", "under-test");
+        props2.put("b", new Byte("2"));
+        props2.put("s", new Short("2"));
+        props2.put("i", new Integer("2"));
+        props2.put("l", new Long("2"));
+        props2.put("d", new Double("2"));
+        props2.put("f", new Float("2"));
+        props2.put("c", new Character('b'));
+        props2.put("bool", new Boolean(false));
+        props2.put("bs", new byte[]{(byte)3,(byte)2,(byte)1});
+        props2.put("ss", new short[]{(short)3,(short)2,(short)1});
+        props2.put("is", new int[]{3,2,1});
+        props2.put("ls", new long[]{3,2,1});
+        props2.put("ds", new double[]{3,2,1});
+        props2.put("fs", new float[]{3,2,1});
+        props2.put("cs", new char[]{'c','b','a'});
+        props2.put("bools", new boolean[]{false,false,false});
+        props2.put("string", "bar");
+        props2.put("strings", new String[]{"baz", "bar", "foo"});
+        
+        instance.reconfigure(props2);
+    }
+
+}

Added: felix/sandbox/clement/Tests/Suite/src/main/java/org/apache/felix/ipojo/test/scenarios/controller/ImmediateLifeCycleControllerTest.java
URL: http://svn.apache.org/viewvc/felix/sandbox/clement/Tests/Suite/src/main/java/org/apache/felix/ipojo/test/scenarios/controller/ImmediateLifeCycleControllerTest.java?rev=579291&view=auto
==============================================================================
--- felix/sandbox/clement/Tests/Suite/src/main/java/org/apache/felix/ipojo/test/scenarios/controller/ImmediateLifeCycleControllerTest.java (added)
+++ felix/sandbox/clement/Tests/Suite/src/main/java/org/apache/felix/ipojo/test/scenarios/controller/ImmediateLifeCycleControllerTest.java Tue Sep 25 08:06:53 2007
@@ -0,0 +1,103 @@
+package org.apache.felix.ipojo.test.scenarios.controller;
+
+import java.util.Properties;
+
+import org.apache.felix.ipojo.ComponentInstance;
+import org.apache.felix.ipojo.Factory;
+import org.apache.felix.ipojo.test.scenarios.service.CheckService;
+import org.apache.felix.ipojo.test.scenarios.util.Utils;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.ServiceReference;
+
+import fr.imag.adele.escoffier.utf.framework.TestCase;
+
+public class ImmediateLifeCycleControllerTest extends TestCase {
+    
+    private ComponentInstance under;
+    private Factory factory;
+
+    public ImmediateLifeCycleControllerTest(BundleContext bc) {
+        super(bc);
+    }
+    
+    public void setUp() {
+        factory = Utils.getFactoryByName(context, "lcTest2");
+    }
+    
+    public void testOne() {
+        Properties props = new Properties();
+        props.put("conf", "foo");
+        props.put("name", "under");
+        under = Utils.getComponentInstance(context, "lcTest2", props);
+        
+        // The conf is correct, the PS must be provided
+        ServiceReference ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), "under");
+        assertNotNull("Check service availability -1", ref);
+        CheckService cs = (CheckService) context.getService(ref);
+        assertTrue("Check state 1", cs.check());
+        context.ungetService(ref);
+        cs = null;
+        
+        // Reconfigure the instance with a bad configuration
+        props.put("conf", "bar"); // Bar is a bad conf
+        try {
+            factory.reconfigure(props);
+        } catch(Exception e) {
+            fail("The reconfiguration is not unacceptable and seems unacceptable : " + props);
+        }
+        
+        // The instance should now be invalid 
+        ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), "under");
+        assertNull("Check service availability -2", ref);
+        
+        // Reconfigure the instance with a valid configuration
+        props.put("conf", "foo"); // Bar is a bad conf
+        try {
+            factory.reconfigure(props);
+        } catch(Exception e) {
+            fail("The reconfiguration is not unacceptable and seems unacceptable (2) : " + props);
+        }
+        
+        ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), "under");
+        assertNotNull("Check service availability -3", ref);
+        cs = (CheckService) context.getService(ref);
+        assertTrue("Check state 2", cs.check());
+        context.ungetService(ref);
+        cs = null;
+        
+        under.dispose();
+    }
+    
+    public void testTwo() {        
+        Properties props = new Properties();
+        props.put("conf", "bar");
+        props.put("name", "under");
+        under = Utils.getComponentInstance(context, "lcTest2", props);    
+        
+        assertEquals("check under state", under.getState(), ComponentInstance.INVALID);
+        
+        // The conf is incorrect, the PS must not be provided
+        ServiceReference ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), "under");
+        assertNull("Check service availability -1", ref);
+        
+        // Reconfigure the instance with a correct configuration
+        props.put("conf", "foo");
+        try {
+            factory.reconfigure(props);
+        } catch(Exception e) {
+            fail("The reconfiguration is not unacceptable and seems unacceptable : " + props);
+        }
+        
+        ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), "under");
+        assertNotNull("Check service availability -2", ref);
+        CheckService cs = (CheckService) context.getService(ref);
+        assertTrue("Check state ", cs.check());
+        context.ungetService(ref);
+        cs = null;
+        
+        under.dispose();
+    }
+    
+    
+
+}

Added: felix/sandbox/clement/Tests/Suite/src/main/java/org/apache/felix/ipojo/test/scenarios/controller/LifeCycleControllerTest.java
URL: http://svn.apache.org/viewvc/felix/sandbox/clement/Tests/Suite/src/main/java/org/apache/felix/ipojo/test/scenarios/controller/LifeCycleControllerTest.java?rev=579291&view=auto
==============================================================================
--- felix/sandbox/clement/Tests/Suite/src/main/java/org/apache/felix/ipojo/test/scenarios/controller/LifeCycleControllerTest.java (added)
+++ felix/sandbox/clement/Tests/Suite/src/main/java/org/apache/felix/ipojo/test/scenarios/controller/LifeCycleControllerTest.java Tue Sep 25 08:06:53 2007
@@ -0,0 +1,108 @@
+package org.apache.felix.ipojo.test.scenarios.controller;
+
+import java.util.Properties;
+
+import org.apache.felix.ipojo.ComponentInstance;
+import org.apache.felix.ipojo.Factory;
+import org.apache.felix.ipojo.test.scenarios.service.CheckService;
+import org.apache.felix.ipojo.test.scenarios.util.Utils;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.ServiceReference;
+
+import fr.imag.adele.escoffier.utf.framework.TestCase;
+
+public class LifeCycleControllerTest extends TestCase {
+    
+    private ComponentInstance under;
+    private Factory factory;
+
+    public LifeCycleControllerTest(BundleContext bc) {
+        super(bc);
+    }
+    
+    public void setUp() {
+        factory = Utils.getFactoryByName(context, "lcTest");
+    }
+    
+    public void testOne() {
+        Properties props = new Properties();
+        props.put("conf", "foo");
+        props.put("name", "under");
+        under = Utils.getComponentInstance(context, "lcTest", props);
+        
+        // The conf is correct, the PS must be provided
+        ServiceReference ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), "under");
+        assertNotNull("Check service availability -1", ref);
+        CheckService cs = (CheckService) context.getService(ref);
+        assertTrue("Check state 1", cs.check());
+        context.ungetService(ref);
+        cs = null;
+        
+        // Reconfigure the instance with a bad configuration
+        props.put("conf", "bar"); // Bar is a bad conf
+        try {
+            factory.reconfigure(props);
+        } catch(Exception e) {
+            fail("The reconfiguration is not unacceptable and seems unacceptable : " + props);
+        }
+        
+        // The instance should now be invalid 
+        ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), "under");
+        assertNull("Check service availability -2", ref);
+        
+        // Reconfigure the instance with a valid configuration
+        props.put("conf", "foo"); // Bar is a bad conf
+        try {
+            factory.reconfigure(props);
+        } catch(Exception e) {
+            fail("The reconfiguration is not unacceptable and seems unacceptable (2) : " + props);
+        }
+        
+        ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), "under");
+        assertNotNull("Check service availability -3", ref);
+        cs = (CheckService) context.getService(ref);
+        assertTrue("Check state 2", cs.check());
+        context.ungetService(ref);
+        cs = null;
+        
+        under.dispose();
+    }
+    
+    public void testTwo() {
+        Properties props = new Properties();
+        props.put("conf", "bar");
+        props.put("name", "under");
+        under = Utils.getComponentInstance(context, "lcTest", props);
+        
+        // The conf is incorrect, but the test can appears only when the object is created : the PS must be provided
+        ServiceReference ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), "under");
+        assertNotNull("Check service availability -1", ref);
+        
+        CheckService cs = (CheckService) context.getService(ref);
+        assertFalse("Check state (false)", cs.check());
+        
+        // As soon as the instance is created, the service has to disappear :
+        ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), "under");
+        assertNull("Check service availability -2", ref);
+        
+        // Reconfigure the instance with a correct configuration
+        props.put("conf", "foo");
+        try {
+            factory.reconfigure(props);
+        } catch(Exception e) {
+            fail("The reconfiguration is not unacceptable and seems unacceptable : " + props);
+        }
+        
+        ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), "under");
+        assertNotNull("Check service availability -3", ref);
+        cs = (CheckService) context.getService(ref);
+        assertTrue("Check state ", cs.check());
+        context.ungetService(ref);
+        cs = null;
+        
+        under.dispose();
+    }
+    
+    
+
+}

Added: felix/sandbox/clement/Tests/Suite/src/main/java/org/apache/felix/ipojo/test/scenarios/controller/LifeCycleControllerTestSuite.java
URL: http://svn.apache.org/viewvc/felix/sandbox/clement/Tests/Suite/src/main/java/org/apache/felix/ipojo/test/scenarios/controller/LifeCycleControllerTestSuite.java?rev=579291&view=auto
==============================================================================
--- felix/sandbox/clement/Tests/Suite/src/main/java/org/apache/felix/ipojo/test/scenarios/controller/LifeCycleControllerTestSuite.java (added)
+++ felix/sandbox/clement/Tests/Suite/src/main/java/org/apache/felix/ipojo/test/scenarios/controller/LifeCycleControllerTestSuite.java Tue Sep 25 08:06:53 2007
@@ -0,0 +1,23 @@
+package org.apache.felix.ipojo.test.scenarios.controller;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.osgi.framework.BundleContext;
+
+import fr.imag.adele.escoffier.utf.framework.TestSuite;
+
+public class LifeCycleControllerTestSuite extends TestSuite {
+
+    public LifeCycleControllerTestSuite(BundleContext bc) {
+        super(bc);
+    }
+
+    public List suite() {
+        List list = new ArrayList();
+        list.add(new LifeCycleControllerTest(context));
+        list.add(new ImmediateLifeCycleControllerTest(context));
+        return list;
+    }
+
+}

Added: felix/sandbox/clement/Tests/Suite/src/main/java/org/apache/felix/ipojo/test/scenarios/core/ComponentDesc.java
URL: http://svn.apache.org/viewvc/felix/sandbox/clement/Tests/Suite/src/main/java/org/apache/felix/ipojo/test/scenarios/core/ComponentDesc.java?rev=579291&view=auto
==============================================================================
--- felix/sandbox/clement/Tests/Suite/src/main/java/org/apache/felix/ipojo/test/scenarios/core/ComponentDesc.java (added)
+++ felix/sandbox/clement/Tests/Suite/src/main/java/org/apache/felix/ipojo/test/scenarios/core/ComponentDesc.java Tue Sep 25 08:06:53 2007
@@ -0,0 +1,332 @@
+package org.apache.felix.ipojo.test.scenarios.core;
+
+import org.apache.felix.ipojo.Factory;
+import org.apache.felix.ipojo.architecture.ComponentDescription;
+import org.apache.felix.ipojo.architecture.PropertyDescription;
+import org.apache.felix.ipojo.metadata.Element;
+import org.apache.felix.ipojo.test.scenarios.service.BarService;
+import org.apache.felix.ipojo.test.scenarios.service.FooService;
+import org.apache.felix.ipojo.test.scenarios.util.Utils;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.ServiceReference;
+
+import fr.imag.adele.escoffier.utf.framework.TestCase;
+
+public class ComponentDesc extends TestCase {
+	
+	ServiceReference sr_fooProvider1;
+	ServiceReference sr_fooProvider2;
+	ServiceReference sr_fooProviderDyn2;
+	ServiceReference sr_fooProvider3;
+	ServiceReference sr_foobarProvider;
+//	ServiceReference sr_simple;
+//	ServiceReference sr_optional;
+//	ServiceReference sr_multiple;
+//	ServiceReference sr_multiple_optional;
+	
+	Factory fooProvider1;
+	Factory fooProvider2;
+	Factory fooProviderDyn2;
+	Factory fooProvider3;
+	Factory foobarProvider;
+//	Factory simple;
+//	Factory optional;
+//	Factory multiple;
+//	Factory multiple_optional;
+	
+	public ComponentDesc(BundleContext bc) { super(bc); }
+	
+	public void setUp() {
+		sr_fooProvider1 = Utils.getServiceReferenceByName(context, Factory.class.getName(), "FooProviderType-1");
+		sr_fooProvider2 = Utils.getServiceReferenceByName(context, Factory.class.getName(), "FooProviderType-2");
+		sr_fooProviderDyn2 = Utils.getServiceReferenceByName(context, Factory.class.getName(), "FooProviderType-Dyn2");
+		sr_fooProvider3 = Utils.getServiceReferenceByName(context, Factory.class.getName(), "FooProviderType-3");
+		sr_foobarProvider = Utils.getServiceReferenceByName(context, Factory.class.getName(), "FooBarProviderType-1");
+//		sr_simple = Utils.getServiceReferenceByName(context, Factory.class.getName(), "SimpleCheckServiceProvider");
+//		sr_optional = Utils.getServiceReferenceByName(context, Factory.class.getName(), "SimpleOptionalCheckServiceProvider");
+//		sr_multiple = Utils.getServiceReferenceByName(context, Factory.class.getName(), "SimpleMultipleCheckServiceProvider");
+//		sr_multiple_optional = Utils.getServiceReferenceByName(context, Factory.class.getName(), "SimpleOptionalMultipleCheckServiceProvider");
+		
+		fooProvider1 = (Factory) context.getService(sr_fooProvider1);
+		fooProvider2 = (Factory) context.getService(sr_fooProvider2);
+		fooProviderDyn2 = (Factory) context.getService(sr_fooProviderDyn2);
+		fooProvider3 = (Factory) context.getService(sr_fooProvider3);
+		foobarProvider = (Factory) context.getService(sr_foobarProvider);
+//		simple = (Factory) context.getService(sr_simple);
+//		optional = (Factory) context.getService(sr_optional);
+//		multiple = (Factory) context.getService(sr_multiple);
+//		multiple_optional = (Factory) context.getService(sr_multiple_optional);
+		
+	}
+	
+	public void tearDown() {
+		fooProvider1 = null;
+		fooProvider2 = null;
+		fooProviderDyn2 = null;
+		fooProvider3 = null;
+		foobarProvider = null;
+//		simple = null;
+//		multiple = null;
+//		optional = null;
+//		multiple_optional = null;
+		
+		context.ungetService(sr_fooProvider1);
+		context.ungetService(sr_fooProvider2);
+		context.ungetService(sr_fooProviderDyn2);
+		context.ungetService(sr_fooProvider3);
+		context.ungetService(sr_foobarProvider);
+//		context.ungetService(sr_simple);
+//		context.ungetService(sr_optional);
+//		context.ungetService(sr_multiple);
+//		context.ungetService(sr_multiple_optional);
+	}
+	
+	public void testFooProvider1() {
+		// Test SR properties
+		String impl = (String) sr_fooProvider1.getProperty("component.class");
+		assertEquals("Check component.class", impl, "org.apache.felix.ipojo.test.scenarios.component.FooProviderType1");
+		
+		String[] specs = (String[]) sr_fooProvider1.getProperty("component.providedServiceSpecifications");
+		assertEquals("Check component.providedServiceSpecifications length", specs.length, 1);
+		assertEquals("Check component.providedServiceSpecifications", FooService.class.getName(), specs[0]);
+		
+		PropertyDescription[] pd = (PropertyDescription[]) sr_fooProvider1.getProperty("component.properties");
+		assertEquals("Check component.properties length", pd.length, 0);
+		
+		// Test factory
+		assertEquals("Check factory name", fooProvider1.getName(), "FooProviderType-1");
+		Element cd = fooProvider1.getDescription();
+		
+		assertEquals("Check implementation class ", cd.getAttribute("implementation-class"), impl);
+		
+		Element[] specs2 = cd.getElements("provides");
+		assertEquals("Check specs length", specs2.length, 1);
+		assertEquals("Check specs", FooService.class.getName(), specs2[0].getAttribute("specification"));
+		
+		Element[] pd2 = cd.getElements("property");
+		assertEquals("Check props length", pd2.length, 0);
+		
+		// Check Description equality
+		ComponentDescription desc = (ComponentDescription) sr_fooProvider1.getProperty("component.description");
+		String str_desc = (String) sr_fooProvider1.getProperty("component.desc");
+		assertEquals("check description equality 1", desc.toString(), str_desc);
+		assertEquals("check description equality 2", cd.toString(), str_desc);
+	}
+	
+	public void testFooProvider2() {
+		// Test SR properties
+		String impl = (String) sr_fooProvider2.getProperty("component.class");
+		assertEquals("Check component.class", impl, "org.apache.felix.ipojo.test.scenarios.component.FooProviderType1");
+		
+		String[] specs = (String[]) sr_fooProvider2.getProperty("component.providedServiceSpecifications");
+		assertEquals("Check component.providedServiceSpecifications length", specs.length, 1);
+		assertEquals("Check component.providedServiceSpecifications", FooService.class.getName(), specs[0]);
+		
+		PropertyDescription[] pd = (PropertyDescription[]) sr_fooProvider2.getProperty("component.properties");
+		assertEquals("Check component.properties length", pd.length, 5);
+		
+		assertEquals("Check component.properties name [" + 0 + "]", "int", pd[0].getName());
+		assertEquals("Check component.properties type [" + 0 + "]", "int", pd[0].getType());
+		assertEquals("Check component.properties value [" + 0 + "]", "2", pd[0].getValue());
+		
+		assertEquals("Check component.properties name [" + 1 + "]", "long", pd[1].getName());
+		assertEquals("Check component.properties type [" + 1 + "]", "long", pd[1].getType());
+		assertEquals("Check component.properties value [" + 1 + "]", "40", pd[1].getValue());
+		
+		assertEquals("Check component.properties name [" + 2 + "]", "string", pd[2].getName());
+		assertEquals("Check component.properties type [" + 2 + "]", "java.lang.String", pd[2].getType());
+		assertEquals("Check component.properties value [" + 2 + "]", "foo", pd[2].getValue());
+		
+		assertEquals("Check component.properties name [" + 3 + "]", "strAProp", pd[3].getName());
+		assertEquals("Check component.properties type [" + 3 + "]", "java.lang.String[]", pd[3].getType());
+		
+		assertEquals("Check component.properties name [" + 4 + "]", "intAProp", pd[4].getName());
+		assertEquals("Check component.properties type [" + 4 + "]", "int[]", pd[4].getType());
+		
+		// Test factory
+		assertEquals("Check factory name", fooProvider2.getName(), "FooProviderType-2");
+		Element cd = fooProvider2.getDescription();
+        
+        assertEquals("Check implementation class ", cd.getAttribute("implementation-class"), impl);
+		
+        Element[] specs2 = cd.getElements("provides");
+        assertEquals("Check specs length", specs2.length, 1);
+        assertEquals("Check specs", FooService.class.getName(), specs2[0].getAttribute("specification"));
+		
+        Element[] pd2 = cd.getElements("property");
+		assertEquals("Check props length", pd2.length, 5);
+		
+		assertEquals("Check component.properties name [" + 0 + "]", "int", pd2[0].getAttribute("name"));
+		assertEquals("Check component.properties type [" + 0 + "]", "int", pd2[0].getAttribute("type"));
+		assertEquals("Check component.properties value [" + 0 + "]", "2", pd2[0].getAttribute("value"));
+		
+		assertEquals("Check component.properties name [" + 1 + "]", "long", pd2[1].getAttribute("name"));
+		assertEquals("Check component.properties type [" + 1 + "]", "long", pd2[1].getAttribute("type"));
+		assertEquals("Check component.properties value [" + 1 + "]", "40", pd2[1].getAttribute("value"));
+		
+		assertEquals("Check component.properties name [" + 2 + "]", "string", pd2[2].getAttribute("name"));
+		assertEquals("Check component.properties type [" + 2 + "]", "java.lang.String", pd2[2].getAttribute("type"));
+		assertEquals("Check component.properties value [" + 2 + "]", "foo", pd2[2].getAttribute("value"));
+		
+		assertEquals("Check component.properties name [" + 3 + "]", "strAProp", pd2[3].getAttribute("name"));
+		assertEquals("Check component.properties type [" + 3 + "]", "java.lang.String[]", pd2[3].getAttribute("type"));
+		
+		assertEquals("Check component.properties name [" + 4 + "]", "intAProp", pd2[4].getAttribute("name"));
+		assertEquals("Check component.properties type [" + 4 + "]", "int[]", pd2[4].getAttribute("type"));
+		
+		// Check Description equality
+		ComponentDescription desc = (ComponentDescription) sr_fooProvider2.getProperty("component.description");
+		String str_desc = (String) sr_fooProvider2.getProperty("component.desc");
+		assertEquals("check description equality 1", desc.toString(), str_desc);
+		assertEquals("check description equality 2", cd.toString(), str_desc);
+	}
+	
+	public void testFooProviderDyn2() {
+		// Test SR properties
+		String impl = (String) sr_fooProviderDyn2.getProperty("component.class");
+		assertEquals("Check component.class", impl, "org.apache.felix.ipojo.test.scenarios.component.FooProviderTypeDyn2");
+		
+		String[] specs = (String[]) sr_fooProviderDyn2.getProperty("component.providedServiceSpecifications");
+		assertEquals("Check component.providedServiceSpecifications length", specs.length, 1);
+		assertEquals("Check component.providedServiceSpecifications", FooService.class.getName(), specs[0]);
+		
+		PropertyDescription[] pd = (PropertyDescription[]) sr_fooProviderDyn2.getProperty("component.properties");
+		assertEquals("Check component.properties length", pd.length, 5);
+		
+		assertEquals("Check component.properties name [" + 0 + "]", "int", pd[0].getName());
+		assertEquals("Check component.properties type [" + 0 + "]", "int", pd[0].getType());
+		assertEquals("Check component.properties value [" + 0 + "]", "4", pd[0].getValue());
+		
+		assertEquals("Check component.properties name [" + 1 + "]", "boolean", pd[1].getName());
+		assertEquals("Check component.properties type [" + 1 + "]", "boolean", pd[1].getType());
+		
+		assertEquals("Check component.properties name [" + 2 + "]", "string", pd[2].getName());
+		assertEquals("Check component.properties type [" + 2 + "]", "java.lang.String", pd[2].getType());
+		
+		assertEquals("Check component.properties name [" + 3 + "]", "strAProp", pd[3].getName());
+		assertEquals("Check component.properties type [" + 3 + "]", "java.lang.String[]", pd[3].getType());
+		
+		assertEquals("Check component.properties name [" + 4 + "]", "intAProp", pd[4].getName());
+		assertEquals("Check component.properties type [" + 4 + "]", "int[]", pd[4].getType());
+		
+		// Test factory
+		assertEquals("Check factory name", fooProviderDyn2.getName(), "FooProviderType-Dyn2");
+		Element cd = fooProviderDyn2.getDescription();
+		
+        assertEquals("Check implementation class ", cd.getAttribute("implementation-class"), impl);
+        
+        Element[] specs2 = cd.getElements("provides");
+        assertEquals("Check specs length", specs2.length, 1);
+        assertEquals("Check specs", FooService.class.getName(), specs2[0].getAttribute("specification"));
+        
+        Element[] pd2 = cd.getElements("property");
+        assertEquals("Check props length", pd2.length, 5);
+		
+		assertEquals("Check component.properties name [" + 0 + "]", "int", pd2[0].getAttribute("name"));
+		assertEquals("Check component.properties type [" + 0 + "]", "int", pd2[0].getAttribute("type"));
+		assertEquals("Check component.properties value [" + 0 + "]", "4", pd2[0].getAttribute("value"));
+		
+		assertEquals("Check component.properties name [" + 1 + "]", "boolean", pd2[1].getAttribute("name"));
+		assertEquals("Check component.properties type [" + 1 + "]", "boolean", pd2[1].getAttribute("type"));
+		
+		assertEquals("Check component.properties name [" + 2 + "]", "string", pd2[2].getAttribute("name"));
+		assertEquals("Check component.properties type [" + 2 + "]", "java.lang.String", pd2[2].getAttribute("type"));
+		
+		assertEquals("Check component.properties name [" + 3 + "]", "strAProp", pd2[3].getAttribute("name"));
+		assertEquals("Check component.properties type [" + 3 + "]", "java.lang.String[]", pd2[3].getAttribute("type"));
+		
+		assertEquals("Check component.properties name [" + 4 + "]", "intAProp", pd2[4].getAttribute("name"));
+		assertEquals("Check component.properties type [" + 4 + "]", "int[]", pd2[4].getAttribute("type"));
+		
+		// Check Description equality
+		ComponentDescription desc = (ComponentDescription) sr_fooProviderDyn2.getProperty("component.description");
+		String str_desc = (String) sr_fooProviderDyn2.getProperty("component.desc");
+		assertEquals("check description equality 1", desc.toString(), str_desc);
+		assertEquals("check description equality 2", cd.toString(), str_desc);
+	}
+	
+	public void testFooProvider3() {
+		// Test SR properties
+		String impl = (String) sr_fooProvider3.getProperty("component.class");
+		assertEquals("Check component.class", impl, "org.apache.felix.ipojo.test.scenarios.component.FooProviderType1");
+		
+		String[] specs = (String[]) sr_fooProvider3.getProperty("component.providedServiceSpecifications");
+		assertEquals("Check component.providedServiceSpecifications length", specs.length, 1);
+		assertEquals("Check component.providedServiceSpecifications", FooService.class.getName(), specs[0]);
+		
+		PropertyDescription[] pd = (PropertyDescription[]) sr_fooProvider3.getProperty("component.properties");
+		assertEquals("Check component.properties length (" + pd.length +")", pd.length, 3);
+		
+		assertEquals("Check component.properties name [" + 0 + "]", "foo", pd[0].getName());
+		
+		assertEquals("Check component.properties name [" + 1 + "]", "bar", pd[1].getName());
+		
+		assertEquals("Check component.properties name [" + 2 + "]", "baz", pd[2].getName());
+		assertEquals("Check component.properties type [" + 2 + "]", "java.lang.String", pd[2].getType());
+		
+		// Test factory
+		assertEquals("Check factory name", fooProvider3.getName(), "FooProviderType-3");
+		Element cd = fooProvider3.getDescription();
+        
+		assertEquals("Check implementation class ", cd.getAttribute("implementation-class"), impl);
+        
+        Element[] specs2 = cd.getElements("provides");
+        assertEquals("Check specs length", specs2.length, 1);
+        assertEquals("Check specs", FooService.class.getName(), specs2[0].getAttribute("specification"));
+        
+        Element[] pd2 = cd.getElements("property");
+        assertEquals("Check props length", pd2.length, 3);
+		
+		assertEquals("Check component.properties name [" + 0 + "]", "foo", pd2[0].getAttribute("name"));
+		
+		assertEquals("Check component.properties name [" + 1 + "]", "bar", pd2[1].getAttribute("name"));
+		
+		assertEquals("Check component.properties name [" + 2 + "]", "baz", pd2[2].getAttribute("name"));
+		assertEquals("Check component.properties type [" + 2 + "]", "java.lang.String", pd2[2].getAttribute("type"));
+		
+		// Check Description equality
+		ComponentDescription desc = (ComponentDescription) sr_fooProvider3.getProperty("component.description");
+		String str_desc = (String) sr_fooProvider3.getProperty("component.desc");
+		assertEquals("check description equality 1", desc.toString(), str_desc);
+		assertEquals("check description equality 2", cd.toString(), str_desc);
+	}
+	
+	public void testFooBar() {
+		//	Test SR properties
+		String impl = (String) sr_foobarProvider.getProperty("component.class");
+		assertEquals("Check component.class", impl, "org.apache.felix.ipojo.test.scenarios.component.FooBarProviderType1");
+		
+		String[] specs = (String[]) sr_foobarProvider.getProperty("component.providedServiceSpecifications");
+		assertEquals("Check component.providedServiceSpecifications length", specs.length, 2);
+		assertEquals("Check component.providedServiceSpecifications 1", FooService.class.getName(), specs[0]);
+		assertEquals("Check component.providedServiceSpecifications 2", BarService.class.getName(), specs[1]);
+		
+		PropertyDescription[] pd = (PropertyDescription[]) sr_foobarProvider.getProperty("component.properties");
+		assertEquals("Check component.properties length", pd.length, 0);
+		
+		// Test factory
+		assertEquals("Check factory name", foobarProvider.getName(), "FooBarProviderType-1");
+		Element cd = foobarProvider.getDescription();
+		
+        assertEquals("Check implementation class ", cd.getAttribute("implementation-class"), impl);
+		
+        Element[] specs2 = cd.getElements("provides");
+        assertEquals("Check specs length", specs2.length, 2);
+        assertEquals("Check specs", FooService.class.getName(), specs2[0].getAttribute("specification"));
+        assertEquals("Check specs", BarService.class.getName(), specs2[1].getAttribute("specification"));
+        
+        Element[] pd2 = cd.getElements("property");
+        assertEquals("Check props length", pd2.length, 0);
+		
+		// Check Description equality
+		ComponentDescription desc = (ComponentDescription) sr_foobarProvider.getProperty("component.description");
+		String str_desc = (String) sr_foobarProvider.getProperty("component.desc");
+		assertEquals("check description equality 1", desc.toString(), str_desc);
+		assertEquals("check description equality 2", cd.toString(), str_desc);
+
+	}
+	
+	
+	
+
+}

Added: felix/sandbox/clement/Tests/Suite/src/main/java/org/apache/felix/ipojo/test/scenarios/core/CoreTestSuite.java
URL: http://svn.apache.org/viewvc/felix/sandbox/clement/Tests/Suite/src/main/java/org/apache/felix/ipojo/test/scenarios/core/CoreTestSuite.java?rev=579291&view=auto
==============================================================================
--- felix/sandbox/clement/Tests/Suite/src/main/java/org/apache/felix/ipojo/test/scenarios/core/CoreTestSuite.java (added)
+++ felix/sandbox/clement/Tests/Suite/src/main/java/org/apache/felix/ipojo/test/scenarios/core/CoreTestSuite.java Tue Sep 25 08:06:53 2007
@@ -0,0 +1,21 @@
+package org.apache.felix.ipojo.test.scenarios.core;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.osgi.framework.BundleContext;
+
+import fr.imag.adele.escoffier.utf.framework.TestSuite;
+
+public class CoreTestSuite extends TestSuite {
+	
+	public CoreTestSuite(BundleContext bc) { super(bc); }
+	
+	public List suite() {
+		List list = new ArrayList();
+		list.add(new POJOCreation(context));
+		list.add(new ComponentDesc(context));
+		return list;
+	}
+
+}



Mime
View raw message