Fix issue FELIX-2132
Provides Service Controller (XSD, Annotation, API, Core and Tests)

Also update several tests to the new pax exam.

git-svn-id: https://svn.apache.org/repos/asf/felix/trunk@915909 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/ipojo/tests/core/annotations/pom.xml b/ipojo/tests/core/annotations/pom.xml
index d54fe9b..1942108 100644
--- a/ipojo/tests/core/annotations/pom.xml
+++ b/ipojo/tests/core/annotations/pom.xml
@@ -116,7 +116,7 @@
       </plugin>

       

       

-       <!-- <plugin>

+       <plugin>

         <groupId>org.apache.felix</groupId>

         <artifactId>maven-junit4osgi-plugin</artifactId>

         <version>1.1.0-SNAPSHOT</version>

@@ -132,7 +132,7 @@
             </configuration>

           </execution>

         </executions>

-      </plugin>-->

+      </plugin>

     </plugins>

   </build>

 </project>

diff --git a/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/ServiceProdiving.java b/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/ServiceProdiving.java
index 2702235..15c5813 100644
--- a/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/ServiceProdiving.java
+++ b/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/ServiceProdiving.java
@@ -82,6 +82,16 @@
         

     }

     

+    public void testServiceController() {

+        Element meta = helper.getMetadata("org.apache.felix.ipojo.test.scenarios.component.PSServiceController");

+        Element[] provs = meta.getElements("provides");

+        assertNotNull("Provides exists ", provs);

+        System.out.println(provs[0].toString());

+        assertNotNull(provs[0].getElements("controller"));

+        assertEquals(1, provs[0].getElements("controller").length);

+        assertEquals("false", provs[0].getElements("controller")[0].getAttribute("value"));

+    }

+

     private Element getPropertyByName(Element[] props, String name) {

         for (int i = 0; i < props.length; i++) {

             String na = props[i].getAttribute("name");

diff --git a/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/component/PSServiceController.java b/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/component/PSServiceController.java
new file mode 100644
index 0000000..13b905c
--- /dev/null
+++ b/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/component/PSServiceController.java
@@ -0,0 +1,54 @@
+package org.apache.felix.ipojo.test.scenarios.component;

+

+import java.util.Properties;

+

+import org.apache.felix.ipojo.annotations.Component;

+import org.apache.felix.ipojo.annotations.Provides;

+import org.apache.felix.ipojo.annotations.ServiceController;

+import org.apache.felix.ipojo.test.scenarios.annotations.service.BarService;

+import org.apache.felix.ipojo.test.scenarios.annotations.service.FooService;

+

+@Component

+@Provides(specifications= {FooService.class, BarService.class})

+public class PSServiceController implements FooService, BarService {

+

+    @ServiceController(value=false)

+    public boolean controller;

+    

+    public boolean foo() {

+        return false;

+    }

+

+    public Properties fooProps() {

+        return null;

+    }

+

+    public boolean getBoolean() {

+        return false;

+    }

+

+    public double getDouble() {

+        return 0;

+    }

+

+    public int getInt() {

+        return 0;

+    }

+

+    public long getLong() {

+        return 0;

+    }

+

+    public Boolean getObject() {

+        return null;

+    }

+

+    public boolean bar() {

+        return false;

+    }

+

+    public Properties getProps() {

+        return null;

+    }

+

+}

diff --git a/ipojo/tests/core/service-providing/pom.xml b/ipojo/tests/core/service-providing/pom.xml
index 2e6ed9c..bdbf7e0 100644
--- a/ipojo/tests/core/service-providing/pom.xml
+++ b/ipojo/tests/core/service-providing/pom.xml
@@ -1,102 +1,120 @@
 <!--

-	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

+  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

+  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.

+  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.

 -->

 <project>

-	<modelVersion>4.0.0</modelVersion>

-	<packaging>bundle</packaging>

-	<name>iPOJO Service Providing Test Suite</name>

-	<artifactId>tests.core.ps</artifactId>

-	<groupId>ipojo.tests</groupId>

-	<version>1.5.0-SNAPSHOT</version>

-	<dependencies>

-		<dependency>

-			<groupId>org.apache.felix</groupId>

-			<artifactId>org.apache.felix.ipojo</artifactId>

-			<version>${pom.version}</version>

-		</dependency>

-		<dependency>

-			<groupId>org.apache.felix</groupId>

-			<artifactId>org.apache.felix.ipojo.metadata</artifactId>

-			<version>${pom.version}</version>

-		</dependency>

-		<dependency>

-			<groupId>org.apache.felix</groupId>

-			<artifactId>org.osgi.core</artifactId>

-			<version>1.0.1</version>

-		</dependency>

-		<dependency>

-			<groupId>junit</groupId>

-			<artifactId>junit</artifactId>

-			<version>3.8.1</version>

-		</dependency>

-		<dependency>

-			<groupId>org.apache.felix</groupId>

-			<artifactId>org.apache.felix.ipojo.junit4osgi</artifactId>

-			<version>1.1.0-SNAPSHOT</version>

-		</dependency>

-	</dependencies>

-	<build>

-		<plugins>

-			<plugin>

-				<groupId>org.apache.felix</groupId>

-				<artifactId>maven-bundle-plugin</artifactId>

-				<version>1.4.3</version>

-				<extensions>true</extensions>

-				<configuration>

-					<instructions>

-						<Export-Package>

-							org.apache.felix.ipojo.test.scenarios.ps.service

-						</Export-Package>

-						<Bundle-SymbolicName>

-							${pom.artifactId}

-						</Bundle-SymbolicName>

-						<Private-Package>

-							org.apache.felix.ipojo.test*

-						</Private-Package>

-						<Test-Suite>

-							org.apache.felix.ipojo.test.scenarios.ps.ProvidedServiceTestSuite

-						</Test-Suite>

-					</instructions>

-				</configuration>

-			</plugin>

-			<plugin>

-				<groupId>org.apache.felix</groupId>

-				<artifactId>maven-ipojo-plugin</artifactId>

-				<version>${pom.version}</version>

-				<executions>

-					<execution>

-						<goals>

-							<goal>ipojo-bundle</goal>

-						</goals>

-						<configuration>

-							<ignoreAnnotations>true</ignoreAnnotations>

-						</configuration>

-					</execution>

-				</executions>

-			</plugin>

-			<plugin>

-				<groupId>org.apache.maven.plugins</groupId>

-				<artifactId>maven-compiler-plugin</artifactId>

-				<configuration>

-					<source>1.4</source>

-					<target>1.4</target>

-				</configuration>

-			</plugin>

-		</plugins>

-	</build>

+  <modelVersion>4.0.0</modelVersion>

+  <packaging>bundle</packaging>

+  <name>iPOJO Service Providing Test Suite</name>

+  <artifactId>tests.core.ps</artifactId>

+  <groupId>ipojo.tests</groupId>

+  <version>1.5.0-SNAPSHOT</version>

+  <dependencies>

+    <dependency>

+      <groupId>org.apache.felix</groupId>

+      <artifactId>org.apache.felix.ipojo</artifactId>

+      <version>${pom.version}</version>

+    </dependency>

+    <dependency>

+      <groupId>org.apache.felix</groupId>

+      <artifactId>org.apache.felix.ipojo.metadata</artifactId>

+      <version>${pom.version}</version>

+    </dependency>

+    <dependency>

+      <groupId>org.apache.felix</groupId>

+      <artifactId>org.osgi.core</artifactId>

+      <version>1.0.1</version>

+    </dependency>

+    <dependency>

+      <groupId>junit</groupId>

+      <artifactId>junit</artifactId>

+      <version>3.8.1</version>

+    </dependency>

+    <dependency>

+      <groupId>org.apache.felix</groupId>

+      <artifactId>org.apache.felix.ipojo.junit4osgi</artifactId>

+      <version>1.1.0-SNAPSHOT</version>

+    </dependency>

+  </dependencies>

+  <build>

+    <plugins>

+      <plugin>

+        <groupId>org.apache.felix</groupId>

+        <artifactId>maven-bundle-plugin</artifactId>

+        <version>1.4.3</version>

+        <extensions>true</extensions>

+        <configuration>

+          <instructions>

+            <Export-Package>

+              org.apache.felix.ipojo.test.scenarios.ps.service

+            </Export-Package>

+            <Bundle-SymbolicName>

+              ${pom.artifactId}

+            </Bundle-SymbolicName>

+            <Private-Package>

+              org.apache.felix.ipojo.test*

+            </Private-Package>

+            <Test-Suite>

+              org.apache.felix.ipojo.test.scenarios.ps.ProvidedServiceTestSuite

+            </Test-Suite>

+          </instructions>

+        </configuration>

+      </plugin>

+      <plugin>

+        <groupId>org.apache.felix</groupId>

+        <artifactId>maven-ipojo-plugin</artifactId>

+        <version>${pom.version}</version>

+        <executions>

+          <execution>

+            <goals>

+              <goal>ipojo-bundle</goal>

+            </goals>

+            <configuration>

+              <ignoreAnnotations>true</ignoreAnnotations>

+            </configuration>

+          </execution>

+        </executions>

+      </plugin>

+      <plugin>

+        <groupId>org.apache.maven.plugins</groupId>

+        <artifactId>maven-compiler-plugin</artifactId>

+        <configuration>

+          <source>1.4</source>

+          <target>1.4</target>

+        </configuration>

+      </plugin>

+      

+       <plugin>

+        <groupId>org.apache.felix</groupId>

+        <artifactId>maven-junit4osgi-plugin</artifactId>

+        <version>1.1.0-SNAPSHOT</version>

+        <executions>

+          <execution>

+            <goals>

+              <goal>test</goal>

+            </goals>

+            <configuration>

+              <configuration>

+              <org.osgi.http.port>8083</org.osgi.http.port>

+              </configuration>

+            </configuration>

+          </execution>

+        </executions>

+      </plugin>

+    </plugins>

+  </build>

 </project>

diff --git a/ipojo/tests/core/service-providing/src/main/java/org/apache/felix/ipojo/test/scenarios/component/controller/ControllerCheckService.java b/ipojo/tests/core/service-providing/src/main/java/org/apache/felix/ipojo/test/scenarios/component/controller/ControllerCheckService.java
new file mode 100644
index 0000000..988294f
--- /dev/null
+++ b/ipojo/tests/core/service-providing/src/main/java/org/apache/felix/ipojo/test/scenarios/component/controller/ControllerCheckService.java
@@ -0,0 +1,56 @@
+package org.apache.felix.ipojo.test.scenarios.component.controller;
+
+import java.util.Properties;
+
+import org.apache.felix.ipojo.test.scenarios.ps.service.CheckService;
+import org.apache.felix.ipojo.test.scenarios.ps.service.FooService;
+
+public class ControllerCheckService implements FooService, CheckService {
+    
+    
+    private boolean controller;
+
+    public boolean foo() {
+        return controller;
+    }
+
+    public Properties fooProps() {
+        Properties props = new Properties();
+        props.put("controller", new Boolean(controller));
+        return props;
+    }
+
+    public boolean getBoolean() {
+        return false;
+    }
+
+    public double getDouble() {
+        return 0;
+    }
+
+    public int getInt() {
+        return 0;
+    }
+
+    public long getLong() {
+        return 0;
+    }
+
+    public Boolean getObject() {
+        return null;
+    }
+
+    public boolean check() {
+        System.out.println("Before : " + controller);
+        controller = ! controller; // Change
+        System.out.println("After : " + controller);
+        return controller;
+    }
+
+    public Properties getProps() {
+        Properties props = new Properties();
+        props.put("controller", new Boolean(controller));
+        return props;
+    }
+
+}
diff --git a/ipojo/tests/core/service-providing/src/main/java/org/apache/felix/ipojo/test/scenarios/component/controller/DoubleControllerCheckService.java b/ipojo/tests/core/service-providing/src/main/java/org/apache/felix/ipojo/test/scenarios/component/controller/DoubleControllerCheckService.java
new file mode 100644
index 0000000..bdfa92c
--- /dev/null
+++ b/ipojo/tests/core/service-providing/src/main/java/org/apache/felix/ipojo/test/scenarios/component/controller/DoubleControllerCheckService.java
@@ -0,0 +1,66 @@
+package org.apache.felix.ipojo.test.scenarios.component.controller;
+
+import java.util.Properties;
+
+import org.apache.felix.ipojo.test.scenarios.ps.service.CheckService;
+import org.apache.felix.ipojo.test.scenarios.ps.service.FooService;
+
+public class DoubleControllerCheckService implements FooService, CheckService {
+    
+    
+    private boolean controllerFoo;
+    private boolean controllerCS;
+
+    public boolean foo() {
+        controllerFoo = ! controllerFoo;
+        return controllerFoo;
+    }
+
+    public Properties fooProps() {
+        Properties props = new Properties();
+        props.put("controller", new Boolean(controllerFoo));
+        
+        controllerCS = true;
+        controllerFoo = true;
+        
+        return props;
+    }
+
+    public boolean getBoolean() {
+        return false;
+    }
+
+    public double getDouble() {
+        return 0;
+    }
+
+    public int getInt() {
+        return 0;
+    }
+
+    public long getLong() {
+        return 0;
+    }
+
+    public Boolean getObject() {
+        return null;
+    }
+
+    public boolean check() {
+        controllerCS = ! controllerCS;
+        return controllerCS;
+    }
+
+    public Properties getProps() {
+        Properties props = new Properties();
+        props.put("controller", new Boolean(controllerCS));
+        
+        // Invert both
+        controllerCS = ! controllerCS;
+        controllerFoo = ! controllerFoo;
+        
+        return props;
+        
+    }
+
+}
diff --git a/ipojo/tests/core/service-providing/src/main/java/org/apache/felix/ipojo/test/scenarios/ps/ProvidedServiceTestSuite.java b/ipojo/tests/core/service-providing/src/main/java/org/apache/felix/ipojo/test/scenarios/ps/ProvidedServiceTestSuite.java
index 720c46a..5e9adc6 100644
--- a/ipojo/tests/core/service-providing/src/main/java/org/apache/felix/ipojo/test/scenarios/ps/ProvidedServiceTestSuite.java
+++ b/ipojo/tests/core/service-providing/src/main/java/org/apache/felix/ipojo/test/scenarios/ps/ProvidedServiceTestSuite.java
@@ -39,6 +39,7 @@
         ots.addTestSuite(ClassTest.class);

         ots.addTestSuite(OSGiPropertiesTest.class);

         ots.addTestSuite(NullCheck.class);

+        ots.addTestSuite(ServiceControllerTest.class);

         return ots;

     }

 

diff --git a/ipojo/tests/core/service-providing/src/main/java/org/apache/felix/ipojo/test/scenarios/ps/ServiceControllerTest.java b/ipojo/tests/core/service-providing/src/main/java/org/apache/felix/ipojo/test/scenarios/ps/ServiceControllerTest.java
new file mode 100644
index 0000000..c325ece
--- /dev/null
+++ b/ipojo/tests/core/service-providing/src/main/java/org/apache/felix/ipojo/test/scenarios/ps/ServiceControllerTest.java
@@ -0,0 +1,168 @@
+/* 

+ * 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.test.scenarios.ps;

+

+import org.apache.felix.ipojo.ComponentInstance;

+import org.apache.felix.ipojo.handlers.providedservice.ProvidedServiceDescription;

+import org.apache.felix.ipojo.handlers.providedservice.ProvidedServiceHandlerDescription;

+import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;

+import org.apache.felix.ipojo.junit4osgi.helpers.IPOJOHelper;

+import org.apache.felix.ipojo.test.scenarios.ps.service.CheckService;

+import org.apache.felix.ipojo.test.scenarios.ps.service.FooService;

+

+public class ServiceControllerTest extends OSGiTestCase {

+    

+    IPOJOHelper helper;

+

+    public void setUp() {

+        helper = new IPOJOHelper(this);

+    }

+    

+    

+    public void tearDown() {

+        helper.dispose();

+    }

+    

+    

+    public void testComponentWithAController() {

+        ComponentInstance ci = helper.createComponentInstance("PS-Controller-1-default");

+        // Controller set to true.

+        waitForService(FooService.class.getName(), null, 5000);

+        waitForService(CheckService.class.getName(), null, 5000);

+        

+        CheckService check = (CheckService) getServiceObject(CheckService.class.getName(), null);

+        assertNotNull(check);

+        

+        assertFalse(check.check());

+        

+        // FooService should not be there anymore

+        assertNull(getServiceReference(FooService.class.getName()));

+        

+        assertTrue(check.check());

+        

+        assertNotNull(getServiceReference(FooService.class.getName()));

+        

+        ci.dispose();

+    }

+    

+    public void testComponentWithAControllerSetToFalse() {

+        ComponentInstance ci = helper.createComponentInstance("PS-Controller-1-false");

+        // Controller set to false.

+        waitForService(CheckService.class.getName(), null, 5000);

+        assertNull(getServiceReference(FooService.class.getName()));

+

+        CheckService check = (CheckService) getServiceObject(CheckService.class.getName(), null);

+        assertNotNull(check);

+        

+        assertTrue(check.check());

+        assertNotNull(getServiceReference(FooService.class.getName()));

+

+        assertFalse(check.check());

+        // FooService should not be there anymore

+        assertNull(getServiceReference(FooService.class.getName()));

+        

+        ci.dispose();

+    }

+    

+    public void testComponentWithTwoControllersSetToTrue() {

+        ComponentInstance ci = helper.createComponentInstance("PS-Controller-2-truetrue");

+

+        waitForService(CheckService.class.getName(), null, 5000);

+        waitForService(FooService.class.getName(), null, 5000);

+

+        CheckService check = (CheckService) getServiceObject(CheckService.class.getName(), null);

+        assertNotNull(check);

+        

+        check.check();

+       

+        assertNull(getServiceReference(CheckService.class.getName()));

+        assertNotNull(getServiceReference(FooService.class.getName()));

+

+        FooService fs = (FooService) getServiceObject(FooService.class.getName(), null);

+        fs.foo();

+        

+        assertNull(getServiceReference(CheckService.class.getName()));

+        assertNull(getServiceReference(FooService.class.getName()));

+        

+        ci.dispose();

+    }

+    

+    public void testComponentWithTwoControllersSetToTrueAndFalse() {

+        ComponentInstance ci = helper.createComponentInstance("PS-Controller-2-truefalse");

+

+        waitForService(CheckService.class.getName(), null, 5000);

+        

+        assertFalse(isServiceAvailable(FooService.class.getName()));

+

+        CheckService check = (CheckService) getServiceObject(CheckService.class.getName(), null);

+        assertNotNull(check);

+        

+        check.getProps();

+        

+        assertFalse(isServiceAvailable(CheckService.class.getName()));

+        assertTrue(isServiceAvailable(FooService.class.getName()));

+       

+        FooService fs = (FooService) getServiceObject(FooService.class.getName(), null);

+        fs.fooProps();

+        

+        assertTrue(isServiceAvailable(CheckService.class.getName()));

+        assertTrue(isServiceAvailable(FooService.class.getName()));

+        

+        ci.dispose();

+    }

+    

+    public void testArchitecture() {

+        ComponentInstance ci = helper.createComponentInstance("PS-Controller-1-default");

+        // Controller set to true.

+        waitForService(FooService.class.getName(), null, 5000);

+        waitForService(CheckService.class.getName(), null, 5000);

+        

+        ProvidedServiceHandlerDescription pshd = null;

+        pshd = (ProvidedServiceHandlerDescription) ci.getInstanceDescription()

+            .getHandlerDescription("org.apache.felix.ipojo:provides");

+        

+        ProvidedServiceDescription ps = getPS(FooService.class.getName(), pshd.getProvidedServices());

+        assertEquals("true", ps.getController());

+        

+        CheckService check = (CheckService) getServiceObject(CheckService.class.getName(), null);

+        assertNotNull(check);

+        

+        assertFalse(check.check());

+        

+        ps = getPS(FooService.class.getName(), pshd.getProvidedServices());

+        assertEquals("false", ps.getController());

+        

+        assertTrue(check.check());

+        

+        ps = getPS(FooService.class.getName(), pshd.getProvidedServices());

+        assertEquals("true", ps.getController());

+        

+    }

+    

+    private  ProvidedServiceDescription getPS(String itf, ProvidedServiceDescription[] svc) {

+        for (int i = 0; i < svc.length; i++) {

+            if (svc[i].getServiceSpecifications()[0].equals(itf)) {

+                return svc[i];

+            }

+        }

+        

+        fail("Service : " + itf + " not found");

+        return null;

+    }

+}

diff --git a/ipojo/tests/core/service-providing/src/main/resources/metadata.xml b/ipojo/tests/core/service-providing/src/main/resources/metadata.xml
index 50c458d..6abd991 100644
--- a/ipojo/tests/core/service-providing/src/main/resources/metadata.xml
+++ b/ipojo/tests/core/service-providing/src/main/resources/metadata.xml
@@ -168,4 +168,46 @@
       <property field="prop2"/>

     </provides>

   </component>

+  

+  <!--  Service Controller -->

+  <component classname="org.apache.felix.ipojo.test.scenarios.component.controller.ControllerCheckService"

+    name="PS-Controller-1-default">

+    <provides specifications="org.apache.felix.ipojo.test.scenarios.ps.service.FooService">

+      <controller field="controller"/>

+    </provides>

+    <provides specifications="org.apache.felix.ipojo.test.scenarios.ps.service.CheckService">

+    </provides>

+  </component>

+    <component classname="org.apache.felix.ipojo.test.scenarios.component.controller.ControllerCheckService"

+    name="PS-Controller-1-false">

+    <provides specifications="org.apache.felix.ipojo.test.scenarios.ps.service.FooService">

+      <property name="test2" type="string" value="test2"/>

+      <controller field="controller" value="false"/>

+      <property name="test" type="string" value="test"/>

+    </provides>

+    <provides specifications="org.apache.felix.ipojo.test.scenarios.ps.service.CheckService">

+    </provides>

+  </component>

+  <component classname="org.apache.felix.ipojo.test.scenarios.component.controller.DoubleControllerCheckService"

+    name="PS-Controller-2-truetrue">

+    <provides specifications="org.apache.felix.ipojo.test.scenarios.ps.service.FooService">

+      <property name="test2" type="string" value="test2"/>

+      <controller field="controllerFoo" value="true"/>

+      <property name="test" type="string" value="test"/>

+    </provides>

+    <provides specifications="org.apache.felix.ipojo.test.scenarios.ps.service.CheckService">

+        <controller field="controllerCS" value="true"/>

+    </provides>

+  </component>

+  <component classname="org.apache.felix.ipojo.test.scenarios.component.controller.DoubleControllerCheckService"

+    name="PS-Controller-2-truefalse">

+    <provides specifications="org.apache.felix.ipojo.test.scenarios.ps.service.FooService">

+      <property name="test2" type="string" value="test2"/>

+      <controller field="controllerFoo" value="false"/>

+      <property name="test" type="string" value="test"/>

+    </provides>

+    <provides specifications="org.apache.felix.ipojo.test.scenarios.ps.service.CheckService">

+        <controller field="controllerCS" value="true"/>

+    </provides>

+  </component>

 </ipojo>