felix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From clem...@apache.org
Subject svn commit: r615675 [8/21] - in /felix/sandbox/clement/ipojo: ./ annotations/ ant/ arch/ core/ core/src/main/java/org/apache/felix/ipojo/handlers/configuration/ core/src/main/java/org/apache/felix/ipojo/handlers/dependency/ core/src/main/java/org/apach...
Date Sun, 27 Jan 2008 23:21:37 GMT
Added: felix/sandbox/clement/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/component/Baz2CheckProvider.java
URL: http://svn.apache.org/viewvc/felix/sandbox/clement/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/component/Baz2CheckProvider.java?rev=615675&view=auto
==============================================================================
--- felix/sandbox/clement/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/component/Baz2CheckProvider.java (added)
+++ felix/sandbox/clement/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/component/Baz2CheckProvider.java Sun Jan 27 15:21:24 2008
@@ -0,0 +1,63 @@
+package org.apache.felix.ipojo.test.scenarios.component;
+
+import java.util.Properties;
+
+import org.apache.felix.ipojo.test.scenarios.service.BazService;
+import org.apache.felix.ipojo.test.scenarios.service.CheckService;
+import org.apache.felix.ipojo.test.scenarios.service.FooService;
+import org.osgi.framework.ServiceReference;
+
+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/sandbox/clement/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/component/BazProviderType1.java
URL: http://svn.apache.org/viewvc/felix/sandbox/clement/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/component/BazProviderType1.java?rev=615675&view=auto
==============================================================================
--- felix/sandbox/clement/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/component/BazProviderType1.java (added)
+++ felix/sandbox/clement/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/component/BazProviderType1.java Sun Jan 27 15:21:24 2008
@@ -0,0 +1,33 @@
+package org.apache.felix.ipojo.test.scenarios.component;
+
+import java.util.Properties;
+
+import org.apache.felix.ipojo.test.scenarios.service.BazService;
+
+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/sandbox/clement/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/component/CallbackCheckService.java
URL: http://svn.apache.org/viewvc/felix/sandbox/clement/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/component/CallbackCheckService.java?rev=615675&view=auto
==============================================================================
--- felix/sandbox/clement/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/component/CallbackCheckService.java (added)
+++ felix/sandbox/clement/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/component/CallbackCheckService.java Sun Jan 27 15:21:24 2008
@@ -0,0 +1,31 @@
+package org.apache.felix.ipojo.test.scenarios.component;
+
+import java.util.Properties;
+
+import org.apache.felix.ipojo.test.scenarios.service.CheckService;
+import org.apache.felix.ipojo.test.scenarios.service.FooService;
+
+public class CallbackCheckService extends ParentClass implements CheckService {
+
+	int i = 0;
+	FooService fs;
+	
+	private void start() {
+		i++;
+	}
+	
+	protected void stop() {
+		i++;
+	}
+	
+	public boolean check() {
+		return fs.foo();
+	}
+
+	public Properties getProps() {
+		Properties p = new Properties();
+		p.put("int", new Integer(i));
+		return p;
+	}
+
+}

Added: felix/sandbox/clement/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/component/CheckProviderParentClass.java
URL: http://svn.apache.org/viewvc/felix/sandbox/clement/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/component/CheckProviderParentClass.java?rev=615675&view=auto
==============================================================================
--- felix/sandbox/clement/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/component/CheckProviderParentClass.java (added)
+++ felix/sandbox/clement/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/component/CheckProviderParentClass.java Sun Jan 27 15:21:24 2008
@@ -0,0 +1,30 @@
+package org.apache.felix.ipojo.test.scenarios.component;
+
+import org.apache.felix.ipojo.test.scenarios.service.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++; }
+    }
+    
+    public void voidUnbind() {
+        simpleU++;
+    }
+
+}

Added: felix/sandbox/clement/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/component/CheckServiceProvider.java
URL: http://svn.apache.org/viewvc/felix/sandbox/clement/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/component/CheckServiceProvider.java?rev=615675&view=auto
==============================================================================
--- felix/sandbox/clement/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/component/CheckServiceProvider.java (added)
+++ felix/sandbox/clement/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/component/CheckServiceProvider.java Sun Jan 27 15:21:24 2008
@@ -0,0 +1,62 @@
+package org.apache.felix.ipojo.test.scenarios.component;
+
+import java.util.Properties;
+
+import org.apache.felix.ipojo.test.scenarios.service.CheckService;
+import org.apache.felix.ipojo.test.scenarios.service.FooService;
+import org.osgi.framework.ServiceReference;
+
+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("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("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));
+		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()));
+        props.put("static", CheckService.foo);
+        props.put("class", CheckService.class.getName());
+		if(fs.getObject() != null) { props.put("object", fs.getObject()); }
+		return props;
+	}
+	
+	private void voidBind() {
+		simpleB++;
+	}
+	
+	protected void objectBind(FooService o) {
+	    if (o == null) {
+	        System.err.println("Bind receive null !!! ");
+	    }
+		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/sandbox/clement/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/component/ConfigurableCheckServiceProvider.java
URL: http://svn.apache.org/viewvc/felix/sandbox/clement/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/component/ConfigurableCheckServiceProvider.java?rev=615675&view=auto
==============================================================================
--- felix/sandbox/clement/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/component/ConfigurableCheckServiceProvider.java (added)
+++ felix/sandbox/clement/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/component/ConfigurableCheckServiceProvider.java Sun Jan 27 15:21:24 2008
@@ -0,0 +1,184 @@
+package org.apache.felix.ipojo.test.scenarios.component;
+
+import java.util.Properties;
+
+import org.apache.felix.ipojo.test.scenarios.service.CheckService;
+
+public class ConfigurableCheckServiceProvider implements CheckService {
+    
+    // Integer types
+    byte b;
+    short s;
+    int i;
+    long l;
+    
+    // Floatting types
+    double d;
+    float f;
+    
+    // Character
+    char c;
+    
+    // Boolean
+    boolean bool;
+    
+    // Integer arrays 
+    byte[] bs;
+    short[] ss;
+    int[] is;
+    long[] ls;
+    
+    double[] ds;
+    float[] fs;
+    
+    char[] cs;
+    
+    boolean[] bools;
+    
+    String string;
+    String[] strings;
+    
+    int upB, upS, upI, upL, upD, upF, upC, upBool, upBs, upSs, upIs, upLs, upDs, upFs, upCs, upBools, upString, upStrings;
+    
+
+    public boolean check() {
+        return true;
+    }
+
+    public Properties getProps() {
+        Properties props = new Properties();
+        props.put("b", new Byte(b));
+        props.put("s", new Short(s));
+        props.put("i", new Integer(i));
+        props.put("l", new Long(l));
+        props.put("d", new Double(d));
+        props.put("f", new Float(f));
+        props.put("c", new Character(c));
+        props.put("bool", new Boolean(bool));
+        
+        props.put("bs", bs);
+        props.put("ss", ss);
+        props.put("is", is);
+        props.put("ls", ls);
+        props.put("ds", ds);
+        props.put("fs", fs);
+        props.put("cs", cs);
+        props.put("bools", bools);
+        
+        props.put("upb", new Integer(upB));
+        props.put("ups", new Integer(upS));
+        props.put("upi", new Integer(upI));
+        props.put("upl", new Integer(upL));
+        props.put("upd", new Integer(upD));
+        props.put("upf", new Integer(upF));
+        props.put("upc", new Integer(upC));
+        props.put("upbool", new Integer(upBool));
+        
+        props.put("upbs", new Integer(upBs));
+        props.put("upss", new Integer(upSs));
+        props.put("upis", new Integer(upIs));
+        props.put("upls", new Integer(upLs));
+        props.put("upds", new Integer(upDs));
+        props.put("upfs", new Integer(upFs));
+        props.put("upcs", new Integer(upCs));
+        props.put("upbools", new Integer(upBools));
+        
+        props.put("string", string);
+        props.put("strings", strings);
+        props.put("upstring", new Integer(upString));
+        props.put("upstrings", new Integer(upStrings));
+        
+        return props;
+    }
+    
+    public void updateB(byte bb) {
+        b = bb;
+        upB++;
+    }
+    
+    public void updateS(short bb) {
+        s = bb;
+        upS++;
+    }
+    
+    public void updateI(int bb) {
+        i = bb;
+        upI++;
+    }
+    
+    public void updateL(long bb) {
+        l = bb;
+        upL++;
+    }
+    
+    public void updateD(double bb) {
+        d = bb;
+        upD++;
+    }
+    
+    public void updateF(float bb) {
+        f = bb;
+        upF++;
+    }
+    
+    public void updateC(char bb) {
+        c = bb;
+        upC++;
+    }
+    
+    public void updateBool(boolean bb) {
+        bool = bb;
+        upBool++;
+    }
+    
+    public void updateBs(byte[] bb) {
+        bs = bb;
+        upBs++;
+    }
+    
+    public void updateSs(short[] bb) {
+        ss = bb;
+        upSs++;
+    }
+    
+    public void updateIs(int[] bb) {
+        is = bb;
+        upIs++;
+    }
+    
+    public void updateLs(long[] bb) {
+        ls = bb;
+        upLs++;
+    }
+    
+    public void updateDs(double[] bb) {
+        ds = bb;
+        upDs++;
+    }
+    
+    public void updateFs(float[] bb) {
+        fs = bb;
+        upFs++;
+    }
+    
+    public void updateCs(char[] bb) {
+        cs = bb;
+        upCs++;
+    }
+    
+    public void updateBools(boolean[] bb) {
+        bools = bb;
+        upBools++;
+    }
+    
+    public void updateStrings(String[] bb) {
+        strings = bb;
+        upStrings++;
+    }
+    
+    public void updateString(String bb) {
+        string = bb;
+        upString++;
+    }
+
+}

Added: felix/sandbox/clement/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/component/FilterCheckProvider.java
URL: http://svn.apache.org/viewvc/felix/sandbox/clement/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/component/FilterCheckProvider.java?rev=615675&view=auto
==============================================================================
--- felix/sandbox/clement/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/component/FilterCheckProvider.java (added)
+++ felix/sandbox/clement/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/component/FilterCheckProvider.java Sun Jan 27 15:21:24 2008
@@ -0,0 +1,77 @@
+package org.apache.felix.ipojo.test.scenarios.component;
+
+import java.util.Properties;
+
+import org.apache.felix.ipojo.test.scenarios.service.CheckService;
+import org.apache.felix.ipojo.test.scenarios.service.FooService;
+
+public class FilterCheckProvider implements CheckService, FooService {
+
+    private String m_toto;
+    
+    private int bind;
+    
+    private int unbind;
+    
+    public FilterCheckProvider(){
+        m_toto = "A";
+    }
+    
+    public boolean check() {
+        if (m_toto.equals("A")){
+            m_toto="B";
+            return true;
+        } else {
+            m_toto="A";
+            return false;
+        }
+    }
+
+    public Properties getProps() {
+        Properties props = new Properties();
+        props.put("Bind", new Integer(bind-unbind));
+        return null;
+    }
+    
+    private void Bind() {
+        bind++;
+    }
+    private void Unbind() {
+        unbind++;
+    }
+
+    public boolean foo() {
+        return true;
+    }
+
+    public Properties fooProps() {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+    public boolean getBoolean() {
+        // TODO Auto-generated method stub
+        return false;
+    }
+
+    public double getDouble() {
+        // TODO Auto-generated method stub
+        return 0;
+    }
+
+    public int getInt() {
+        // TODO Auto-generated method stub
+        return 0;
+    }
+
+    public long getLong() {
+        // TODO Auto-generated method stub
+        return 0;
+    }
+
+    public Boolean getObject() {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+}

Added: felix/sandbox/clement/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/component/FilterCheckSubscriber.java
URL: http://svn.apache.org/viewvc/felix/sandbox/clement/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/component/FilterCheckSubscriber.java?rev=615675&view=auto
==============================================================================
--- felix/sandbox/clement/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/component/FilterCheckSubscriber.java (added)
+++ felix/sandbox/clement/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/component/FilterCheckSubscriber.java Sun Jan 27 15:21:24 2008
@@ -0,0 +1,37 @@
+package org.apache.felix.ipojo.test.scenarios.component;
+
+import java.util.Properties;
+
+import org.apache.felix.ipojo.Nullable;
+import org.apache.felix.ipojo.test.scenarios.service.CheckService;
+import org.apache.felix.ipojo.test.scenarios.service.FooService;
+
+public class FilterCheckSubscriber implements CheckService {
+    
+    private FooService m_foo;
+    
+    private int binded;
+    
+    public FilterCheckSubscriber(){
+    }
+    
+    public boolean check() {
+        m_foo.foo();
+        return true;
+    }
+
+    public Properties getProps() {
+        Properties props = new Properties();
+        props.put("Bind", new Integer(binded));
+        props.put("Nullable", new Boolean(m_foo instanceof Nullable));
+        return props;
+    }
+    
+    private void Bind() {
+        binded++;
+    }
+    private void Unbind() {
+        binded--;
+    }
+
+}

Added: felix/sandbox/clement/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/component/FooBarProviderType1.java
URL: http://svn.apache.org/viewvc/felix/sandbox/clement/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/component/FooBarProviderType1.java?rev=615675&view=auto
==============================================================================
--- felix/sandbox/clement/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/component/FooBarProviderType1.java (added)
+++ felix/sandbox/clement/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/component/FooBarProviderType1.java Sun Jan 27 15:21:24 2008
@@ -0,0 +1,36 @@
+package org.apache.felix.ipojo.test.scenarios.component;
+
+import java.util.Properties;
+
+import org.apache.felix.ipojo.test.scenarios.service.BarService;
+import org.apache.felix.ipojo.test.scenarios.service.FooService;
+
+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/sandbox/clement/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/component/FooProviderType1.java
URL: http://svn.apache.org/viewvc/felix/sandbox/clement/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/component/FooProviderType1.java?rev=615675&view=auto
==============================================================================
--- felix/sandbox/clement/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/component/FooProviderType1.java (added)
+++ felix/sandbox/clement/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/component/FooProviderType1.java Sun Jan 27 15:21:24 2008
@@ -0,0 +1,66 @@
+package org.apache.felix.ipojo.test.scenarios.component;
+
+import java.util.Properties;
+
+import org.apache.felix.ipojo.test.scenarios.service.FooService;
+import org.osgi.framework.BundleContext;
+
+public class FooProviderType1 implements FooService {
+	
+	private int m_bar;
+	private String m_foo;
+    
+    private BundleContext m_context;
+        
+    public FooProviderType1(BundleContext bc) {
+            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);
+		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/sandbox/clement/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/component/FooProviderTypeDyn.java
URL: http://svn.apache.org/viewvc/felix/sandbox/clement/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/component/FooProviderTypeDyn.java?rev=615675&view=auto
==============================================================================
--- felix/sandbox/clement/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/component/FooProviderTypeDyn.java (added)
+++ felix/sandbox/clement/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/component/FooProviderTypeDyn.java Sun Jan 27 15:21:24 2008
@@ -0,0 +1,45 @@
+package org.apache.felix.ipojo.test.scenarios.component;
+
+import java.util.Properties;
+
+import org.apache.felix.ipojo.test.scenarios.service.FooService;
+
+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/sandbox/clement/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/component/FooProviderTypeDyn2.java
URL: http://svn.apache.org/viewvc/felix/sandbox/clement/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/component/FooProviderTypeDyn2.java?rev=615675&view=auto
==============================================================================
--- felix/sandbox/clement/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/component/FooProviderTypeDyn2.java (added)
+++ felix/sandbox/clement/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/component/FooProviderTypeDyn2.java Sun Jan 27 15:21:24 2008
@@ -0,0 +1,40 @@
+package org.apache.felix.ipojo.test.scenarios.component;
+
+import java.util.Properties;
+
+import org.apache.felix.ipojo.test.scenarios.service.FooService;
+
+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/sandbox/clement/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/component/FooServiceDefaultImpl.java
URL: http://svn.apache.org/viewvc/felix/sandbox/clement/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/component/FooServiceDefaultImpl.java?rev=615675&view=auto
==============================================================================
--- felix/sandbox/clement/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/component/FooServiceDefaultImpl.java (added)
+++ felix/sandbox/clement/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/component/FooServiceDefaultImpl.java Sun Jan 27 15:21:24 2008
@@ -0,0 +1,37 @@
+package org.apache.felix.ipojo.test.scenarios.component;
+
+import java.util.Properties;
+
+import org.apache.felix.ipojo.test.scenarios.service.FooService;
+
+public class FooServiceDefaultImpl implements FooService {
+
+    public boolean foo() {
+        return false;
+    }
+
+    public Properties fooProps() {
+        return null;
+    }
+
+    public boolean getBoolean() {
+        return false;
+    }
+
+    public double getDouble() {
+        return 5;
+    }
+
+    public int getInt() {
+        return 5;
+    }
+
+    public long getLong() {
+        return 5;
+    }
+
+    public Boolean getObject() {
+        return null;
+    }
+
+}

Added: felix/sandbox/clement/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/component/LifecycleControllerTest.java
URL: http://svn.apache.org/viewvc/felix/sandbox/clement/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/component/LifecycleControllerTest.java?rev=615675&view=auto
==============================================================================
--- felix/sandbox/clement/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/component/LifecycleControllerTest.java (added)
+++ felix/sandbox/clement/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/component/LifecycleControllerTest.java Sun Jan 27 15:21:24 2008
@@ -0,0 +1,31 @@
+package org.apache.felix.ipojo.test.scenarios.component;
+
+import java.util.Properties;
+
+import org.apache.felix.ipojo.test.scenarios.service.CheckService;
+
+public class LifecycleControllerTest implements CheckService {
+    
+    private boolean m_state;
+    private String m_conf;
+    
+    public void setConf(String newConf) {
+        if (newConf.equals("foo")) {
+            m_state = true;
+        } else {
+            m_state = false;
+        }
+    }
+
+    public boolean check() {
+        return m_state;
+    }
+
+    public Properties getProps() {
+       Properties props = new Properties();
+       props.put("conf", m_conf);
+       props.put("state", new Boolean(m_state));
+       return props;
+    }
+}
+

Added: felix/sandbox/clement/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/component/Manipulation23Tester.java
URL: http://svn.apache.org/viewvc/felix/sandbox/clement/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/component/Manipulation23Tester.java?rev=615675&view=auto
==============================================================================
--- felix/sandbox/clement/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/component/Manipulation23Tester.java (added)
+++ felix/sandbox/clement/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/component/Manipulation23Tester.java Sun Jan 27 15:21:24 2008
@@ -0,0 +1,101 @@
+package org.apache.felix.ipojo.test.scenarios.component;
+
+import org.apache.felix.ipojo.test.scenarios.service.PrimitiveManipulationTestService;
+
+
+public class Manipulation23Tester implements PrimitiveManipulationTestService {
+	
+	// Integer types
+	byte b = 1;
+	short s = 1;
+	int i = 1;
+	long l = 1;
+	
+	// Floatting types
+	double d = 1.1;
+	float f = 1.1f;
+	
+	// Character
+	char c = 'a';
+	
+	// Boolean
+	boolean bool = false;
+	
+	// Integer arrays 
+	byte[] bs = new byte[] {0,1,2};
+	short[] ss = new short[] {0,1,2};
+	int[] is = new int[] {0,1,2};
+	long[] ls = new long[] {0,1,2};
+	
+	double[] ds = new double[] {0.0, 1.1, 2.2};
+	float[] fs = new float[] {0.0f, 1.1f, 2.2f};
+	
+	char[] cs = new char[] {'a', 'b', 'c'};
+	
+	boolean[] bools = new boolean[] {false, true, false};
+
+	public boolean getBoolean() { return bool; }
+
+	public boolean[] getBooleans() { return bools; }
+
+	public byte getByte() { return b; }
+
+	public byte[] getBytes() { return bs; }
+
+	public char getChar() { return c; }
+
+	public char[] getChars() { return cs; }
+
+	public double getDouble() { return d; }
+
+	public double[] getDoubles() { return ds; }
+
+	public float getFloat() { return f; }
+
+	public float[] getFloats() { return fs; }
+
+	public int getInt() { return i; }
+
+	public int[] getInts() { return is; }
+
+	public long getLong() { return l; }
+
+	public long[] getLongs() { return ls; }
+
+	public short getShort() { return s; }
+
+	public short[] getShorts() { return ss; }
+
+	public void setBoolean(boolean b) { this.bool = b; }
+
+	public void setBooleans(boolean[] bs) { this.bools = bs; }
+
+	public void setByte(byte b) { this.b = b; }
+
+	public void setBytes(byte[] bs) { this.bs = bs; }
+
+	public void setChar(char c) { this.c = c; }
+
+	public void setChars(char[] cs) { this.cs = cs; }
+
+	public void setDouble(double d) { this.d = d; }
+
+	public void setDoubles(double[] ds) { this.ds = ds; }
+
+	public void setFloat(float f) { this.f = f; }
+
+	public void setFloats(float[] fs) { this.fs = fs; }
+
+	public void setInt(int i) { this.i = i; }
+
+	public void setInts(int[] is) { this.is = is; }
+
+	public void setLong(long l) { this.l = l; }
+
+	public void setLongs(long[] ls) { this.ls = ls; }
+
+ 	public void setShort(short s) { this.s = s; }
+
+	public void setShorts(short[] ss) { this.ss = ss; }	
+
+}

Added: felix/sandbox/clement/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/component/MethodCheckServiceProvider.java
URL: http://svn.apache.org/viewvc/felix/sandbox/clement/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/component/MethodCheckServiceProvider.java?rev=615675&view=auto
==============================================================================
--- felix/sandbox/clement/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/component/MethodCheckServiceProvider.java (added)
+++ felix/sandbox/clement/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/component/MethodCheckServiceProvider.java Sun Jan 27 15:21:24 2008
@@ -0,0 +1,88 @@
+package org.apache.felix.ipojo.test.scenarios.component;
+
+import java.util.Properties;
+
+import org.apache.felix.ipojo.test.scenarios.service.CheckService;
+import org.apache.felix.ipojo.test.scenarios.service.FooService;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.ServiceReference;
+
+public class MethodCheckServiceProvider implements CheckService {
+	
+	FooService fs;
+    
+    BundleContext context;
+	
+	int simpleB = 0;
+	int objectB = 0;
+	int refB = 0;
+	int bothB = 0;
+	int simpleU = 0;
+	int objectU = 0;
+	int refU = 0;
+	int bothU = 0;
+	
+    
+    public MethodCheckServiceProvider(BundleContext bc) {
+        context = bc;
+    }
+
+	public boolean check() {
+		return fs.foo();
+	}
+
+	public Properties getProps() {
+		Properties props = new Properties();
+        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()));
+        } else {
+            props.put("result", new Boolean(false));
+        }
+		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) {
+		    if(fs.getObject() != null) { props.put("object", fs.getObject()); }
+        }
+		
+		return props;
+	}
+	
+	protected void objectBind(FooService o) {
+		if(o != null && o instanceof FooService) { objectB++; }
+        fs = o;
+	}
+	protected void objectUnbind(FooService o) {
+		if(o != null && o instanceof FooService) { objectU++; }
+        fs = null;
+	}
+	
+	public void refBind(ServiceReference sr) {
+		if(sr != null) { refB++; }
+        fs = (FooService) context.getService(sr);
+	}
+	public void refUnbind(ServiceReference sr) {
+		if(sr != null) { refU++; }
+        context.ungetService(sr);
+        fs = null;
+	}
+	
+    protected void bothBind(FooService o, ServiceReference ref) {
+	    if(ref != null && o != null && o instanceof FooService) { bothB++; }
+	    fs = o;
+	}	
+    protected void bothUnbind(FooService o, ServiceReference ref) {
+	     if(ref != null && o != null && o instanceof FooService) { bothU++; }
+	     fs = null;
+	}
+}

Added: felix/sandbox/clement/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/component/MethodMultipleCheckService.java
URL: http://svn.apache.org/viewvc/felix/sandbox/clement/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/component/MethodMultipleCheckService.java?rev=615675&view=auto
==============================================================================
--- felix/sandbox/clement/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/component/MethodMultipleCheckService.java (added)
+++ felix/sandbox/clement/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/component/MethodMultipleCheckService.java Sun Jan 27 15:21:24 2008
@@ -0,0 +1,135 @@
+package org.apache.felix.ipojo.test.scenarios.component;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Properties;
+
+import org.apache.felix.ipojo.test.scenarios.service.CheckService;
+import org.apache.felix.ipojo.test.scenarios.service.FooService;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.ServiceReference;
+
+public class MethodMultipleCheckService implements CheckService {
+
+	List fs = new ArrayList();
+	BundleContext context;
+
+    int simpleB = 0;
+
+    int objectB = 0;
+
+    int refB = 0;
+
+    int bothB = 0;
+
+    int simpleU = 0;
+
+    int objectU = 0;
+
+    int refU = 0;
+
+    int bothU = 0;
+    
+    public MethodMultipleCheckService(BundleContext bc) {
+        context = bc;
+    }
+
+	public boolean check() {
+            boolean r = fs.size() != 0;
+            for(int i = 0; i < fs.size(); i++) {
+                r = r & ((FooService) fs.get(i)).foo();
+            }
+            return r;
+	}
+	
+	private boolean getBoolean() {
+		return check();
+	}
+	
+	private int getInt() {
+		int r = 0;
+		for(int i = 0; i < fs.size(); i++) {
+			r = r + ((FooService) fs.get(i)).getInt();
+		}
+		return r;
+	}
+	
+	private long getLong() {
+		long r = 0;
+		for(int i = 0; i < fs.size(); i++) {
+			r = r + ((FooService) fs.get(i)).getLong();
+		}
+		return r;
+	}
+	
+	private double getDouble() {
+		double r = 0.0;
+		for(int i = 0; i < fs.size(); i++) {
+			r = r + ((FooService) fs.get(i)).getInt();
+		}
+		return r;
+	}
+	
+	protected Object doNothing(Object o, String s) { return null; }
+	
+//	private Object getObject() {
+//		boolean r = true;
+//		for(int i = 0; i < fs.length; i++) {
+//			r = r && ((Boolean) fs[i].getObject()).booleanValue();
+//		}
+//		return new Boolean(r);
+//	}
+
+	public Properties getProps() {
+		Properties props = new Properties();
+		props.put("result", new Boolean(check()));
+		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));
+		props.put("boolean", new Boolean(getBoolean()));
+		props.put("int", new Integer(getInt()));
+		props.put("long", new Long(getLong()));
+		props.put("double", new Double(getDouble()));
+		
+		return props;
+	}
+	
+	public void objectBind(FooService o) {
+		if(o != null && o instanceof FooService) { objectB++; }
+        fs.add(o);
+	}
+	public void objectUnbind(FooService o) {
+		if(o != null && o instanceof FooService) { objectU++; }
+        fs.remove(o);
+	}
+	
+	public void refBind(ServiceReference sr) {
+		if(sr != null) { refB++; }
+        fs.add(context.getService(sr));
+	}
+	public void refUnbind(ServiceReference sr) {
+		if(sr != null) { refU++; }
+        fs.remove(context.getService(sr));
+        context.ungetService(sr);
+	}
+	
+	public void bothBind(FooService o, ServiceReference sr) {
+        if (o != null && o instanceof FooService && sr != null) {
+            fs.add(o);
+            bothB++;
+        }
+    }
+
+    public void bothUnbind(FooService o, ServiceReference sr) {
+        if (o != null && o instanceof FooService && sr != null) {
+            fs.remove(o);
+            bothU++;
+        }
+    }
+	
+}

Added: felix/sandbox/clement/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/component/MultipleCheckService.java
URL: http://svn.apache.org/viewvc/felix/sandbox/clement/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/component/MultipleCheckService.java?rev=615675&view=auto
==============================================================================
--- felix/sandbox/clement/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/component/MultipleCheckService.java (added)
+++ felix/sandbox/clement/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/component/MultipleCheckService.java Sun Jan 27 15:21:24 2008
@@ -0,0 +1,140 @@
+package org.apache.felix.ipojo.test.scenarios.component;
+
+import java.util.Properties;
+
+import org.apache.felix.ipojo.test.scenarios.service.CheckService;
+import org.apache.felix.ipojo.test.scenarios.service.FooService;
+import org.osgi.framework.ServiceReference;
+
+public class MultipleCheckService implements CheckService {
+
+    FooService fs[];
+
+    int simpleB = 0;
+
+    int objectB = 0;
+
+    int refB = 0;
+
+    int bothB = 0;
+
+    int simpleU = 0;
+
+    int objectU = 0;
+
+    int refU = 0;
+
+    int bothU = 0;
+
+    public boolean check() {
+        boolean r = fs.length != 0;
+        for (int i = 0; i < fs.length; i++) {
+            r = r & fs[i].foo();
+        }
+        return r;
+    }
+
+    private boolean getBoolean() {
+        return check();
+    }
+
+    private int getInt() {
+        int r = 0;
+        for (int i = 0; i < fs.length; i++) {
+            r = r + fs[i].getInt();
+        }
+        return r;
+    }
+
+    private long getLong() {
+        long r = 0;
+        for (int i = 0; i < fs.length; i++) {
+            r = r + fs[i].getLong();
+        }
+        return r;
+    }
+
+    private double getDouble() {
+        double r = 0.0;
+        for (int i = 0; i < fs.length; i++) {
+            r = r + fs[i].getInt();
+        }
+        return r;
+    }
+
+    protected Object doNothing(Object o, String s) {
+        return null;
+    }
+
+    // private Object getObject() {
+    // boolean r = true;
+    // for(int i = 0; i < fs.length; i++) {
+    // r = r && ((Boolean) fs[i].getObject()).booleanValue();
+    // }
+    // return new Boolean(r);
+    // }
+
+    public Properties getProps() {
+        Properties props = new Properties();
+        props.put("result", new Boolean(check()));
+        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));
+        props.put("boolean", new Boolean(getBoolean()));
+        props.put("int", new Integer(getInt()));
+        props.put("long", new Long(getLong()));
+        props.put("double", new Double(getDouble()));
+
+        return props;
+    }
+
+    public void voidBind() {
+        simpleB++;
+    }
+
+    public void voidUnbind() {
+        simpleU++;
+    }
+
+    public void objectBind(FooService o) {
+        if (o != null && o instanceof FooService) {
+            objectB++;
+        }
+    }
+
+    public void objectUnbind(FooService 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++;
+        }
+    }
+
+    public void bothBind(FooService o, ServiceReference sr) {
+        if (o != null && o instanceof FooService && sr != null) {
+            bothB++;
+        }
+    }
+
+    public void bothUnbind(FooService o, ServiceReference sr) {
+        if (o != null && o instanceof FooService && sr != null) {
+            bothU++;
+        }
+    }
+
+}

Added: felix/sandbox/clement/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/component/MultipleFilterCheckSubscriber.java
URL: http://svn.apache.org/viewvc/felix/sandbox/clement/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/component/MultipleFilterCheckSubscriber.java?rev=615675&view=auto
==============================================================================
--- felix/sandbox/clement/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/component/MultipleFilterCheckSubscriber.java (added)
+++ felix/sandbox/clement/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/component/MultipleFilterCheckSubscriber.java Sun Jan 27 15:21:24 2008
@@ -0,0 +1,38 @@
+package org.apache.felix.ipojo.test.scenarios.component;
+
+import java.util.Properties;
+
+import org.apache.felix.ipojo.test.scenarios.service.CheckService;
+import org.apache.felix.ipojo.test.scenarios.service.FooService;
+
+public class MultipleFilterCheckSubscriber implements CheckService {
+    
+    private FooService[] m_foo;
+    
+    private int binded;
+    
+    public MultipleFilterCheckSubscriber(){
+    }
+    
+    public boolean check() {
+        for (int i = 0; i < m_foo.length; i++) {
+            m_foo[i].foo();
+        }
+        return true;
+    }
+
+    public Properties getProps() {
+        Properties props = new Properties();
+        props.put("Bind", new Integer(binded));
+        props.put("Size",  new Integer(m_foo.length));
+        return props;
+    }
+    
+    private void Bind() {
+        binded++;
+    }
+    private void Unbind() {
+        binded--;
+    }
+
+}

Added: felix/sandbox/clement/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/component/ParentClass.java
URL: http://svn.apache.org/viewvc/felix/sandbox/clement/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/component/ParentClass.java?rev=615675&view=auto
==============================================================================
--- felix/sandbox/clement/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/component/ParentClass.java (added)
+++ felix/sandbox/clement/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/component/ParentClass.java Sun Jan 27 15:21:24 2008
@@ -0,0 +1,33 @@
+package org.apache.felix.ipojo.test.scenarios.component;
+
+public class ParentClass {
+    
+    public void parentStart() {
+        
+    }
+    
+    public void parentStop() {
+        
+    }
+	
+	protected String[] strings;
+	
+	protected String string;
+	
+	protected int upStrings;
+	
+	protected int upString;
+	
+	public void updateStrings(String[] bb) {
+        strings = bb;
+        upStrings++;
+    }
+    
+    public void updateString(String bb) {
+        string = bb;
+        upString++;
+    }
+	
+	
+
+}

Added: felix/sandbox/clement/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/component/ParentConfigurableCheckServiceProvider.java
URL: http://svn.apache.org/viewvc/felix/sandbox/clement/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/component/ParentConfigurableCheckServiceProvider.java?rev=615675&view=auto
==============================================================================
--- felix/sandbox/clement/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/component/ParentConfigurableCheckServiceProvider.java (added)
+++ felix/sandbox/clement/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/component/ParentConfigurableCheckServiceProvider.java Sun Jan 27 15:21:24 2008
@@ -0,0 +1,176 @@
+package org.apache.felix.ipojo.test.scenarios.component;
+
+import java.util.Properties;
+
+import org.apache.felix.ipojo.test.scenarios.service.CheckService;
+
+public class ParentConfigurableCheckServiceProvider extends ParentClass implements CheckService {
+    
+    // Integer types
+    byte b;
+    short s;
+    int i;
+    long l;
+    
+    // Floatting types
+    double d;
+    float f;
+    
+    // Character
+    char c;
+    
+    // Boolean
+    boolean bool;
+    
+    // Integer arrays 
+    byte[] bs;
+    short[] ss;
+    int[] is;
+    long[] ls;
+    
+    double[] ds;
+    float[] fs;
+    
+    char[] cs;
+    
+    boolean[] bools;
+    
+    //String string;
+    //String[] strings;
+    
+    int upB, upS, upI, upL, upD, upF, upC, upBool, upBs, upSs, upIs, upLs, upDs, upFs, upCs, upBools/*, upString, upStrings*/;
+    
+
+    public boolean check() {
+        return true;
+    }
+
+    public Properties getProps() {
+        Properties props = new Properties();
+        props.put("b", new Byte(b));
+        props.put("s", new Short(s));
+        props.put("i", new Integer(i));
+        props.put("l", new Long(l));
+        props.put("d", new Double(d));
+        props.put("f", new Float(f));
+        props.put("c", new Character(c));
+        props.put("bool", new Boolean(bool));
+        
+        props.put("bs", bs);
+        props.put("ss", ss);
+        props.put("is", is);
+        props.put("ls", ls);
+        props.put("ds", ds);
+        props.put("fs", fs);
+        props.put("cs", cs);
+        props.put("bools", bools);
+        
+        props.put("upb", new Integer(upB));
+        props.put("ups", new Integer(upS));
+        props.put("upi", new Integer(upI));
+        props.put("upl", new Integer(upL));
+        props.put("upd", new Integer(upD));
+        props.put("upf", new Integer(upF));
+        props.put("upc", new Integer(upC));
+        props.put("upbool", new Integer(upBool));
+        
+        props.put("upbs", new Integer(upBs));
+        props.put("upss", new Integer(upSs));
+        props.put("upis", new Integer(upIs));
+        props.put("upls", new Integer(upLs));
+        props.put("upds", new Integer(upDs));
+        props.put("upfs", new Integer(upFs));
+        props.put("upcs", new Integer(upCs));
+        props.put("upbools", new Integer(upBools));
+        
+        props.put("string", string);
+        props.put("strings", strings);
+        props.put("upstring", new Integer(upString));
+        props.put("upstrings", new Integer(upStrings));
+        
+        return props;
+    }
+    
+    public void updateB(byte bb) {
+        b = bb;
+        upB++;
+    }
+    
+    public void updateS(short bb) {
+        s = bb;
+        upS++;
+    }
+    
+    public void updateI(int bb) {
+        i = bb;
+        upI++;
+    }
+    
+    public void updateL(long bb) {
+        l = bb;
+        upL++;
+    }
+    
+    public void updateD(double bb) {
+        d = bb;
+        upD++;
+    }
+    
+    public void updateF(float bb) {
+        f = bb;
+        upF++;
+    }
+    
+    public void updateC(char bb) {
+        c = bb;
+        upC++;
+    }
+    
+    public void updateBool(boolean bb) {
+        bool = bb;
+        upBool++;
+    }
+    
+    public void updateBs(byte[] bb) {
+        bs = bb;
+        upBs++;
+    }
+    
+    public void updateSs(short[] bb) {
+        ss = bb;
+        upSs++;
+    }
+    
+    public void updateIs(int[] bb) {
+        is = bb;
+        upIs++;
+    }
+    
+    public void updateLs(long[] bb) {
+        ls = bb;
+        upLs++;
+    }
+    
+    public void updateDs(double[] bb) {
+        ds = bb;
+        upDs++;
+    }
+    
+    public void updateFs(float[] bb) {
+        fs = bb;
+        upFs++;
+    }
+    
+    public void updateCs(char[] bb) {
+        cs = bb;
+        upCs++;
+    }
+    
+    public void updateBools(boolean[] bb) {
+        bools = bb;
+        upBools++;
+    }
+    
+    
+
+}

Propchange: felix/sandbox/clement/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/component/inherited/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Sun Jan 27 15:21:24 2008
@@ -0,0 +1,6 @@
+target*
+bin*
+.settings*
+.classpath
+.project
+.checkstyle

Added: felix/sandbox/clement/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/component/inherited/ProcessImplementation1.java
URL: http://svn.apache.org/viewvc/felix/sandbox/clement/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/component/inherited/ProcessImplementation1.java?rev=615675&view=auto
==============================================================================
--- felix/sandbox/clement/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/component/inherited/ProcessImplementation1.java (added)
+++ felix/sandbox/clement/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/component/inherited/ProcessImplementation1.java Sun Jan 27 15:21:24 2008
@@ -0,0 +1,27 @@
+package org.apache.felix.ipojo.test.scenarios.component.inherited;
+
+import org.apache.felix.ipojo.test.scenarios.service.ChildInterface;
+
+public class ProcessImplementation1 implements ChildInterface {
+
+    public void processChild() {
+        // TODO Auto-generated method stub
+
+    }
+
+    public void processParent1() {
+        // TODO Auto-generated method stub
+
+    }
+
+    public void processParentParent() {
+        // TODO Auto-generated method stub
+
+    }
+
+    public void processParent2() {
+        // TODO Auto-generated method stub
+
+    }
+
+}

Added: felix/sandbox/clement/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/component/inherited/ProcessImplementation2.java
URL: http://svn.apache.org/viewvc/felix/sandbox/clement/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/component/inherited/ProcessImplementation2.java?rev=615675&view=auto
==============================================================================
--- felix/sandbox/clement/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/component/inherited/ProcessImplementation2.java (added)
+++ felix/sandbox/clement/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/component/inherited/ProcessImplementation2.java Sun Jan 27 15:21:24 2008
@@ -0,0 +1,26 @@
+package org.apache.felix.ipojo.test.scenarios.component.inherited;
+
+
+public class ProcessImplementation2 extends ProcessParentImplementation {
+
+    public void processChild() {
+        // TODO Auto-generated method stub
+
+    }
+
+    public void processParent1() {
+        // TODO Auto-generated method stub
+
+    }
+
+    public void processParentParent() {
+        // TODO Auto-generated method stub
+
+    }
+
+    public void processParent2() {
+        // TODO Auto-generated method stub
+
+    }
+
+}

Added: felix/sandbox/clement/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/component/inherited/ProcessImplementation3.java
URL: http://svn.apache.org/viewvc/felix/sandbox/clement/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/component/inherited/ProcessImplementation3.java?rev=615675&view=auto
==============================================================================
--- felix/sandbox/clement/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/component/inherited/ProcessImplementation3.java (added)
+++ felix/sandbox/clement/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/component/inherited/ProcessImplementation3.java Sun Jan 27 15:21:24 2008
@@ -0,0 +1,64 @@
+package org.apache.felix.ipojo.test.scenarios.component.inherited;
+
+import java.util.Properties;
+
+import org.apache.felix.ipojo.test.scenarios.service.FooService;
+
+public class ProcessImplementation3 extends ProcessParentImplementation  implements FooService {
+
+    public void processChild() {
+        // TODO Auto-generated method stub
+
+    }
+
+    public void processParent1() {
+        // TODO Auto-generated method stub
+
+    }
+
+    public void processParentParent() {
+        // TODO Auto-generated method stub
+
+    }
+
+    public void processParent2() {
+        // TODO Auto-generated method stub
+
+    }
+
+    public boolean foo() {
+        // TODO Auto-generated method stub
+        return false;
+    }
+
+    public Properties fooProps() {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+    public boolean getBoolean() {
+        // TODO Auto-generated method stub
+        return false;
+    }
+
+    public double getDouble() {
+        // TODO Auto-generated method stub
+        return 0;
+    }
+
+    public int getInt() {
+        // TODO Auto-generated method stub
+        return 0;
+    }
+
+    public long getLong() {
+        // TODO Auto-generated method stub
+        return 0;
+    }
+
+    public Boolean getObject() {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+}

Added: felix/sandbox/clement/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/component/inherited/ProcessParentImplementation.java
URL: http://svn.apache.org/viewvc/felix/sandbox/clement/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/component/inherited/ProcessParentImplementation.java?rev=615675&view=auto
==============================================================================
--- felix/sandbox/clement/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/component/inherited/ProcessParentImplementation.java (added)
+++ felix/sandbox/clement/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/component/inherited/ProcessParentImplementation.java Sun Jan 27 15:21:24 2008
@@ -0,0 +1,28 @@
+package org.apache.felix.ipojo.test.scenarios.component.inherited;
+
+import org.apache.felix.ipojo.test.scenarios.service.ChildInterface;
+
+public class ProcessParentImplementation implements ChildInterface {
+
+    public void processChild() {
+        // TODO Auto-generated method stub
+        
+    }
+
+    public void processParent1() {
+        // TODO Auto-generated method stub
+        
+    }
+
+    public void processParentParent() {
+        // TODO Auto-generated method stub
+        
+    }
+
+    public void processParent2() {
+        // TODO Auto-generated method stub
+        
+    }
+
+
+}

Propchange: felix/sandbox/clement/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/configuration/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Sun Jan 27 15:21:24 2008
@@ -0,0 +1,6 @@
+target*
+bin*
+.settings*
+.classpath
+.project
+.checkstyle

Added: felix/sandbox/clement/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/configuration/ConfigurationTestSuite.java
URL: http://svn.apache.org/viewvc/felix/sandbox/clement/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/configuration/ConfigurationTestSuite.java?rev=615675&view=auto
==============================================================================
--- felix/sandbox/clement/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/configuration/ConfigurationTestSuite.java (added)
+++ felix/sandbox/clement/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/configuration/ConfigurationTestSuite.java Sun Jan 27 15:21:24 2008
@@ -0,0 +1,22 @@
+package org.apache.felix.ipojo.test.scenarios.configuration;
+
+import junit.framework.Test;
+
+import org.apache.felix.ipojo.junit4osgi.OSGiTestSuite;
+import org.osgi.framework.BundleContext;
+
+public class ConfigurationTestSuite {
+
+	public static Test suite(BundleContext bc) {
+		OSGiTestSuite ots = new OSGiTestSuite("Configuration Test Suite", bc);
+		ots.addTestSuite(SimpleProperties.class);
+		ots.addTestSuite(DynamicallyConfigurableProperties.class);
+		ots.addTestSuite(TestFieldProperties.class);
+		ots.addTestSuite(TestMethodProperties.class);
+		ots.addTestSuite(TestBothProperties.class);
+		ots.addTestSuite(TestSuperMethodProperties.class);
+		
+		return ots;
+	}
+
+}

Added: felix/sandbox/clement/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/configuration/DynamicallyConfigurableProperties.java
URL: http://svn.apache.org/viewvc/felix/sandbox/clement/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/configuration/DynamicallyConfigurableProperties.java?rev=615675&view=auto
==============================================================================
--- felix/sandbox/clement/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/configuration/DynamicallyConfigurableProperties.java (added)
+++ felix/sandbox/clement/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/configuration/DynamicallyConfigurableProperties.java Sun Jan 27 15:21:24 2008
@@ -0,0 +1,210 @@
+package org.apache.felix.ipojo.test.scenarios.configuration;
+
+import java.util.Properties;
+
+import org.apache.felix.ipojo.ComponentInstance;
+import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
+import org.apache.felix.ipojo.test.scenarios.service.FooService;
+import org.apache.felix.ipojo.test.scenarios.util.Utils;
+import org.osgi.framework.ServiceReference;
+import org.osgi.service.cm.ConfigurationException;
+import org.osgi.service.cm.ManagedServiceFactory;
+
+public class DynamicallyConfigurableProperties extends OSGiTestCase {
+
+	ComponentInstance instance;
+	
+	public void setUp() {
+		String type = "FooProviderType-3";
+		
+		Properties p1 = new Properties();
+		p1.put("name", "instance");
+		p1.put("foo", "foo");
+		p1.put("bar", "2");
+		p1.put("baz", "baz");
+		instance = Utils.getComponentInstance(context, type, p1);
+	}
+	
+	public void tearDown() {
+		instance.dispose();
+		instance = null;
+	}
+	
+	public void testStatic() {
+		ServiceReference fooRef = Utils.getServiceReferenceByName(context, FooService.class.getName(), instance.getInstanceName());
+		assertNotNull("Check FS availability", fooRef);
+		String fooP = (String) fooRef.getProperty("foo");
+		Integer barP = (Integer) fooRef.getProperty("bar");
+		String bazP = (String) fooRef.getProperty("baz");
+		assertEquals("Check foo equality -1", fooP, "foo");
+		assertEquals("Check bar equality -1", barP, new Integer(2));
+		assertEquals("Check baz equality -1", bazP, "baz");
+		
+		ServiceReference msRef = Utils.getServiceReferenceByName(context, ManagedServiceFactory.class.getName(), instance.getFactory().getName());
+		assertNotNull("Check ManagedServiceFactory availability", msRef);
+		
+		
+		// Configuration of baz
+		Properties conf = new Properties();
+		conf.put("baz", "zab");
+		conf.put("bar", new Integer(2));
+		conf.put("foo", "foo");
+		ManagedServiceFactory ms = (ManagedServiceFactory) context.getService(msRef);
+		try {
+			ms.updated(instance.getInstanceName(), conf);
+		} catch (ConfigurationException e) { fail("Configuration Exception : " + e); }
+		
+		// Recheck props
+		fooRef = Utils.getServiceReferenceByName(context, FooService.class.getName(), instance.getInstanceName());
+		fooP = (String) fooRef.getProperty("foo");
+		barP = (Integer) fooRef.getProperty("bar");
+		bazP = (String) fooRef.getProperty("baz");
+		assertEquals("Check foo equality -2", fooP, "foo");
+		assertEquals("Check bar equality -2", barP, new Integer(2));
+		assertEquals("Check baz equality -2", bazP, "zab");
+		context.ungetService(msRef);
+	}
+	
+	public void testDynamic() {
+    	ServiceReference fooRef = Utils.getServiceReferenceByName(context, FooService.class.getName(), instance.getInstanceName());
+    	assertNotNull("Check FS availability", fooRef);
+    	
+    	String fooP = (String) fooRef.getProperty("foo");
+    	Integer barP = (Integer) fooRef.getProperty("bar");
+    	String bazP = (String) fooRef.getProperty("baz");
+    	
+    	assertEquals("Check foo equality", fooP, "foo");
+    	assertEquals("Check bar equality", barP, new Integer(2));
+    	assertEquals("Check baz equality", bazP, "baz");
+    	
+    	ServiceReference msRef = Utils.getServiceReferenceByName(context, ManagedServiceFactory.class.getName(), instance.getFactory().getName());
+    	assertNotNull("Check ManagedServiceFactory availability", msRef);
+    	
+    	// Configuration of baz
+    	Properties conf = new Properties();
+    	conf.put("baz", "zab");
+    	conf.put("foo", "oof");
+    	conf.put("bar", new Integer(0));
+    	ManagedServiceFactory ms = (ManagedServiceFactory) context.getService(msRef);
+    	try {
+    		ms.updated(instance.getInstanceName(), conf);
+    	} catch (ConfigurationException e) { fail("Configuration Exception : " + e); }
+    	
+    	// Recheck props
+    	fooRef = Utils.getServiceReferenceByName(context, FooService.class.getName(), instance.getInstanceName());
+    	fooP = (String) fooRef.getProperty("foo");
+    	barP = (Integer) fooRef.getProperty("bar");
+    	bazP = (String) fooRef.getProperty("baz");
+    	
+    	assertEquals("Check foo equality", fooP, "oof");
+    	assertEquals("Check bar equality", barP, new Integer(0));
+    	assertEquals("Check baz equality", bazP, "zab");
+    	
+    	// Check field value
+    	FooService fs = (FooService) context.getService(fooRef);
+    	Properties p = fs.fooProps();
+    	fooP = (String) p.get("foo");
+    	barP = (Integer) p.get("bar");
+    	
+    	assertEquals("Check foo field equality", fooP, "oof");
+    	assertEquals("Check bar field equality", barP, new Integer(0));
+    	
+    	context.ungetService(fooRef);
+    	context.ungetService(msRef);
+    }
+
+    public void testDynamicString() {
+		ServiceReference fooRef = Utils.getServiceReferenceByName(context, FooService.class.getName(), instance.getInstanceName());
+		assertNotNull("Check FS availability", fooRef);
+		
+		String fooP = (String) fooRef.getProperty("foo");
+		Integer barP = (Integer) fooRef.getProperty("bar");
+		String bazP = (String) fooRef.getProperty("baz");
+		
+		assertEquals("Check foo equality", fooP, "foo");
+		assertEquals("Check bar equality", barP, new Integer(2));
+		assertEquals("Check baz equality", bazP, "baz");
+		
+		ServiceReference msRef = Utils.getServiceReferenceByName(context, ManagedServiceFactory.class.getName(), instance.getFactory().getName());
+		assertNotNull("Check ManagedServiceFactory availability", msRef);
+		
+		// Configuration of baz
+		Properties conf = new Properties();
+		conf.put("baz", "zab");
+		conf.put("foo", "oof");
+		conf.put("bar", "0");
+		ManagedServiceFactory ms = (ManagedServiceFactory) context.getService(msRef);
+		try {
+			ms.updated(instance.getInstanceName(), conf);
+		} catch (ConfigurationException e) { fail("Configuration Exception : " + e); }
+		
+		// Recheck props
+		fooRef = Utils.getServiceReferenceByName(context, FooService.class.getName(), instance.getInstanceName());
+		fooP = (String) fooRef.getProperty("foo");
+		barP = (Integer) fooRef.getProperty("bar");
+		bazP = (String) fooRef.getProperty("baz");
+		
+		assertEquals("Check foo equality", fooP, "oof");
+		assertEquals("Check bar equality", barP, new Integer(0));
+		assertEquals("Check baz equality", bazP, "zab");
+		
+		// Check field value
+		FooService fs = (FooService) context.getService(fooRef);
+		Properties p = fs.fooProps();
+		fooP = (String) p.get("foo");
+		barP = (Integer) p.get("bar");
+		
+		assertEquals("Check foo field equality", fooP, "oof");
+		assertEquals("Check bar field equality", barP, new Integer(0));
+		
+		context.ungetService(fooRef);
+		context.ungetService(msRef);
+	}
+	
+	public void testPropagation() {
+		ServiceReference fooRef = Utils.getServiceReferenceByName(context, FooService.class.getName(), instance.getInstanceName());
+		assertNotNull("Check FS availability", fooRef);
+		
+		String fooP = (String) fooRef.getProperty("foo");
+		Integer barP = (Integer) fooRef.getProperty("bar");
+		String bazP = (String) fooRef.getProperty("baz");
+		
+		assertEquals("Check foo equality", fooP, "foo");
+		assertEquals("Check bar equality", barP, new Integer(2));
+		assertEquals("Check baz equality", bazP, "baz");
+		
+		ServiceReference msRef = Utils.getServiceReferenceByName(context, ManagedServiceFactory.class.getName(), instance.getFactory().getName());
+		assertNotNull("Check ManagedServiceFactory availability", msRef);
+		
+		// Configuration of baz
+		Properties conf = new Properties();
+		conf.put("baz", "zab");
+		conf.put("foo", "foo");
+		conf.put("bar", new Integer(2));
+		conf.put("propagated1", "propagated");
+		conf.put("propagated2", new Integer(1));
+		ManagedServiceFactory ms = (ManagedServiceFactory) context.getService(msRef);
+		try {
+			ms.updated(instance.getInstanceName(), conf);
+		} catch (ConfigurationException e) { fail("Configuration Exception : " + e); }
+		
+		// Recheck props
+		fooRef = Utils.getServiceReferenceByName(context, FooService.class.getName(), instance.getInstanceName());
+		fooP = (String) fooRef.getProperty("foo");
+		barP = (Integer) fooRef.getProperty("bar");
+		bazP = (String) fooRef.getProperty("baz");
+		assertNotNull("Check the propagated1 existency", fooRef.getProperty("propagated1"));
+		String prop1 = (String) fooRef.getProperty("propagated1");
+		assertNotNull("Check the propagated2 existency", fooRef.getProperty("propagated2"));
+		Integer prop2 = (Integer) fooRef.getProperty("propagated2");
+		
+		assertEquals("Check foo equality", fooP, "foo");
+		assertEquals("Check bar equality", barP, new Integer(2));
+		assertEquals("Check baz equality", bazP, "zab");
+		assertEquals("Check propagated1 equality", prop1, "propagated");
+		assertEquals("Check propagated2 equality", prop2, new Integer(1));
+		
+		context.ungetService(msRef);
+	}
+
+}

Added: felix/sandbox/clement/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/configuration/SimpleProperties.java
URL: http://svn.apache.org/viewvc/felix/sandbox/clement/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/configuration/SimpleProperties.java?rev=615675&view=auto
==============================================================================
--- felix/sandbox/clement/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/configuration/SimpleProperties.java (added)
+++ felix/sandbox/clement/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/configuration/SimpleProperties.java Sun Jan 27 15:21:24 2008
@@ -0,0 +1,153 @@
+package org.apache.felix.ipojo.test.scenarios.configuration;
+
+import java.util.Properties;
+
+import org.apache.felix.ipojo.ComponentInstance;
+import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
+import org.apache.felix.ipojo.test.scenarios.service.FooService;
+import org.apache.felix.ipojo.test.scenarios.util.Utils;
+import org.osgi.framework.ServiceReference;
+
+public class SimpleProperties extends OSGiTestCase {
+	
+	ComponentInstance fooProvider1;
+	ComponentInstance fooProvider2;
+	
+	public void setUp() {
+		String type = "FooProviderType-Conf";
+		
+		Properties p1 = new Properties();
+		p1.put("name", "FooProvider-1");
+		fooProvider1 = Utils.getComponentInstance(context, type, p1);
+		
+		Properties p2 = new Properties();
+		p2.put("name", "FooProvider-2");
+		p2.put("int", new Integer(4));
+		p2.put("boolean", new Boolean(false));
+		p2.put("string", new String("bar"));
+		p2.put("strAProp", new String[] {"bar", "foo"});
+		p2.put("intAProp", new int[] {1, 2, 3});
+		fooProvider2 = Utils.getComponentInstance(context, type, p2);
+	}
+	
+	public void tearDown() {
+		fooProvider1.dispose();
+		fooProvider2.dispose();
+		fooProvider1 = null;
+		fooProvider2 = null;
+	}
+	
+	public void testComponentTypeConfiguration() {
+		ServiceReference ref = Utils.getServiceReferenceByName(context, FooService.class.getName(), fooProvider1.getInstanceName());
+		assertNotNull("Check FooService availability", ref);
+		FooService fs = (FooService) context.getService(ref);
+		Properties toCheck = fs.fooProps();
+		
+		Integer intProp = (Integer) toCheck.get("intProp");
+		Boolean boolProp = (Boolean) toCheck.get("boolProp");
+		String strProp = (String) toCheck.get("strProp");
+		String[] strAProp = (String[]) toCheck.get("strAProp");
+		int[] intAProp = (int[]) toCheck.get("intAProp");
+		
+		assertEquals("Check intProp equality (1)", intProp, new Integer(2));
+		assertEquals("Check longProp equality (1)", boolProp, new Boolean(false));
+		assertEquals("Check strProp equality (1)", strProp, new String("foo"));
+		assertNotNull("Check strAProp not nullity (1)", strAProp);
+		String[] v = new String[] {"foo", "bar"};
+		for (int i = 0; i < strAProp.length; i++) {
+			if(!strAProp[i].equals(v[i])) { fail("Check the strAProp Equality (1) : " + strAProp[i] + " != " + v[i]); }
+		}
+		assertNotNull("Check intAProp not nullity", intAProp);
+		int[] v2 = new int[] {1, 2, 3};
+		for (int i = 0; i < intAProp.length; i++) {
+			if(intAProp[i] != v2[i]) { fail("Check the intAProp Equality (1) : " + intAProp[i] + " != " + v2[i]); }
+		}
+		
+		// change the field value
+		assertTrue("Invoke the fs service", fs.foo());
+		toCheck = fs.fooProps();
+		
+		
+		//	Re-check the property (change)
+		intProp = (Integer) toCheck.get("intProp");
+		boolProp = (Boolean) toCheck.get("boolProp");
+		strProp = (String) toCheck.get("strProp");
+		strAProp = (String[]) toCheck.get("strAProp");
+		intAProp = (int[]) toCheck.get("intAProp");
+		
+		assertEquals("Check intProp equality (2) ("+intProp+")", intProp, new Integer(3));
+		assertEquals("Check longProp equality (2)", boolProp, new Boolean(true));
+		assertEquals("Check strProp equality (2)", strProp, new String("bar"));
+		assertNotNull("Check strAProp not nullity (2)", strAProp);
+		v = new String[] {"foo", "bar", "baz"};
+		for (int i = 0; i < strAProp.length; i++) {
+			if(!strAProp[i].equals(v[i])) { fail("Check the strAProp Equality (2)"); }
+		}
+		assertNotNull("Check intAProp not nullity (2)", intAProp);
+		v2 = new int[] {3, 2, 1};
+		for (int i = 0; i < intAProp.length; i++) {
+			if(intAProp[i] != v2[i]) { fail("Check the intAProp Equality (2) : " + intAProp[i] + " != " + v2[i]); }
+		}
+		
+		fs = null;
+		context.ungetService(ref);
+	}
+	
+	public void testInstanceConfiguration() {
+		ServiceReference sr = Utils.getServiceReferenceByName(context, FooService.class.getName(), "FooProvider-2");
+		assertNotNull("Check the availability of the FS service", sr);
+		
+		FooService fs = (FooService) context.getService(sr);
+		Properties toCheck = fs.fooProps();
+		
+		// Check service properties
+		Integer intProp = (Integer) toCheck.get("intProp");
+		Boolean boolProp = (Boolean) toCheck.get("boolProp");
+		String strProp = (String) toCheck.get("strProp");
+		String[] strAProp = (String[]) toCheck.get("strAProp");
+		int[] intAProp = (int[]) toCheck.get("intAProp");
+		
+		assertEquals("Check intProp equality", intProp, new Integer(4));
+		assertEquals("Check longProp equality", boolProp, new Boolean(false));
+		assertEquals("Check strProp equality", strProp, new String("bar"));
+		assertNotNull("Check strAProp not nullity", strAProp);
+		String[] v = new String[] {"bar", "foo"};
+		for (int i = 0; i < strAProp.length; i++) {
+			if(!strAProp[i].equals(v[i])) { fail("Check the strAProp Equality"); }
+		}
+		assertNotNull("Check intAProp not nullity", intAProp);
+		int[] v2 = new int[] {1, 2, 3};
+		for (int i = 0; i < intAProp.length; i++) {
+			if(intAProp[i] != v2[i]) { fail("Check the intAProp Equality"); }
+		}
+		
+		
+		assertTrue("invoke fs", fs.foo());
+		toCheck = fs.fooProps();
+		
+		// Re-check the property (change)
+		intProp = (Integer) toCheck.get("intProp");
+		boolProp = (Boolean) toCheck.get("boolProp");
+		strProp = (String) toCheck.get("strProp");
+		strAProp = (String[]) toCheck.get("strAProp");
+		intAProp = (int[]) toCheck.get("intAProp");
+		
+		assertEquals("Check intProp equality", intProp, new Integer(3));
+		assertEquals("Check longProp equality", boolProp, new Boolean(true));
+		assertEquals("Check strProp equality", strProp, new String("foo"));
+		assertNotNull("Check strAProp not nullity", strAProp);
+		v = new String[] {"foo", "bar", "baz"};
+		for (int i = 0; i < strAProp.length; i++) {
+			if(!strAProp[i].equals(v[i])) { fail("Check the strAProp Equality"); }
+		}
+		assertNotNull("Check intAProp not nullity", intAProp);
+		v2 = new int[] {3, 2, 1};
+		for (int i = 0; i < intAProp.length; i++) {
+			if(intAProp[i] != v2[i]) { fail("Check the intAProp Equality"); }
+		}
+		
+		fs = null;
+		context.ungetService(sr);	
+	}
+
+}



Mime
View raw message