You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@felix.apache.org by cl...@apache.org on 2013/02/15 09:55:44 UTC

svn commit: r1446477 - in /felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-external-handlers-test: ./ 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/ s...

Author: clement
Date: Fri Feb 15 08:55:43 2013
New Revision: 1446477

URL: http://svn.apache.org/r1446477
Log:
Migrate some core tests (external handlers) to pax exam 3

Added:
    felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-external-handlers-test/
    felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-external-handlers-test/pom.xml
    felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-external-handlers-test/src/
    felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-external-handlers-test/src/main/
    felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-external-handlers-test/src/main/java/
    felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-external-handlers-test/src/main/java/org/
    felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-external-handlers-test/src/main/java/org/apache/
    felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-external-handlers-test/src/main/java/org/apache/felix/
    felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-external-handlers-test/src/main/java/org/apache/felix/ipojo/
    felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-external-handlers-test/src/main/java/org/apache/felix/ipojo/runtime/
    felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-external-handlers-test/src/main/java/org/apache/felix/ipojo/runtime/externalhandlers/
    felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-external-handlers-test/src/main/java/org/apache/felix/ipojo/runtime/externalhandlers/components/
    felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-external-handlers-test/src/main/java/org/apache/felix/ipojo/runtime/externalhandlers/components/CheckServiceHandler.java
    felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-external-handlers-test/src/main/java/org/apache/felix/ipojo/runtime/externalhandlers/components/FooProviderType1.java
    felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-external-handlers-test/src/main/java/org/apache/felix/ipojo/runtime/externalhandlers/services/
    felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-external-handlers-test/src/main/java/org/apache/felix/ipojo/runtime/externalhandlers/services/CheckService.java
    felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-external-handlers-test/src/main/java/org/apache/felix/ipojo/runtime/externalhandlers/services/CheckServiceHandlerDescription.java
    felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-external-handlers-test/src/main/java/org/apache/felix/ipojo/runtime/externalhandlers/services/FooService.java
    felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-external-handlers-test/src/main/resources/
    felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-external-handlers-test/src/main/resources/metadata.xml
    felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-external-handlers-test/src/test/
    felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-external-handlers-test/src/test/java/
    felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-external-handlers-test/src/test/java/org/
    felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-external-handlers-test/src/test/java/org/apache/
    felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-external-handlers-test/src/test/java/org/apache/felix/
    felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-external-handlers-test/src/test/java/org/apache/felix/ipojo/
    felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-external-handlers-test/src/test/java/org/apache/felix/ipojo/runtime/
    felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-external-handlers-test/src/test/java/org/apache/felix/ipojo/runtime/externalhandlers/
    felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-external-handlers-test/src/test/java/org/apache/felix/ipojo/runtime/externalhandlers/test/
    felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-external-handlers-test/src/test/java/org/apache/felix/ipojo/runtime/externalhandlers/test/AutoHandlerTest.java
    felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-external-handlers-test/src/test/java/org/apache/felix/ipojo/runtime/externalhandlers/test/Common.java
    felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-external-handlers-test/src/test/java/org/apache/felix/ipojo/runtime/externalhandlers/test/HandlerTest.java
    felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-external-handlers-test/src/test/resources/
    felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-external-handlers-test/src/test/resources/exam.properties

Added: felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-external-handlers-test/pom.xml
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-external-handlers-test/pom.xml?rev=1446477&view=auto
==============================================================================
--- felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-external-handlers-test/pom.xml (added)
+++ felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-external-handlers-test/pom.xml Fri Feb 15 08:55:43 2013
@@ -0,0 +1,153 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+
+    <parent>
+        <groupId>org.apache.felix</groupId>
+        <artifactId>org.apache.felix.ipojo.runtime.core-it</artifactId>
+        <version>1.9.0-SNAPSHOT</version>
+        <relativePath>../../../pom.xml</relativePath>
+    </parent>
+
+    <modelVersion>4.0.0</modelVersion>
+
+    <groupId>org.apache.felix</groupId>
+    <artifactId>ipojo-core-external-handlers-test</artifactId>
+    <version>1.0-SNAPSHOT</version>
+
+    <name>${project.artifactId}</name>
+
+    <properties>
+        <exam.version>3.0.0</exam.version>
+        <url.version>1.5.1</url.version>
+    </properties>
+
+    <dependencies>
+
+        <dependency>
+            <groupId>org.ops4j.pax.exam</groupId>
+            <artifactId>pax-exam-container-native</artifactId>
+            <version>${exam.version}</version>
+            <scope>test</scope>
+        </dependency>
+
+        <dependency>
+            <groupId>org.ops4j.pax.exam</groupId>
+            <artifactId>pax-exam-junit4</artifactId>
+            <version>${exam.version}</version>
+            <scope>test</scope>
+        </dependency>
+
+        <dependency>
+            <groupId>org.ops4j.pax.exam</groupId>
+            <artifactId>pax-exam-link-mvn</artifactId>
+            <version>${exam.version}</version>
+            <scope>test</scope>
+        </dependency>
+
+        <dependency>
+            <groupId>org.ops4j.pax.url</groupId>
+            <artifactId>pax-url-aether</artifactId>
+            <version>${url.version}</version>
+            <scope>test</scope>
+        </dependency>
+
+        <dependency>
+            <groupId>org.apache.felix</groupId>
+            <artifactId>org.apache.felix.framework</artifactId>
+            <version>4.2.0</version>
+            <scope>test</scope>
+        </dependency>
+
+        <dependency>
+            <groupId>ch.qos.logback</groupId>
+            <artifactId>logback-core</artifactId>
+            <version>0.9.6</version>
+            <scope>test</scope>
+        </dependency>
+
+        <dependency>
+            <groupId>ch.qos.logback</groupId>
+            <artifactId>logback-classic</artifactId>
+            <version>0.9.6</version>
+            <scope>test</scope>
+        </dependency>
+
+
+        <dependency>
+            <groupId>junit</groupId>
+            <artifactId>junit</artifactId>
+            <version>4.9</version>
+            <scope>test</scope>
+        </dependency>
+
+
+        <dependency>
+            <groupId>org.ops4j.pax.tinybundles</groupId>
+            <artifactId>tinybundles</artifactId>
+            <version>1.0.0</version>
+        </dependency>
+
+        <dependency>
+            <groupId>org.apache.felix</groupId>
+            <artifactId>org.apache.felix.ipojo</artifactId>
+            <version>1.9.0-SNAPSHOT</version>
+        </dependency>
+
+        <dependency>
+            <groupId>org.apache.felix</groupId>
+            <artifactId>org.apache.felix.ipojo.manipulator</artifactId>
+            <version>1.9.0-SNAPSHOT</version>
+        </dependency>
+
+        <dependency>
+            <groupId>commons-io</groupId>
+            <artifactId>commons-io</artifactId>
+            <version>2.4</version>
+        </dependency>
+
+        <dependency>
+            <groupId>org.ow2.chameleon.testing</groupId>
+            <artifactId>osgi-helpers</artifactId>
+            <version>0.6.0</version>
+            <scope>test</scope>
+        </dependency>
+
+        <dependency>
+            <groupId>org.ow2.chameleon.testing</groupId>
+            <artifactId>tinybundles-ipojo</artifactId>
+            <version>0.3.0</version>
+        </dependency>
+
+    </dependencies>
+
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-compiler-plugin</artifactId>
+                <version>2.5.1</version>
+                <configuration>
+                    <source>1.6</source>
+                    <target>1.6</target>
+                </configuration>
+            </plugin>
+
+            <plugin>
+                <groupId>org.apache.servicemix.tooling</groupId>
+                <artifactId>depends-maven-plugin</artifactId>
+                <version>1.2</version>
+                <executions>
+                    <execution>
+                        <id>generate-config</id>
+                        <goals>
+                            <goal>generate-depends-file</goal>
+                        </goals>
+                    </execution>
+                </executions>
+            </plugin>
+        </plugins>
+    </build>
+    
+</project>
\ No newline at end of file

Added: felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-external-handlers-test/src/main/java/org/apache/felix/ipojo/runtime/externalhandlers/components/CheckServiceHandler.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-external-handlers-test/src/main/java/org/apache/felix/ipojo/runtime/externalhandlers/components/CheckServiceHandler.java?rev=1446477&view=auto
==============================================================================
--- felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-external-handlers-test/src/main/java/org/apache/felix/ipojo/runtime/externalhandlers/components/CheckServiceHandler.java (added)
+++ felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-external-handlers-test/src/main/java/org/apache/felix/ipojo/runtime/externalhandlers/components/CheckServiceHandler.java Fri Feb 15 08:55:43 2013
@@ -0,0 +1,105 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.felix.ipojo.runtime.externalhandlers.components;
+
+import org.apache.felix.ipojo.PrimitiveHandler;
+import org.apache.felix.ipojo.architecture.ComponentTypeDescription;
+import org.apache.felix.ipojo.architecture.HandlerDescription;
+import org.apache.felix.ipojo.architecture.PropertyDescription;
+import org.apache.felix.ipojo.metadata.Element;
+import org.apache.felix.ipojo.runtime.externalhandlers.services.CheckService;
+import org.apache.felix.ipojo.runtime.externalhandlers.services.CheckServiceHandlerDescription;
+import org.osgi.framework.ServiceRegistration;
+
+import java.util.Dictionary;
+import java.util.Hashtable;
+
+public class CheckServiceHandler extends PrimitiveHandler implements CheckService {
+
+	ServiceRegistration sr;
+	boolean isValid;
+	int changes = 0;
+	static final String NAMESPACE = "org.apache.felix.ipojo.test.handler.checkservice";
+
+	Dictionary<String, Object> props = new Hashtable<String, Object>();
+
+	public void configure(Element metadata, Dictionary configuration) {
+		Element[] meta = metadata.getElements("check", NAMESPACE);
+		if(meta == null) { return;	}
+		// Get handler props
+		props.put("instance.name", configuration.get("instance.name"));
+		if(configuration.get("csh.simple") != null) { props.put("Simple", configuration.get("csh.simple")); }
+		if(configuration.get("csh.map") != null) {
+			Dictionary m = (Dictionary) configuration.get("csh.map");
+            if (m.size() > 0) {
+                props.put("Map1", m.get("a"));
+                props.put("Map2", m.get("b"));
+                props.put("Map3", m.get("c"));
+            }
+		}
+		props.put("changes", new Integer(changes));
+
+	}
+
+	public void initializeComponentFactory(ComponentTypeDescription cd, Element metadata) {
+	    cd.addProperty(new PropertyDescription("csh.simple", "java.lang.String", null));
+        cd.addProperty(new PropertyDescription("csh.map", "java.util.Dictionary", null));
+	}
+
+	public void start() {
+		if(sr == null) {
+			sr = getInstanceManager().getContext().registerService(CheckService.class.getName(), this, props);
+		}
+		isValid = true;
+	}
+
+	public void stop() {
+		isValid = false;
+		synchronized(this) {
+			if(sr != null) { sr.unregister(); }
+		}
+	}
+
+	public boolean check() {
+		if(isValid) { isValid = false;}
+		else { isValid = true; }
+		return isValid;
+	}
+
+	public Dictionary<String, Object> getProps() {
+		return props;
+	}
+
+	public void stateChanged(int state) {
+		if (sr != null) {
+		    changes++;
+		    props.put("changes", new Integer(changes));
+		    sr.setProperties(props);
+		}
+	}
+
+	public String getName() {
+		return NAMESPACE;
+	}
+
+	public HandlerDescription getDescription() {
+		return new CheckServiceHandlerDescription(this);
+	}
+
+}

Added: felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-external-handlers-test/src/main/java/org/apache/felix/ipojo/runtime/externalhandlers/components/FooProviderType1.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-external-handlers-test/src/main/java/org/apache/felix/ipojo/runtime/externalhandlers/components/FooProviderType1.java?rev=1446477&view=auto
==============================================================================
--- felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-external-handlers-test/src/main/java/org/apache/felix/ipojo/runtime/externalhandlers/components/FooProviderType1.java (added)
+++ felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-external-handlers-test/src/main/java/org/apache/felix/ipojo/runtime/externalhandlers/components/FooProviderType1.java Fri Feb 15 08:55:43 2013
@@ -0,0 +1,117 @@
+/* 
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.felix.ipojo.runtime.externalhandlers.components;
+
+import org.apache.felix.ipojo.runtime.externalhandlers.services.FooService;
+import org.osgi.framework.BundleContext;
+
+import java.util.Properties;
+
+public class FooProviderType1 implements FooService {
+	
+	private int m_bar;
+	private String m_foo;
+    
+    private BundleContext m_context;
+    
+    private static FooProviderType1 singleton;
+    private static int count = 0;
+    
+    private static FooProviderType1 singleton(BundleContext bc) {
+        if (singleton == null) {
+            count++;
+            singleton = new FooProviderType1(bc);
+        }
+        return singleton;
+    }
+    
+    public static FooProviderType1 several(BundleContext bc) {
+        count++;
+        return new FooProviderType1(bc);
+    }
+        
+    public FooProviderType1(BundleContext bc) {
+        if (bc ==null) {
+            throw new RuntimeException("Injected bundle context null");
+        }
+        m_context = bc;
+    }
+
+	public boolean foo() {
+		return true;
+	}
+
+	public Properties fooProps() {
+		Properties p = new Properties();
+		p.put("bar", new Integer(m_bar));
+        if(m_foo != null) {
+            p.put("foo", m_foo);
+        }
+        p.put("context", m_context);
+        
+        p.put("count", new Integer(count));
+		return p;
+	}
+    
+	public void testException() throws Exception {
+        String a = "foobarbaz";
+	    throw new Exception("foo"+a);
+    }
+    
+    public void testTry() {
+            String a = "foo";
+            a.charAt(0);
+    }
+    
+    public void testTry2(String s) {
+            String a = "foo";
+            a.charAt(0);
+    }
+    
+    private void nexttry(String  s) {
+        try {
+            s += "foo";
+        } catch(RuntimeException e) {
+            
+        }
+    }
+    
+	public boolean getBoolean() { return true; }
+
+	public double getDouble() { return 1.0; }
+
+	public int getInt() { return 1; }
+
+	public long getLong() { return 1; }
+
+	public Boolean getObject() { return new Boolean(true); }
+	
+	/**
+	 * Custom constructor.
+	 * @param bar
+	 * @param foo
+	 * @param bc
+	 */
+	public FooProviderType1(int bar, String foo, BundleContext bc) {
+	    m_bar = bar;
+	    m_foo = foo;
+	    m_context = bc;
+	}
+
+}

Added: felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-external-handlers-test/src/main/java/org/apache/felix/ipojo/runtime/externalhandlers/services/CheckService.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-external-handlers-test/src/main/java/org/apache/felix/ipojo/runtime/externalhandlers/services/CheckService.java?rev=1446477&view=auto
==============================================================================
--- felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-external-handlers-test/src/main/java/org/apache/felix/ipojo/runtime/externalhandlers/services/CheckService.java (added)
+++ felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-external-handlers-test/src/main/java/org/apache/felix/ipojo/runtime/externalhandlers/services/CheckService.java Fri Feb 15 08:55:43 2013
@@ -0,0 +1,32 @@
+/* 
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.felix.ipojo.runtime.externalhandlers.services;
+
+import java.util.Dictionary;
+import java.util.Properties;
+
+public interface CheckService {
+    
+    public static final String foo = "foo";
+	
+	public boolean check();
+	
+	public Dictionary<String, Object> getProps();
+
+}

Added: felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-external-handlers-test/src/main/java/org/apache/felix/ipojo/runtime/externalhandlers/services/CheckServiceHandlerDescription.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-external-handlers-test/src/main/java/org/apache/felix/ipojo/runtime/externalhandlers/services/CheckServiceHandlerDescription.java?rev=1446477&view=auto
==============================================================================
--- felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-external-handlers-test/src/main/java/org/apache/felix/ipojo/runtime/externalhandlers/services/CheckServiceHandlerDescription.java (added)
+++ felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-external-handlers-test/src/main/java/org/apache/felix/ipojo/runtime/externalhandlers/services/CheckServiceHandlerDescription.java Fri Feb 15 08:55:43 2013
@@ -0,0 +1,38 @@
+/* 
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.felix.ipojo.runtime.externalhandlers.services;
+
+import org.apache.felix.ipojo.Handler;
+import org.apache.felix.ipojo.architecture.HandlerDescription;
+import org.apache.felix.ipojo.metadata.Attribute;
+import org.apache.felix.ipojo.metadata.Element;
+
+public class CheckServiceHandlerDescription extends HandlerDescription {
+
+	public CheckServiceHandlerDescription(Handler h) {
+		super(h);
+	}
+	
+	public Element getHandlerInfo() {
+		Element elem = super.getHandlerInfo();
+		elem.addAttribute(new Attribute("isValid", isValid()+""));
+		return elem;
+	}
+
+}

Added: felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-external-handlers-test/src/main/java/org/apache/felix/ipojo/runtime/externalhandlers/services/FooService.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-external-handlers-test/src/main/java/org/apache/felix/ipojo/runtime/externalhandlers/services/FooService.java?rev=1446477&view=auto
==============================================================================
--- felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-external-handlers-test/src/main/java/org/apache/felix/ipojo/runtime/externalhandlers/services/FooService.java (added)
+++ felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-external-handlers-test/src/main/java/org/apache/felix/ipojo/runtime/externalhandlers/services/FooService.java Fri Feb 15 08:55:43 2013
@@ -0,0 +1,39 @@
+/* 
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.felix.ipojo.runtime.externalhandlers.services;
+
+import java.util.Properties;
+
+public interface FooService {
+
+	boolean foo();
+	
+	Properties fooProps();
+	
+	Boolean getObject();
+	
+	boolean getBoolean();
+	
+	int getInt();
+	
+	long getLong();
+	
+	double getDouble();
+	
+}

Added: felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-external-handlers-test/src/main/resources/metadata.xml
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-external-handlers-test/src/main/resources/metadata.xml?rev=1446477&view=auto
==============================================================================
--- felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-external-handlers-test/src/main/resources/metadata.xml (added)
+++ felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-external-handlers-test/src/main/resources/metadata.xml Fri Feb 15 08:55:43 2013
@@ -0,0 +1,39 @@
+<ipojo
+        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+        xsi:schemaLocation="org.apache.felix.ipojo http://felix.apache.org/ipojo/schemas/DEV/core.xsd"
+        xmlns="org.apache.felix.ipojo"
+        xmlns:cs="org.apache.felix.ipojo.test.handler.checkservice">
+    <handler
+            classname="org.apache.felix.ipojo.runtime.externalhandlers.components.CheckServiceHandler"
+            name="check"
+            namespace="org.apache.felix.ipojo.test.handler.checkservice"
+            architecture="false">
+        <controller field="isValid" />
+    </handler>
+    <component
+            classname="org.apache.felix.ipojo.runtime.externalhandlers.components.FooProviderType1"
+            name="HANDLER-HandlerTester" architecture="true">
+        <cs:check />
+    </component>
+    <instance name="HandlerTest-2" component="HANDLER-HandlerTester">
+        <property name="csh.simple" value="Simple" />
+        <property name="csh.map">
+            <property name="a" value="a" />
+            <property name="b" value="b" />
+            <property name="c" value="c" />
+        </property>
+    </instance>
+    <instance name="HandlerTest-2-empty" component="HANDLER-HandlerTester">
+        <property name="csh.simple" value="Simple" />
+        <property name="csh.map">
+            <!-- Empty dictionary -->
+        </property>
+    </instance>
+
+    <!-- The handler will be added using the auto handler property -->
+    <component
+            classname="org.apache.felix.ipojo.runtime.externalhandlers.components.FooProviderType1"
+            name="HANDLER-HandlerTesterWO" architecture="true">
+    </component>
+
+</ipojo>

Added: felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-external-handlers-test/src/test/java/org/apache/felix/ipojo/runtime/externalhandlers/test/AutoHandlerTest.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-external-handlers-test/src/test/java/org/apache/felix/ipojo/runtime/externalhandlers/test/AutoHandlerTest.java?rev=1446477&view=auto
==============================================================================
--- felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-external-handlers-test/src/test/java/org/apache/felix/ipojo/runtime/externalhandlers/test/AutoHandlerTest.java (added)
+++ felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-external-handlers-test/src/test/java/org/apache/felix/ipojo/runtime/externalhandlers/test/AutoHandlerTest.java Fri Feb 15 08:55:43 2013
@@ -0,0 +1,108 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.felix.ipojo.runtime.externalhandlers.test;
+
+import org.apache.felix.ipojo.ComponentFactory;
+import org.apache.felix.ipojo.ComponentInstance;
+import org.apache.felix.ipojo.architecture.HandlerDescription;
+import org.apache.felix.ipojo.runtime.externalhandlers.services.CheckServiceHandlerDescription;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+
+import java.util.List;
+import java.util.Properties;
+
+import static junit.framework.Assert.assertEquals;
+import static org.junit.Assert.*;
+
+public class AutoHandlerTest extends Common {
+
+	private static final String ORG_APACHE_FELIX_IPOJO_HANDLER_AUTO_PRIMITIVE = "org.apache.felix.ipojo.handler.auto.primitive";
+
+	ComponentInstance instance;
+
+	ComponentFactory factory;
+
+    @Before
+	public void setUp() {
+		factory = (ComponentFactory) ipojoHelper.getFactory("HANDLER-HandlerTesterWO");
+		System.setProperty(ORG_APACHE_FELIX_IPOJO_HANDLER_AUTO_PRIMITIVE, "");
+	}
+
+    @After
+	public void tearDown() {
+		if (instance != null) {
+			instance.dispose();
+		}
+		instance = null;
+
+		System.setProperty(ORG_APACHE_FELIX_IPOJO_HANDLER_AUTO_PRIMITIVE, "");
+
+	}
+
+    @Test
+	public void testRequiredHandlerList() {
+		System.setProperty(ORG_APACHE_FELIX_IPOJO_HANDLER_AUTO_PRIMITIVE, "");
+
+		factory.stop();
+		factory.restart();
+		factory.start();
+
+		List list = factory.getRequiredHandlers();
+		assertFalse(list.contains("org.apache.felix.ipojo.test.handler.checkservice:check"));
+
+		String v = "org.apache.felix.ipojo.test.handler.checkservice:check";
+		System.setProperty(ORG_APACHE_FELIX_IPOJO_HANDLER_AUTO_PRIMITIVE, v);
+
+		factory.stop();
+		factory.restart();
+		factory.start();
+
+		list = factory.getRequiredHandlers();
+		assertTrue(list.contains("org.apache.felix.ipojo.test.handler.checkservice:check"));
+
+		System.setProperty(ORG_APACHE_FELIX_IPOJO_HANDLER_AUTO_PRIMITIVE, "");
+
+	}
+
+
+    @Test
+    public void testInstanceCreation() throws Exception {
+		String v = "org.apache.felix.ipojo.test.handler.checkservice:check";
+		System.setProperty(ORG_APACHE_FELIX_IPOJO_HANDLER_AUTO_PRIMITIVE, v);
+
+		factory.stop();
+		factory.restart();
+		factory.start();
+
+		instance = factory.createComponentInstance(new Properties());
+		assertEquals(ComponentInstance.VALID, instance.getState());
+
+		HandlerDescription hd = instance.getInstanceDescription().getHandlerDescription(v);
+		assertNotNull(hd);
+		assertTrue(hd instanceof CheckServiceHandlerDescription);
+
+		System.setProperty(ORG_APACHE_FELIX_IPOJO_HANDLER_AUTO_PRIMITIVE, "");
+
+		factory.stop();
+		factory.restart();
+		factory.start();
+	}
+}

Added: felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-external-handlers-test/src/test/java/org/apache/felix/ipojo/runtime/externalhandlers/test/Common.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-external-handlers-test/src/test/java/org/apache/felix/ipojo/runtime/externalhandlers/test/Common.java?rev=1446477&view=auto
==============================================================================
--- felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-external-handlers-test/src/test/java/org/apache/felix/ipojo/runtime/externalhandlers/test/Common.java (added)
+++ felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-external-handlers-test/src/test/java/org/apache/felix/ipojo/runtime/externalhandlers/test/Common.java Fri Feb 15 08:55:43 2013
@@ -0,0 +1,146 @@
+package org.apache.felix.ipojo.runtime.externalhandlers.test;
+
+import ch.qos.logback.classic.Level;
+import ch.qos.logback.classic.Logger;
+import org.apache.commons.io.FileUtils;
+import org.apache.commons.io.filefilter.TrueFileFilter;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.runner.RunWith;
+import org.ops4j.pax.exam.Configuration;
+import org.ops4j.pax.exam.Option;
+import org.ops4j.pax.exam.junit.PaxExam;
+import org.ops4j.pax.exam.options.CompositeOption;
+import org.ops4j.pax.exam.options.DefaultCompositeOption;
+import org.ops4j.pax.exam.spi.reactors.ExamReactorStrategy;
+import org.ops4j.pax.exam.spi.reactors.PerClass;
+import org.ops4j.pax.tinybundles.core.TinyBundle;
+import org.ops4j.pax.tinybundles.core.TinyBundles;
+import org.osgi.framework.Bundle;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.Constants;
+import org.ow2.chameleon.testing.helpers.IPOJOHelper;
+import org.ow2.chameleon.testing.helpers.OSGiHelper;
+import org.ow2.chameleon.testing.tinybundles.ipojo.IPOJOStrategy;
+import org.slf4j.LoggerFactory;
+
+import javax.inject.Inject;
+import java.io.File;
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.MalformedURLException;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
+
+import static org.ops4j.pax.exam.CoreOptions.*;
+
+/**
+ * Bootstrap the test from this project
+ */
+@RunWith(PaxExam.class)
+@ExamReactorStrategy(PerClass.class)
+public class Common {
+
+    @Inject
+    BundleContext bc;
+
+    OSGiHelper osgiHelper;
+    IPOJOHelper ipojoHelper;
+
+    Bundle testedBundle;
+
+    @Configuration
+    public Option[] config() throws MalformedURLException {
+        Logger root = (Logger) LoggerFactory.getLogger(Logger.ROOT_LOGGER_NAME);
+        root.setLevel(Level.INFO);
+
+        return options(
+                ipojoBundles(),
+                junitBundles(),
+                testedBundle(),
+                systemProperty("org.ops4j.pax.logging.DefaultServiceLog.level").value("WARN")
+        );
+    }
+
+    @Before
+    public void commonSetUp() {
+        osgiHelper = new OSGiHelper(bc);
+        ipojoHelper = new IPOJOHelper(bc);
+
+        testedBundle = osgiHelper.getBundle("test.bundle");
+
+        // Dump OSGi Framework information
+        String vendor = (String) osgiHelper.getBundle(0).getHeaders().get(Constants.BUNDLE_VENDOR);
+        if (vendor == null) {
+            vendor = (String) osgiHelper.getBundle(0).getHeaders().get(Constants.BUNDLE_SYMBOLICNAME);
+        }
+        String version = (String) osgiHelper.getBundle(0).getHeaders().get(Constants.BUNDLE_VERSION);
+        System.out.println("OSGi Framework : " + vendor + " - " + version);
+    }
+
+    @After
+    public void commonTearDown() {
+        ipojoHelper.dispose();
+        osgiHelper.dispose();
+    }
+
+    public CompositeOption ipojoBundles() {
+        return new DefaultCompositeOption(
+                mavenBundle("org.apache.felix", "org.apache.felix.ipojo").versionAsInProject(),
+                mavenBundle("org.ow2.chameleon.testing", "osgi-helpers").versionAsInProject());
+    }
+
+    public Option testedBundle() throws MalformedURLException {
+        File out = new File("target/tested/bundle.jar");
+
+        TinyBundle tested = TinyBundles.bundle();
+
+        // We look inside target/classes to find the class and resources
+        File classes = new File("target/classes");
+        Collection<File> files = FileUtils.listFilesAndDirs(classes, TrueFileFilter.INSTANCE, TrueFileFilter.INSTANCE);
+        List<File> services = new ArrayList<File>();
+        for (File file : files) {
+            if (file.isDirectory()) {
+                // By convention we export of .services and .service package
+                if (file.getName().endsWith("services") || file.getName().endsWith("service")) {
+                    services.add(file);
+                }
+            } else {
+                // We need to compute the path
+                String path = file.getAbsolutePath().substring(classes.getAbsolutePath().length() + 1);
+                tested.add(path, file.toURI().toURL());
+                System.out.println(file.getName() + " added to " + path);
+            }
+        }
+
+        String export = "";
+        for (File file : services) {
+            if (export.length() > 0) {
+                export += ", ";
+            }
+            String path = file.getAbsolutePath().substring(classes.getAbsolutePath().length() + 1);
+            String packageName = path.replace('/', '.');
+            export += packageName;
+        }
+
+        System.out.println("Exported packages : " + export);
+
+        InputStream inputStream = tested
+                .set(Constants.BUNDLE_SYMBOLICNAME, "test.bundle")
+                .set(Constants.IMPORT_PACKAGE, "*")
+                .set(Constants.EXPORT_PACKAGE, export)
+                .build(IPOJOStrategy.withiPOJO(new File("src/main/resources")));
+
+        try {
+            FileUtils.copyInputStreamToFile(inputStream, out);
+            return bundle(out.toURI().toURL().toExternalForm());
+        } catch (MalformedURLException e) {
+            throw new RuntimeException("Cannot compute the url of the manipulated bundle");
+        } catch (IOException e) {
+            throw new RuntimeException("Cannot write of the manipulated bundle");
+        }
+    }
+
+
+}

Added: felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-external-handlers-test/src/test/java/org/apache/felix/ipojo/runtime/externalhandlers/test/HandlerTest.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-external-handlers-test/src/test/java/org/apache/felix/ipojo/runtime/externalhandlers/test/HandlerTest.java?rev=1446477&view=auto
==============================================================================
--- felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-external-handlers-test/src/test/java/org/apache/felix/ipojo/runtime/externalhandlers/test/HandlerTest.java (added)
+++ felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-external-handlers-test/src/test/java/org/apache/felix/ipojo/runtime/externalhandlers/test/HandlerTest.java Fri Feb 15 08:55:43 2013
@@ -0,0 +1,205 @@
+/* 
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.felix.ipojo.runtime.externalhandlers.test;
+
+import org.apache.felix.ipojo.ComponentInstance;
+import org.apache.felix.ipojo.HandlerManagerFactory;
+import org.apache.felix.ipojo.architecture.Architecture;
+import org.apache.felix.ipojo.runtime.externalhandlers.services.CheckService;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+import org.osgi.framework.ServiceReference;
+
+import java.util.Dictionary;
+import java.util.Properties;
+
+import static junit.framework.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
+
+public class HandlerTest extends Common {
+
+	ComponentInstance instance;
+
+    @Before
+	public void setUp() {
+		Properties props = new Properties();
+		props.put("instance.name","HandlerTest-1");
+		props.put("csh.simple", "simple");
+		Properties p = new Properties();
+		p.put("a", "a");
+		p.put("b", "b");
+		p.put("c", "c");
+		props.put("csh.map", p);
+		instance = ipojoHelper.createComponentInstance("HANDLER-HandlerTester", props);
+	}
+    
+	@After
+	public void tearDown() {
+		instance.dispose();
+		instance = null;
+	}
+
+    @Test
+	public void testConfiguration1() {
+		// Check the availability of CheckService
+	    String name = "HandlerTest-1";
+		ServiceReference sr = null;
+		ServiceReference[] refs = null;
+        String filter = "("+"instance.name"+"="+name+")";
+        refs =osgiHelper.getServiceReferences(CheckService.class.getName(), filter);
+        if(refs != null) { sr = refs[0]; }
+        
+		assertNotNull("Check the check service availability", sr);
+		
+		CheckService cs = (CheckService) osgiHelper.getServiceObject(sr);
+		Dictionary<String, Object> p = cs.getProps();
+		assertEquals("Assert 'simple' equality", p.get("Simple"), "simple");
+		assertEquals("Assert 'a' equality", p.get("Map1"), "a");
+		assertEquals("Assert 'b' equality", p.get("Map2"), "b");
+		assertEquals("Assert 'c' equality", p.get("Map3"), "c");
+	}
+
+    @Test
+	public void testConfiguration2() {
+		// Check the availability of CheckService
+	    String name = "HandlerTest-2";
+        ServiceReference sr = null;
+        ServiceReference[] refs = null;
+        String filter = "("+"instance.name"+"="+name+")";
+
+        refs = osgiHelper.getServiceReferences(CheckService.class.getName(), filter);
+
+        if(refs != null) { sr = refs[0]; }
+		assertNotNull("Check the check service availability", sr);
+		
+		CheckService cs = (CheckService) osgiHelper.getServiceObject(sr);
+        Dictionary<String, Object> p = cs.getProps();
+		assertEquals("Assert 'simple' equality", p.get("Simple"), "Simple");
+		assertEquals("Assert 'a' equality", p.get("Map1"), "a");
+		assertEquals("Assert 'b' equality", p.get("Map2"), "b");
+		assertEquals("Assert 'c' equality", p.get("Map3"), "c");
+	}
+
+    @Test
+    public void testConfiguration3() {
+        // Check the availability of CheckService
+        String name = "HandlerTest-2-empty";
+        ServiceReference sr = null;
+        ServiceReference[] refs = null;
+        String filter = "("+"instance.name"+"="+name+")";
+        refs = osgiHelper.getServiceReferences(CheckService.class.getName(), filter);
+        if(refs != null) { sr = refs[0]; }
+        assertNotNull("Check the check service availability", sr);
+        
+        CheckService cs = (CheckService) osgiHelper.getServiceObject(sr);
+        Dictionary<String, Object> p = cs.getProps();
+        assertEquals("Assert 'simple' equality", p.get("Simple"), "Simple");
+        assertEquals("Size of p", 3, p.size()); // instance name, simple and changes.
+        
+        cs = null;
+    }
+
+    @Test
+	public void testLifecycle() {
+		// Check the availability of CheckService
+	    String name = "HandlerTest-1";
+        ServiceReference sr = null;
+        ServiceReference[] refs = null;
+        String filter = "("+"instance.name"+"="+name+")";
+        refs = osgiHelper.getServiceReferences(CheckService.class.getName(), filter);
+        if(refs != null) { sr = refs[0]; }
+		assertNotNull("Check the check service availability", sr);
+		
+		ServiceReference sr_arch = ipojoHelper.getServiceReferenceByName(Architecture.class.getName(), "HandlerTest-1");
+		Architecture arch = (Architecture) osgiHelper.getServiceObject(sr_arch);
+		
+		assertEquals("Check instance validity - 0", arch.getInstanceDescription().getState(), ComponentInstance.VALID);
+		
+		CheckService cs = (CheckService) osgiHelper.getServiceObject(sr);
+		Dictionary<String, Object> p = cs.getProps();
+		Integer changes = (Integer) p.get("changes");
+		assertNotNull("Check changes no null", changes);
+		assertEquals("Changes changes 1 ("+changes+")", changes.intValue(), 1);
+		assertEquals("Check instance validity - 1", arch.getInstanceDescription().getState(), ComponentInstance.VALID);
+		cs.check();
+		p = cs.getProps();
+		changes = (Integer) p.get("changes");
+		assertEquals("Changes changes 2 ("+changes+")", changes.intValue(), 2);
+		assertEquals("Check instance validity - 2", arch.getInstanceDescription().getState(), ComponentInstance.INVALID);
+		cs.check();
+		p = cs.getProps();
+		changes = (Integer) p.get("changes");
+		assertEquals("Changes changes 3 ("+changes+")", changes.intValue(), 3);
+		assertEquals("Check instance validity - 3", arch.getInstanceDescription().getState(), ComponentInstance.VALID);
+		cs.check();
+		p = cs.getProps();
+		changes = (Integer) p.get("changes");
+		assertEquals("Changes changes 4 ("+changes+")", changes.intValue(), 4);
+		assertEquals("Check instance validity - 4", arch.getInstanceDescription().getState(), ComponentInstance.INVALID);
+	}
+
+    @Test
+	public void testAvailability() {
+	    String name = "HandlerTest-1";
+        ServiceReference sr = null;
+        ServiceReference[] refs = null;
+        String filter = "("+"instance.name"+"="+name+")";
+        refs = osgiHelper.getServiceReferences(CheckService.class.getName(), filter);
+
+        if(refs != null) { sr = refs[0]; }
+        assertNotNull("Check the check service availability", sr);
+        
+        ServiceReference sr_arch = ipojoHelper.getServiceReferenceByName(Architecture.class.getName(), "HandlerTest-1");
+        Architecture arch = (Architecture) osgiHelper.getServiceObject(sr_arch);
+        assertEquals("Check validity", arch.getInstanceDescription().getState(), ComponentInstance.VALID);
+        
+        // Kill the handler factory
+        HandlerManagerFactory f = (HandlerManagerFactory)ipojoHelper.getHandlerFactory( "check");
+        f.stop();
+        
+        sr = ipojoHelper.getServiceReferenceByName(CheckService.class.getName(), "HandlerTest-1");
+        assertNull("Check the check service unavailability", sr);
+        
+        sr_arch = ipojoHelper.getServiceReferenceByName(Architecture.class.getName(), "HandlerTest-1");
+        assertNull("Check the architecture unavailability", sr_arch);
+        
+        // The instance is disposed, restart the handler
+        f.start();
+        
+        Properties props = new Properties();
+        props.put("instance.name","HandlerTest-1");
+        props.put("csh.simple", "simple");
+        Properties p = new Properties();
+        p.put("a", "a");
+        p.put("b", "b");
+        p.put("c", "c");
+        props.put("csh.map", p);
+        instance = ipojoHelper.createComponentInstance("HANDLER-HandlerTester", props);
+        
+        sr = ipojoHelper.getServiceReferenceByName(CheckService.class.getName(), "HandlerTest-1");
+        assertNotNull("Check the check service availability - 2", sr);
+        
+        sr_arch = ipojoHelper.getServiceReferenceByName(Architecture.class.getName(), "HandlerTest-1");
+        arch = (Architecture) osgiHelper.getServiceObject(sr_arch);
+        assertEquals("Check validity - 2", arch.getInstanceDescription().getState(), ComponentInstance.VALID);
+	}
+
+}

Added: felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-external-handlers-test/src/test/resources/exam.properties
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-external-handlers-test/src/test/resources/exam.properties?rev=1446477&view=auto
==============================================================================
    (empty)