Continue the work about FELIX-4134
Migrate api-it to the core-it.
git-svn-id: https://svn.apache.org/repos/asf/felix/trunk@1495722 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/ipojo/runtime/api-it/pom.xml b/ipojo/runtime/api-it/pom.xml
deleted file mode 100644
index d40447b..0000000
--- a/ipojo/runtime/api-it/pom.xml
+++ /dev/null
@@ -1,460 +0,0 @@
-<!--
- 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.
--->
-<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>felix-parent</artifactId>
- <version>2.1</version>
- <relativePath>../../../pom/pom.xml</relativePath>
- </parent>
- <modelVersion>4.0.0</modelVersion>
- <artifactId>org.apache.felix.ipojo.runtime.api-it</artifactId>
- <version>1.10.2-SNAPSHOT</version>
- <name>Apache Felix iPOJO Runtime Project ~ API Integration Tests</name>
- <packaging>pom</packaging>
-
- <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>
-
- <plugin>
- <groupId>org.apache.rat</groupId>
- <artifactId>apache-rat-plugin</artifactId>
- <executions>
- <execution>
- <phase>verify</phase>
- <goals>
- <goal>check</goal>
- </goals>
- </execution>
- </executions>
- <configuration>
- <!-- check src only (except remote resources additions) -->
- <includes>
- <include>src/**</include>
- </includes>
- <excludes>
- <exclude>src/main/appended-resources/**</exclude>
- <exclude>**/*.iml</exclude> <!-- Exclude iml files -->
- </excludes>
- </configuration>
- </plugin>
-
- <plugin>
- <artifactId>maven-deploy-plugin</artifactId>
- <version>2.4</version>
- <configuration>
- <skip>true</skip>
- </configuration>
- </plugin>
- </plugins>
-
- </build>
-
- <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.mockito</groupId>
- <artifactId>mockito-all</artifactId>
- <version>1.9.5</version>
- </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.10.2-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.felix</groupId>
- <artifactId>org.apache.felix.ipojo.api</artifactId>
- <version>1.10.2-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.felix</groupId>
- <artifactId>org.apache.felix.ipojo.composite</artifactId>
- <version>1.10.2-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.felix</groupId>
- <artifactId>org.apache.felix.ipojo.manipulator</artifactId>
- <version>1.10.0</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.felix</groupId>
- <artifactId>org.apache.felix.configadmin</artifactId>
- <version>1.6.0</version>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.felix</groupId>
- <artifactId>org.apache.felix.ipojo.handler.whiteboard</artifactId>
- <version>1.4.0</version>
- <scope>test</scope>
- <exclusions>
- <exclusion>
- <groupId>org.apache.felix</groupId>
- <artifactId>org.osgi.core</artifactId>
- </exclusion>
- </exclusions>
- </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.1</version>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>org.ow2.chameleon.testing</groupId>
- <artifactId>tinybundles-ipojo</artifactId>
- <version>0.3.0</version>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.felix</groupId>
- <artifactId>org.apache.felix.ipojo.handler.eventadmin</artifactId>
- <!--
- We use the released version as we don't really have to do any behavioral test on the handler in the core
- test.
- -->
- <version>1.8.0</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.felix</groupId>
- <artifactId>org.apache.felix.log</artifactId>
- <version>1.0.1</version>
- </dependency>
-
- <dependency>
- <groupId>org.ops4j.pax.url</groupId>
- <artifactId>pax-url-wrap</artifactId>
- <version>1.5.2</version>
- </dependency>
- </dependencies>
-
- <profiles>
- <profile>
- <id>knopflerfish</id>
- <activation>
- <activeByDefault>false</activeByDefault>
- <property>
- <name>pax.exam.framework</name>
- <value>knopflerfish</value>
- </property>
- </activation>
- <properties>
- <pax.exam.framework>knopflerfish</pax.exam.framework>
- </properties>
- <repositories>
- <repository>
- <id>knopflerfish-releases</id>
- <url>http://www.knopflerfish.org/maven2</url>
- </repository>
- </repositories>
- <dependencies>
- <dependency>
- <groupId>org.knopflerfish</groupId>
- <artifactId>framework</artifactId>
- <version>5.2.0</version>
- <scope>test</scope>
- </dependency>
- </dependencies>
- </profile>
-
- <profile>
- <id>equinox</id>
- <activation>
- <activeByDefault>false</activeByDefault>
- <property>
- <name>pax.exam.framework</name>
- <value>equinox</value>
- </property>
- </activation>
- <properties>
- <pax.exam.framework>equinox</pax.exam.framework>
- </properties>
- <dependencies>
- <dependency>
- <groupId>org.eclipse.tycho</groupId>
- <artifactId>org.eclipse.osgi</artifactId>
- <version>3.8.1.v20120830-144521</version>
- <scope>test</scope>
- </dependency>
- </dependencies>
- </profile>
-
- <profile>
- <id>felix</id>
- <activation>
- <activeByDefault>false</activeByDefault>
- <property>
- <name>pax.exam.framework</name>
- <value>felix</value>
- </property>
- </activation>
- <properties>
- <pax.exam.framework>felix</pax.exam.framework>
- </properties>
- <dependencies>
- <dependency>
- <groupId>org.apache.felix</groupId>
- <artifactId>org.apache.felix.framework</artifactId>
- <version>4.2.0</version>
- <scope>test</scope>
- </dependency>
- </dependencies>
- </profile>
-
- <profile>
- <id>test</id>
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-invoker-plugin</artifactId>
- <version>1.8</version>
- <configuration>
- <streamLogs>true</streamLogs>
- <goals>
- <goal>clean</goal>
- <goal>test</goal>
- </goals>
- <cloneClean>true</cloneClean>
- </configuration>
- <executions>
- <execution>
- <id>regular</id>
- <goals>
- <goal>run</goal>
- </goals>
- <configuration>
- <profiles>
- <profile>felix</profile>
- </profiles>
- <cloneProjectsTo>${project.build.directory}/regular</cloneProjectsTo>
- </configuration>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
- </profile>
-
- <profile>
- <id>test-all</id>
- <activation>
- <activeByDefault>false</activeByDefault>
- </activation>
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-invoker-plugin</artifactId>
- <version>1.8</version>
- <configuration>
- <streamLogs>true</streamLogs>
- <goals>
- <goal>clean</goal>
- <goal>test</goal>
- </goals>
- <cloneClean>true</cloneClean>
- </configuration>
- <executions>
- <execution>
- <id>equinox-native</id>
- <goals>
- <goal>run</goal>
- </goals>
- <configuration>
- <profiles>
- <profile>equinox</profile>
- </profiles>
- <cloneProjectsTo>${project.build.directory}/equinox-native</cloneProjectsTo>
-
- </configuration>
- </execution>
- <execution>
- <id>felix-native</id>
- <goals>
- <goal>run</goal>
- </goals>
- <configuration>
- <profiles>
- <profile>felix</profile>
- </profiles>
- <cloneProjectsTo>${project.build.directory}/felix-native</cloneProjectsTo>
- </configuration>
- </execution>
- <execution>
- <id>knopflerfish-native</id>
- <goals>
- <goal>run</goal>
- </goals>
- <configuration>
- <profiles>
- <profile>knopflerfish</profile>
- </profiles>
- <cloneProjectsTo>${project.build.directory}/knopflerfish-native</cloneProjectsTo>
- </configuration>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
- </profile>
-
- <profile>
- <id>apache-release</id>
- <build>
- <plugins>
- <plugin>
- <artifactId>maven-assembly-plugin</artifactId>
- <dependencies>
- <dependency>
- <groupId>org.apache.apache.resources</groupId>
- <artifactId>apache-source-release-assembly-descriptor</artifactId>
- <version>1.0.3</version>
- </dependency>
- </dependencies>
- <executions>
- <execution>
- <id>source-release-assembly</id>
- <phase>package</phase>
- <goals>
- <goal>single</goal>
- </goals>
- <configuration>
- <runOnlyAtExecutionRoot>false</runOnlyAtExecutionRoot>
- <descriptorRefs>
- <descriptorRef>${sourceReleaseAssemblyDescriptor}</descriptorRef>
- </descriptorRefs>
- <tarLongFileMode>gnu</tarLongFileMode>
- </configuration>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
- </profile>
- </profiles>
-</project>
diff --git a/ipojo/runtime/api-it/src/it/ipojo-api-test/pom.xml b/ipojo/runtime/api-it/src/it/ipojo-api-test/pom.xml
deleted file mode 100644
index 815fccc..0000000
--- a/ipojo/runtime/api-it/src/it/ipojo-api-test/pom.xml
+++ /dev/null
@@ -1,38 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- ~ 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.
- -->
-
-<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.api-it</artifactId>
- <version>1.10.2-SNAPSHOT</version>
- <relativePath>../../../pom.xml</relativePath>
- </parent>
-
- <modelVersion>4.0.0</modelVersion>
-
- <artifactId>ipojo-api-test</artifactId>
-
- <name>${project.artifactId}</name>
-
-</project>
\ No newline at end of file
diff --git a/ipojo/runtime/api-it/src/it/ipojo-api-test/src/main/java/org/apache/felix/ipojo/runtime/core/api/components/FooImpl.java b/ipojo/runtime/api-it/src/it/ipojo-api-test/src/main/java/org/apache/felix/ipojo/runtime/core/api/components/FooImpl.java
deleted file mode 100644
index 8e396d6..0000000
--- a/ipojo/runtime/api-it/src/it/ipojo-api-test/src/main/java/org/apache/felix/ipojo/runtime/core/api/components/FooImpl.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.felix.ipojo.runtime.core.api.components;
-
-import org.apache.felix.ipojo.runtime.core.api.services.Foo;
-
-public class FooImpl implements Foo {
-
- // private List<String> m_list = new ArrayList<String>();
-
- public void doSomething() {
- // Do something...
- System.out.println("Hello World !");
- }
-
- public FooImpl(String s) {
- _setIM(s);
- }
-
- public void _setIM(String s) {
-
- }
-
-}
diff --git a/ipojo/runtime/api-it/src/it/ipojo-api-test/src/main/java/org/apache/felix/ipojo/runtime/core/api/components/HostImpl.java b/ipojo/runtime/api-it/src/it/ipojo-api-test/src/main/java/org/apache/felix/ipojo/runtime/core/api/components/HostImpl.java
deleted file mode 100644
index ab75f87..0000000
--- a/ipojo/runtime/api-it/src/it/ipojo-api-test/src/main/java/org/apache/felix/ipojo/runtime/core/api/components/HostImpl.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.felix.ipojo.runtime.core.api.components;
-
-import org.osgi.framework.ServiceReference;
-
-public class HostImpl {
-
- public void arrival(ServiceReference ref) {
-
- }
-
- public void departure(ServiceReference ref) {
-
- }
-
- public void modification(ServiceReference ref) {
-
- }
-
-}
diff --git a/ipojo/runtime/api-it/src/it/ipojo-api-test/src/main/java/org/apache/felix/ipojo/runtime/core/api/components/MyComponentImpl.java b/ipojo/runtime/api-it/src/it/ipojo-api-test/src/main/java/org/apache/felix/ipojo/runtime/core/api/components/MyComponentImpl.java
deleted file mode 100644
index a07feb8..0000000
--- a/ipojo/runtime/api-it/src/it/ipojo-api-test/src/main/java/org/apache/felix/ipojo/runtime/core/api/components/MyComponentImpl.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.felix.ipojo.runtime.core.api.components;
-
-import org.apache.felix.ipojo.annotations.Component;
-import org.apache.felix.ipojo.runtime.core.api.services.Foo;
-
-/**
- * This class is marked as a component to be manipulated.
- */
-@Component(name="do-not-use-this-factory", public_factory = false)
-public class MyComponentImpl {
-
- private Foo myFoo;
-
- private int anInt;
-
- public MyComponentImpl() {
- anInt = 2;
- }
-
- public MyComponentImpl(int i) {
- anInt = i;
- }
-
- public void start() {
- myFoo.doSomething();
- if (anInt > 0) {
- System.out.println("Set int to " + anInt);
- }
- }
-
-}
diff --git a/ipojo/runtime/api-it/src/it/ipojo-api-test/src/main/java/org/apache/felix/ipojo/runtime/core/api/components/MyServiceImpl.java b/ipojo/runtime/api-it/src/it/ipojo-api-test/src/main/java/org/apache/felix/ipojo/runtime/core/api/components/MyServiceImpl.java
deleted file mode 100644
index 7973ed7..0000000
--- a/ipojo/runtime/api-it/src/it/ipojo-api-test/src/main/java/org/apache/felix/ipojo/runtime/core/api/components/MyServiceImpl.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.felix.ipojo.runtime.core.api.components;
-
-import org.apache.felix.ipojo.runtime.core.api.services.MyService;
-
-public class MyServiceImpl implements MyService {
- public double compute(double value) {
- return Math.exp(value * Math.cosh(value));
- }
-}
diff --git a/ipojo/runtime/api-it/src/it/ipojo-api-test/src/main/java/org/apache/felix/ipojo/runtime/core/api/services/BarService.java b/ipojo/runtime/api-it/src/it/ipojo-api-test/src/main/java/org/apache/felix/ipojo/runtime/core/api/services/BarService.java
deleted file mode 100644
index faa9f38..0000000
--- a/ipojo/runtime/api-it/src/it/ipojo-api-test/src/main/java/org/apache/felix/ipojo/runtime/core/api/services/BarService.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.felix.ipojo.runtime.core.api.services;
-
-public interface BarService {
-
- public void doSomethingWithBar();
-
-
-}
diff --git a/ipojo/runtime/api-it/src/it/ipojo-api-test/src/main/java/org/apache/felix/ipojo/runtime/core/api/services/Foo.java b/ipojo/runtime/api-it/src/it/ipojo-api-test/src/main/java/org/apache/felix/ipojo/runtime/core/api/services/Foo.java
deleted file mode 100644
index 719b2fd..0000000
--- a/ipojo/runtime/api-it/src/it/ipojo-api-test/src/main/java/org/apache/felix/ipojo/runtime/core/api/services/Foo.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.felix.ipojo.runtime.core.api.services;
-
-public interface Foo {
-
-
- public void doSomething();
-
-}
diff --git a/ipojo/runtime/api-it/src/it/ipojo-api-test/src/main/java/org/apache/felix/ipojo/runtime/core/api/services/MyService.java b/ipojo/runtime/api-it/src/it/ipojo-api-test/src/main/java/org/apache/felix/ipojo/runtime/core/api/services/MyService.java
deleted file mode 100644
index ed24f45..0000000
--- a/ipojo/runtime/api-it/src/it/ipojo-api-test/src/main/java/org/apache/felix/ipojo/runtime/core/api/services/MyService.java
+++ /dev/null
@@ -1,24 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.felix.ipojo.runtime.core.api.services;
-
-public interface MyService {
- double compute(double value);
-}
diff --git a/ipojo/runtime/api-it/src/it/ipojo-api-test/src/test/java/org/apache/felix/ipojo/runtime/core/api/Common.java b/ipojo/runtime/api-it/src/it/ipojo-api-test/src/test/java/org/apache/felix/ipojo/runtime/core/api/Common.java
deleted file mode 100644
index df7c115..0000000
--- a/ipojo/runtime/api-it/src/it/ipojo-api-test/src/test/java/org/apache/felix/ipojo/runtime/core/api/Common.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.felix.ipojo.runtime.core.api;
-
-import org.apache.felix.ipojo.ComponentInstance;
-import org.apache.felix.ipojo.ServiceContext;
-import org.apache.felix.ipojo.composite.CompositeManager;
-import org.ops4j.pax.exam.Option;
-import org.ops4j.pax.exam.spi.reactors.ExamReactorStrategy;
-import org.ops4j.pax.exam.spi.reactors.PerMethod;
-import org.ow2.chameleon.testing.helpers.BaseTest;
-
-import java.util.Arrays;
-import java.util.List;
-
-import static org.ops4j.pax.exam.CoreOptions.mavenBundle;
-
-/**
- * Bootstrap the test from this project
- */
-@ExamReactorStrategy(PerMethod.class)
-public class Common extends BaseTest {
-
- public static ServiceContext getServiceContext(ComponentInstance ci) {
- if (ci instanceof CompositeManager) {
- return ((CompositeManager) ci).getServiceContext();
- } else {
- throw new RuntimeException("Cannot get the service context from a non composite instance");
- }
- }
-
- @Override
- public boolean deployiPOJOComposite() {
- return true;
- }
-
- @Override
- public boolean deployConfigAdmin() {
- return true;
- }
-
- @Override
- protected Option[] getCustomOptions() {
- return new Option[]{
- mavenBundle("org.apache.felix", "org.apache.felix.ipojo.handler.whiteboard").versionAsInProject(),
- mavenBundle("org.apache.felix", "org.apache.felix.ipojo.api").versionAsInProject()
- };
- }
-
- @Override
- protected List<String> getExtraExports() {
- return Arrays.asList(
- "org.apache.felix.ipojo.runtime.core.api.components"
- );
- }
-}
diff --git a/ipojo/runtime/api-it/src/it/ipojo-api-test/src/test/java/org/apache/felix/ipojo/runtime/core/api/CompositeTest.java b/ipojo/runtime/api-it/src/it/ipojo-api-test/src/test/java/org/apache/felix/ipojo/runtime/core/api/CompositeTest.java
deleted file mode 100644
index 5d1c460..0000000
--- a/ipojo/runtime/api-it/src/it/ipojo-api-test/src/test/java/org/apache/felix/ipojo/runtime/core/api/CompositeTest.java
+++ /dev/null
@@ -1,247 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.felix.ipojo.runtime.core.api;
-
-import org.apache.felix.ipojo.*;
-import org.apache.felix.ipojo.api.Dependency;
-import org.apache.felix.ipojo.api.PrimitiveComponentType;
-import org.apache.felix.ipojo.api.Service;
-import org.apache.felix.ipojo.api.composite.*;
-import org.apache.felix.ipojo.runtime.core.api.components.FooImpl;
-import org.apache.felix.ipojo.runtime.core.api.components.MyComponentImpl;
-import org.apache.felix.ipojo.runtime.core.api.services.Foo;
-import org.junit.Before;
-import org.junit.Test;
-import org.osgi.framework.BundleContext;
-import org.osgi.framework.ServiceReference;
-
-import static org.hamcrest.CoreMatchers.is;
-import static org.hamcrest.CoreMatchers.not;
-import static org.junit.Assert.assertThat;
-
-
-public class CompositeTest extends Common {
-
- private BundleContext context;
-
- @Before
- public void setUp() {
- context = getContext();
- }
-
- @Test
- public void createACompositeWithcontainedInstance() throws UnacceptableConfiguration, MissingHandlerException, ConfigurationException {
- // Define the component types
- PrimitiveComponentType prov = createAProvider();
- PrimitiveComponentType cons = createAConsumer();
-
- CompositeComponentType type = new CompositeComponentType()
- .setBundleContext(context)
- .setComponentTypeName("comp1")
- .addInstance(new Instance(prov.getFactory().getName()))
- .addInstance(new Instance(cons.getFactory().getName()));
-
- ComponentInstance ci = type.createInstance();
-
- assertThat("ci is valid", ci.getState(), is(ComponentInstance.VALID));
-
- // Stop cons
- cons.stop();
- assertThat("ci is invalid", ci.getState(), is(ComponentInstance.INVALID));
-
- // Restart cons
- cons.start();
- assertThat("ci is valid - 2", ci.getState(), is(ComponentInstance.VALID));
-
- }
-
- @Test
- public void createACompositeWithAnInstantiatedService() throws UnacceptableConfiguration, MissingHandlerException, ConfigurationException {
- // Define the component types
- PrimitiveComponentType prov = createAProvider();
- prov.start();
- PrimitiveComponentType cons = createAConsumer();
-
- ServiceReference[] refs = osgiHelper.getServiceReferences(Factory.class.getName(),
- "(component.providedServiceSpecifications=" + Foo.class.getName() + ")");
- assertThat(refs.length, is(not(0)));
-
- Factory factory = (Factory) osgiHelper.getServiceObject(refs[0]);
- System.out.println(factory.getComponentDescription().getDescription());
-
- CompositeComponentType type = new CompositeComponentType()
- .setBundleContext(context)
- .setComponentTypeName("comp2")
- .addSubService(new InstantiatedService().setSpecification(Foo.class.getName()))
- .addInstance(new Instance(cons.getFactory().getName()));
-
- ComponentInstance ci = type.createInstance();
-
- System.out.println(ci.getInstanceDescription().getDescription());
-
- assertThat("ci is valid", ci.getState(), is(ComponentInstance.VALID));
-
- // Stop prov
- prov.stop();
- assertThat("ci is invalid", ci.getState(), is(ComponentInstance.INVALID));
-
- // Restart prov
- prov.start();
- assertThat("ci is valid - 2", ci.getState(), is(ComponentInstance.VALID));
-
- }
-
- @Test
- public void createACompositeWithAnOptionalInstantiatedService() throws UnacceptableConfiguration, MissingHandlerException, ConfigurationException {
- // Define the component types
- PrimitiveComponentType prov = createAProvider();
- prov.start();
-
- CompositeComponentType type = new CompositeComponentType()
- .setBundleContext(context)
- .setComponentTypeName("comp3")
- .addSubService(new InstantiatedService().setSpecification(Foo.class.getName()).setOptional(true));
-
- ComponentInstance ci = type.createInstance();
-
- assertThat("ci is valid", ci.getState(), is(ComponentInstance.VALID));
-
- // Stop prov
- prov.stop();
- assertThat("ci is valid - 1", ci.getState(), is(ComponentInstance.VALID));
-
- // Restart prov
- prov.start();
- assertThat("ci is valid - 2", ci.getState(), is(ComponentInstance.VALID));
-
- }
-
- @Test
- public void createACompositeWithAnImportedService() throws UnacceptableConfiguration, MissingHandlerException, ConfigurationException {
- // Define the component types
- PrimitiveComponentType prov = createAProvider();
- prov.createInstance();
- PrimitiveComponentType cons = createAConsumer();
-
- ServiceReference[] refs = osgiHelper.getServiceReferences(Factory.class.getName(),
- "(component.providedServiceSpecifications=" + Foo.class.getName() + ")");
- assertThat(refs.length, is(not(0)));
-
- CompositeComponentType type = new CompositeComponentType()
- .setBundleContext(context)
- .setComponentTypeName("comp2")
- .addSubService(new ImportedService().setSpecification(Foo.class.getName()))
- .addInstance(new Instance(cons.getFactory().getName()));
-
- ComponentInstance ci = type.createInstance();
-
- System.out.println(ci.getInstanceDescription().getDescription());
-
- assertThat("ci is valid", ci.getState(), is(ComponentInstance.VALID));
-
- // Stop prov
- prov.stop();
- assertThat("ci is invalid", ci.getState(), is(ComponentInstance.INVALID));
-
- // Restart prov
- prov.start();
- prov.createInstance();
- assertThat("ci is valid - 2", ci.getState(), is(ComponentInstance.VALID));
-
- }
-
- @Test
- public void createACompositeWithAnOptionalImportedService() throws UnacceptableConfiguration, MissingHandlerException, ConfigurationException {
- // Define the component types
- PrimitiveComponentType prov = createAProvider();
- prov.createInstance();
-
- CompositeComponentType type = new CompositeComponentType()
- .setBundleContext(context)
- .setComponentTypeName("comp3")
- .addSubService(new ImportedService().setSpecification(Foo.class.getName()).setOptional(true));
-
- ComponentInstance ci = type.createInstance();
-
- assertThat("ci is valid", ci.getState(), is(ComponentInstance.VALID));
-
- // Stop prov
- prov.stop();
- assertThat("ci is valid - 1", ci.getState(), is(ComponentInstance.VALID));
-
- // Restart prov
- prov.start();
- prov.createInstance();
- assertThat("ci is valid - 2", ci.getState(), is(ComponentInstance.VALID));
-
- }
-
- @Test
- public void createACompositeWithExportingAService() throws UnacceptableConfiguration, MissingHandlerException, ConfigurationException {
- // Define the component types
- PrimitiveComponentType prov = createAProvider();
- prov.start();
- PrimitiveComponentType cons = createAConsumer();
- ComponentInstance c = cons.createInstance();
-
- CompositeComponentType type = new CompositeComponentType()
- .setBundleContext(context)
- .setComponentTypeName("compExport")
- .addSubService(new InstantiatedService().setSpecification(Foo.class.getName()))
- .addService(new ExportedService().setSpecification(Foo.class.getName()));
-
- ComponentInstance ci = type.createInstance();
-
- assertThat("ci is valid", ci.getState(), is(ComponentInstance.VALID));
- assertThat("c is valid", c.getState(), is(ComponentInstance.VALID));
-
-
- // Stop prov
- prov.stop();
- assertThat("ci is invalid", ci.getState(), is(ComponentInstance.INVALID));
- assertThat("c is invalid", c.getState(), is(ComponentInstance.INVALID));
-
-
- // Restart prov
- prov.start();
- assertThat("ci is valid - 2", ci.getState(), is(ComponentInstance.VALID));
- assertThat("c is valid - 2", c.getState(), is(ComponentInstance.VALID));
-
-
- }
-
- private PrimitiveComponentType createAProvider() {
- return new PrimitiveComponentType()
- .setBundleContext(context)
- .setClassName(FooImpl.class.getName())
- .setPublic(true)
- .addService(new Service()); // Provide the FooService
- }
-
- private PrimitiveComponentType createAConsumer() {
- return new PrimitiveComponentType()
- .setBundleContext(context)
- .setClassName(MyComponentImpl.class.getName())
- .addDependency(new Dependency().setField("myFoo"))
- .setValidateMethod("start");
- }
-
-
-}
diff --git a/ipojo/runtime/api-it/src/it/ipojo-api-test/src/test/java/org/apache/felix/ipojo/runtime/core/api/ExternalHandlerTest.java b/ipojo/runtime/api-it/src/it/ipojo-api-test/src/test/java/org/apache/felix/ipojo/runtime/core/api/ExternalHandlerTest.java
deleted file mode 100644
index e478c79..0000000
--- a/ipojo/runtime/api-it/src/it/ipojo-api-test/src/test/java/org/apache/felix/ipojo/runtime/core/api/ExternalHandlerTest.java
+++ /dev/null
@@ -1,91 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.felix.ipojo.runtime.core.api;
-
-import org.apache.felix.ipojo.ComponentInstance;
-import org.apache.felix.ipojo.api.PrimitiveComponentType;
-import org.apache.felix.ipojo.architecture.HandlerDescription;
-import org.apache.felix.ipojo.runtime.core.api.components.HostImpl;
-import org.junit.Before;
-import org.junit.Test;
-import org.osgi.framework.BundleContext;
-
-import static org.hamcrest.CoreMatchers.is;
-import static org.hamcrest.CoreMatchers.notNullValue;
-import static org.junit.Assert.assertThat;
-
-
-public class ExternalHandlerTest extends Common {
-
-
- private BundleContext context;
-
- @Before
- public void setUp() {
- context = getContext();
- }
-
- @Test
- public void createAHost() throws Exception {
- PrimitiveComponentType type = createAWhiteboardHost();
- ComponentInstance ci = type.createInstance();
- assertThat(ci.getState(), is(ComponentInstance.VALID));
- HandlerDescription hd = ci.getInstanceDescription().getHandlerDescription(Whiteboard.NAMESPACE + ":" + Whiteboard.NAME);
- assertThat(hd, is(notNullValue()));
- }
-
- @Test
- public void createDoubleHost() throws Exception {
- PrimitiveComponentType type = createASecondWhiteboardHost();
- ComponentInstance ci = type.createInstance();
- assertThat(ci.getState(), is(ComponentInstance.VALID));
- HandlerDescription hd = ci.getInstanceDescription().getHandlerDescription(Whiteboard.NAMESPACE + ":" + Whiteboard.NAME);
- assertThat(hd, is(notNullValue()));
- }
-
- private PrimitiveComponentType createAWhiteboardHost() {
- return new PrimitiveComponentType()
- .setBundleContext(context)
- .setClassName(HostImpl.class.getName())
- .addHandler(new Whiteboard()
- .onArrival("arrival")
- .onDeparture("departure")
- .setFilter("(foo=foo)")
- );
- }
-
- private PrimitiveComponentType createASecondWhiteboardHost() {
- return new PrimitiveComponentType()
- .setBundleContext(context)
- .setClassName(HostImpl.class.getName())
- .addHandler(new Whiteboard()
- .onArrival("arrival")
- .onDeparture("departure")
- .setFilter("(foo=foo)")
- )
- .addHandler(new Whiteboard()
- .onArrival("arrival")
- .onDeparture("departure")
- .setFilter("(foo=bar)")
- .onModification("modification")
- );
- }
-
-}
diff --git a/ipojo/runtime/api-it/src/it/ipojo-api-test/src/test/java/org/apache/felix/ipojo/runtime/core/api/PrimitiveComponentTest.java b/ipojo/runtime/api-it/src/it/ipojo-api-test/src/test/java/org/apache/felix/ipojo/runtime/core/api/PrimitiveComponentTest.java
deleted file mode 100644
index 57423d8..0000000
--- a/ipojo/runtime/api-it/src/it/ipojo-api-test/src/test/java/org/apache/felix/ipojo/runtime/core/api/PrimitiveComponentTest.java
+++ /dev/null
@@ -1,162 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.felix.ipojo.runtime.core.api;
-
-import org.apache.felix.ipojo.ComponentInstance;
-import org.apache.felix.ipojo.ConfigurationException;
-import org.apache.felix.ipojo.MissingHandlerException;
-import org.apache.felix.ipojo.UnacceptableConfiguration;
-import org.apache.felix.ipojo.api.Dependency;
-import org.apache.felix.ipojo.api.PrimitiveComponentType;
-import org.apache.felix.ipojo.api.Service;
-import org.apache.felix.ipojo.api.SingletonComponentType;
-import org.apache.felix.ipojo.runtime.core.api.components.FooImpl;
-import org.apache.felix.ipojo.runtime.core.api.components.MyComponentImpl;
-import org.apache.felix.ipojo.runtime.core.api.services.Foo;
-import org.junit.Before;
-import org.junit.Test;
-import org.ops4j.pax.exam.Configuration;
-import org.ops4j.pax.exam.Option;
-import org.osgi.framework.BundleContext;
-import org.osgi.framework.ServiceReference;
-
-import java.io.IOException;
-
-import static org.hamcrest.CoreMatchers.*;
-import static org.junit.Assert.assertThat;
-
-
-public class PrimitiveComponentTest extends Common {
-
- private BundleContext context;
-
- @Before
- public void setUp() {
- context = getContext();
- }
-
- @Configuration
- public Option[] config() throws IOException {
- return super.config();
- }
-
- @Test
- public void createAServiceProvider() throws Exception {
- assertThat(context, is(notNullValue()));
- ComponentInstance ci;
-
- PrimitiveComponentType type = createAProvider();
- ci = type.createInstance();
- assertThat("Ci is valid", ci.getState(), is(ComponentInstance.VALID));
- ServiceReference ref = ipojoHelper.getServiceReferenceByName(Foo.class
- .getName(), ci.getInstanceName());
- assertThat(ref, is(notNullValue()));
-
- }
-
- @Test
- public void killTheFactory() throws UnacceptableConfiguration, MissingHandlerException, ConfigurationException {
- assertThat(context, is(notNullValue()));
- ComponentInstance ci = null;
-
- PrimitiveComponentType type = createAProvider();
- ci = type.createInstance();
- assertThat("Ci is valid", ci.getState(), is(ComponentInstance.VALID));
- ServiceReference ref = ipojoHelper.getServiceReferenceByName(Foo.class
- .getName(), ci.getInstanceName());
- assertThat(ref, is(notNullValue()));
- type.stop();
- assertThat("Ci is disposed", ci.getState(),
- is(ComponentInstance.DISPOSED));
- ref = ipojoHelper.getServiceReferenceByName(Foo.class.getName(), ci
- .getInstanceName());
- assertThat(ref, is(nullValue()));
-
- }
-
- @Test
- public void createAServiceCons() throws Exception {
- assertThat(context, is(notNullValue()));
- ComponentInstance ci = null;
-
- PrimitiveComponentType type = createAConsumer();
- ci = type.createInstance();
- assertThat("Ci is invalid", ci.getState(),
- is(ComponentInstance.INVALID));
-
- }
-
- @Test
- public void createBoth() throws Exception {
- ComponentInstance cons = createAConsumer().createInstance();
- // cons is invalid
- assertThat("cons is invalid", cons.getState(), is(ComponentInstance.INVALID));
-
- ComponentInstance prov = createAProvider().createInstance();
- assertThat("prov is valid", prov.getState(), is(ComponentInstance.VALID));
- assertThat("cons is valid", cons.getState(), is(ComponentInstance.VALID));
-
- }
-
- @Test
- public void createTwoCons() throws Exception {
- ComponentInstance cons1 = createAConsumer().createInstance();
- // cons is invalid
- assertThat("cons is invalid", cons1.getState(), is(ComponentInstance.INVALID));
-
- ComponentInstance prov = createAProvider().createInstance();
- assertThat("prov is valid", prov.getState(), is(ComponentInstance.VALID));
- assertThat("cons is valid", cons1.getState(), is(ComponentInstance.VALID));
-
- ComponentInstance cons2 = createAnOptionalConsumer().createInstance();
-
- assertThat("cons2 is valid", cons2.getState(), is(ComponentInstance.VALID));
-
- prov.stop();
- assertThat("cons is invalid", cons1.getState(), is(ComponentInstance.INVALID));
- assertThat("cons2 is valid", cons2.getState(), is(ComponentInstance.VALID));
- }
-
- private PrimitiveComponentType createAProvider() {
- return new PrimitiveComponentType()
- .setBundleContext(context)
- .setClassName(FooImpl.class.getName())
- .addService(new Service()); // Provide the FooService
- }
-
- private PrimitiveComponentType createAConsumer() {
- return new SingletonComponentType()
- .setBundleContext(context)
- .setClassName(MyComponentImpl.class.getName())
- .addDependency(new Dependency().setField("myFoo"))
- .setValidateMethod("start");
- }
-
- private PrimitiveComponentType createAnOptionalConsumer() {
- return new SingletonComponentType()
- .setBundleContext(context)
- .setComponentTypeName("cons.optional")
- .setClassName(MyComponentImpl.class.getName())
- .addDependency(new Dependency().setField("myFoo").setOptional(true))
- .setValidateMethod("start");
- }
-
-
-}
diff --git a/ipojo/runtime/api-it/src/it/ipojo-api-test/src/test/java/org/apache/felix/ipojo/runtime/core/api/SingletonComponentTest.java b/ipojo/runtime/api-it/src/it/ipojo-api-test/src/test/java/org/apache/felix/ipojo/runtime/core/api/SingletonComponentTest.java
deleted file mode 100644
index 323b2dd..0000000
--- a/ipojo/runtime/api-it/src/it/ipojo-api-test/src/test/java/org/apache/felix/ipojo/runtime/core/api/SingletonComponentTest.java
+++ /dev/null
@@ -1,178 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.felix.ipojo.runtime.core.api;
-
-import org.apache.felix.ipojo.ComponentInstance;
-import org.apache.felix.ipojo.ConfigurationException;
-import org.apache.felix.ipojo.MissingHandlerException;
-import org.apache.felix.ipojo.UnacceptableConfiguration;
-import org.apache.felix.ipojo.api.Dependency;
-import org.apache.felix.ipojo.api.PrimitiveComponentType;
-import org.apache.felix.ipojo.api.Service;
-import org.apache.felix.ipojo.api.SingletonComponentType;
-import org.apache.felix.ipojo.runtime.core.api.components.FooImpl;
-import org.apache.felix.ipojo.runtime.core.api.components.MyComponentImpl;
-import org.apache.felix.ipojo.runtime.core.api.services.Foo;
-import org.junit.Before;
-import org.junit.Ignore;
-import org.junit.Test;
-import org.osgi.framework.BundleContext;
-import org.osgi.framework.ServiceReference;
-
-import static org.hamcrest.CoreMatchers.*;
-import static org.junit.Assert.assertThat;
-
-
-public class SingletonComponentTest extends Common {
-
- private BundleContext context;
-
- @Before
- public void setUp() {
- context = getContext();
- }
-
- @Test
- public void createAServiceProvider() throws UnacceptableConfiguration, MissingHandlerException, ConfigurationException {
- assertThat(context, is(notNullValue()));
- ComponentInstance ci = null;
-
- SingletonComponentType type = createAProvider();
- ci = type.create();
- assertThat("Ci is valid", ci.getState(), is(ComponentInstance.VALID));
- ServiceReference ref = ipojoHelper.getServiceReferenceByName(Foo.class
- .getName(), ci.getInstanceName());
- assertThat(ref, is(notNullValue()));
- type.disposeInstance(ci);
-
- }
-
- @Test
- public void killTheFactory() throws Exception {
- assertThat(context, is(notNullValue()));
- ComponentInstance ci = null;
- SingletonComponentType type = createAProvider();
- ci = type.create();
- assertThat("Ci is valid", ci.getState(), is(ComponentInstance.VALID));
- ServiceReference ref = ipojoHelper.getServiceReferenceByName(Foo.class
- .getName(), ci.getInstanceName());
- assertThat(ref, is(notNullValue()));
- type.stop();
- assertThat("Ci is disposed", ci.getState(),
- is(ComponentInstance.DISPOSED));
- ref = ipojoHelper.getServiceReferenceByName(Foo.class.getName(), ci
- .getInstanceName());
- assertThat(ref, is(nullValue()));
- }
-
- @Test
- public void createAServiceCons() throws Exception {
- assertThat(context, is(notNullValue()));
- ComponentInstance ci = null;
-
- SingletonComponentType type = createAConsumer();
- ci = type.create();
- assertThat("Ci is invalid", ci.getState(),
- is(ComponentInstance.INVALID));
- type.stop();
- }
-
- @Test
- public void createBoth() throws Exception {
- SingletonComponentType consFactory = createAConsumer();
- ComponentInstance cons = consFactory.create();
- // cons is invalid
- assertThat("cons is invalid", cons.getState(), is(ComponentInstance.INVALID));
-
- SingletonComponentType provFactory = createAProvider();
- ComponentInstance prov = provFactory.create();
- assertThat("prov is valid", prov.getState(), is(ComponentInstance.VALID));
- assertThat("cons is valid", cons.getState(), is(ComponentInstance.VALID));
- consFactory.stop();
- provFactory.stop();
- }
-
- @Test
- public void createTwoCons() throws Exception {
- SingletonComponentType consFactory = createAConsumer();
- ComponentInstance cons1 = createAConsumer().create();
- // cons is invalid
- assertThat("cons is invalid", cons1.getState(), is(ComponentInstance.INVALID));
-
- ComponentInstance prov = createAProvider().create();
- assertThat("prov is valid", prov.getState(), is(ComponentInstance.VALID));
- assertThat("cons is valid", cons1.getState(), is(ComponentInstance.VALID));
-
- ComponentInstance cons2 = createAnOptionalConsumer().create();
-
- assertThat("cons2 is valid", cons2.getState(), is(ComponentInstance.VALID));
-
- prov.stop();
- assertThat("cons is invalid", cons1.getState(), is(ComponentInstance.INVALID));
- assertThat("cons2 is valid", cons2.getState(), is(ComponentInstance.VALID));
- }
-
- @Test
- // @Ignore("We can't test as the MyComponentImpl must be manipulated before creating the object")
- public void setObject() throws Exception {
- ComponentInstance cons = createAConsumer().setObject(new MyComponentImpl(5)).create();
- // cons is invalid
- assertThat("cons is invalid", cons.getState(), is(ComponentInstance.INVALID));
-
- ComponentInstance prov = createAProvider().create();
- assertThat("prov is valid", prov.getState(), is(ComponentInstance.VALID));
- assertThat("cons is valid", cons.getState(), is(ComponentInstance.VALID));
-
- }
-
- private SingletonComponentType createAProvider() {
- PrimitiveComponentType type = new SingletonComponentType()
- .setBundleContext(context)
- .setClassName(FooImpl.class.getName())
- .addService(new Service()); // Provide the FooService
-
- return (SingletonComponentType) type;
- }
-
- private SingletonComponentType createAConsumer() {
- PrimitiveComponentType type = new SingletonComponentType()
- .setBundleContext(context)
- .setClassName(MyComponentImpl.class.getName())
- .setComponentTypeName("singleton.cons")
- .addDependency(new Dependency().setField("myFoo"))
- .setValidateMethod("start");
-
- return (SingletonComponentType) type;
- }
-
- private SingletonComponentType createAnOptionalConsumer() {
- PrimitiveComponentType type = new SingletonComponentType()
- .setBundleContext(context)
- .setClassName(MyComponentImpl.class.getName())
- .addDependency(new Dependency().setField("myFoo").setOptional(true))
- .setComponentTypeName("singleton.optional.consumer")
- .setValidateMethod("start");
-
- return (SingletonComponentType) type;
-
- }
-
-
-}
diff --git a/ipojo/runtime/api-it/src/it/ipojo-api-test/src/test/java/org/apache/felix/ipojo/runtime/core/api/Whiteboard.java b/ipojo/runtime/api-it/src/it/ipojo-api-test/src/test/java/org/apache/felix/ipojo/runtime/core/api/Whiteboard.java
deleted file mode 100644
index 77caf6b..0000000
--- a/ipojo/runtime/api-it/src/it/ipojo-api-test/src/test/java/org/apache/felix/ipojo/runtime/core/api/Whiteboard.java
+++ /dev/null
@@ -1,90 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.felix.ipojo.runtime.core.api;
-
-import org.apache.felix.ipojo.api.HandlerConfiguration;
-import org.apache.felix.ipojo.metadata.Attribute;
-import org.apache.felix.ipojo.metadata.Element;
-
-public class Whiteboard implements HandlerConfiguration {
-
- public static final String NAME = "wbp";
-
- public static final String NAMESPACE = "org.apache.felix.ipojo.whiteboard";
-
- private String arrival;
-
- private String departure;
-
- private String modification;
-
- private String filter;
-
- public Whiteboard onArrival(String method) {
- arrival = method;
- return this;
- }
-
- public Whiteboard onDeparture(String method) {
- departure = method;
- return this;
- }
-
- public Whiteboard onModification(String method) {
- modification = method;
- return this;
- }
-
- public Whiteboard setFilter(String fil) {
- filter = fil;
- return this;
- }
-
- public Element getElement() {
- ensureValidity();
- // Create the root element.
- Element element = new Element(NAME, NAMESPACE);
- // Mandatory attributes
- element.addAttribute(new Attribute("onArrival", arrival));
- element.addAttribute(new Attribute("onDeparture", departure));
- element.addAttribute(new Attribute("filter", filter));
-
- // Optional attribute
- if (modification != null) {
- element.addAttribute(new Attribute("onModification", modification));
- }
-
- return element;
- }
-
- private void ensureValidity() {
- if (arrival == null) {
- throw new IllegalStateException("The whiteboard pattern configuration must have a onArrival method");
- }
- if (departure == null) {
- throw new IllegalStateException("The whiteboard pattern configuration must have a onDeparture method");
- }
- if (filter == null) {
- throw new IllegalStateException("The whiteboard pattern configuration must have a filter");
- }
-
- }
-
-}
diff --git a/ipojo/runtime/api-it/src/main/appended-resources/META-INF/NOTICE b/ipojo/runtime/api-it/src/main/appended-resources/META-INF/NOTICE
deleted file mode 100644
index e69de29..0000000
--- a/ipojo/runtime/api-it/src/main/appended-resources/META-INF/NOTICE
+++ /dev/null
diff --git a/ipojo/runtime/core-it/pom.xml b/ipojo/runtime/core-it/pom.xml
index 854c88e..9fb1490 100644
--- a/ipojo/runtime/core-it/pom.xml
+++ b/ipojo/runtime/core-it/pom.xml
@@ -65,6 +65,7 @@
<module>ipojo-core-service-dependency-test</module>
<module>ipojo-core-service-dependency-interceptor-test</module>
<module>ipojo-core-service-providing-test</module>
+ <module>ipojo-api-test</module>
</modules>
<build>
diff --git a/ipojo/runtime/pom.xml b/ipojo/runtime/pom.xml
index 327a486..f1ec9a3 100644
--- a/ipojo/runtime/pom.xml
+++ b/ipojo/runtime/pom.xml
@@ -35,11 +35,10 @@
<modules>
<module>core</module>
- <module>core-it</module>
- <module>composite</module>
- <module>composite-it</module>
<module>api</module>
- <module>api-it</module>
+ <module>composite</module>
+ <module>core-it</module>
+ <module>composite-it</module>
<module>ipojo-gogo-commands</module>
</modules>