Split the iPOJO test suite in several bundles.
git-svn-id: https://svn.apache.org/repos/asf/felix/trunk@651646 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/ipojo/tests/pom.xml b/ipojo/tests/pom.xml
index d0a91ca..0f42790 100644
--- a/ipojo/tests/pom.xml
+++ b/ipojo/tests/pom.xml
@@ -23,26 +23,18 @@
<version>0.7.6-SNAPSHOT</version>
<name>Apache Felix iPOJO Tests</name>
<packaging>pom</packaging>
- <profiles>
- <profile>
- <id>java5</id>
- <activation>
- <jdk>1.5</jdk>
- </activation>
- <modules>
- <module>tests.core</module>
- <module>tests.composite</module>
- </modules>
- </profile>
- <profile>
- <id>java6</id>
- <activation>
- <jdk>1.6</jdk>
- </activation>
- <modules>
- <module>tests.core</module>
- <module>tests.composite</module>
- </modules>
- </profile>
-</profiles>
+
+ <modules>
+ <module>tests.core.manipulation</module>
+ <module>tests.core.factories</module>
+ <module>tests.core.lifecycle.controller</module>
+ <module>tests.core.service.providing</module>
+ <module>tests.core.lifecycle.callback</module>
+ <module>tests.core.service.dependency</module>
+ <module>tests.core.configuration</module>
+ <module>tests.core.external.handlers</module>
+ <module>tests.core.bad.configurations</module>
+ <module>tests.composite</module>
+ </modules>
+
</project>
\ No newline at end of file
diff --git a/ipojo/tests/tests.composite/pom.xml b/ipojo/tests/tests.composite/pom.xml
index 3a2ffeb..9162a38 100644
--- a/ipojo/tests/tests.composite/pom.xml
+++ b/ipojo/tests/tests.composite/pom.xml
@@ -54,11 +54,6 @@
<artifactId>org.apache.felix.ipojo.junit4osgi</artifactId>
<version>0.7.6-SNAPSHOT</version>
</dependency>
- <dependency>
- <groupId>ipojo.tests</groupId>
- <artifactId>tests.core</artifactId>
- <version>0.7.6-SNAPSHOT</version>
- </dependency>
</dependencies>
<build>
<plugins>
@@ -81,9 +76,6 @@
<Test-Suite>
org.apache.felix.ipojo.test.composite.CompositeTestSuite
</Test-Suite>
- <Import-Package>
- org.apache.felix.ipojo.test.scenarios.service,*
- </Import-Package>
</instructions>
</configuration>
</plugin>
diff --git a/ipojo/tests/tests.composite/src/main/java/org/apache/felix/ipojo/test/composite/component/Baz2CheckProvider.java b/ipojo/tests/tests.composite/src/main/java/org/apache/felix/ipojo/test/composite/component/Baz2CheckProvider.java
index 662c8e2..9fcc4fd 100644
--- a/ipojo/tests/tests.composite/src/main/java/org/apache/felix/ipojo/test/composite/component/Baz2CheckProvider.java
+++ b/ipojo/tests/tests.composite/src/main/java/org/apache/felix/ipojo/test/composite/component/Baz2CheckProvider.java
@@ -20,9 +20,9 @@
import java.util.Properties;
-import org.apache.felix.ipojo.test.scenarios.service.BazService;
-import org.apache.felix.ipojo.test.scenarios.service.CheckService;
-import org.apache.felix.ipojo.test.scenarios.service.FooService;
+import org.apache.felix.ipojo.test.composite.service.BazService;
+import org.apache.felix.ipojo.test.composite.service.CheckService;
+import org.apache.felix.ipojo.test.composite.service.FooService;
import org.osgi.framework.ServiceReference;
public class Baz2CheckProvider implements CheckService {
diff --git a/ipojo/tests/tests.composite/src/main/java/org/apache/felix/ipojo/test/composite/component/BazProviderType1.java b/ipojo/tests/tests.composite/src/main/java/org/apache/felix/ipojo/test/composite/component/BazProviderType1.java
index 6917d39..fd495e0 100644
--- a/ipojo/tests/tests.composite/src/main/java/org/apache/felix/ipojo/test/composite/component/BazProviderType1.java
+++ b/ipojo/tests/tests.composite/src/main/java/org/apache/felix/ipojo/test/composite/component/BazProviderType1.java
@@ -20,7 +20,7 @@
import java.util.Properties;
-import org.apache.felix.ipojo.test.scenarios.service.BazService;
+import org.apache.felix.ipojo.test.composite.service.BazService;
public class BazProviderType1 implements BazService {
diff --git a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/component/CheckProviderParentClass.java b/ipojo/tests/tests.composite/src/main/java/org/apache/felix/ipojo/test/composite/component/CheckProviderParentClass.java
similarity index 92%
copy from ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/component/CheckProviderParentClass.java
copy to ipojo/tests/tests.composite/src/main/java/org/apache/felix/ipojo/test/composite/component/CheckProviderParentClass.java
index 675fe41..2294ba3 100644
--- a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/component/CheckProviderParentClass.java
+++ b/ipojo/tests/tests.composite/src/main/java/org/apache/felix/ipojo/test/composite/component/CheckProviderParentClass.java
@@ -16,9 +16,9 @@
* specific language governing permissions and limitations
* under the License.
*/
-package org.apache.felix.ipojo.test.scenarios.component;
+package org.apache.felix.ipojo.test.composite.component;
-import org.apache.felix.ipojo.test.scenarios.service.FooService;
+import org.apache.felix.ipojo.test.composite.service.FooService;
import org.osgi.framework.ServiceReference;
public abstract class CheckProviderParentClass {
diff --git a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/component/CheckServiceProvider.java b/ipojo/tests/tests.composite/src/main/java/org/apache/felix/ipojo/test/composite/component/CheckServiceProvider.java
similarity index 92%
copy from ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/component/CheckServiceProvider.java
copy to ipojo/tests/tests.composite/src/main/java/org/apache/felix/ipojo/test/composite/component/CheckServiceProvider.java
index cd2b927..9a17f1f 100644
--- a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/component/CheckServiceProvider.java
+++ b/ipojo/tests/tests.composite/src/main/java/org/apache/felix/ipojo/test/composite/component/CheckServiceProvider.java
@@ -16,12 +16,12 @@
* specific language governing permissions and limitations
* under the License.
*/
-package org.apache.felix.ipojo.test.scenarios.component;
+package org.apache.felix.ipojo.test.composite.component;
import java.util.Properties;
-import org.apache.felix.ipojo.test.scenarios.service.CheckService;
-import org.apache.felix.ipojo.test.scenarios.service.FooService;
+import org.apache.felix.ipojo.test.composite.service.CheckService;
+import org.apache.felix.ipojo.test.composite.service.FooService;
import org.osgi.framework.ServiceReference;
public class CheckServiceProvider extends CheckProviderParentClass implements CheckService {
diff --git a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/component/FooBarProviderType1.java b/ipojo/tests/tests.composite/src/main/java/org/apache/felix/ipojo/test/composite/component/FooBarProviderType1.java
similarity index 87%
copy from ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/component/FooBarProviderType1.java
copy to ipojo/tests/tests.composite/src/main/java/org/apache/felix/ipojo/test/composite/component/FooBarProviderType1.java
index 2b739b4..719f235 100644
--- a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/component/FooBarProviderType1.java
+++ b/ipojo/tests/tests.composite/src/main/java/org/apache/felix/ipojo/test/composite/component/FooBarProviderType1.java
@@ -16,12 +16,12 @@
* specific language governing permissions and limitations
* under the License.
*/
-package org.apache.felix.ipojo.test.scenarios.component;
+package org.apache.felix.ipojo.test.composite.component;
import java.util.Properties;
-import org.apache.felix.ipojo.test.scenarios.service.BarService;
-import org.apache.felix.ipojo.test.scenarios.service.FooService;
+import org.apache.felix.ipojo.test.composite.service.BarService;
+import org.apache.felix.ipojo.test.composite.service.FooService;
public class FooBarProviderType1 implements FooService, BarService {
diff --git a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/component/FooProviderType1.java b/ipojo/tests/tests.composite/src/main/java/org/apache/felix/ipojo/test/composite/component/FooProviderType1.java
similarity index 77%
copy from ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/component/FooProviderType1.java
copy to ipojo/tests/tests.composite/src/main/java/org/apache/felix/ipojo/test/composite/component/FooProviderType1.java
index 3fe9bad..fc2ea2b 100644
--- a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/component/FooProviderType1.java
+++ b/ipojo/tests/tests.composite/src/main/java/org/apache/felix/ipojo/test/composite/component/FooProviderType1.java
@@ -16,11 +16,11 @@
* specific language governing permissions and limitations
* under the License.
*/
-package org.apache.felix.ipojo.test.scenarios.component;
+package org.apache.felix.ipojo.test.composite.component;
import java.util.Properties;
-import org.apache.felix.ipojo.test.scenarios.service.FooService;
+import org.apache.felix.ipojo.test.composite.service.FooService;
import org.osgi.framework.BundleContext;
public class FooProviderType1 implements FooService {
@@ -33,19 +33,6 @@
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");
@@ -101,17 +88,5 @@
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;
- }
}
diff --git a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/component/FooProviderTypeDyn.java b/ipojo/tests/tests.composite/src/main/java/org/apache/felix/ipojo/test/composite/component/FooProviderTypeDyn.java
similarity index 93%
copy from ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/component/FooProviderTypeDyn.java
copy to ipojo/tests/tests.composite/src/main/java/org/apache/felix/ipojo/test/composite/component/FooProviderTypeDyn.java
index 39f3918..ec5261b 100644
--- a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/component/FooProviderTypeDyn.java
+++ b/ipojo/tests/tests.composite/src/main/java/org/apache/felix/ipojo/test/composite/component/FooProviderTypeDyn.java
@@ -16,11 +16,11 @@
* specific language governing permissions and limitations
* under the License.
*/
-package org.apache.felix.ipojo.test.scenarios.component;
+package org.apache.felix.ipojo.test.composite.component;
import java.util.Properties;
-import org.apache.felix.ipojo.test.scenarios.service.FooService;
+import org.apache.felix.ipojo.test.composite.service.FooService;
public class FooProviderTypeDyn implements FooService {
diff --git a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/component/FooProviderTypeDyn2.java b/ipojo/tests/tests.composite/src/main/java/org/apache/felix/ipojo/test/composite/component/FooProviderTypeDyn2.java
similarity index 92%
copy from ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/component/FooProviderTypeDyn2.java
copy to ipojo/tests/tests.composite/src/main/java/org/apache/felix/ipojo/test/composite/component/FooProviderTypeDyn2.java
index f5f233a..757ae24 100644
--- a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/component/FooProviderTypeDyn2.java
+++ b/ipojo/tests/tests.composite/src/main/java/org/apache/felix/ipojo/test/composite/component/FooProviderTypeDyn2.java
@@ -16,11 +16,11 @@
* specific language governing permissions and limitations
* under the License.
*/
-package org.apache.felix.ipojo.test.scenarios.component;
+package org.apache.felix.ipojo.test.composite.component;
import java.util.Properties;
-import org.apache.felix.ipojo.test.scenarios.service.FooService;
+import org.apache.felix.ipojo.test.composite.service.FooService;
public class FooProviderTypeDyn2 implements FooService {
diff --git a/ipojo/tests/tests.composite/src/main/java/org/apache/felix/ipojo/test/composite/exporter/FilteredExport.java b/ipojo/tests/tests.composite/src/main/java/org/apache/felix/ipojo/test/composite/exporter/FilteredExport.java
index 938bb94..8353c03 100644
--- a/ipojo/tests/tests.composite/src/main/java/org/apache/felix/ipojo/test/composite/exporter/FilteredExport.java
+++ b/ipojo/tests/tests.composite/src/main/java/org/apache/felix/ipojo/test/composite/exporter/FilteredExport.java
@@ -23,9 +23,9 @@
import org.apache.felix.ipojo.ComponentInstance;
import org.apache.felix.ipojo.Factory;
import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
+import org.apache.felix.ipojo.test.composite.service.BazService;
+import org.apache.felix.ipojo.test.composite.service.FooService;
import org.apache.felix.ipojo.test.composite.util.Utils;
-import org.apache.felix.ipojo.test.scenarios.service.BazService;
-import org.apache.felix.ipojo.test.scenarios.service.FooService;
import org.osgi.framework.ServiceReference;
public class FilteredExport extends OSGiTestCase {
diff --git a/ipojo/tests/tests.composite/src/main/java/org/apache/felix/ipojo/test/composite/exporter/MultipleExport.java b/ipojo/tests/tests.composite/src/main/java/org/apache/felix/ipojo/test/composite/exporter/MultipleExport.java
index 10a0a4e..fed07ba 100644
--- a/ipojo/tests/tests.composite/src/main/java/org/apache/felix/ipojo/test/composite/exporter/MultipleExport.java
+++ b/ipojo/tests/tests.composite/src/main/java/org/apache/felix/ipojo/test/composite/exporter/MultipleExport.java
@@ -23,9 +23,9 @@
import org.apache.felix.ipojo.ComponentInstance;
import org.apache.felix.ipojo.Factory;
import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
+import org.apache.felix.ipojo.test.composite.service.BazService;
+import org.apache.felix.ipojo.test.composite.service.FooService;
import org.apache.felix.ipojo.test.composite.util.Utils;
-import org.apache.felix.ipojo.test.scenarios.service.BazService;
-import org.apache.felix.ipojo.test.scenarios.service.FooService;
import org.osgi.framework.ServiceReference;
public class MultipleExport extends OSGiTestCase {
diff --git a/ipojo/tests/tests.composite/src/main/java/org/apache/felix/ipojo/test/composite/exporter/OptionalExport.java b/ipojo/tests/tests.composite/src/main/java/org/apache/felix/ipojo/test/composite/exporter/OptionalExport.java
index 5c30d24..4f78f49 100644
--- a/ipojo/tests/tests.composite/src/main/java/org/apache/felix/ipojo/test/composite/exporter/OptionalExport.java
+++ b/ipojo/tests/tests.composite/src/main/java/org/apache/felix/ipojo/test/composite/exporter/OptionalExport.java
@@ -23,9 +23,9 @@
import org.apache.felix.ipojo.ComponentInstance;
import org.apache.felix.ipojo.Factory;
import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
+import org.apache.felix.ipojo.test.composite.service.BazService;
+import org.apache.felix.ipojo.test.composite.service.FooService;
import org.apache.felix.ipojo.test.composite.util.Utils;
-import org.apache.felix.ipojo.test.scenarios.service.BazService;
-import org.apache.felix.ipojo.test.scenarios.service.FooService;
import org.osgi.framework.ServiceReference;
public class OptionalExport extends OSGiTestCase {
diff --git a/ipojo/tests/tests.composite/src/main/java/org/apache/felix/ipojo/test/composite/exporter/OptionalMultipleExport.java b/ipojo/tests/tests.composite/src/main/java/org/apache/felix/ipojo/test/composite/exporter/OptionalMultipleExport.java
index 997be4e..a285ef0 100644
--- a/ipojo/tests/tests.composite/src/main/java/org/apache/felix/ipojo/test/composite/exporter/OptionalMultipleExport.java
+++ b/ipojo/tests/tests.composite/src/main/java/org/apache/felix/ipojo/test/composite/exporter/OptionalMultipleExport.java
@@ -23,9 +23,9 @@
import org.apache.felix.ipojo.ComponentInstance;
import org.apache.felix.ipojo.Factory;
import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
+import org.apache.felix.ipojo.test.composite.service.BazService;
+import org.apache.felix.ipojo.test.composite.service.FooService;
import org.apache.felix.ipojo.test.composite.util.Utils;
-import org.apache.felix.ipojo.test.scenarios.service.BazService;
-import org.apache.felix.ipojo.test.scenarios.service.FooService;
import org.osgi.framework.ServiceReference;
public class OptionalMultipleExport extends OSGiTestCase {
diff --git a/ipojo/tests/tests.composite/src/main/java/org/apache/felix/ipojo/test/composite/exporter/SimpleExport.java b/ipojo/tests/tests.composite/src/main/java/org/apache/felix/ipojo/test/composite/exporter/SimpleExport.java
index 5ee7cd7..b0bf922 100644
--- a/ipojo/tests/tests.composite/src/main/java/org/apache/felix/ipojo/test/composite/exporter/SimpleExport.java
+++ b/ipojo/tests/tests.composite/src/main/java/org/apache/felix/ipojo/test/composite/exporter/SimpleExport.java
@@ -23,9 +23,9 @@
import org.apache.felix.ipojo.ComponentInstance;
import org.apache.felix.ipojo.Factory;
import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
+import org.apache.felix.ipojo.test.composite.service.BazService;
+import org.apache.felix.ipojo.test.composite.service.FooService;
import org.apache.felix.ipojo.test.composite.util.Utils;
-import org.apache.felix.ipojo.test.scenarios.service.BazService;
-import org.apache.felix.ipojo.test.scenarios.service.FooService;
import org.osgi.framework.ServiceReference;
public class SimpleExport extends OSGiTestCase {
diff --git a/ipojo/tests/tests.composite/src/main/java/org/apache/felix/ipojo/test/composite/importer/DelayedFilteredImport.java b/ipojo/tests/tests.composite/src/main/java/org/apache/felix/ipojo/test/composite/importer/DelayedFilteredImport.java
index 659705f..1466677 100644
--- a/ipojo/tests/tests.composite/src/main/java/org/apache/felix/ipojo/test/composite/importer/DelayedFilteredImport.java
+++ b/ipojo/tests/tests.composite/src/main/java/org/apache/felix/ipojo/test/composite/importer/DelayedFilteredImport.java
@@ -24,8 +24,8 @@
import org.apache.felix.ipojo.Factory;
import org.apache.felix.ipojo.ServiceContext;
import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
+import org.apache.felix.ipojo.test.composite.service.FooService;
import org.apache.felix.ipojo.test.composite.util.Utils;
-import org.apache.felix.ipojo.test.scenarios.service.FooService;
import org.osgi.framework.ServiceReference;
public class DelayedFilteredImport extends OSGiTestCase {
@@ -47,7 +47,7 @@
import1.stop();
- fooProvider = Utils.getFactoryByName(context, "FooProviderType-1");
+ fooProvider = Utils.getFactoryByName(context, "COMPO-FooProviderType-1");
assertNotNull("Check fooProvider availability", fooProvider);
Properties p1 = new Properties();
diff --git a/ipojo/tests/tests.composite/src/main/java/org/apache/felix/ipojo/test/composite/importer/DelayedMultipleImport.java b/ipojo/tests/tests.composite/src/main/java/org/apache/felix/ipojo/test/composite/importer/DelayedMultipleImport.java
index 99b359c..47688ee 100644
--- a/ipojo/tests/tests.composite/src/main/java/org/apache/felix/ipojo/test/composite/importer/DelayedMultipleImport.java
+++ b/ipojo/tests/tests.composite/src/main/java/org/apache/felix/ipojo/test/composite/importer/DelayedMultipleImport.java
@@ -24,8 +24,8 @@
import org.apache.felix.ipojo.Factory;
import org.apache.felix.ipojo.ServiceContext;
import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
+import org.apache.felix.ipojo.test.composite.service.FooService;
import org.apache.felix.ipojo.test.composite.util.Utils;
-import org.apache.felix.ipojo.test.scenarios.service.FooService;
import org.osgi.framework.ServiceReference;
public class DelayedMultipleImport extends OSGiTestCase {
@@ -47,7 +47,7 @@
import2.stop();
- fooProvider = Utils.getFactoryByName(context, "FooProviderType-1");
+ fooProvider = Utils.getFactoryByName(context, "COMPO-FooProviderType-1");
assertNotNull("Check fooProvider availability", fooProvider);
Properties p1 = new Properties();
diff --git a/ipojo/tests/tests.composite/src/main/java/org/apache/felix/ipojo/test/composite/importer/DelayedOptionalImport.java b/ipojo/tests/tests.composite/src/main/java/org/apache/felix/ipojo/test/composite/importer/DelayedOptionalImport.java
index 41ffb28..6e36797 100644
--- a/ipojo/tests/tests.composite/src/main/java/org/apache/felix/ipojo/test/composite/importer/DelayedOptionalImport.java
+++ b/ipojo/tests/tests.composite/src/main/java/org/apache/felix/ipojo/test/composite/importer/DelayedOptionalImport.java
@@ -24,8 +24,8 @@
import org.apache.felix.ipojo.Factory;
import org.apache.felix.ipojo.ServiceContext;
import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
+import org.apache.felix.ipojo.test.composite.service.FooService;
import org.apache.felix.ipojo.test.composite.util.Utils;
-import org.apache.felix.ipojo.test.scenarios.service.FooService;
import org.osgi.framework.ServiceReference;
public class DelayedOptionalImport extends OSGiTestCase {
@@ -47,7 +47,7 @@
import3.stop();
- fooProvider = Utils.getFactoryByName(context, "FooProviderType-1");
+ fooProvider = Utils.getFactoryByName(context, "COMPO-FooProviderType-1");
assertNotNull("Check fooProvider availability", fooProvider);
Properties p1 = new Properties();
diff --git a/ipojo/tests/tests.composite/src/main/java/org/apache/felix/ipojo/test/composite/importer/DelayedOptionalMultipleImport.java b/ipojo/tests/tests.composite/src/main/java/org/apache/felix/ipojo/test/composite/importer/DelayedOptionalMultipleImport.java
index de9d875..0dac390 100644
--- a/ipojo/tests/tests.composite/src/main/java/org/apache/felix/ipojo/test/composite/importer/DelayedOptionalMultipleImport.java
+++ b/ipojo/tests/tests.composite/src/main/java/org/apache/felix/ipojo/test/composite/importer/DelayedOptionalMultipleImport.java
@@ -24,8 +24,8 @@
import org.apache.felix.ipojo.Factory;
import org.apache.felix.ipojo.ServiceContext;
import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
+import org.apache.felix.ipojo.test.composite.service.FooService;
import org.apache.felix.ipojo.test.composite.util.Utils;
-import org.apache.felix.ipojo.test.scenarios.service.FooService;
import org.osgi.framework.ServiceReference;
public class DelayedOptionalMultipleImport extends OSGiTestCase {
@@ -47,7 +47,7 @@
import4.stop();
- fooProvider = Utils.getFactoryByName(context, "FooProviderType-1");
+ fooProvider = Utils.getFactoryByName(context, "COMPO-FooProviderType-1");
assertNotNull("Check fooProvider availability", fooProvider);
Properties p1 = new Properties();
diff --git a/ipojo/tests/tests.composite/src/main/java/org/apache/felix/ipojo/test/composite/importer/DelayedSimpleImport.java b/ipojo/tests/tests.composite/src/main/java/org/apache/felix/ipojo/test/composite/importer/DelayedSimpleImport.java
index e29055d..2d89ee8 100644
--- a/ipojo/tests/tests.composite/src/main/java/org/apache/felix/ipojo/test/composite/importer/DelayedSimpleImport.java
+++ b/ipojo/tests/tests.composite/src/main/java/org/apache/felix/ipojo/test/composite/importer/DelayedSimpleImport.java
@@ -24,8 +24,8 @@
import org.apache.felix.ipojo.Factory;
import org.apache.felix.ipojo.ServiceContext;
import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
+import org.apache.felix.ipojo.test.composite.service.FooService;
import org.apache.felix.ipojo.test.composite.util.Utils;
-import org.apache.felix.ipojo.test.scenarios.service.FooService;
import org.osgi.framework.ServiceReference;
public class DelayedSimpleImport extends OSGiTestCase {
@@ -47,7 +47,7 @@
import1.stop();
- fooProvider = Utils.getFactoryByName(context, "FooProviderType-1");
+ fooProvider = Utils.getFactoryByName(context, "COMPO-FooProviderType-1");
assertNotNull("Check fooProvider availability", fooProvider);
Properties p1 = new Properties();
diff --git a/ipojo/tests/tests.composite/src/main/java/org/apache/felix/ipojo/test/composite/importer/FilteredImport.java b/ipojo/tests/tests.composite/src/main/java/org/apache/felix/ipojo/test/composite/importer/FilteredImport.java
index 69b3a37..221ecda 100644
--- a/ipojo/tests/tests.composite/src/main/java/org/apache/felix/ipojo/test/composite/importer/FilteredImport.java
+++ b/ipojo/tests/tests.composite/src/main/java/org/apache/felix/ipojo/test/composite/importer/FilteredImport.java
@@ -24,8 +24,8 @@
import org.apache.felix.ipojo.Factory;
import org.apache.felix.ipojo.ServiceContext;
import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
+import org.apache.felix.ipojo.test.composite.service.FooService;
import org.apache.felix.ipojo.test.composite.util.Utils;
-import org.apache.felix.ipojo.test.scenarios.service.FooService;
import org.osgi.framework.ServiceReference;
public class FilteredImport extends OSGiTestCase {
@@ -47,10 +47,10 @@
}
import1.stop();
- fooProvider = Utils.getFactoryByName(context, "FooProviderType-1");
+ fooProvider = Utils.getFactoryByName(context, "COMPO-FooProviderType-1");
assertNotNull("Check fooProvider availability", fooProvider);
- fooProvider2 = Utils.getFactoryByName(context, "FooProviderType-2");
+ fooProvider2 = Utils.getFactoryByName(context, "COMPO-FooProviderType-2");
assertNotNull("Check fooProvider availability", fooProvider2);
Properties p1 = new Properties();
diff --git a/ipojo/tests/tests.composite/src/main/java/org/apache/felix/ipojo/test/composite/importer/MultipleImport.java b/ipojo/tests/tests.composite/src/main/java/org/apache/felix/ipojo/test/composite/importer/MultipleImport.java
index 4d5df53..c8eedce 100644
--- a/ipojo/tests/tests.composite/src/main/java/org/apache/felix/ipojo/test/composite/importer/MultipleImport.java
+++ b/ipojo/tests/tests.composite/src/main/java/org/apache/felix/ipojo/test/composite/importer/MultipleImport.java
@@ -24,8 +24,8 @@
import org.apache.felix.ipojo.Factory;
import org.apache.felix.ipojo.ServiceContext;
import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
+import org.apache.felix.ipojo.test.composite.service.FooService;
import org.apache.felix.ipojo.test.composite.util.Utils;
-import org.apache.felix.ipojo.test.scenarios.service.FooService;
import org.osgi.framework.ServiceReference;
public class MultipleImport extends OSGiTestCase {
@@ -34,7 +34,7 @@
Factory fooProvider;
public void setUp() {
- fooProvider = Utils.getFactoryByName(context, "FooProviderType-1");
+ fooProvider = Utils.getFactoryByName(context, "COMPO-FooProviderType-1");
assertNotNull("Check fooProvider availability", fooProvider);
Properties p = new Properties();
diff --git a/ipojo/tests/tests.composite/src/main/java/org/apache/felix/ipojo/test/composite/importer/OptionalImport.java b/ipojo/tests/tests.composite/src/main/java/org/apache/felix/ipojo/test/composite/importer/OptionalImport.java
index 69cd1bb..0fb3f89 100644
--- a/ipojo/tests/tests.composite/src/main/java/org/apache/felix/ipojo/test/composite/importer/OptionalImport.java
+++ b/ipojo/tests/tests.composite/src/main/java/org/apache/felix/ipojo/test/composite/importer/OptionalImport.java
@@ -24,8 +24,8 @@
import org.apache.felix.ipojo.Factory;
import org.apache.felix.ipojo.ServiceContext;
import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
+import org.apache.felix.ipojo.test.composite.service.FooService;
import org.apache.felix.ipojo.test.composite.util.Utils;
-import org.apache.felix.ipojo.test.scenarios.service.FooService;
import org.osgi.framework.ServiceReference;
public class OptionalImport extends OSGiTestCase {
@@ -34,7 +34,7 @@
Factory fooProvider;
public void setUp() {
- fooProvider = Utils.getFactoryByName(context, "FooProviderType-1");
+ fooProvider = Utils.getFactoryByName(context, "COMPO-FooProviderType-1");
assertNotNull("Check fooProvider availability", fooProvider);
Properties p = new Properties();
diff --git a/ipojo/tests/tests.composite/src/main/java/org/apache/felix/ipojo/test/composite/importer/OptionalMultipleImport.java b/ipojo/tests/tests.composite/src/main/java/org/apache/felix/ipojo/test/composite/importer/OptionalMultipleImport.java
index 811301d..a7c71b0 100644
--- a/ipojo/tests/tests.composite/src/main/java/org/apache/felix/ipojo/test/composite/importer/OptionalMultipleImport.java
+++ b/ipojo/tests/tests.composite/src/main/java/org/apache/felix/ipojo/test/composite/importer/OptionalMultipleImport.java
@@ -24,8 +24,8 @@
import org.apache.felix.ipojo.Factory;
import org.apache.felix.ipojo.ServiceContext;
import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
+import org.apache.felix.ipojo.test.composite.service.FooService;
import org.apache.felix.ipojo.test.composite.util.Utils;
-import org.apache.felix.ipojo.test.scenarios.service.FooService;
import org.osgi.framework.ServiceReference;
public class OptionalMultipleImport extends OSGiTestCase {
@@ -34,7 +34,7 @@
Factory fooProvider;
public void setUp() {
- fooProvider = Utils.getFactoryByName(context, "FooProviderType-1");
+ fooProvider = Utils.getFactoryByName(context, "COMPO-FooProviderType-1");
assertNotNull("Check fooProvider availability", fooProvider);
Properties p = new Properties();
diff --git a/ipojo/tests/tests.composite/src/main/java/org/apache/felix/ipojo/test/composite/importer/SimpleImport.java b/ipojo/tests/tests.composite/src/main/java/org/apache/felix/ipojo/test/composite/importer/SimpleImport.java
index 9bcdc87..31f2b5a 100644
--- a/ipojo/tests/tests.composite/src/main/java/org/apache/felix/ipojo/test/composite/importer/SimpleImport.java
+++ b/ipojo/tests/tests.composite/src/main/java/org/apache/felix/ipojo/test/composite/importer/SimpleImport.java
@@ -24,8 +24,8 @@
import org.apache.felix.ipojo.Factory;
import org.apache.felix.ipojo.ServiceContext;
import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
+import org.apache.felix.ipojo.test.composite.service.FooService;
import org.apache.felix.ipojo.test.composite.util.Utils;
-import org.apache.felix.ipojo.test.scenarios.service.FooService;
import org.osgi.framework.ServiceReference;
public class SimpleImport extends OSGiTestCase {
@@ -34,7 +34,7 @@
Factory fooProvider;
public void setUp() {
- fooProvider = Utils.getFactoryByName(context, "FooProviderType-1");
+ fooProvider = Utils.getFactoryByName(context, "COMPO-FooProviderType-1");
assertNotNull("Check fooProvider availability", fooProvider);
Properties p = new Properties();
diff --git a/ipojo/tests/tests.composite/src/main/java/org/apache/felix/ipojo/test/composite/infrastructure/FactoryManagementTest.java b/ipojo/tests/tests.composite/src/main/java/org/apache/felix/ipojo/test/composite/infrastructure/FactoryManagementTest.java
index 8e238a3..43433a9 100644
--- a/ipojo/tests/tests.composite/src/main/java/org/apache/felix/ipojo/test/composite/infrastructure/FactoryManagementTest.java
+++ b/ipojo/tests/tests.composite/src/main/java/org/apache/felix/ipojo/test/composite/infrastructure/FactoryManagementTest.java
@@ -30,8 +30,8 @@
import org.apache.felix.ipojo.architecture.ComponentTypeDescription;
import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
import org.apache.felix.ipojo.metadata.Element;
+import org.apache.felix.ipojo.test.composite.service.CheckService;
import org.apache.felix.ipojo.test.composite.util.Utils;
-import org.apache.felix.ipojo.test.scenarios.service.CheckService;
import org.osgi.framework.BundleContext;
import org.osgi.framework.ServiceReference;
import org.osgi.framework.ServiceRegistration;
@@ -217,7 +217,7 @@
ServiceContext sc2 = Utils.getServiceContext(empty2);
- Factory fact1 = Utils.getFactoryByName(sc2, "SimpleCheckServiceProvider");
+ Factory fact1 = Utils.getFactoryByName(sc2, "COMPO-SimpleCheckServiceProvider");
Properties props = new Properties();
props.put("name", "client");
ComponentInstance client = null;
@@ -225,7 +225,7 @@
client = fact1.createComponentInstance(props);
} catch (Exception e) { e.printStackTrace(); fail("Cannot instantiate the client : " + e.getMessage()); }
- Factory fact2 = Utils.getFactoryByName(sc2, "FooProviderType-1");
+ Factory fact2 = Utils.getFactoryByName(sc2, "COMPO-FooProviderType-1");
Properties props2 = new Properties();
props2.put("name", "provider");
ComponentInstance provider = null;
diff --git a/ipojo/tests/tests.composite/src/main/java/org/apache/felix/ipojo/test/composite/infrastructure/ServiceRangeTest.java b/ipojo/tests/tests.composite/src/main/java/org/apache/felix/ipojo/test/composite/infrastructure/ServiceRangeTest.java
index 740f129..a2d9f3c 100644
--- a/ipojo/tests/tests.composite/src/main/java/org/apache/felix/ipojo/test/composite/infrastructure/ServiceRangeTest.java
+++ b/ipojo/tests/tests.composite/src/main/java/org/apache/felix/ipojo/test/composite/infrastructure/ServiceRangeTest.java
@@ -24,9 +24,9 @@
import org.apache.felix.ipojo.Factory;
import org.apache.felix.ipojo.ServiceContext;
import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
+import org.apache.felix.ipojo.test.composite.service.CheckService;
+import org.apache.felix.ipojo.test.composite.service.FooService;
import org.apache.felix.ipojo.test.composite.util.Utils;
-import org.apache.felix.ipojo.test.scenarios.service.CheckService;
-import org.apache.felix.ipojo.test.scenarios.service.FooService;
import org.osgi.framework.InvalidSyntaxException;
import org.osgi.framework.ServiceReference;
@@ -53,7 +53,7 @@
public void testLevelOne1() {
ServiceContext sc2 = Utils.getServiceContext(empty);
- Factory fact1 = Utils.getFactoryByName(sc2, "SimpleCheckServiceProvider");
+ Factory fact1 = Utils.getFactoryByName(sc2, "COMPO-SimpleCheckServiceProvider");
Properties props = new Properties();
props.put("name", "client");
ComponentInstance client = null;
@@ -61,7 +61,7 @@
client = fact1.createComponentInstance(props);
} catch(Exception e) { fail("Cannot instantiate the client : " + e.getMessage()); }
- Factory fact2 = Utils.getFactoryByName(sc2, "FooProviderType-1");
+ Factory fact2 = Utils.getFactoryByName(sc2, "COMPO-FooProviderType-1");
Properties props2 = new Properties();
props2.put("name", "provider");
ComponentInstance provider = null;
@@ -105,7 +105,7 @@
public void testLevelOne2() {
ServiceContext sc2 = Utils.getServiceContext(empty);
- Factory fact1 = Utils.getFactoryByName(sc2, "SimpleCheckServiceProvider");
+ Factory fact1 = Utils.getFactoryByName(sc2, "COMPO-SimpleCheckServiceProvider");
Properties props = new Properties();
props.put("name", "client");
ComponentInstance client = null;
@@ -113,7 +113,7 @@
client = fact1.createComponentInstance(props, sc2);
} catch(Exception e) { fail("Cannot instantiate the client : " + e.getMessage()); }
- Factory fact2 = Utils.getFactoryByName(sc2, "FooProviderType-1");
+ Factory fact2 = Utils.getFactoryByName(sc2, "COMPO-FooProviderType-1");
Properties props2 = new Properties();
props2.put("name", "provider");
ComponentInstance provider = null;
@@ -157,7 +157,7 @@
public void testLevelOne3() {
ServiceContext sc2 = Utils.getServiceContext(empty);
- Factory fact1 = Utils.getFactoryByName(context, "SimpleCheckServiceProvider");
+ Factory fact1 = Utils.getFactoryByName(context, "COMPO-SimpleCheckServiceProvider");
Properties props = new Properties();
props.put("name", "client");
ComponentInstance client = null;
@@ -165,7 +165,7 @@
client = fact1.createComponentInstance(props, sc2);
} catch(Exception e) { fail("Cannot instantiate the client : " + e.getMessage()); }
- Factory fact2 = Utils.getFactoryByName(context, "FooProviderType-1");
+ Factory fact2 = Utils.getFactoryByName(context, "COMPO-FooProviderType-1");
Properties props2 = new Properties();
props2.put("name", "provider");
ComponentInstance provider = null;
@@ -220,7 +220,7 @@
ServiceContext sc2 = Utils.getServiceContext(empty2);
- Factory fact1 = Utils.getFactoryByName(sc2, "SimpleCheckServiceProvider");
+ Factory fact1 = Utils.getFactoryByName(sc2, "COMPO-SimpleCheckServiceProvider");
Properties props = new Properties();
props.put("name", "client");
ComponentInstance client = null;
@@ -228,7 +228,7 @@
client = fact1.createComponentInstance(props);
} catch(Exception e) { fail("Cannot instantiate the client : " + e.getMessage()); }
- Factory fact2 = Utils.getFactoryByName(sc2, "FooProviderType-1");
+ Factory fact2 = Utils.getFactoryByName(sc2, "COMPO-FooProviderType-1");
Properties props2 = new Properties();
props2.put("name", "provider");
ComponentInstance provider = null;
@@ -288,7 +288,7 @@
ServiceContext sc2 = Utils.getServiceContext(empty2);
- Factory fact1 = Utils.getFactoryByName(sc1, "SimpleCheckServiceProvider");
+ Factory fact1 = Utils.getFactoryByName(sc1, "COMPO-SimpleCheckServiceProvider");
Properties props = new Properties();
props.put("name", "client");
ComponentInstance client = null;
@@ -296,7 +296,7 @@
client = fact1.createComponentInstance(props, sc2);
} catch(Exception e) { fail("Cannot instantiate the client : " + e.getMessage()); }
- Factory fact2 = Utils.getFactoryByName(sc1, "FooProviderType-1");
+ Factory fact2 = Utils.getFactoryByName(sc1, "COMPO-FooProviderType-1");
Properties props2 = new Properties();
props2.put("name", "provider");
ComponentInstance provider = null;
@@ -356,7 +356,7 @@
ServiceContext sc2 = Utils.getServiceContext(empty2);
- Factory fact1 = Utils.getFactoryByName(context, "SimpleCheckServiceProvider");
+ Factory fact1 = Utils.getFactoryByName(context, "COMPO-SimpleCheckServiceProvider");
Properties props = new Properties();
props.put("name", "client");
ComponentInstance client = null;
@@ -364,7 +364,7 @@
client = fact1.createComponentInstance(props, sc2);
} catch(Exception e) { fail("Cannot instantiate the client : " + e.getMessage()); }
- Factory fact2 = Utils.getFactoryByName(context, "FooProviderType-1");
+ Factory fact2 = Utils.getFactoryByName(context, "COMPO-FooProviderType-1");
Properties props2 = new Properties();
props2.put("name", "provider");
ComponentInstance provider = null;
@@ -424,7 +424,7 @@
ServiceContext sc2 = Utils.getServiceContext(empty2);
- Factory fact1 = Utils.getFactoryByName(sc2, "SimpleCheckServiceProvider");
+ Factory fact1 = Utils.getFactoryByName(sc2, "COMPO-SimpleCheckServiceProvider");
Properties props = new Properties();
props.put("name", "client");
ComponentInstance client = null;
@@ -432,7 +432,7 @@
client = fact1.createComponentInstance(props, sc2);
} catch(Exception e) { fail("Cannot instantiate the client : " + e.getMessage()); }
- Factory fact2 = Utils.getFactoryByName(sc2, "FooProviderType-1");
+ Factory fact2 = Utils.getFactoryByName(sc2, "COMPO-FooProviderType-1");
Properties props2 = new Properties();
props2.put("name", "provider");
ComponentInstance provider = null;
diff --git a/ipojo/tests/tests.composite/src/main/java/org/apache/felix/ipojo/test/composite/infrastructure/ServiceRegistryTest.java b/ipojo/tests/tests.composite/src/main/java/org/apache/felix/ipojo/test/composite/infrastructure/ServiceRegistryTest.java
index 0b76bcb..14b3f61 100644
--- a/ipojo/tests/tests.composite/src/main/java/org/apache/felix/ipojo/test/composite/infrastructure/ServiceRegistryTest.java
+++ b/ipojo/tests/tests.composite/src/main/java/org/apache/felix/ipojo/test/composite/infrastructure/ServiceRegistryTest.java
@@ -28,7 +28,7 @@
import org.apache.felix.ipojo.architecture.InstanceDescription;
import org.apache.felix.ipojo.context.ServiceRegistry;
import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
-import org.apache.felix.ipojo.test.scenarios.service.BarService;
+import org.apache.felix.ipojo.test.composite.service.BarService;
import org.osgi.framework.BundleContext;
import org.osgi.framework.InvalidSyntaxException;
import org.osgi.framework.ServiceEvent;
diff --git a/ipojo/tests/tests.composite/src/main/java/org/apache/felix/ipojo/test/composite/instance/SimpleInstance.java b/ipojo/tests/tests.composite/src/main/java/org/apache/felix/ipojo/test/composite/instance/SimpleInstance.java
index 433f62f..179c296 100644
--- a/ipojo/tests/tests.composite/src/main/java/org/apache/felix/ipojo/test/composite/instance/SimpleInstance.java
+++ b/ipojo/tests/tests.composite/src/main/java/org/apache/felix/ipojo/test/composite/instance/SimpleInstance.java
@@ -27,8 +27,8 @@
import org.apache.felix.ipojo.architecture.Architecture;
import org.apache.felix.ipojo.architecture.InstanceDescription;
import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
+import org.apache.felix.ipojo.test.composite.service.FooService;
import org.apache.felix.ipojo.test.composite.util.Utils;
-import org.apache.felix.ipojo.test.scenarios.service.FooService;
import org.osgi.framework.ServiceReference;
public class SimpleInstance extends OSGiTestCase {
@@ -39,8 +39,8 @@
public void setUp() {
- fooFactory1 = (ComponentFactory) Utils.getFactoryByName(context, "FooProviderType-1");
- fooFactory2 = (ComponentFactory) Utils.getFactoryByName(context, "FooProviderType-Dyn2");
+ fooFactory1 = (ComponentFactory) Utils.getFactoryByName(context, "COMPO-FooProviderType-1");
+ fooFactory2 = (ComponentFactory) Utils.getFactoryByName(context, "COMPO-FooProviderType-Dyn2");
compoFactory = (ComponentFactory) Utils.getFactoryByName(context, "composite.inst.1");
Factory fact = Utils.getFactoryByName(context, "composite.empty");
Properties props = new Properties();
@@ -59,14 +59,15 @@
public void testCreation() {
Properties props = new Properties();
- props.put("name", "under");
+ props.put("name", "under-A");
ComponentInstance under = null;
try {
under = compoFactory.createComponentInstance(props);
} catch(Exception e) {
e.printStackTrace();
fail("Cannot instantiate under from " + compoFactory.getName() + " -> " + e.getMessage());
- }
+ }
+
assertTrue("Check instance validity", under.getState() == ComponentInstance.VALID);
under.dispose();
}
@@ -203,9 +204,9 @@
assertEquals("Check instance name" , id.getName(), "under");
assertEquals("Check component type name" , id.getComponentDescription().getName(), "composite.bar.1");
- ComponentFactory fact1 = (ComponentFactory) Utils.getFactoryByName(context, "FooBarProviderType-1");
- ComponentFactory fact2 = (ComponentFactory) Utils.getFactoryByName(context, "FooBarProviderType-2");
- ComponentFactory fact3 = (ComponentFactory) Utils.getFactoryByName(context, "FooBarProviderType-3");
+ ComponentFactory fact1 = (ComponentFactory) Utils.getFactoryByName(context, "COMPO-FooBarProviderType-1");
+ ComponentFactory fact2 = (ComponentFactory) Utils.getFactoryByName(context, "COMPO-FooBarProviderType-2");
+ ComponentFactory fact3 = (ComponentFactory) Utils.getFactoryByName(context, "COMPO-FooBarProviderType-3");
fact1.stop();
assertTrue("Check instance validity - 2", under.getState() == ComponentInstance.VALID);
diff --git a/ipojo/tests/tests.composite/src/main/java/org/apache/felix/ipojo/test/composite/instantiator/ConfigurableInstantiation.java b/ipojo/tests/tests.composite/src/main/java/org/apache/felix/ipojo/test/composite/instantiator/ConfigurableInstantiation.java
index a7de283..2c851ea 100644
--- a/ipojo/tests/tests.composite/src/main/java/org/apache/felix/ipojo/test/composite/instantiator/ConfigurableInstantiation.java
+++ b/ipojo/tests/tests.composite/src/main/java/org/apache/felix/ipojo/test/composite/instantiator/ConfigurableInstantiation.java
@@ -23,9 +23,10 @@
import org.apache.felix.ipojo.ComponentFactory;
import org.apache.felix.ipojo.ComponentInstance;
import org.apache.felix.ipojo.ServiceContext;
+import org.apache.felix.ipojo.architecture.Architecture;
import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
+import org.apache.felix.ipojo.test.composite.service.FooService;
import org.apache.felix.ipojo.test.composite.util.Utils;
-import org.apache.felix.ipojo.test.scenarios.service.FooService;
import org.osgi.framework.ServiceReference;
public class ConfigurableInstantiation extends OSGiTestCase {
@@ -45,13 +46,14 @@
public void testAccept() {
Properties props = new Properties();
- props.put("name", "under");
+ props.put("name", "under-A");
ComponentInstance under = null;
try {
under = acceptF.createComponentInstance(props);
} catch(Exception e) {
fail("Cannot instantiate under : " + e.getMessage());
}
+
assertTrue("Check instance validity", under.getState() == ComponentInstance.VALID);
ServiceContext sc = Utils.getServiceContext(under);
ServiceReference ref = sc.getServiceReference(FooService.class.getName());
diff --git a/ipojo/tests/tests.composite/src/main/java/org/apache/felix/ipojo/test/composite/instantiator/MultipleInstantiation.java b/ipojo/tests/tests.composite/src/main/java/org/apache/felix/ipojo/test/composite/instantiator/MultipleInstantiation.java
index 066f29d..f155add 100644
--- a/ipojo/tests/tests.composite/src/main/java/org/apache/felix/ipojo/test/composite/instantiator/MultipleInstantiation.java
+++ b/ipojo/tests/tests.composite/src/main/java/org/apache/felix/ipojo/test/composite/instantiator/MultipleInstantiation.java
@@ -27,8 +27,8 @@
import org.apache.felix.ipojo.architecture.Architecture;
import org.apache.felix.ipojo.architecture.InstanceDescription;
import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
+import org.apache.felix.ipojo.test.composite.service.BarService;
import org.apache.felix.ipojo.test.composite.util.Utils;
-import org.apache.felix.ipojo.test.scenarios.service.BarService;
import org.osgi.framework.ServiceReference;
public class MultipleInstantiation extends OSGiTestCase {
@@ -128,9 +128,9 @@
ServiceContext sc = Utils.getServiceContext(under);
assertTrue("Check instance validity - 1", under.getState() == ComponentInstance.VALID);
- ComponentFactory fact1 = (ComponentFactory) Utils.getFactoryByName(context, "FooBarProviderType-1");
- ComponentFactory fact2 = (ComponentFactory) Utils.getFactoryByName(context, "FooBarProviderType-2");
- ComponentFactory fact3 = (ComponentFactory) Utils.getFactoryByName(context, "FooBarProviderType-3");
+ ComponentFactory fact1 = (ComponentFactory) Utils.getFactoryByName(context, "COMPO-FooBarProviderType-1");
+ ComponentFactory fact2 = (ComponentFactory) Utils.getFactoryByName(context, "COMPO-FooBarProviderType-2");
+ ComponentFactory fact3 = (ComponentFactory) Utils.getFactoryByName(context, "COMPO-FooBarProviderType-3");
fact1.stop();
assertTrue("Check instance validity - 2", under.getState() == ComponentInstance.VALID);
@@ -166,9 +166,9 @@
assertTrue("Check instance validity - 1", under.getState() == ComponentInstance.VALID);
ServiceContext sc2 = Utils.getServiceContext(under);
- ComponentFactory fact1 = (ComponentFactory) Utils.getFactoryByName(context, "FooBarProviderType-1");
- ComponentFactory fact2 = (ComponentFactory) Utils.getFactoryByName(context, "FooBarProviderType-2");
- ComponentFactory fact3 = (ComponentFactory) Utils.getFactoryByName(context, "FooBarProviderType-3");
+ ComponentFactory fact1 = (ComponentFactory) Utils.getFactoryByName(context, "COMPO-FooBarProviderType-1");
+ ComponentFactory fact2 = (ComponentFactory) Utils.getFactoryByName(context, "COMPO-FooBarProviderType-2");
+ ComponentFactory fact3 = (ComponentFactory) Utils.getFactoryByName(context, "COMPO-FooBarProviderType-3");
fact1.stop();
assertTrue("Check instance validity - 2", under.getState() == ComponentInstance.VALID);
@@ -211,9 +211,9 @@
assertEquals("Check instance name" , id.getName(), "under");
assertEquals("Check component type name" , id.getComponentDescription().getName(), "composite.bar.2");
- ComponentFactory fact1 = (ComponentFactory) Utils.getFactoryByName(context, "FooBarProviderType-1");
- ComponentFactory fact2 = (ComponentFactory) Utils.getFactoryByName(context, "FooBarProviderType-2");
- ComponentFactory fact3 = (ComponentFactory) Utils.getFactoryByName(context, "FooBarProviderType-3");
+ ComponentFactory fact1 = (ComponentFactory) Utils.getFactoryByName(context, "COMPO-FooBarProviderType-1");
+ ComponentFactory fact2 = (ComponentFactory) Utils.getFactoryByName(context, "COMPO-FooBarProviderType-2");
+ ComponentFactory fact3 = (ComponentFactory) Utils.getFactoryByName(context, "COMPO-FooBarProviderType-3");
fact1.stop();
assertTrue("Check instance validity - 2", under.getState() == ComponentInstance.VALID);
diff --git a/ipojo/tests/tests.composite/src/main/java/org/apache/felix/ipojo/test/composite/instantiator/OptionalInstantiation.java b/ipojo/tests/tests.composite/src/main/java/org/apache/felix/ipojo/test/composite/instantiator/OptionalInstantiation.java
index 64f80f9..e617d64 100644
--- a/ipojo/tests/tests.composite/src/main/java/org/apache/felix/ipojo/test/composite/instantiator/OptionalInstantiation.java
+++ b/ipojo/tests/tests.composite/src/main/java/org/apache/felix/ipojo/test/composite/instantiator/OptionalInstantiation.java
@@ -27,8 +27,8 @@
import org.apache.felix.ipojo.architecture.Architecture;
import org.apache.felix.ipojo.architecture.InstanceDescription;
import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
+import org.apache.felix.ipojo.test.composite.service.BarService;
import org.apache.felix.ipojo.test.composite.util.Utils;
-import org.apache.felix.ipojo.test.scenarios.service.BarService;
import org.osgi.framework.ServiceReference;
public class OptionalInstantiation extends OSGiTestCase {
@@ -124,9 +124,9 @@
}
assertTrue("Check instance validity - 1", under.getState() == ComponentInstance.VALID);
- ComponentFactory fact1 = (ComponentFactory) Utils.getFactoryByName(context, "FooBarProviderType-1");
- ComponentFactory fact2 = (ComponentFactory) Utils.getFactoryByName(context, "FooBarProviderType-2");
- ComponentFactory fact3 = (ComponentFactory) Utils.getFactoryByName(context, "FooBarProviderType-3");
+ ComponentFactory fact1 = (ComponentFactory) Utils.getFactoryByName(context, "COMPO-FooBarProviderType-1");
+ ComponentFactory fact2 = (ComponentFactory) Utils.getFactoryByName(context, "COMPO-FooBarProviderType-2");
+ ComponentFactory fact3 = (ComponentFactory) Utils.getFactoryByName(context, "COMPO-FooBarProviderType-3");
fact1.stop();
assertTrue("Check instance validity - 2", under.getState() == ComponentInstance.VALID);
@@ -159,9 +159,9 @@
}
assertTrue("Check instance validity - 1", under.getState() == ComponentInstance.VALID);
- ComponentFactory fact1 = (ComponentFactory) Utils.getFactoryByName(context, "FooBarProviderType-1");
- ComponentFactory fact2 = (ComponentFactory) Utils.getFactoryByName(context, "FooBarProviderType-2");
- ComponentFactory fact3 = (ComponentFactory) Utils.getFactoryByName(context, "FooBarProviderType-3");
+ ComponentFactory fact1 = (ComponentFactory) Utils.getFactoryByName(context, "COMPO-FooBarProviderType-1");
+ ComponentFactory fact2 = (ComponentFactory) Utils.getFactoryByName(context, "COMPO-FooBarProviderType-2");
+ ComponentFactory fact3 = (ComponentFactory) Utils.getFactoryByName(context, "COMPO-FooBarProviderType-3");
fact1.stop();
assertTrue("Check instance validity - 2", under.getState() == ComponentInstance.VALID);
@@ -203,9 +203,9 @@
assertEquals("Check instance name" , id.getName(), "under");
assertEquals("Check component type name" , id.getComponentDescription().getName(), "composite.bar.3");
- ComponentFactory fact1 = (ComponentFactory) Utils.getFactoryByName(context, "FooBarProviderType-1");
- ComponentFactory fact2 = (ComponentFactory) Utils.getFactoryByName(context, "FooBarProviderType-2");
- ComponentFactory fact3 = (ComponentFactory) Utils.getFactoryByName(context, "FooBarProviderType-3");
+ ComponentFactory fact1 = (ComponentFactory) Utils.getFactoryByName(context, "COMPO-FooBarProviderType-1");
+ ComponentFactory fact2 = (ComponentFactory) Utils.getFactoryByName(context, "COMPO-FooBarProviderType-2");
+ ComponentFactory fact3 = (ComponentFactory) Utils.getFactoryByName(context, "COMPO-FooBarProviderType-3");
fact1.stop();
diff --git a/ipojo/tests/tests.composite/src/main/java/org/apache/felix/ipojo/test/composite/instantiator/OptionalMultipleInstantiation.java b/ipojo/tests/tests.composite/src/main/java/org/apache/felix/ipojo/test/composite/instantiator/OptionalMultipleInstantiation.java
index 19984d0..a3d9351 100644
--- a/ipojo/tests/tests.composite/src/main/java/org/apache/felix/ipojo/test/composite/instantiator/OptionalMultipleInstantiation.java
+++ b/ipojo/tests/tests.composite/src/main/java/org/apache/felix/ipojo/test/composite/instantiator/OptionalMultipleInstantiation.java
@@ -25,8 +25,8 @@
import org.apache.felix.ipojo.Factory;
import org.apache.felix.ipojo.ServiceContext;
import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
+import org.apache.felix.ipojo.test.composite.service.BarService;
import org.apache.felix.ipojo.test.composite.util.Utils;
-import org.apache.felix.ipojo.test.scenarios.service.BarService;
public class OptionalMultipleInstantiation extends OSGiTestCase {
@@ -127,9 +127,9 @@
ServiceContext sc = Utils.getServiceContext(under);
assertTrue("Check instance validity - 1", under.getState() == ComponentInstance.VALID);
- ComponentFactory fact1 = (ComponentFactory) Utils.getFactoryByName(context, "FooBarProviderType-1");
- ComponentFactory fact2 = (ComponentFactory) Utils.getFactoryByName(context, "FooBarProviderType-2");
- ComponentFactory fact3 = (ComponentFactory) Utils.getFactoryByName(context, "FooBarProviderType-3");
+ ComponentFactory fact1 = (ComponentFactory) Utils.getFactoryByName(context, "COMPO-FooBarProviderType-1");
+ ComponentFactory fact2 = (ComponentFactory) Utils.getFactoryByName(context, "COMPO-FooBarProviderType-2");
+ ComponentFactory fact3 = (ComponentFactory) Utils.getFactoryByName(context, "COMPO-FooBarProviderType-3");
fact1.stop();
assertTrue("Check instance validity - 2", under.getState() == ComponentInstance.VALID);
@@ -165,9 +165,9 @@
assertTrue("Check instance validity - 1", under.getState() == ComponentInstance.VALID);
ServiceContext sc2 = Utils.getServiceContext(under);
- ComponentFactory fact1 = (ComponentFactory) Utils.getFactoryByName(context, "FooBarProviderType-1");
- ComponentFactory fact2 = (ComponentFactory) Utils.getFactoryByName(context, "FooBarProviderType-2");
- ComponentFactory fact3 = (ComponentFactory) Utils.getFactoryByName(context, "FooBarProviderType-3");
+ ComponentFactory fact1 = (ComponentFactory) Utils.getFactoryByName(context, "COMPO-FooBarProviderType-1");
+ ComponentFactory fact2 = (ComponentFactory) Utils.getFactoryByName(context, "COMPO-FooBarProviderType-2");
+ ComponentFactory fact3 = (ComponentFactory) Utils.getFactoryByName(context, "COMPO-FooBarProviderType-3");
fact1.stop();
assertTrue("Check instance validity - 2", under.getState() == ComponentInstance.VALID);
diff --git a/ipojo/tests/tests.composite/src/main/java/org/apache/felix/ipojo/test/composite/instantiator/SimpleInstantiation.java b/ipojo/tests/tests.composite/src/main/java/org/apache/felix/ipojo/test/composite/instantiator/SimpleInstantiation.java
index 14b1e1d..4430c19 100644
--- a/ipojo/tests/tests.composite/src/main/java/org/apache/felix/ipojo/test/composite/instantiator/SimpleInstantiation.java
+++ b/ipojo/tests/tests.composite/src/main/java/org/apache/felix/ipojo/test/composite/instantiator/SimpleInstantiation.java
@@ -27,8 +27,8 @@
import org.apache.felix.ipojo.architecture.Architecture;
import org.apache.felix.ipojo.architecture.InstanceDescription;
import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
+import org.apache.felix.ipojo.test.composite.service.BarService;
import org.apache.felix.ipojo.test.composite.util.Utils;
-import org.apache.felix.ipojo.test.scenarios.service.BarService;
import org.osgi.framework.ServiceReference;
public class SimpleInstantiation extends OSGiTestCase {
@@ -125,9 +125,9 @@
}
assertTrue("Check instance validity - 1", under.getState() == ComponentInstance.VALID);
- ComponentFactory fact1 = (ComponentFactory) Utils.getFactoryByName(context, "FooBarProviderType-1");
- ComponentFactory fact2 = (ComponentFactory) Utils.getFactoryByName(context, "FooBarProviderType-2");
- ComponentFactory fact3 = (ComponentFactory) Utils.getFactoryByName(context, "FooBarProviderType-3");
+ ComponentFactory fact1 = (ComponentFactory) Utils.getFactoryByName(context, "COMPO-FooBarProviderType-1");
+ ComponentFactory fact2 = (ComponentFactory) Utils.getFactoryByName(context, "COMPO-FooBarProviderType-2");
+ ComponentFactory fact3 = (ComponentFactory) Utils.getFactoryByName(context, "COMPO-FooBarProviderType-3");
fact1.stop();
@@ -159,9 +159,9 @@
}
assertTrue("Check instance validity - 1", under.getState() == ComponentInstance.VALID);
- ComponentFactory fact1 = (ComponentFactory) Utils.getFactoryByName(context, "FooBarProviderType-1");
- ComponentFactory fact2 = (ComponentFactory) Utils.getFactoryByName(context, "FooBarProviderType-2");
- ComponentFactory fact3 = (ComponentFactory) Utils.getFactoryByName(context, "FooBarProviderType-3");
+ ComponentFactory fact1 = (ComponentFactory) Utils.getFactoryByName(context, "COMPO-FooBarProviderType-1");
+ ComponentFactory fact2 = (ComponentFactory) Utils.getFactoryByName(context, "COMPO-FooBarProviderType-2");
+ ComponentFactory fact3 = (ComponentFactory) Utils.getFactoryByName(context, "COMPO-FooBarProviderType-3");
fact1.stop();
assertTrue("Check instance validity - 2", under.getState() == ComponentInstance.VALID);
@@ -201,9 +201,9 @@
assertEquals("Check instance name" , id.getName(), "under");
assertEquals("Check component type name" , id.getComponentDescription().getName(), "composite.bar.1");
- ComponentFactory fact1 = (ComponentFactory) Utils.getFactoryByName(context, "FooBarProviderType-1");
- ComponentFactory fact2 = (ComponentFactory) Utils.getFactoryByName(context, "FooBarProviderType-2");
- ComponentFactory fact3 = (ComponentFactory) Utils.getFactoryByName(context, "FooBarProviderType-3");
+ ComponentFactory fact1 = (ComponentFactory) Utils.getFactoryByName(context, "COMPO-FooBarProviderType-1");
+ ComponentFactory fact2 = (ComponentFactory) Utils.getFactoryByName(context, "COMPO-FooBarProviderType-2");
+ ComponentFactory fact3 = (ComponentFactory) Utils.getFactoryByName(context, "COMPO-FooBarProviderType-3");
fact1.stop();
assertTrue("Check instance validity - 2", under.getState() == ComponentInstance.VALID);
diff --git a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/service/BarService.java b/ipojo/tests/tests.composite/src/main/java/org/apache/felix/ipojo/test/composite/service/BarService.java
similarity index 94%
rename from ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/service/BarService.java
rename to ipojo/tests/tests.composite/src/main/java/org/apache/felix/ipojo/test/composite/service/BarService.java
index 727e845..8b24f04 100644
--- a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/service/BarService.java
+++ b/ipojo/tests/tests.composite/src/main/java/org/apache/felix/ipojo/test/composite/service/BarService.java
@@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
-package org.apache.felix.ipojo.test.scenarios.service;
+package org.apache.felix.ipojo.test.composite.service;
import java.util.Properties;
diff --git a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/service/BazService.java b/ipojo/tests/tests.composite/src/main/java/org/apache/felix/ipojo/test/composite/service/BazService.java
similarity index 94%
rename from ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/service/BazService.java
rename to ipojo/tests/tests.composite/src/main/java/org/apache/felix/ipojo/test/composite/service/BazService.java
index 115b5de..88b78a1 100644
--- a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/service/BazService.java
+++ b/ipojo/tests/tests.composite/src/main/java/org/apache/felix/ipojo/test/composite/service/BazService.java
@@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
-package org.apache.felix.ipojo.test.scenarios.service;
+package org.apache.felix.ipojo.test.composite.service;
import java.util.Properties;
diff --git a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/service/CheckService.java b/ipojo/tests/tests.composite/src/main/java/org/apache/felix/ipojo/test/composite/service/CheckService.java
similarity index 94%
copy from ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/service/CheckService.java
copy to ipojo/tests/tests.composite/src/main/java/org/apache/felix/ipojo/test/composite/service/CheckService.java
index 62f254c..8eb499f 100644
--- a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/service/CheckService.java
+++ b/ipojo/tests/tests.composite/src/main/java/org/apache/felix/ipojo/test/composite/service/CheckService.java
@@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
-package org.apache.felix.ipojo.test.scenarios.service;
+package org.apache.felix.ipojo.test.composite.service;
import java.util.Properties;
diff --git a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/service/FooService.java b/ipojo/tests/tests.composite/src/main/java/org/apache/felix/ipojo/test/composite/service/FooService.java
similarity index 94%
copy from ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/service/FooService.java
copy to ipojo/tests/tests.composite/src/main/java/org/apache/felix/ipojo/test/composite/service/FooService.java
index 78693cf..bbfa2c9 100644
--- a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/service/FooService.java
+++ b/ipojo/tests/tests.composite/src/main/java/org/apache/felix/ipojo/test/composite/service/FooService.java
@@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
-package org.apache.felix.ipojo.test.scenarios.service;
+package org.apache.felix.ipojo.test.composite.service;
import java.util.Properties;
diff --git a/ipojo/tests/tests.composite/src/main/java/org/apache/felix/ipojo/test/composite/test/CompositeTest.java b/ipojo/tests/tests.composite/src/main/java/org/apache/felix/ipojo/test/composite/test/CompositeTest.java
index 9f7c6c4..e7f73bb 100644
--- a/ipojo/tests/tests.composite/src/main/java/org/apache/felix/ipojo/test/composite/test/CompositeTest.java
+++ b/ipojo/tests/tests.composite/src/main/java/org/apache/felix/ipojo/test/composite/test/CompositeTest.java
@@ -24,10 +24,10 @@
import org.apache.felix.ipojo.Factory;
import org.apache.felix.ipojo.ServiceContext;
import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
+import org.apache.felix.ipojo.test.composite.service.BazService;
+import org.apache.felix.ipojo.test.composite.service.CheckService;
+import org.apache.felix.ipojo.test.composite.service.FooService;
import org.apache.felix.ipojo.test.composite.util.Utils;
-import org.apache.felix.ipojo.test.scenarios.service.BazService;
-import org.apache.felix.ipojo.test.scenarios.service.CheckService;
-import org.apache.felix.ipojo.test.scenarios.service.FooService;
import org.osgi.framework.InvalidSyntaxException;
import org.osgi.framework.ServiceReference;
diff --git a/ipojo/tests/tests.composite/src/main/resources/metadata.xml b/ipojo/tests/tests.composite/src/main/resources/metadata.xml
index 2357580..23636cf 100644
--- a/ipojo/tests/tests.composite/src/main/resources/metadata.xml
+++ b/ipojo/tests/tests.composite/src/main/resources/metadata.xml
@@ -1,26 +1,98 @@
<ipojo xmlns:cs="org.apache.felix.ipojo.test.composite.handler.CheckServiceHandler">
+ <!-- Used component type -->
+ <component
+ className="org.apache.felix.ipojo.test.composite.component.FooProviderType1"
+ factory="COMPO-FooProviderType-1" architecture="true">
+ <provides />
+ </component>
+ <component
+ className="org.apache.felix.ipojo.test.composite.component.FooProviderType1"
+ name="COMPO-FooProviderType-2" architecture="true">
+ <provides>
+ <property name="int" type="int" value="2" />
+ <property name="long" type="long" value="40" />
+ <property name="string" type="java.lang.String" value="foo" />
+ <property name="strAProp" type="java.lang.String[]"
+ value="{foo, bar}" />
+ <property name="intAProp" type="int[]" value="{1,2,3}" />
+ </provides>
+ </component>
+ <component
+ className="org.apache.felix.ipojo.test.composite.component.FooProviderTypeDyn"
+ name="COMPO-FooProviderType-Dyn" architecture="true">
+ <provides>
+ <property name="int" field="intProp" value="2" />
+ <property name="boolean" field="boolProp" value="false" />
+ <property name="string" field="strProp" value="foo" />
+ <property name="strAProp" field="strAProp"
+ value="{foo, bar}" />
+ <property name="intAProp" field="intAProp" value="{ 1,2,3}" />
+ </provides>
+ </component>
+ <component
+ className="org.apache.felix.ipojo.test.composite.component.FooProviderTypeDyn2"
+ name="COMPO-FooProviderType-Dyn2" factory="true" architecture="true">
+ <provides>
+ <property name="int" field="intProp" value="4" />
+ <property name="boolean" field="boolProp" />
+ <property name="string" field="strProp" />
+ <property name="strAProp" field="strAProp" />
+ <property name="intAProp" field="intAProp"
+ value="{1, 2,3 }" />
+ </provides>
+ </component>
+ <component
+ className="org.apache.felix.ipojo.test.composite.component.CheckServiceProvider"
+ factory="COMPO-SimpleCheckServiceProvider" architecture="true">
+ <requires field="fs" />
+ <provides />
+ </component>
+ <component
+ className="org.apache.felix.ipojo.test.composite.component.FooBarProviderType1"
+ factory="COMPO-FooBarProviderType-1" architecture="true">
+ <provides />
+ </component>
+ <component
+ className="org.apache.felix.ipojo.test.composite.component.FooBarProviderType1"
+ factory="COMPO-FooBarProviderType-2" architecture="true">
+ <provides
+ interface="{org.apache.felix.ipojo.test.composite.service.FooService, org.apache.felix.ipojo.test.composite.service.BarService }" />
+ </component>
+ <component
+ className="org.apache.felix.ipojo.test.composite.component.FooBarProviderType1"
+ factory="COMPO-FooBarProviderType-3" architecture="true">
+ <provides
+ interface="{org.apache.felix.ipojo.test.composite.service.FooService}">
+ <property name="baz" type="java.lang.String" value="foo" />
+ </provides>
+ <provides
+ interface="{org.apache.felix.ipojo.test.composite.service.BarService}">
+ <property name="baz" type="java.lang.String" value="bar" />
+ </provides>
+ </component>
+
<!-- Composite -->
<composite name="composite.empty" factory="true" architecture="true">
</composite>
<composite name="composite.bar.1" architecture="true">
- <subservice action="instantiate" specification="org.apache.felix.ipojo.test.scenarios.service.BarService"/>
+ <subservice action="instantiate" specification="org.apache.felix.ipojo.test.composite.service.BarService"/>
</composite>
<composite name="composite.bar.2" architecture="true">
- <subservice action="instantiate" specification="org.apache.felix.ipojo.test.scenarios.service.BarService" aggregate="true"/>
+ <subservice action="instantiate" specification="org.apache.felix.ipojo.test.composite.service.BarService" aggregate="true"/>
</composite>
<composite name="composite.bar.3" architecture="true">
- <subservice action="instantiate" specification="org.apache.felix.ipojo.test.scenarios.service.BarService" optional="true"/>
+ <subservice action="instantiate" specification="org.apache.felix.ipojo.test.composite.service.BarService" optional="true"/>
</composite>
<composite name="composite.bar.4" architecture="true">
- <subservice action="instantiate" specification="org.apache.felix.ipojo.test.scenarios.service.FooService" aggregate="true" optional="true"/>
+ <subservice action="instantiate" specification="org.apache.felix.ipojo.test.composite.service.FooService" aggregate="true" optional="true"/>
</composite>
<composite name="composite.bar.5-accept" architecture="true">
- <subservice action="instantiate" specification="org.apache.felix.ipojo.test.scenarios.service.FooService">
+ <subservice action="instantiate" specification="org.apache.felix.ipojo.test.composite.service.FooService">
<property name="boolean" value="true"/>
<property name="string" value="foo"/>
<property name="strAprop" value="{foo, bar, baz}"/>
@@ -29,7 +101,7 @@
</composite>
<composite name="composite.bar.5-refuse1" architecture="true">
- <subservice action="instantiate" specification="org.apache.felix.ipojo.test.scenarios.service.BarService">
+ <subservice action="instantiate" specification="org.apache.felix.ipojo.test.composite.service.BarService">
<property name="foo" value="bar"/>
<property name="boolean" value="true"/>
<property name="string" value="foo"/>
@@ -39,15 +111,15 @@
</composite>
<composite name="composite.bar.5-refuse2" architecture="true">
- <subservice action="instantiate" specification="org.apache.felix.ipojo.test.scenarios.service.BarService">
+ <subservice action="instantiate" specification="org.apache.felix.ipojo.test.composite.service.BarService">
<property name="string" value="foo"/>
<property name="strAprop" value="{foo, bar, baz}"/>
</subservice>
</composite>
<composite name="composite.inst.1" factory="true" architecture="true">
- <instance component="FooProviderType-1" /> <!-- name="FooProv" -->
- <instance component="FooProviderType-Dyn2">
+ <instance component="COMPO-FooProviderType-1" /> <!-- name="FooProv" -->
+ <instance component="COMPO-FooProviderType-Dyn2">
<property name="boolean" value="true"/>
<property name="string" value="foo"/>
<property name="strAProp" value="{a,b,c}"/>
@@ -55,23 +127,23 @@
</composite>
<composite name="composite.requires.1" architecture="true">
- <subservice action="import" specification="org.apache.felix.ipojo.test.scenarios.service.FooService" scope="composite"/>
+ <subservice action="import" specification="org.apache.felix.ipojo.test.composite.service.FooService" scope="composite"/>
</composite>
<composite name="composite.requires.2" architecture="true">
- <subservice action="import" specification="org.apache.felix.ipojo.test.scenarios.service.FooService" aggregate="true" scope="composite"/>
+ <subservice action="import" specification="org.apache.felix.ipojo.test.composite.service.FooService" aggregate="true" scope="composite"/>
</composite>
<composite name="composite.requires.3" architecture="true">
- <subservice action="import" specification="org.apache.felix.ipojo.test.scenarios.service.FooService" optional="true" scope="composite"/>
+ <subservice action="import" specification="org.apache.felix.ipojo.test.composite.service.FooService" optional="true" scope="composite"/>
</composite>
<composite name="composite.requires.4" architecture="true">
- <subservice action="import" specification="org.apache.felix.ipojo.test.scenarios.service.FooService" optional="true" aggregate="true" scope="composite"/>
+ <subservice action="import" specification="org.apache.felix.ipojo.test.composite.service.FooService" optional="true" aggregate="true" scope="composite"/>
</composite>
<composite name="composite.requires.5" architecture="true">
- <subservice action="import" specification="org.apache.felix.ipojo.test.scenarios.service.FooService" filter="(&(int=2)(long=40))" scope="composite"/>
+ <subservice action="import" specification="org.apache.felix.ipojo.test.composite.service.FooService" filter="(&(int=2)(long=40))" scope="composite"/>
</composite>
<component className="org.apache.felix.ipojo.test.composite.component.BazProviderType1" factory="BazProviderType" scope="composite">
@@ -79,28 +151,28 @@
</component>
<composite name="composite.export.1" architecture="true">
- <subservice action="import" specification="org.apache.felix.ipojo.test.scenarios.service.BazService" aggregate="true" optional="true" filter="(!(instance.name=export))" scope="composite"/>
- <provides action="export" specification="org.apache.felix.ipojo.test.scenarios.service.BazService"/>
+ <subservice action="import" specification="org.apache.felix.ipojo.test.composite.service.BazService" aggregate="true" optional="true" filter="(!(instance.name=export))" scope="composite"/>
+ <provides action="export" specification="org.apache.felix.ipojo.test.composite.service.BazService"/>
</composite>
<composite name="composite.export.2" architecture="true">
- <subservice action="import" specification="org.apache.felix.ipojo.test.scenarios.service.BazService" scope="composite" aggregate="true" optional="true" filter="(!(instance.name=export))"/>
- <provides action="export" specification="org.apache.felix.ipojo.test.scenarios.service.BazService" optional="true"/>
+ <subservice action="import" specification="org.apache.felix.ipojo.test.composite.service.BazService" scope="composite" aggregate="true" optional="true" filter="(!(instance.name=export))"/>
+ <provides action="export" specification="org.apache.felix.ipojo.test.composite.service.BazService" optional="true"/>
</composite>
<composite name="composite.export.3" architecture="true">
- <subservice action="import" specification="org.apache.felix.ipojo.test.scenarios.service.BazService" scope="composite" aggregate="true" optional="true" filter="(!(instance.name=export))"/>
- <provides action="export" specification="org.apache.felix.ipojo.test.scenarios.service.BazService" aggregate="true"/>
+ <subservice action="import" specification="org.apache.felix.ipojo.test.composite.service.BazService" scope="composite" aggregate="true" optional="true" filter="(!(instance.name=export))"/>
+ <provides action="export" specification="org.apache.felix.ipojo.test.composite.service.BazService" aggregate="true"/>
</composite>
<composite name="composite.export.4" architecture="true">
- <subservice action="import" specification="org.apache.felix.ipojo.test.scenarios.service.BazService" aggregate="true" optional="true" filter="(!(instance.name=export))" scope="composite"/>
- <provides action="export" specification="org.apache.felix.ipojo.test.scenarios.service.BazService" aggregate="true" optional="true"/>
+ <subservice action="import" specification="org.apache.felix.ipojo.test.composite.service.BazService" aggregate="true" optional="true" filter="(!(instance.name=export))" scope="composite"/>
+ <provides action="export" specification="org.apache.felix.ipojo.test.composite.service.BazService" aggregate="true" optional="true"/>
</composite>
<composite name="composite.export.5" architecture="true">
- <subservice action="import" specification="org.apache.felix.ipojo.test.scenarios.service.BazService" aggregate="true" optional="true" filter="(!(instance.name=export))" scope="composite"/>
- <provides action="export" specification="org.apache.felix.ipojo.test.scenarios.service.BazService" filter="(instance.name=foo1)"/>
+ <subservice action="import" specification="org.apache.felix.ipojo.test.composite.service.BazService" aggregate="true" optional="true" filter="(!(instance.name=export))" scope="composite"/>
+ <provides action="export" specification="org.apache.felix.ipojo.test.composite.service.BazService" filter="(instance.name=foo1)"/>
</composite>
<component className="org.apache.felix.ipojo.test.composite.component.Baz2CheckProvider" factory="Baz2CheckProvider" architecture="true">
@@ -109,27 +181,27 @@
</component>
<composite name="composite.test.3" architecture="true">
- <subservice action="instantiate" specification="org.apache.felix.ipojo.test.scenarios.service.BazService" aggregate="true" filter="(factory.name=BazProviderType)"/>
- <provides action="export" specification="org.apache.felix.ipojo.test.scenarios.service.BazService"/>
+ <subservice action="instantiate" specification="org.apache.felix.ipojo.test.composite.service.BazService" aggregate="true" filter="(factory.name=BazProviderType)"/>
+ <provides action="export" specification="org.apache.felix.ipojo.test.composite.service.BazService"/>
</composite>
<composite name="composite.test.2" architecture="true">
- <subservice action="instantiate" specification="org.apache.felix.ipojo.test.scenarios.service.CheckService" filter="(factory.name=Baz2CheckProvider)"/>
- <provides action="export" specification="org.apache.felix.ipojo.test.scenarios.service.CheckService"/>
- <subservice action="import" specification="org.apache.felix.ipojo.test.scenarios.service.BazService" scope="composite"/>
+ <subservice action="instantiate" specification="org.apache.felix.ipojo.test.composite.service.CheckService" filter="(factory.name=Baz2CheckProvider)"/>
+ <provides action="export" specification="org.apache.felix.ipojo.test.composite.service.CheckService"/>
+ <subservice action="import" specification="org.apache.felix.ipojo.test.composite.service.BazService" scope="composite"/>
</composite>
<composite name="composite.test.1" architecture="true">
- <subservice action="instantiate" specification="org.apache.felix.ipojo.test.scenarios.service.BazService" filter="(factory.name=composite.test.3)" />
- <subservice action="instantiate" specification="org.apache.felix.ipojo.test.scenarios.service.CheckService" filter="(factory.name=composite.test.2)"/>
- <provides action="export" specification="org.apache.felix.ipojo.test.scenarios.service.CheckService"/>
+ <subservice action="instantiate" specification="org.apache.felix.ipojo.test.composite.service.BazService" filter="(factory.name=composite.test.3)" />
+ <subservice action="instantiate" specification="org.apache.felix.ipojo.test.composite.service.CheckService" filter="(factory.name=composite.test.2)"/>
+ <provides action="export" specification="org.apache.felix.ipojo.test.composite.service.CheckService"/>
</composite>
<composite name="composite.instantiator" architecture="true">
- <subservice action="instantiate" specification="org.apache.felix.ipojo.test.scenarios.service.BazService" filter="(factory.name=composite.test.3)"/>
- <subservice action="instantiate" specification="org.apache.felix.ipojo.test.scenarios.service.FooService"/>
- <provides action="export" specification="org.apache.felix.ipojo.test.scenarios.service.BazService"/>
- <provides action="export" specification="org.apache.felix.ipojo.test.scenarios.service.FooService"/>
+ <subservice action="instantiate" specification="org.apache.felix.ipojo.test.composite.service.BazService" filter="(factory.name=composite.test.3)"/>
+ <subservice action="instantiate" specification="org.apache.felix.ipojo.test.composite.service.FooService"/>
+ <provides action="export" specification="org.apache.felix.ipojo.test.composite.service.BazService"/>
+ <provides action="export" specification="org.apache.felix.ipojo.test.composite.service.FooService"/>
</composite>
<!-- Test composition provides -->
diff --git a/ipojo/tests/tests.core/pom.xml b/ipojo/tests/tests.core.bad.configurations/pom.xml
similarity index 87%
copy from ipojo/tests/tests.core/pom.xml
copy to ipojo/tests/tests.core.bad.configurations/pom.xml
index 4795777..62aafbd 100644
--- a/ipojo/tests/tests.core/pom.xml
+++ b/ipojo/tests/tests.core.bad.configurations/pom.xml
@@ -19,8 +19,8 @@
<project>
<modelVersion>4.0.0</modelVersion>
<packaging>bundle</packaging>
- <name>iPOJO Test Suite</name>
- <artifactId>tests.core</artifactId>
+ <name>iPOJO Bad Configurations Test Suite</name>
+ <artifactId>tests.core.bad.configurations</artifactId>
<groupId>ipojo.tests</groupId>
<version>0.7.6-SNAPSHOT</version>
<dependencies>
@@ -31,11 +31,6 @@
</dependency>
<dependency>
<groupId>org.apache.felix</groupId>
- <artifactId>org.apache.felix.ipojo.composite</artifactId>
- <version>0.7.6-SNAPSHOT</version>
- </dependency>
- <dependency>
- <groupId>org.apache.felix</groupId>
<artifactId>org.apache.felix.ipojo.metadata</artifactId>
<version>0.7.6-SNAPSHOT</version>
</dependency>
@@ -65,7 +60,7 @@
<configuration>
<instructions>
<Export-Package>
- org.apache.felix.ipojo.test.scenarios.service
+ org.apache.felix.ipojo.test.scenarios.bad.service
</Export-Package>
<Bundle-SymbolicName>
${pom.artifactId}
@@ -74,7 +69,7 @@
org.apache.felix.ipojo.test*
</Private-Package>
<Test-Suite>
- org.apache.felix.ipojo.test.IPOJOTestSuite
+ org.apache.felix.ipojo.test.scenarios.bad.BadTestSuite
</Test-Suite>
</instructions>
</configuration>
@@ -98,8 +93,8 @@
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
- <source>1.5</source>
- <target>1.5</target>
+ <source>1.4</source>
+ <target>1.4</target>
</configuration>
</plugin>
</plugins>
diff --git a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/bad/BadFactories.java b/ipojo/tests/tests.core.bad.configurations/src/main/java/org/apache/felix/ipojo/test/scenarios/bad/BadFactories.java
similarity index 100%
rename from ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/bad/BadFactories.java
rename to ipojo/tests/tests.core.bad.configurations/src/main/java/org/apache/felix/ipojo/test/scenarios/bad/BadFactories.java
diff --git a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/bad/BadLFCCallback.java b/ipojo/tests/tests.core.bad.configurations/src/main/java/org/apache/felix/ipojo/test/scenarios/bad/BadLFCCallback.java
similarity index 98%
rename from ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/bad/BadLFCCallback.java
rename to ipojo/tests/tests.core.bad.configurations/src/main/java/org/apache/felix/ipojo/test/scenarios/bad/BadLFCCallback.java
index 8be6ac4..cca4fe5 100644
--- a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/bad/BadLFCCallback.java
+++ b/ipojo/tests/tests.core.bad.configurations/src/main/java/org/apache/felix/ipojo/test/scenarios/bad/BadLFCCallback.java
@@ -34,7 +34,7 @@
public class BadLFCCallback extends OSGiTestCase {
private String clazz = "org.apache.felix.ipojo.test.scenarios.component.CallbackCheckService";
- private String type = "CallbackCheckService";
+ private String type = "BAD-CallbackCheckService";
private Element manipulation;
private Properties props;
@@ -117,7 +117,7 @@
String header = (String) context.getBundle().getHeaders().get("iPOJO-Components");
Element elem = null;
try {
- elem = ManifestMetadataParser.parse(header);
+ elem = ManifestMetadataParser.parseHeaderMetadata(header);
} catch (ParseException e) {
fail("Parse Exception when parsing iPOJO-Component");
}
diff --git a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/bad/BadLFCController.java b/ipojo/tests/tests.core.bad.configurations/src/main/java/org/apache/felix/ipojo/test/scenarios/bad/BadLFCController.java
similarity index 96%
rename from ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/bad/BadLFCController.java
rename to ipojo/tests/tests.core.bad.configurations/src/main/java/org/apache/felix/ipojo/test/scenarios/bad/BadLFCController.java
index 8816530..9ebc8ed 100644
--- a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/bad/BadLFCController.java
+++ b/ipojo/tests/tests.core.bad.configurations/src/main/java/org/apache/felix/ipojo/test/scenarios/bad/BadLFCController.java
@@ -45,7 +45,7 @@
Element controller = new Element("controller", "");
controller.addAttribute(new Attribute("field", "controller")); // Missing field
elem.addElement(controller);
- elem.addElement(getManipulationForComponent("lcTest"));
+ elem.addElement(getManipulationForComponent("BAD-lcTest"));
return elem;
}
@@ -53,7 +53,7 @@
String header = (String) context.getBundle().getHeaders().get("iPOJO-Components");
Element elem = null;
try {
- elem = ManifestMetadataParser.parse(header);
+ elem = ManifestMetadataParser.parseHeaderMetadata(header);
} catch (ParseException e) {
fail("Parse Exception when parsing iPOJO-Component");
}
diff --git a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/bad/BadServiceDependencies.java b/ipojo/tests/tests.core.bad.configurations/src/main/java/org/apache/felix/ipojo/test/scenarios/bad/BadServiceDependencies.java
similarity index 98%
rename from ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/bad/BadServiceDependencies.java
rename to ipojo/tests/tests.core.bad.configurations/src/main/java/org/apache/felix/ipojo/test/scenarios/bad/BadServiceDependencies.java
index 5bd57c0..43ebb13 100644
--- a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/bad/BadServiceDependencies.java
+++ b/ipojo/tests/tests.core.bad.configurations/src/main/java/org/apache/felix/ipojo/test/scenarios/bad/BadServiceDependencies.java
@@ -30,12 +30,12 @@
import org.apache.felix.ipojo.metadata.Element;
import org.apache.felix.ipojo.parser.ManifestMetadataParser;
import org.apache.felix.ipojo.parser.ParseException;
-import org.apache.felix.ipojo.test.scenarios.service.BarService;
+import org.apache.felix.ipojo.test.scenarios.bad.service.BarService;
public class BadServiceDependencies extends OSGiTestCase {
private String clazz = "org.apache.felix.ipojo.test.scenarios.component.CheckServiceProvider";
- private String type = "BothCheckServiceProvider";
+ private String type = "BAD-BothCheckServiceProvider";
private Element manipulation;
private Properties props;
diff --git a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/bad/BadTestSuite.java b/ipojo/tests/tests.core.bad.configurations/src/main/java/org/apache/felix/ipojo/test/scenarios/bad/BadTestSuite.java
similarity index 100%
rename from ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/bad/BadTestSuite.java
rename to ipojo/tests/tests.core.bad.configurations/src/main/java/org/apache/felix/ipojo/test/scenarios/bad/BadTestSuite.java
diff --git a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/service/BarService.java b/ipojo/tests/tests.core.bad.configurations/src/main/java/org/apache/felix/ipojo/test/scenarios/bad/service/BarService.java
similarity index 93%
copy from ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/service/BarService.java
copy to ipojo/tests/tests.core.bad.configurations/src/main/java/org/apache/felix/ipojo/test/scenarios/bad/service/BarService.java
index 727e845..e3d8b8b 100644
--- a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/service/BarService.java
+++ b/ipojo/tests/tests.core.bad.configurations/src/main/java/org/apache/felix/ipojo/test/scenarios/bad/service/BarService.java
@@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
-package org.apache.felix.ipojo.test.scenarios.service;
+package org.apache.felix.ipojo.test.scenarios.bad.service;
import java.util.Properties;
diff --git a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/service/CheckService.java b/ipojo/tests/tests.core.bad.configurations/src/main/java/org/apache/felix/ipojo/test/scenarios/bad/service/CheckService.java
similarity index 93%
copy from ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/service/CheckService.java
copy to ipojo/tests/tests.core.bad.configurations/src/main/java/org/apache/felix/ipojo/test/scenarios/bad/service/CheckService.java
index 62f254c..f9e7e2d 100644
--- a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/service/CheckService.java
+++ b/ipojo/tests/tests.core.bad.configurations/src/main/java/org/apache/felix/ipojo/test/scenarios/bad/service/CheckService.java
@@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
-package org.apache.felix.ipojo.test.scenarios.service;
+package org.apache.felix.ipojo.test.scenarios.bad.service;
import java.util.Properties;
diff --git a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/service/FooService.java b/ipojo/tests/tests.core.bad.configurations/src/main/java/org/apache/felix/ipojo/test/scenarios/bad/service/FooService.java
similarity index 94%
rename from ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/service/FooService.java
rename to ipojo/tests/tests.core.bad.configurations/src/main/java/org/apache/felix/ipojo/test/scenarios/bad/service/FooService.java
index 78693cf..cdebe3f 100644
--- a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/service/FooService.java
+++ b/ipojo/tests/tests.core.bad.configurations/src/main/java/org/apache/felix/ipojo/test/scenarios/bad/service/FooService.java
@@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
-package org.apache.felix.ipojo.test.scenarios.service;
+package org.apache.felix.ipojo.test.scenarios.bad.service;
import java.util.Properties;
diff --git a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/component/CallbackCheckService.java b/ipojo/tests/tests.core.bad.configurations/src/main/java/org/apache/felix/ipojo/test/scenarios/component/CallbackCheckService.java
similarity index 92%
rename from ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/component/CallbackCheckService.java
rename to ipojo/tests/tests.core.bad.configurations/src/main/java/org/apache/felix/ipojo/test/scenarios/component/CallbackCheckService.java
index 76176c8..86b9679 100644
--- a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/component/CallbackCheckService.java
+++ b/ipojo/tests/tests.core.bad.configurations/src/main/java/org/apache/felix/ipojo/test/scenarios/component/CallbackCheckService.java
@@ -20,8 +20,8 @@
import java.util.Properties;
-import org.apache.felix.ipojo.test.scenarios.service.CheckService;
-import org.apache.felix.ipojo.test.scenarios.service.FooService;
+import org.apache.felix.ipojo.test.scenarios.bad.service.CheckService;
+import org.apache.felix.ipojo.test.scenarios.bad.service.FooService;
public class CallbackCheckService extends ParentClass implements CheckService {
diff --git a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/component/CheckProviderParentClass.java b/ipojo/tests/tests.core.bad.configurations/src/main/java/org/apache/felix/ipojo/test/scenarios/component/CheckProviderParentClass.java
similarity index 95%
copy from ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/component/CheckProviderParentClass.java
copy to ipojo/tests/tests.core.bad.configurations/src/main/java/org/apache/felix/ipojo/test/scenarios/component/CheckProviderParentClass.java
index 675fe41..05d9f31 100644
--- a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/component/CheckProviderParentClass.java
+++ b/ipojo/tests/tests.core.bad.configurations/src/main/java/org/apache/felix/ipojo/test/scenarios/component/CheckProviderParentClass.java
@@ -18,7 +18,7 @@
*/
package org.apache.felix.ipojo.test.scenarios.component;
-import org.apache.felix.ipojo.test.scenarios.service.FooService;
+import org.apache.felix.ipojo.test.scenarios.bad.service.FooService;
import org.osgi.framework.ServiceReference;
public abstract class CheckProviderParentClass {
diff --git a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/component/CheckServiceProvider.java b/ipojo/tests/tests.core.bad.configurations/src/main/java/org/apache/felix/ipojo/test/scenarios/component/CheckServiceProvider.java
similarity index 94%
rename from ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/component/CheckServiceProvider.java
rename to ipojo/tests/tests.core.bad.configurations/src/main/java/org/apache/felix/ipojo/test/scenarios/component/CheckServiceProvider.java
index cd2b927..71b5e77 100644
--- a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/component/CheckServiceProvider.java
+++ b/ipojo/tests/tests.core.bad.configurations/src/main/java/org/apache/felix/ipojo/test/scenarios/component/CheckServiceProvider.java
@@ -20,8 +20,8 @@
import java.util.Properties;
-import org.apache.felix.ipojo.test.scenarios.service.CheckService;
-import org.apache.felix.ipojo.test.scenarios.service.FooService;
+import org.apache.felix.ipojo.test.scenarios.bad.service.CheckService;
+import org.apache.felix.ipojo.test.scenarios.bad.service.FooService;
import org.osgi.framework.ServiceReference;
public class CheckServiceProvider extends CheckProviderParentClass implements CheckService {
diff --git a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/component/LifecycleControllerTest.java b/ipojo/tests/tests.core.bad.configurations/src/main/java/org/apache/felix/ipojo/test/scenarios/component/LifecycleControllerTest.java
similarity index 95%
rename from ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/component/LifecycleControllerTest.java
rename to ipojo/tests/tests.core.bad.configurations/src/main/java/org/apache/felix/ipojo/test/scenarios/component/LifecycleControllerTest.java
index c69bad5..8cef49f 100644
--- a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/component/LifecycleControllerTest.java
+++ b/ipojo/tests/tests.core.bad.configurations/src/main/java/org/apache/felix/ipojo/test/scenarios/component/LifecycleControllerTest.java
@@ -20,7 +20,7 @@
import java.util.Properties;
-import org.apache.felix.ipojo.test.scenarios.service.CheckService;
+import org.apache.felix.ipojo.test.scenarios.bad.service.CheckService;
public class LifecycleControllerTest implements CheckService {
diff --git a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/component/ParentClass.java b/ipojo/tests/tests.core.bad.configurations/src/main/java/org/apache/felix/ipojo/test/scenarios/component/ParentClass.java
similarity index 100%
copy from ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/component/ParentClass.java
copy to ipojo/tests/tests.core.bad.configurations/src/main/java/org/apache/felix/ipojo/test/scenarios/component/ParentClass.java
diff --git a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/util/Utils.java b/ipojo/tests/tests.core.bad.configurations/src/main/java/org/apache/felix/ipojo/test/scenarios/util/Utils.java
similarity index 100%
copy from ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/util/Utils.java
copy to ipojo/tests/tests.core.bad.configurations/src/main/java/org/apache/felix/ipojo/test/scenarios/util/Utils.java
diff --git a/ipojo/tests/tests.core.bad.configurations/src/main/resources/metadata.xml b/ipojo/tests/tests.core.bad.configurations/src/main/resources/metadata.xml
new file mode 100644
index 0000000..8222765
--- /dev/null
+++ b/ipojo/tests/tests.core.bad.configurations/src/main/resources/metadata.xml
@@ -0,0 +1,31 @@
+<ipojo>
+ <component
+ className="org.apache.felix.ipojo.test.scenarios.component.CallbackCheckService"
+ factory="BAD-CallbackCheckService" architecture="true">
+ <requires field="fs" />
+ <provides />
+ <callback transition="validate" method="start" />
+ <callback transition="invalidate" method="stop" />
+ </component>
+
+ <component
+ classname="org.apache.felix.ipojo.test.scenarios.component.LifecycleControllerTest"
+ name="BAD-lcTest">
+ <provides />
+ <controller field="m_state" />
+ <properties>
+ <property name="conf" field="m_conf" method="setConf" />
+ </properties>
+ </component>
+
+ <component
+ className="org.apache.felix.ipojo.test.scenarios.component.CheckServiceProvider"
+ factory="BAD-BothCheckServiceProvider" architecture="true">
+ <requires field="fs">
+ <callback type="bind" method="bothBind" />
+ <callback type="unbind" method="bothUnbind" />
+ </requires>
+ <provides />
+ </component>
+
+</ipojo>
diff --git a/ipojo/tests/tests.core/pom.xml b/ipojo/tests/tests.core.configuration/pom.xml
similarity index 87%
copy from ipojo/tests/tests.core/pom.xml
copy to ipojo/tests/tests.core.configuration/pom.xml
index 4795777..d308dfc 100644
--- a/ipojo/tests/tests.core/pom.xml
+++ b/ipojo/tests/tests.core.configuration/pom.xml
@@ -19,8 +19,8 @@
<project>
<modelVersion>4.0.0</modelVersion>
<packaging>bundle</packaging>
- <name>iPOJO Test Suite</name>
- <artifactId>tests.core</artifactId>
+ <name>iPOJO Configuration Management Test Suite</name>
+ <artifactId>tests.core.configuration</artifactId>
<groupId>ipojo.tests</groupId>
<version>0.7.6-SNAPSHOT</version>
<dependencies>
@@ -31,11 +31,6 @@
</dependency>
<dependency>
<groupId>org.apache.felix</groupId>
- <artifactId>org.apache.felix.ipojo.composite</artifactId>
- <version>0.7.6-SNAPSHOT</version>
- </dependency>
- <dependency>
- <groupId>org.apache.felix</groupId>
<artifactId>org.apache.felix.ipojo.metadata</artifactId>
<version>0.7.6-SNAPSHOT</version>
</dependency>
@@ -65,7 +60,7 @@
<configuration>
<instructions>
<Export-Package>
- org.apache.felix.ipojo.test.scenarios.service
+ org.apache.felix.ipojo.test.scenarios.configuration.service
</Export-Package>
<Bundle-SymbolicName>
${pom.artifactId}
@@ -74,7 +69,7 @@
org.apache.felix.ipojo.test*
</Private-Package>
<Test-Suite>
- org.apache.felix.ipojo.test.IPOJOTestSuite
+ org.apache.felix.ipojo.test.scenarios.configuration.ConfigurationTestSuite
</Test-Suite>
</instructions>
</configuration>
@@ -98,8 +93,8 @@
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
- <source>1.5</source>
- <target>1.5</target>
+ <source>1.4</source>
+ <target>1.4</target>
</configuration>
</plugin>
</plugins>
diff --git a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/component/CheckProviderParentClass.java b/ipojo/tests/tests.core.configuration/src/main/java/org/apache/felix/ipojo/test/scenarios/component/CheckProviderParentClass.java
similarity index 94%
copy from ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/component/CheckProviderParentClass.java
copy to ipojo/tests/tests.core.configuration/src/main/java/org/apache/felix/ipojo/test/scenarios/component/CheckProviderParentClass.java
index 675fe41..11bf266 100644
--- a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/component/CheckProviderParentClass.java
+++ b/ipojo/tests/tests.core.configuration/src/main/java/org/apache/felix/ipojo/test/scenarios/component/CheckProviderParentClass.java
@@ -18,7 +18,7 @@
*/
package org.apache.felix.ipojo.test.scenarios.component;
-import org.apache.felix.ipojo.test.scenarios.service.FooService;
+import org.apache.felix.ipojo.test.scenarios.configuration.service.FooService;
import org.osgi.framework.ServiceReference;
public abstract class CheckProviderParentClass {
diff --git a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/component/CheckServiceProvider.java b/ipojo/tests/tests.core.configuration/src/main/java/org/apache/felix/ipojo/test/scenarios/component/CheckServiceProvider.java
similarity index 93%
copy from ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/component/CheckServiceProvider.java
copy to ipojo/tests/tests.core.configuration/src/main/java/org/apache/felix/ipojo/test/scenarios/component/CheckServiceProvider.java
index cd2b927..5b2494e 100644
--- a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/component/CheckServiceProvider.java
+++ b/ipojo/tests/tests.core.configuration/src/main/java/org/apache/felix/ipojo/test/scenarios/component/CheckServiceProvider.java
@@ -20,8 +20,8 @@
import java.util.Properties;
-import org.apache.felix.ipojo.test.scenarios.service.CheckService;
-import org.apache.felix.ipojo.test.scenarios.service.FooService;
+import org.apache.felix.ipojo.test.scenarios.configuration.service.CheckService;
+import org.apache.felix.ipojo.test.scenarios.configuration.service.FooService;
import org.osgi.framework.ServiceReference;
public class CheckServiceProvider extends CheckProviderParentClass implements CheckService {
diff --git a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/component/ConfigurableCheckServiceProvider.java b/ipojo/tests/tests.core.configuration/src/main/java/org/apache/felix/ipojo/test/scenarios/component/ConfigurableCheckServiceProvider.java
similarity index 98%
rename from ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/component/ConfigurableCheckServiceProvider.java
rename to ipojo/tests/tests.core.configuration/src/main/java/org/apache/felix/ipojo/test/scenarios/component/ConfigurableCheckServiceProvider.java
index 5ae13cb..c018a54 100644
--- a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/component/ConfigurableCheckServiceProvider.java
+++ b/ipojo/tests/tests.core.configuration/src/main/java/org/apache/felix/ipojo/test/scenarios/component/ConfigurableCheckServiceProvider.java
@@ -20,7 +20,7 @@
import java.util.Properties;
-import org.apache.felix.ipojo.test.scenarios.service.CheckService;
+import org.apache.felix.ipojo.test.scenarios.configuration.service.CheckService;
public class ConfigurableCheckServiceProvider implements CheckService {
diff --git a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/component/FooProviderType1.java b/ipojo/tests/tests.core.configuration/src/main/java/org/apache/felix/ipojo/test/scenarios/component/FooProviderType1.java
similarity index 97%
copy from ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/component/FooProviderType1.java
copy to ipojo/tests/tests.core.configuration/src/main/java/org/apache/felix/ipojo/test/scenarios/component/FooProviderType1.java
index 3fe9bad..32d2fd9 100644
--- a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/component/FooProviderType1.java
+++ b/ipojo/tests/tests.core.configuration/src/main/java/org/apache/felix/ipojo/test/scenarios/component/FooProviderType1.java
@@ -20,7 +20,7 @@
import java.util.Properties;
-import org.apache.felix.ipojo.test.scenarios.service.FooService;
+import org.apache.felix.ipojo.test.scenarios.configuration.service.FooService;
import org.osgi.framework.BundleContext;
public class FooProviderType1 implements FooService {
diff --git a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/component/FooProviderTypeDyn.java b/ipojo/tests/tests.core.configuration/src/main/java/org/apache/felix/ipojo/test/scenarios/component/FooProviderTypeDyn.java
similarity index 95%
copy from ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/component/FooProviderTypeDyn.java
copy to ipojo/tests/tests.core.configuration/src/main/java/org/apache/felix/ipojo/test/scenarios/component/FooProviderTypeDyn.java
index 39f3918..6266e30 100644
--- a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/component/FooProviderTypeDyn.java
+++ b/ipojo/tests/tests.core.configuration/src/main/java/org/apache/felix/ipojo/test/scenarios/component/FooProviderTypeDyn.java
@@ -20,7 +20,7 @@
import java.util.Properties;
-import org.apache.felix.ipojo.test.scenarios.service.FooService;
+import org.apache.felix.ipojo.test.scenarios.configuration.service.FooService;
public class FooProviderTypeDyn implements FooService {
diff --git a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/component/ParentClass.java b/ipojo/tests/tests.core.configuration/src/main/java/org/apache/felix/ipojo/test/scenarios/component/ParentClass.java
similarity index 100%
rename from ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/component/ParentClass.java
rename to ipojo/tests/tests.core.configuration/src/main/java/org/apache/felix/ipojo/test/scenarios/component/ParentClass.java
diff --git a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/component/ParentConfigurableCheckServiceProvider.java b/ipojo/tests/tests.core.configuration/src/main/java/org/apache/felix/ipojo/test/scenarios/component/ParentConfigurableCheckServiceProvider.java
similarity index 97%
rename from ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/component/ParentConfigurableCheckServiceProvider.java
rename to ipojo/tests/tests.core.configuration/src/main/java/org/apache/felix/ipojo/test/scenarios/component/ParentConfigurableCheckServiceProvider.java
index 304b83f..1dc7212 100644
--- a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/component/ParentConfigurableCheckServiceProvider.java
+++ b/ipojo/tests/tests.core.configuration/src/main/java/org/apache/felix/ipojo/test/scenarios/component/ParentConfigurableCheckServiceProvider.java
@@ -20,7 +20,7 @@
import java.util.Properties;
-import org.apache.felix.ipojo.test.scenarios.service.CheckService;
+import org.apache.felix.ipojo.test.scenarios.configuration.service.CheckService;
public class ParentConfigurableCheckServiceProvider extends ParentClass implements CheckService {
diff --git a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/configuration/ConfigurationTestSuite.java b/ipojo/tests/tests.core.configuration/src/main/java/org/apache/felix/ipojo/test/scenarios/configuration/ConfigurationTestSuite.java
similarity index 100%
rename from ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/configuration/ConfigurationTestSuite.java
rename to ipojo/tests/tests.core.configuration/src/main/java/org/apache/felix/ipojo/test/scenarios/configuration/ConfigurationTestSuite.java
diff --git a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/configuration/DynamicallyConfigurableProperties.java b/ipojo/tests/tests.core.configuration/src/main/java/org/apache/felix/ipojo/test/scenarios/configuration/DynamicallyConfigurableProperties.java
similarity index 98%
rename from ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/configuration/DynamicallyConfigurableProperties.java
rename to ipojo/tests/tests.core.configuration/src/main/java/org/apache/felix/ipojo/test/scenarios/configuration/DynamicallyConfigurableProperties.java
index 204d1b4..b7fbb6c 100644
--- a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/configuration/DynamicallyConfigurableProperties.java
+++ b/ipojo/tests/tests.core.configuration/src/main/java/org/apache/felix/ipojo/test/scenarios/configuration/DynamicallyConfigurableProperties.java
@@ -22,7 +22,7 @@
import org.apache.felix.ipojo.ComponentInstance;
import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
-import org.apache.felix.ipojo.test.scenarios.service.FooService;
+import org.apache.felix.ipojo.test.scenarios.configuration.service.FooService;
import org.apache.felix.ipojo.test.scenarios.util.Utils;
import org.osgi.framework.ServiceReference;
import org.osgi.service.cm.ConfigurationException;
@@ -33,7 +33,7 @@
ComponentInstance instance;
public void setUp() {
- String type = "FooProviderType-3";
+ String type = "CONFIG-FooProviderType-3";
Properties p1 = new Properties();
p1.put("name", "instance");
diff --git a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/configuration/ManagedServiceConfigurableProperties.java b/ipojo/tests/tests.core.configuration/src/main/java/org/apache/felix/ipojo/test/scenarios/configuration/ManagedServiceConfigurableProperties.java
similarity index 98%
rename from ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/configuration/ManagedServiceConfigurableProperties.java
rename to ipojo/tests/tests.core.configuration/src/main/java/org/apache/felix/ipojo/test/scenarios/configuration/ManagedServiceConfigurableProperties.java
index 9576aad..0859ac1 100644
--- a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/configuration/ManagedServiceConfigurableProperties.java
+++ b/ipojo/tests/tests.core.configuration/src/main/java/org/apache/felix/ipojo/test/scenarios/configuration/ManagedServiceConfigurableProperties.java
@@ -23,7 +23,7 @@
import org.apache.felix.ipojo.ComponentInstance;
import org.apache.felix.ipojo.PrimitiveHandler;
import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
-import org.apache.felix.ipojo.test.scenarios.service.FooService;
+import org.apache.felix.ipojo.test.scenarios.configuration.service.FooService;
import org.apache.felix.ipojo.test.scenarios.util.Utils;
import org.osgi.framework.ServiceReference;
import org.osgi.service.cm.ConfigurationException;
@@ -41,7 +41,7 @@
ComponentInstance instance2;
public void setUp() {
- String type = "FooProviderType-4";
+ String type = "CONFIG-FooProviderType-4";
Properties p = new Properties();
p.put("name", "instance");
p.put("foo", "foo");
@@ -50,7 +50,7 @@
instance1 = Utils.getComponentInstance(context, type, p);
assertEquals("instance1 created", ComponentInstance.VALID,instance1.getState());
- type = "FooProviderType-3";
+ type = "CONFIG-FooProviderType-3";
Properties p1 = new Properties();
p1.put("name", "instance-2");
p1.put("foo", "foo");
diff --git a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/configuration/SimpleProperties.java b/ipojo/tests/tests.core.configuration/src/main/java/org/apache/felix/ipojo/test/scenarios/configuration/SimpleProperties.java
similarity index 97%
rename from ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/configuration/SimpleProperties.java
rename to ipojo/tests/tests.core.configuration/src/main/java/org/apache/felix/ipojo/test/scenarios/configuration/SimpleProperties.java
index 318304e..33f47a7 100644
--- a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/configuration/SimpleProperties.java
+++ b/ipojo/tests/tests.core.configuration/src/main/java/org/apache/felix/ipojo/test/scenarios/configuration/SimpleProperties.java
@@ -22,7 +22,7 @@
import org.apache.felix.ipojo.ComponentInstance;
import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
-import org.apache.felix.ipojo.test.scenarios.service.FooService;
+import org.apache.felix.ipojo.test.scenarios.configuration.service.FooService;
import org.apache.felix.ipojo.test.scenarios.util.Utils;
import org.osgi.framework.ServiceReference;
@@ -32,7 +32,7 @@
ComponentInstance fooProvider2;
public void setUp() {
- String type = "FooProviderType-Conf";
+ String type = "CONFIG-FooProviderType-Conf";
Properties p1 = new Properties();
p1.put("name", "FooProvider-1");
diff --git a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/configuration/TestBothProperties.java b/ipojo/tests/tests.core.configuration/src/main/java/org/apache/felix/ipojo/test/scenarios/configuration/TestBothProperties.java
similarity index 99%
rename from ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/configuration/TestBothProperties.java
rename to ipojo/tests/tests.core.configuration/src/main/java/org/apache/felix/ipojo/test/scenarios/configuration/TestBothProperties.java
index 695d61e..7cfce8a 100644
--- a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/configuration/TestBothProperties.java
+++ b/ipojo/tests/tests.core.configuration/src/main/java/org/apache/felix/ipojo/test/scenarios/configuration/TestBothProperties.java
@@ -23,7 +23,7 @@
import org.apache.felix.ipojo.ComponentInstance;
import org.apache.felix.ipojo.Factory;
import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
-import org.apache.felix.ipojo.test.scenarios.service.CheckService;
+import org.apache.felix.ipojo.test.scenarios.configuration.service.CheckService;
import org.apache.felix.ipojo.test.scenarios.util.Utils;
import org.osgi.framework.ServiceReference;
@@ -33,7 +33,7 @@
public void setUp() {
- Factory fact = Utils.getFactoryByName(context, "BothConfigurableCheckService");
+ Factory fact = Utils.getFactoryByName(context, "CONFIG-BothConfigurableCheckService");
Properties props = new Properties();
props.put("name", "under-test");
props.put("b", "1");
diff --git a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/configuration/TestFieldProperties.java b/ipojo/tests/tests.core.configuration/src/main/java/org/apache/felix/ipojo/test/scenarios/configuration/TestFieldProperties.java
similarity index 98%
rename from ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/configuration/TestFieldProperties.java
rename to ipojo/tests/tests.core.configuration/src/main/java/org/apache/felix/ipojo/test/scenarios/configuration/TestFieldProperties.java
index b49c823..a34051a 100644
--- a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/configuration/TestFieldProperties.java
+++ b/ipojo/tests/tests.core.configuration/src/main/java/org/apache/felix/ipojo/test/scenarios/configuration/TestFieldProperties.java
@@ -23,7 +23,7 @@
import org.apache.felix.ipojo.ComponentInstance;
import org.apache.felix.ipojo.Factory;
import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
-import org.apache.felix.ipojo.test.scenarios.service.CheckService;
+import org.apache.felix.ipojo.test.scenarios.configuration.service.CheckService;
import org.apache.felix.ipojo.test.scenarios.util.Utils;
import org.osgi.framework.ServiceReference;
@@ -32,7 +32,7 @@
ComponentInstance instance;
public void setUp() {
- Factory fact = Utils.getFactoryByName(context, "FieldConfigurableCheckService");
+ Factory fact = Utils.getFactoryByName(context, "CONFIG-FieldConfigurableCheckService");
Properties props = new Properties();
props.put("name", "under-test");
props.put("b", "1");
diff --git a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/configuration/TestMethodProperties.java b/ipojo/tests/tests.core.configuration/src/main/java/org/apache/felix/ipojo/test/scenarios/configuration/TestMethodProperties.java
similarity index 99%
rename from ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/configuration/TestMethodProperties.java
rename to ipojo/tests/tests.core.configuration/src/main/java/org/apache/felix/ipojo/test/scenarios/configuration/TestMethodProperties.java
index 0c68867..b4e9afc 100644
--- a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/configuration/TestMethodProperties.java
+++ b/ipojo/tests/tests.core.configuration/src/main/java/org/apache/felix/ipojo/test/scenarios/configuration/TestMethodProperties.java
@@ -23,7 +23,7 @@
import org.apache.felix.ipojo.ComponentInstance;
import org.apache.felix.ipojo.Factory;
import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
-import org.apache.felix.ipojo.test.scenarios.service.CheckService;
+import org.apache.felix.ipojo.test.scenarios.configuration.service.CheckService;
import org.apache.felix.ipojo.test.scenarios.util.Utils;
import org.osgi.framework.ServiceReference;
@@ -34,7 +34,7 @@
ComponentInstance instance2;
public void setUp() {
- Factory fact = Utils.getFactoryByName(context, "MethodConfigurableCheckService");
+ Factory fact = Utils.getFactoryByName(context, "CONFIG-MethodConfigurableCheckService");
Properties props = new Properties();
props.put("name", "under-test");
props.put("b", "1");
diff --git a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/configuration/TestSuperMethodProperties.java b/ipojo/tests/tests.core.configuration/src/main/java/org/apache/felix/ipojo/test/scenarios/configuration/TestSuperMethodProperties.java
similarity index 99%
rename from ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/configuration/TestSuperMethodProperties.java
rename to ipojo/tests/tests.core.configuration/src/main/java/org/apache/felix/ipojo/test/scenarios/configuration/TestSuperMethodProperties.java
index c1c25d9..99c477a 100644
--- a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/configuration/TestSuperMethodProperties.java
+++ b/ipojo/tests/tests.core.configuration/src/main/java/org/apache/felix/ipojo/test/scenarios/configuration/TestSuperMethodProperties.java
@@ -23,7 +23,7 @@
import org.apache.felix.ipojo.ComponentInstance;
import org.apache.felix.ipojo.Factory;
import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
-import org.apache.felix.ipojo.test.scenarios.service.CheckService;
+import org.apache.felix.ipojo.test.scenarios.configuration.service.CheckService;
import org.apache.felix.ipojo.test.scenarios.util.Utils;
import org.osgi.framework.ServiceReference;
@@ -32,7 +32,7 @@
ComponentInstance instance;
public void setUp() {
- Factory fact = Utils.getFactoryByName(context, "ParentMethodConfigurableCheckService");
+ Factory fact = Utils.getFactoryByName(context, "CONFIG-ParentMethodConfigurableCheckService");
Properties props = new Properties();
props.put("name", "under-test");
props.put("b", "1");
diff --git a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/service/CheckService.java b/ipojo/tests/tests.core.configuration/src/main/java/org/apache/felix/ipojo/test/scenarios/configuration/service/CheckService.java
similarity index 93%
copy from ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/service/CheckService.java
copy to ipojo/tests/tests.core.configuration/src/main/java/org/apache/felix/ipojo/test/scenarios/configuration/service/CheckService.java
index 62f254c..e8f89b9 100644
--- a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/service/CheckService.java
+++ b/ipojo/tests/tests.core.configuration/src/main/java/org/apache/felix/ipojo/test/scenarios/configuration/service/CheckService.java
@@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
-package org.apache.felix.ipojo.test.scenarios.service;
+package org.apache.felix.ipojo.test.scenarios.configuration.service;
import java.util.Properties;
diff --git a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/service/FooService.java b/ipojo/tests/tests.core.configuration/src/main/java/org/apache/felix/ipojo/test/scenarios/configuration/service/FooService.java
similarity index 93%
copy from ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/service/FooService.java
copy to ipojo/tests/tests.core.configuration/src/main/java/org/apache/felix/ipojo/test/scenarios/configuration/service/FooService.java
index 78693cf..7f6a005 100644
--- a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/service/FooService.java
+++ b/ipojo/tests/tests.core.configuration/src/main/java/org/apache/felix/ipojo/test/scenarios/configuration/service/FooService.java
@@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
-package org.apache.felix.ipojo.test.scenarios.service;
+package org.apache.felix.ipojo.test.scenarios.configuration.service;
import java.util.Properties;
diff --git a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/util/Utils.java b/ipojo/tests/tests.core.configuration/src/main/java/org/apache/felix/ipojo/test/scenarios/util/Utils.java
similarity index 100%
copy from ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/util/Utils.java
copy to ipojo/tests/tests.core.configuration/src/main/java/org/apache/felix/ipojo/test/scenarios/util/Utils.java
diff --git a/ipojo/tests/tests.core.configuration/src/main/resources/metadata.xml b/ipojo/tests/tests.core.configuration/src/main/resources/metadata.xml
new file mode 100644
index 0000000..b389cd5
--- /dev/null
+++ b/ipojo/tests/tests.core.configuration/src/main/resources/metadata.xml
@@ -0,0 +1,148 @@
+<ipojo>
+ <component
+ className="org.apache.felix.ipojo.test.scenarios.component.FooProviderTypeDyn"
+ factory="CONFIG-FooProviderType-Conf" architecture="true">
+ <provides />
+ <properties propagation="false">
+ <property name="int" field="intProp" value="2" />
+ <property name="boolean" field="boolProp" value="false" />
+ <property name="string" field="strProp" value="foo" />
+ <property name="strAProp" field="strAProp"
+ value="{foo, bar}" />
+ <property name="intAProp" field="intAProp" value="{1,2, 3}" />
+ </properties>
+ </component>
+ <component
+ className="org.apache.felix.ipojo.test.scenarios.component.FooProviderType1"
+ factory="CONFIG-FooProviderType-3" architecture="true">
+ <provides>
+ <property name="foo" field="m_foo" />
+ <property name="bar" field="m_bar" />
+ <property name="baz" type="java.lang.String" />
+ </provides>
+ <properties propagation="true">
+ <property name="foo" field="m_foo" />
+ <property name="bar" field="m_bar" />
+ </properties>
+ </component>
+ <!-- Configuration Management Test -->
+ <component factory="CONFIG-FieldConfigurableCheckService"
+ className="org.apache.felix.ipojo.test.scenarios.component.ConfigurableCheckServiceProvider"
+ architecture="true">
+ <provides />
+ <properties propagation="true">
+ <property field="b" />
+ <property field="s" />
+ <property field="i" />
+ <property field="l" />
+ <property field="d" />
+ <property field="f" />
+ <property field="c" />
+ <property field="bool" />
+ <property field="bs" />
+ <property field="ss" />
+ <property field="is" />
+ <property field="ls" />
+ <property field="ds" />
+ <property field="fs" />
+ <property field="cs" />
+ <property field="bools" />
+ <property field="string" />
+ <property field="strings" />
+ </properties>
+ </component>
+
+ <component factory="CONFIG-BothConfigurableCheckService"
+ className="org.apache.felix.ipojo.test.scenarios.component.ConfigurableCheckServiceProvider"
+ architecture="true">
+ <provides />
+ <properties propagation="true">
+ <property field="b" method="updateB" />
+ <property field="s" method="updateS" />
+ <property field="i" method="updateI" />
+ <property field="l" method="updateL" />
+ <property field="d" method="updateD" />
+ <property field="f" method="updateF" />
+ <property field="c" method="updateC" />
+ <property field="bool" method="updateBool" />
+ <property field="bs" method="updateBs" />
+ <property field="ss" method="updateSs" />
+ <property field="is" method="updateIs" />
+ <property field="ls" method="updateLs" />
+ <property field="ds" method="updateDs" />
+ <property field="fs" method="updateFs" />
+ <property field="cs" method="updateCs" />
+ <property field="bools" method="updateBools" />
+ <property field="string" method="updateString" />
+ <property field="strings" method="updateStrings" />
+ </properties>
+ </component>
+
+ <component factory="CONFIG-MethodConfigurableCheckService"
+ className="org.apache.felix.ipojo.test.scenarios.component.ConfigurableCheckServiceProvider"
+ architecture="true">
+ <provides />
+ <properties propagation="true">
+ <property method="updateB" name="b" />
+ <property method="updateS" name="s" />
+ <property method="updateI" name="i" />
+ <property method="updateL" name="l" />
+ <property method="updateD" name="d" />
+ <property method="updateF" name="f" />
+ <property method="updateC" name="c" />
+ <property method="updateBool" name="bool" />
+ <property method="updateBs" name="bs" />
+ <property method="updateSs" name="ss" />
+ <property method="updateIs" name="is" />
+ <property method="updateLs" name="ls" />
+ <property method="updateDs" name="ds" />
+ <property method="updateFs" name="fs" />
+ <property method="updateCs" name="cs" />
+ <property method="updateBools" name="bools" />
+ <property method="updateString" name="string" />
+ <property method="updateStrings" name="strings" />
+ </properties>
+ </component>
+
+ <component factory="CONFIG-ParentMethodConfigurableCheckService"
+ className="org.apache.felix.ipojo.test.scenarios.component.ParentConfigurableCheckServiceProvider"
+ architecture="true">
+ <provides />
+ <properties propagation="true">
+ <property method="updateB" name="b" />
+ <property method="updateS" name="s" />
+ <property method="updateI" name="i" />
+ <property method="updateL" name="l" />
+ <property method="updateD" name="d" />
+ <property method="updateF" name="f" />
+ <property method="updateC" name="c" />
+ <property method="updateBool" name="bool" />
+ <property method="updateBs" name="bs" />
+ <property method="updateSs" name="ss" />
+ <property method="updateIs" name="is" />
+ <property method="updateLs" name="ls" />
+ <property method="updateDs" name="ds" />
+ <property method="updateFs" name="fs" />
+ <property method="updateCs" name="cs" />
+ <property method="updateBools" name="bools" />
+ <property method="updateString" name="string" type="string" />
+ <property method="updateStrings" name="strings"
+ type="java.lang.String[]" />
+ </properties>
+ </component>
+
+ <component
+ className="org.apache.felix.ipojo.test.scenarios.component.FooProviderType1"
+ factory="CONFIG-FooProviderType-4" architecture="true">
+ <provides>
+ <property name="foo" field="m_foo" />
+ <property name="bar" field="m_bar" />
+ <property name="baz" type="java.lang.String" />
+ </provides>
+ <properties propagation="true" pid="FooProvider-3">
+ <property name="foo" field="m_foo" />
+ <property name="bar" field="m_bar" />
+ </properties>
+ </component>
+
+</ipojo>
diff --git a/ipojo/tests/tests.core/pom.xml b/ipojo/tests/tests.core.external.handlers/pom.xml
similarity index 87%
copy from ipojo/tests/tests.core/pom.xml
copy to ipojo/tests/tests.core.external.handlers/pom.xml
index 4795777..803b9d9 100644
--- a/ipojo/tests/tests.core/pom.xml
+++ b/ipojo/tests/tests.core.external.handlers/pom.xml
@@ -19,8 +19,8 @@
<project>
<modelVersion>4.0.0</modelVersion>
<packaging>bundle</packaging>
- <name>iPOJO Test Suite</name>
- <artifactId>tests.core</artifactId>
+ <name>iPOJO External Handler Mechanism Test Suite</name>
+ <artifactId>tests.core.external.handlers</artifactId>
<groupId>ipojo.tests</groupId>
<version>0.7.6-SNAPSHOT</version>
<dependencies>
@@ -31,11 +31,6 @@
</dependency>
<dependency>
<groupId>org.apache.felix</groupId>
- <artifactId>org.apache.felix.ipojo.composite</artifactId>
- <version>0.7.6-SNAPSHOT</version>
- </dependency>
- <dependency>
- <groupId>org.apache.felix</groupId>
<artifactId>org.apache.felix.ipojo.metadata</artifactId>
<version>0.7.6-SNAPSHOT</version>
</dependency>
@@ -65,7 +60,7 @@
<configuration>
<instructions>
<Export-Package>
- org.apache.felix.ipojo.test.scenarios.service
+ org.apache.felix.ipojo.test.scenarios.eh.service
</Export-Package>
<Bundle-SymbolicName>
${pom.artifactId}
@@ -74,7 +69,7 @@
org.apache.felix.ipojo.test*
</Private-Package>
<Test-Suite>
- org.apache.felix.ipojo.test.IPOJOTestSuite
+ org.apache.felix.ipojo.test.scenarios.eh.ExternalHandlerTestSuite
</Test-Suite>
</instructions>
</configuration>
@@ -98,8 +93,8 @@
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
- <source>1.5</source>
- <target>1.5</target>
+ <source>1.4</source>
+ <target>1.4</target>
</configuration>
</plugin>
</plugins>
diff --git a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/handler/CheckServiceHandler.java b/ipojo/tests/tests.core.external.handlers/src/main/java/org/apache/felix/ipojo/test/scenarios/component/CheckServiceHandler.java
similarity index 95%
rename from ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/handler/CheckServiceHandler.java
rename to ipojo/tests/tests.core.external.handlers/src/main/java/org/apache/felix/ipojo/test/scenarios/component/CheckServiceHandler.java
index b3ead6f..efd79d6 100644
--- a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/handler/CheckServiceHandler.java
+++ b/ipojo/tests/tests.core.external.handlers/src/main/java/org/apache/felix/ipojo/test/scenarios/component/CheckServiceHandler.java
@@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
-package org.apache.felix.ipojo.test.handler;
+package org.apache.felix.ipojo.test.scenarios.component;
import java.util.Dictionary;
import java.util.Properties;
@@ -26,7 +26,7 @@
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.test.scenarios.service.CheckService;
+import org.apache.felix.ipojo.test.scenarios.eh.service.CheckService;
import org.osgi.framework.ServiceRegistration;
public class CheckServiceHandler extends PrimitiveHandler implements CheckService {
diff --git a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/handler/CheckServiceHandlerDescription.java b/ipojo/tests/tests.core.external.handlers/src/main/java/org/apache/felix/ipojo/test/scenarios/component/CheckServiceHandlerDescription.java
similarity index 95%
rename from ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/handler/CheckServiceHandlerDescription.java
rename to ipojo/tests/tests.core.external.handlers/src/main/java/org/apache/felix/ipojo/test/scenarios/component/CheckServiceHandlerDescription.java
index fb43042..ade2474 100644
--- a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/handler/CheckServiceHandlerDescription.java
+++ b/ipojo/tests/tests.core.external.handlers/src/main/java/org/apache/felix/ipojo/test/scenarios/component/CheckServiceHandlerDescription.java
@@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
-package org.apache.felix.ipojo.test.handler;
+package org.apache.felix.ipojo.test.scenarios.component;
import org.apache.felix.ipojo.Handler;
import org.apache.felix.ipojo.architecture.HandlerDescription;
diff --git a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/component/FooProviderType1.java b/ipojo/tests/tests.core.external.handlers/src/main/java/org/apache/felix/ipojo/test/scenarios/component/FooProviderType1.java
similarity index 97%
copy from ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/component/FooProviderType1.java
copy to ipojo/tests/tests.core.external.handlers/src/main/java/org/apache/felix/ipojo/test/scenarios/component/FooProviderType1.java
index 3fe9bad..e7040e7 100644
--- a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/component/FooProviderType1.java
+++ b/ipojo/tests/tests.core.external.handlers/src/main/java/org/apache/felix/ipojo/test/scenarios/component/FooProviderType1.java
@@ -20,7 +20,7 @@
import java.util.Properties;
-import org.apache.felix.ipojo.test.scenarios.service.FooService;
+import org.apache.felix.ipojo.test.scenarios.eh.service.FooService;
import org.osgi.framework.BundleContext;
public class FooProviderType1 implements FooService {
diff --git a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/handler/ExternalHandlerTestSuite.java b/ipojo/tests/tests.core.external.handlers/src/main/java/org/apache/felix/ipojo/test/scenarios/eh/ExternalHandlerTestSuite.java
similarity index 95%
rename from ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/handler/ExternalHandlerTestSuite.java
rename to ipojo/tests/tests.core.external.handlers/src/main/java/org/apache/felix/ipojo/test/scenarios/eh/ExternalHandlerTestSuite.java
index f37d2ec..9965643 100644
--- a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/handler/ExternalHandlerTestSuite.java
+++ b/ipojo/tests/tests.core.external.handlers/src/main/java/org/apache/felix/ipojo/test/scenarios/eh/ExternalHandlerTestSuite.java
@@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
-package org.apache.felix.ipojo.test.scenarios.handler;
+package org.apache.felix.ipojo.test.scenarios.eh;
import junit.framework.Test;
import junit.framework.TestSuite;
diff --git a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/handler/HandlerTest.java b/ipojo/tests/tests.core.external.handlers/src/main/java/org/apache/felix/ipojo/test/scenarios/eh/HandlerTest.java
similarity index 95%
rename from ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/handler/HandlerTest.java
rename to ipojo/tests/tests.core.external.handlers/src/main/java/org/apache/felix/ipojo/test/scenarios/eh/HandlerTest.java
index a9d2718..82c404a 100644
--- a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/handler/HandlerTest.java
+++ b/ipojo/tests/tests.core.external.handlers/src/main/java/org/apache/felix/ipojo/test/scenarios/eh/HandlerTest.java
@@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
-package org.apache.felix.ipojo.test.scenarios.handler;
+package org.apache.felix.ipojo.test.scenarios.eh;
import java.util.Properties;
@@ -24,7 +24,7 @@
import org.apache.felix.ipojo.HandlerFactory;
import org.apache.felix.ipojo.architecture.Architecture;
import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
-import org.apache.felix.ipojo.test.scenarios.service.CheckService;
+import org.apache.felix.ipojo.test.scenarios.eh.service.CheckService;
import org.apache.felix.ipojo.test.scenarios.util.Utils;
import org.osgi.framework.InvalidSyntaxException;
import org.osgi.framework.ServiceReference;
@@ -42,7 +42,7 @@
p.put("b", "b");
p.put("c", "c");
props.put("csh.map", p);
- instance = Utils.getComponentInstance(context, "HandlerTester", props);
+ instance = Utils.getComponentInstance(context, "HANDLER-HandlerTester", props);
}
public void tearDown() {
@@ -178,7 +178,7 @@
p.put("b", "b");
p.put("c", "c");
props.put("csh.map", p);
- instance = Utils.getComponentInstance(context, "HandlerTester", props);
+ instance = Utils.getComponentInstance(context, "HANDLER-HandlerTester", props);
sr = Utils.getServiceReferenceByName(context, CheckService.class.getName(), "HandlerTest-1");
assertNotNull("Check the check service availability - 2", sr);
diff --git a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/service/CheckService.java b/ipojo/tests/tests.core.external.handlers/src/main/java/org/apache/felix/ipojo/test/scenarios/eh/service/CheckService.java
similarity index 94%
copy from ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/service/CheckService.java
copy to ipojo/tests/tests.core.external.handlers/src/main/java/org/apache/felix/ipojo/test/scenarios/eh/service/CheckService.java
index 62f254c..9239759 100644
--- a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/service/CheckService.java
+++ b/ipojo/tests/tests.core.external.handlers/src/main/java/org/apache/felix/ipojo/test/scenarios/eh/service/CheckService.java
@@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
-package org.apache.felix.ipojo.test.scenarios.service;
+package org.apache.felix.ipojo.test.scenarios.eh.service;
import java.util.Properties;
diff --git a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/service/FooService.java b/ipojo/tests/tests.core.external.handlers/src/main/java/org/apache/felix/ipojo/test/scenarios/eh/service/FooService.java
similarity index 94%
copy from ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/service/FooService.java
copy to ipojo/tests/tests.core.external.handlers/src/main/java/org/apache/felix/ipojo/test/scenarios/eh/service/FooService.java
index 78693cf..38d66ff 100644
--- a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/service/FooService.java
+++ b/ipojo/tests/tests.core.external.handlers/src/main/java/org/apache/felix/ipojo/test/scenarios/eh/service/FooService.java
@@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
-package org.apache.felix.ipojo.test.scenarios.service;
+package org.apache.felix.ipojo.test.scenarios.eh.service;
import java.util.Properties;
diff --git a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/util/Utils.java b/ipojo/tests/tests.core.external.handlers/src/main/java/org/apache/felix/ipojo/test/scenarios/util/Utils.java
similarity index 100%
copy from ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/util/Utils.java
copy to ipojo/tests/tests.core.external.handlers/src/main/java/org/apache/felix/ipojo/test/scenarios/util/Utils.java
diff --git a/ipojo/tests/tests.core.external.handlers/src/main/resources/metadata.xml b/ipojo/tests/tests.core.external.handlers/src/main/resources/metadata.xml
new file mode 100644
index 0000000..134c5a7
--- /dev/null
+++ b/ipojo/tests/tests.core.external.handlers/src/main/resources/metadata.xml
@@ -0,0 +1,24 @@
+<ipojo
+ xmlns:cs="org.apache.felix.ipojo.test.handler.checkservice">
+ <handler
+ classname="org.apache.felix.ipojo.test.scenarios.component.CheckServiceHandler"
+ name="check"
+ namespace="org.apache.felix.ipojo.test.handler.checkservice"
+ architecture="false">
+ <controller field="isValid" />
+ </handler>
+ <component
+ className="org.apache.felix.ipojo.test.scenarios.component.FooProviderType1"
+ factory="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>
+
+</ipojo>
diff --git a/ipojo/tests/tests.core/pom.xml b/ipojo/tests/tests.core.factories/pom.xml
similarity index 87%
rename from ipojo/tests/tests.core/pom.xml
rename to ipojo/tests/tests.core.factories/pom.xml
index 4795777..cb4ab55 100644
--- a/ipojo/tests/tests.core/pom.xml
+++ b/ipojo/tests/tests.core.factories/pom.xml
@@ -19,8 +19,8 @@
<project>
<modelVersion>4.0.0</modelVersion>
<packaging>bundle</packaging>
- <name>iPOJO Test Suite</name>
- <artifactId>tests.core</artifactId>
+ <name>iPOJO Factories Test Suite</name>
+ <artifactId>tests.core.factories</artifactId>
<groupId>ipojo.tests</groupId>
<version>0.7.6-SNAPSHOT</version>
<dependencies>
@@ -31,11 +31,6 @@
</dependency>
<dependency>
<groupId>org.apache.felix</groupId>
- <artifactId>org.apache.felix.ipojo.composite</artifactId>
- <version>0.7.6-SNAPSHOT</version>
- </dependency>
- <dependency>
- <groupId>org.apache.felix</groupId>
<artifactId>org.apache.felix.ipojo.metadata</artifactId>
<version>0.7.6-SNAPSHOT</version>
</dependency>
@@ -65,7 +60,7 @@
<configuration>
<instructions>
<Export-Package>
- org.apache.felix.ipojo.test.scenarios.service
+ org.apache.felix.ipojo.test.scenarios.factories.service
</Export-Package>
<Bundle-SymbolicName>
${pom.artifactId}
@@ -74,7 +69,7 @@
org.apache.felix.ipojo.test*
</Private-Package>
<Test-Suite>
- org.apache.felix.ipojo.test.IPOJOTestSuite
+ org.apache.felix.ipojo.test.scenarios.factories.FactoryTestSuite
</Test-Suite>
</instructions>
</configuration>
@@ -98,8 +93,8 @@
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
- <source>1.5</source>
- <target>1.5</target>
+ <source>1.4</source>
+ <target>1.4</target>
</configuration>
</plugin>
</plugins>
diff --git a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/component/CheckProviderParentClass.java b/ipojo/tests/tests.core.factories/src/main/java/org/apache/felix/ipojo/test/scenarios/component/CheckProviderParentClass.java
similarity index 95%
rename from ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/component/CheckProviderParentClass.java
rename to ipojo/tests/tests.core.factories/src/main/java/org/apache/felix/ipojo/test/scenarios/component/CheckProviderParentClass.java
index 675fe41..7f7f37d 100644
--- a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/component/CheckProviderParentClass.java
+++ b/ipojo/tests/tests.core.factories/src/main/java/org/apache/felix/ipojo/test/scenarios/component/CheckProviderParentClass.java
@@ -18,7 +18,7 @@
*/
package org.apache.felix.ipojo.test.scenarios.component;
-import org.apache.felix.ipojo.test.scenarios.service.FooService;
+import org.apache.felix.ipojo.test.scenarios.factories.service.FooService;
import org.osgi.framework.ServiceReference;
public abstract class CheckProviderParentClass {
diff --git a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/component/CheckServiceProvider.java b/ipojo/tests/tests.core.factories/src/main/java/org/apache/felix/ipojo/test/scenarios/component/CheckServiceProvider.java
similarity index 94%
copy from ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/component/CheckServiceProvider.java
copy to ipojo/tests/tests.core.factories/src/main/java/org/apache/felix/ipojo/test/scenarios/component/CheckServiceProvider.java
index cd2b927..fdaf7c1 100644
--- a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/component/CheckServiceProvider.java
+++ b/ipojo/tests/tests.core.factories/src/main/java/org/apache/felix/ipojo/test/scenarios/component/CheckServiceProvider.java
@@ -20,8 +20,8 @@
import java.util.Properties;
-import org.apache.felix.ipojo.test.scenarios.service.CheckService;
-import org.apache.felix.ipojo.test.scenarios.service.FooService;
+import org.apache.felix.ipojo.test.scenarios.factories.service.CheckService;
+import org.apache.felix.ipojo.test.scenarios.factories.service.FooService;
import org.osgi.framework.ServiceReference;
public class CheckServiceProvider extends CheckProviderParentClass implements CheckService {
diff --git a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/component/FooBarProviderType1.java b/ipojo/tests/tests.core.factories/src/main/java/org/apache/felix/ipojo/test/scenarios/component/FooBarProviderType1.java
similarity index 90%
copy from ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/component/FooBarProviderType1.java
copy to ipojo/tests/tests.core.factories/src/main/java/org/apache/felix/ipojo/test/scenarios/component/FooBarProviderType1.java
index 2b739b4..419da2e 100644
--- a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/component/FooBarProviderType1.java
+++ b/ipojo/tests/tests.core.factories/src/main/java/org/apache/felix/ipojo/test/scenarios/component/FooBarProviderType1.java
@@ -20,8 +20,8 @@
import java.util.Properties;
-import org.apache.felix.ipojo.test.scenarios.service.BarService;
-import org.apache.felix.ipojo.test.scenarios.service.FooService;
+import org.apache.felix.ipojo.test.scenarios.factories.service.BarService;
+import org.apache.felix.ipojo.test.scenarios.factories.service.FooService;
public class FooBarProviderType1 implements FooService, BarService {
diff --git a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/component/FooProviderType1.java b/ipojo/tests/tests.core.factories/src/main/java/org/apache/felix/ipojo/test/scenarios/component/FooProviderType1.java
similarity index 97%
rename from ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/component/FooProviderType1.java
rename to ipojo/tests/tests.core.factories/src/main/java/org/apache/felix/ipojo/test/scenarios/component/FooProviderType1.java
index 3fe9bad..d1217a1 100644
--- a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/component/FooProviderType1.java
+++ b/ipojo/tests/tests.core.factories/src/main/java/org/apache/felix/ipojo/test/scenarios/component/FooProviderType1.java
@@ -20,7 +20,7 @@
import java.util.Properties;
-import org.apache.felix.ipojo.test.scenarios.service.FooService;
+import org.apache.felix.ipojo.test.scenarios.factories.service.FooService;
import org.osgi.framework.BundleContext;
public class FooProviderType1 implements FooService {
diff --git a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/component/FooProviderTypeDyn.java b/ipojo/tests/tests.core.factories/src/main/java/org/apache/felix/ipojo/test/scenarios/component/FooProviderTypeDyn.java
similarity index 95%
copy from ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/component/FooProviderTypeDyn.java
copy to ipojo/tests/tests.core.factories/src/main/java/org/apache/felix/ipojo/test/scenarios/component/FooProviderTypeDyn.java
index 39f3918..77a1583 100644
--- a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/component/FooProviderTypeDyn.java
+++ b/ipojo/tests/tests.core.factories/src/main/java/org/apache/felix/ipojo/test/scenarios/component/FooProviderTypeDyn.java
@@ -20,7 +20,8 @@
import java.util.Properties;
-import org.apache.felix.ipojo.test.scenarios.service.FooService;
+import org.apache.felix.ipojo.test.scenarios.factories.service.FooService;
+
public class FooProviderTypeDyn implements FooService {
diff --git a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/component/FooProviderTypeDyn2.java b/ipojo/tests/tests.core.factories/src/main/java/org/apache/felix/ipojo/test/scenarios/component/FooProviderTypeDyn2.java
similarity index 95%
copy from ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/component/FooProviderTypeDyn2.java
copy to ipojo/tests/tests.core.factories/src/main/java/org/apache/felix/ipojo/test/scenarios/component/FooProviderTypeDyn2.java
index f5f233a..8cc7d12 100644
--- a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/component/FooProviderTypeDyn2.java
+++ b/ipojo/tests/tests.core.factories/src/main/java/org/apache/felix/ipojo/test/scenarios/component/FooProviderTypeDyn2.java
@@ -20,7 +20,7 @@
import java.util.Properties;
-import org.apache.felix.ipojo.test.scenarios.service.FooService;
+import org.apache.felix.ipojo.test.scenarios.factories.service.FooService;
public class FooProviderTypeDyn2 implements FooService {
diff --git a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/core/ComponentDesc.java b/ipojo/tests/tests.core.factories/src/main/java/org/apache/felix/ipojo/test/scenarios/factories/ComponentDesc.java
similarity index 93%
rename from ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/core/ComponentDesc.java
rename to ipojo/tests/tests.core.factories/src/main/java/org/apache/felix/ipojo/test/scenarios/factories/ComponentDesc.java
index ec4fef9..41dbcc2 100644
--- a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/core/ComponentDesc.java
+++ b/ipojo/tests/tests.core.factories/src/main/java/org/apache/felix/ipojo/test/scenarios/factories/ComponentDesc.java
@@ -16,18 +16,21 @@
* specific language governing permissions and limitations
* under the License.
*/
-package org.apache.felix.ipojo.test.scenarios.core;
+package org.apache.felix.ipojo.test.scenarios.factories;
import org.apache.felix.ipojo.Factory;
import org.apache.felix.ipojo.architecture.ComponentTypeDescription;
import org.apache.felix.ipojo.architecture.PropertyDescription;
import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
import org.apache.felix.ipojo.metadata.Element;
-import org.apache.felix.ipojo.test.scenarios.service.BarService;
-import org.apache.felix.ipojo.test.scenarios.service.FooService;
+import org.apache.felix.ipojo.test.scenarios.factories.service.BarService;
+import org.apache.felix.ipojo.test.scenarios.factories.service.FooService;
import org.apache.felix.ipojo.test.scenarios.util.Utils;
import org.osgi.framework.ServiceReference;
+/**
+ * Check component type description.
+ */
public class ComponentDesc extends OSGiTestCase {
ServiceReference sr_fooProvider1;
@@ -51,11 +54,11 @@
// Factory multiple_optional;
public void setUp() {
- sr_fooProvider1 = Utils.getServiceReferenceByName(context, Factory.class.getName(), "FooProviderType-1");
- sr_fooProvider2 = Utils.getServiceReferenceByName(context, Factory.class.getName(), "FooProviderType-2");
- sr_fooProviderDyn2 = Utils.getServiceReferenceByName(context, Factory.class.getName(), "FooProviderType-Dyn2");
- sr_fooProvider3 = Utils.getServiceReferenceByName(context, Factory.class.getName(), "FooProviderType-3");
- sr_foobarProvider = Utils.getServiceReferenceByName(context, Factory.class.getName(), "FooBarProviderType-1");
+ sr_fooProvider1 = Utils.getServiceReferenceByName(context, Factory.class.getName(), "Factories-FooProviderType-1");
+ sr_fooProvider2 = Utils.getServiceReferenceByName(context, Factory.class.getName(), "Factories-FooProviderType-2");
+ sr_fooProviderDyn2 = Utils.getServiceReferenceByName(context, Factory.class.getName(), "Factories-FooProviderType-Dyn2");
+ sr_fooProvider3 = Utils.getServiceReferenceByName(context, Factory.class.getName(), "Factories-FooProviderType-3");
+ sr_foobarProvider = Utils.getServiceReferenceByName(context, Factory.class.getName(), "Factories-FooBarProviderType-1");
// sr_simple = Utils.getServiceReferenceByName(context, Factory.class.getName(), "SimpleCheckServiceProvider");
// sr_optional = Utils.getServiceReferenceByName(context, Factory.class.getName(), "SimpleOptionalCheckServiceProvider");
// sr_multiple = Utils.getServiceReferenceByName(context, Factory.class.getName(), "SimpleMultipleCheckServiceProvider");
@@ -95,6 +98,9 @@
// context.ungetService(sr_multiple_optional);
}
+ /**
+ * Check simple providing.
+ */
public void testFooProvider1() {
// Test SR properties
// String impl = (String) sr_fooProvider1.getProperty("component.class");
@@ -108,7 +114,7 @@
assertEquals("Check component.properties length", pd.length, 0);
// Test factory
- assertEquals("Check factory name", fooProvider1.getName(), "FooProviderType-1");
+ assertEquals("Check factory name", fooProvider1.getName(), "Factories-FooProviderType-1");
Element cd = fooProvider1.getDescription();
// assertEquals("Check implementation class ", cd.getAttribute("implementation-class"), impl);
@@ -125,6 +131,9 @@
assertNotNull("check description equality", desc);
}
+ /**
+ * Check component properties.
+ */
public void testFooProvider2() {
// Test SR properties
// String impl = (String) sr_fooProvider2.getProperty("component.class");
@@ -156,7 +165,7 @@
assertEquals("Check component.properties type [" + 4 + "]", "int[]", pd[4].getType());
// Test factory
- assertEquals("Check factory name", fooProvider2.getName(), "FooProviderType-2");
+ assertEquals("Check factory name", fooProvider2.getName(), "Factories-FooProviderType-2");
Element cd = fooProvider2.getDescription();
// assertEquals("Check implementation class ", cd.getAttribute("implementation-class"), impl);
@@ -191,6 +200,9 @@
assertNotNull("check description equality", desc);
}
+ /**
+ * Check component properties (dynamic).
+ */
public void testFooProviderDyn2() {
// Test SR properties
// String impl = (String) sr_fooProviderDyn2.getProperty("component.class");
@@ -220,7 +232,7 @@
assertEquals("Check component.properties type [" + 4 + "]", "int[]", pd[4].getType());
// Test factory
- assertEquals("Check factory name", fooProviderDyn2.getName(), "FooProviderType-Dyn2");
+ assertEquals("Check factory name", fooProviderDyn2.getName(), "Factories-FooProviderType-Dyn2");
Element cd = fooProviderDyn2.getDescription();
// assertEquals("Check implementation class ", cd.getAttribute("implementation-class"), impl);
@@ -253,6 +265,9 @@
assertNotNull("check description equality", desc);
}
+ /**
+ * Check component properties.
+ */
public void testFooProvider3() {
// Test SR properties
// String impl = (String) sr_fooProvider3.getProperty("component.class");
@@ -273,7 +288,7 @@
assertEquals("Check component.properties type [" + 2 + "]", "java.lang.String", pd[2].getType());
// Test factory
- assertEquals("Check factory name", fooProvider3.getName(), "FooProviderType-3");
+ assertEquals("Check factory name", fooProvider3.getName(), "Factories-FooProviderType-3");
Element cd = fooProvider3.getDescription();
// assertEquals("Check implementation class ", cd.getAttribute("implementation-class"), impl);
@@ -297,6 +312,9 @@
assertNotNull("check description equality", desc);
}
+ /**
+ * Test two services provider.
+ */
public void testFooBar() {
// Test SR properties
// String impl = (String) sr_foobarProvider.getProperty("component.class");
@@ -311,7 +329,7 @@
assertEquals("Check component.properties length", pd.length, 0);
// Test factory
- assertEquals("Check factory name", foobarProvider.getName(), "FooBarProviderType-1");
+ assertEquals("Check factory name", foobarProvider.getName(), "Factories-FooBarProviderType-1");
Element cd = foobarProvider.getDescription();
// assertEquals("Check implementation class ", cd.getAttribute("implementation-class"), impl);
diff --git a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/factory/ConfigAdminTest.java b/ipojo/tests/tests.core.factories/src/main/java/org/apache/felix/ipojo/test/scenarios/factories/ConfigAdminTest.java
similarity index 87%
rename from ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/factory/ConfigAdminTest.java
rename to ipojo/tests/tests.core.factories/src/main/java/org/apache/felix/ipojo/test/scenarios/factories/ConfigAdminTest.java
index 34f5b5d..3b6d440 100644
--- a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/factory/ConfigAdminTest.java
+++ b/ipojo/tests/tests.core.factories/src/main/java/org/apache/felix/ipojo/test/scenarios/factories/ConfigAdminTest.java
@@ -16,18 +16,21 @@
* specific language governing permissions and limitations
* under the License.
*/
-package org.apache.felix.ipojo.test.scenarios.factory;
+package org.apache.felix.ipojo.test.scenarios.factories;
import java.util.Properties;
import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
-import org.apache.felix.ipojo.test.scenarios.service.FooService;
+import org.apache.felix.ipojo.test.scenarios.factories.service.FooService;
import org.apache.felix.ipojo.test.scenarios.util.Utils;
import org.osgi.framework.InvalidSyntaxException;
import org.osgi.framework.ServiceReference;
import org.osgi.service.cm.ConfigurationException;
import org.osgi.service.cm.ManagedServiceFactory;
+/**
+ * Check configuration admin reconfiguration.
+ */
public class ConfigAdminTest extends OSGiTestCase {
private ManagedServiceFactory getFactoryByName(String pid) {
@@ -42,8 +45,11 @@
}
}
+ /**
+ * Check creation.
+ */
public void testCreation() {
- ManagedServiceFactory f = getFactoryByName("FooProviderType-2");
+ ManagedServiceFactory f = getFactoryByName("Factories-FooProviderType-2");
Properties p = new Properties();
p.put("int", new Integer(3));
@@ -64,8 +70,11 @@
}
}
+ /**
+ * Check creation (push String).
+ */
public void testCreationString() {
- ManagedServiceFactory f = getFactoryByName("FooProviderType-2");
+ ManagedServiceFactory f = getFactoryByName("Factories-FooProviderType-2");
Properties p = new Properties();
p.put("int", "3");
@@ -86,8 +95,11 @@
}
}
+ /**
+ * Check update and delete.
+ */
public void testUpdate() {
- ManagedServiceFactory f = getFactoryByName("FooProviderType-2");
+ ManagedServiceFactory f = getFactoryByName("Factories-FooProviderType-2");
Properties p = new Properties();
p.put("int", new Integer(3));
@@ -113,8 +125,12 @@
}
}
+ /**
+ * Check update and delete.
+ * (Push String).
+ */
public void testUpdateString() {
- ManagedServiceFactory f = getFactoryByName("FooProviderType-2");
+ ManagedServiceFactory f = getFactoryByName("Factories-FooProviderType-2");
Properties p = new Properties();
p.put("int", "3");
diff --git a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/service/providing/FactoryProps.java b/ipojo/tests/tests.core.factories/src/main/java/org/apache/felix/ipojo/test/scenarios/factories/FactoryProps.java
similarity index 89%
rename from ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/service/providing/FactoryProps.java
rename to ipojo/tests/tests.core.factories/src/main/java/org/apache/felix/ipojo/test/scenarios/factories/FactoryProps.java
index 0be3205..d2604d0 100644
--- a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/service/providing/FactoryProps.java
+++ b/ipojo/tests/tests.core.factories/src/main/java/org/apache/felix/ipojo/test/scenarios/factories/FactoryProps.java
@@ -16,13 +16,13 @@
* specific language governing permissions and limitations
* under the License.
*/
-package org.apache.felix.ipojo.test.scenarios.service.providing;
+package org.apache.felix.ipojo.test.scenarios.factories;
import org.apache.felix.ipojo.Factory;
import org.apache.felix.ipojo.architecture.PropertyDescription;
import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
-import org.apache.felix.ipojo.test.scenarios.service.BarService;
-import org.apache.felix.ipojo.test.scenarios.service.FooService;
+import org.apache.felix.ipojo.test.scenarios.factories.service.BarService;
+import org.apache.felix.ipojo.test.scenarios.factories.service.FooService;
import org.apache.felix.ipojo.test.scenarios.util.Utils;
import org.osgi.framework.ServiceReference;
@@ -36,7 +36,7 @@
// }
public void testSimpleExposition() {
- ServiceReference ref1 = Utils.getServiceReferenceByName(context, Factory.class.getName(), "FooProviderType-1");
+ ServiceReference ref1 = Utils.getServiceReferenceByName(context, Factory.class.getName(), "Factories-FooProviderType-1");
assertNotNull("The factory is available", ref1);
String[] spec = (String[]) ref1.getProperty("component.providedServiceSpecifications");
assertEquals("Check array length", spec.length, 1);
@@ -44,7 +44,7 @@
}
public void testDoubleExposition() {
- ServiceReference ref1 = Utils.getServiceReferenceByName(context, Factory.class.getName(), "FooBarProviderType-1");
+ ServiceReference ref1 = Utils.getServiceReferenceByName(context, Factory.class.getName(), "Factories-FooBarProviderType-1");
assertNotNull("The factory is available", ref1);
String[] spec = (String[]) ref1.getProperty("component.providedServiceSpecifications");
assertEquals("Check array length", spec.length, 2);
@@ -53,7 +53,7 @@
}
public void testProps() {
- ServiceReference ref1 = Utils.getServiceReferenceByName(context, Factory.class.getName(), "FooProviderType-Dyn2");
+ ServiceReference ref1 = Utils.getServiceReferenceByName(context, Factory.class.getName(), "Factories-FooProviderType-Dyn2");
assertNotNull("The factory is available", ref1);
PropertyDescription[] pd = (PropertyDescription[]) ref1.getProperty("component.properties");
assertEquals("Check property list size", pd.length, 5);
diff --git a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/controller/LifeCycleControllerTestSuite.java b/ipojo/tests/tests.core.factories/src/main/java/org/apache/felix/ipojo/test/scenarios/factories/FactoryTestSuite.java
similarity index 70%
copy from ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/controller/LifeCycleControllerTestSuite.java
copy to ipojo/tests/tests.core.factories/src/main/java/org/apache/felix/ipojo/test/scenarios/factories/FactoryTestSuite.java
index 423088f..e34477a 100644
--- a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/controller/LifeCycleControllerTestSuite.java
+++ b/ipojo/tests/tests.core.factories/src/main/java/org/apache/felix/ipojo/test/scenarios/factories/FactoryTestSuite.java
@@ -16,20 +16,22 @@
* specific language governing permissions and limitations
* under the License.
*/
-package org.apache.felix.ipojo.test.scenarios.controller;
+package org.apache.felix.ipojo.test.scenarios.factories;
import junit.framework.Test;
import org.apache.felix.ipojo.junit4osgi.OSGiTestSuite;
import org.osgi.framework.BundleContext;
-public class LifeCycleControllerTestSuite {
-
+public class FactoryTestSuite {
public static Test suite(BundleContext bc) {
- OSGiTestSuite ots = new OSGiTestSuite("Lifecycle Controller Test Suite", bc);
- ots.addTestSuite( LifeCycleControllerTest.class);
- ots.addTestSuite( ImmediateLifeCycleControllerTest.class);
+ OSGiTestSuite ots = new OSGiTestSuite("Factories Test Suite", bc);
+ ots.addTestSuite(ComponentDesc.class);
+ ots.addTestSuite(UnacceptableConfigurationTest.class);
+ ots.addTestSuite(ConfigAdminTest.class);
+ ots.addTestSuite(ObedienceTest.class);
+ ots.addTestSuite(FactoryProps.class);
return ots;
}
diff --git a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/factory/ObedienceTest.java b/ipojo/tests/tests.core.factories/src/main/java/org/apache/felix/ipojo/test/scenarios/factories/ObedienceTest.java
similarity index 89%
rename from ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/factory/ObedienceTest.java
rename to ipojo/tests/tests.core.factories/src/main/java/org/apache/felix/ipojo/test/scenarios/factories/ObedienceTest.java
index da818e4..8ecdf56 100644
--- a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/factory/ObedienceTest.java
+++ b/ipojo/tests/tests.core.factories/src/main/java/org/apache/felix/ipojo/test/scenarios/factories/ObedienceTest.java
@@ -16,21 +16,24 @@
* specific language governing permissions and limitations
* under the License.
*/
-package org.apache.felix.ipojo.test.scenarios.factory;
+package org.apache.felix.ipojo.test.scenarios.factories;
import java.util.Properties;
import org.apache.felix.ipojo.ComponentFactory;
import org.apache.felix.ipojo.ComponentInstance;
import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
-import org.apache.felix.ipojo.test.scenarios.service.FooService;
+import org.apache.felix.ipojo.test.scenarios.factories.service.FooService;
import org.apache.felix.ipojo.test.scenarios.util.Utils;
+/**
+ * Check that instances are disposed when the factory is stopped.
+ */
public class ObedienceTest extends OSGiTestCase {
- public void testObedience1() {
+ public void testObedience() {
assertNull("Check no foo service", context.getServiceReference(FooService.class.getName()));
- ComponentFactory factory = (ComponentFactory) Utils.getFactoryByName(context, "FooProviderType-1");
+ ComponentFactory factory = (ComponentFactory) Utils.getFactoryByName(context, "Factories-FooProviderType-1");
assertNotNull("Check factory existing", factory);
Properties props1 = new Properties();
diff --git a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/factory/UnacceptableConfigurationTest.java b/ipojo/tests/tests.core.factories/src/main/java/org/apache/felix/ipojo/test/scenarios/factories/UnacceptableConfigurationTest.java
similarity index 80%
rename from ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/factory/UnacceptableConfigurationTest.java
rename to ipojo/tests/tests.core.factories/src/main/java/org/apache/felix/ipojo/test/scenarios/factories/UnacceptableConfigurationTest.java
index 797b5db..b4f7aa0 100644
--- a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/factory/UnacceptableConfigurationTest.java
+++ b/ipojo/tests/tests.core.factories/src/main/java/org/apache/felix/ipojo/test/scenarios/factories/UnacceptableConfigurationTest.java
@@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
-package org.apache.felix.ipojo.test.scenarios.factory;
+package org.apache.felix.ipojo.test.scenarios.factories;
import java.util.Properties;
@@ -25,10 +25,16 @@
import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
import org.apache.felix.ipojo.test.scenarios.util.Utils;
+/**
+ * Test unacceptable configuration.
+ */
public class UnacceptableConfigurationTest extends OSGiTestCase {
+ /**
+ * Configuration without the name property.
+ */
public void testWithoutName() {
- Factory f = Utils.getFactoryByName(context, "FooProviderType-2");
+ Factory f = Utils.getFactoryByName(context, "Factories-FooProviderType-2");
Properties p = new Properties();
p.put("int", new Integer(3));
@@ -45,8 +51,11 @@
}
+ /**
+ * Empty configuration.
+ */
public void testEmptyConfiguration() {
- Factory f = Utils.getFactoryByName(context, "FooProviderType-2");
+ Factory f = Utils.getFactoryByName(context, "Factories-FooProviderType-2");
Properties p = new Properties();
ComponentInstance ci = null;
@@ -56,8 +65,11 @@
} catch(Exception e) { fail("An acceptable configuration is refused"); }
}
+ /**
+ * Empty configuration (just the name).
+ */
public void testEmptyConfiguration2() {
- Factory f = Utils.getFactoryByName(context, "FooProviderType-Dyn2");
+ Factory f = Utils.getFactoryByName(context, "Factories-FooProviderType-Dyn2");
Properties p = new Properties();
p.put("name", "ko");
ComponentInstance ci = null;
@@ -69,8 +81,11 @@
fail("An unacceptable configuration is accepted");
}
+ /**
+ * Null configuration (accept).
+ */
public void testNull() {
- Factory f = Utils.getFactoryByName(context, "FooProviderType-2");
+ Factory f = Utils.getFactoryByName(context, "Factories-FooProviderType-2");
ComponentInstance ci = null;
try {
@@ -79,8 +94,11 @@
} catch(Exception e) { fail("An acceptable configuration is refused"); }
}
+ /**
+ * Null configuration (fail).
+ */
public void testNull2() {
- Factory f = Utils.getFactoryByName(context, "FooProviderType-Dyn2");
+ Factory f = Utils.getFactoryByName(context, "Factories-FooProviderType-Dyn2");
ComponentInstance ci = null;
try {
@@ -91,8 +109,11 @@
fail("An unacceptable configuration is accepted");
}
+ /**
+ * Check static properties.
+ */
public void testStaticOK() {
- Factory f = Utils.getFactoryByName(context, "FooProviderType-2");
+ Factory f = Utils.getFactoryByName(context, "Factories-FooProviderType-2");
Properties p = new Properties();
p.put("name", "ok");
@@ -111,8 +132,11 @@
}
}
+ /**
+ * Check dynamic properties.
+ */
public void testDynamicOK() {
- Factory f = Utils.getFactoryByName(context, "FooProviderType-Dyn");
+ Factory f = Utils.getFactoryByName(context, "Factories-FooProviderType-Dyn");
Properties p = new Properties();
p.put("name", "ok");
@@ -132,8 +156,11 @@
}
}
+ /**
+ * Check inconsistent types.
+ */
public void testDynamicBadType() {
- Factory f = Utils.getFactoryByName(context, "FooProviderType-Dyn");
+ Factory f = Utils.getFactoryByName(context, "Factories-FooProviderType-Dyn");
Properties p = new Properties();
p.put("name", "ok");
@@ -152,8 +179,11 @@
}
}
+ /**
+ * Check good configuration (with overriding).
+ */
public void testDynamicComplete() {
- Factory f = Utils.getFactoryByName(context, "FooProviderType-Dyn2");
+ Factory f = Utils.getFactoryByName(context, "Factories-FooProviderType-Dyn2");
Properties p = new Properties();
p.put("name", "ok");
@@ -172,8 +202,11 @@
}
}
+ /**
+ * Check good configuration.
+ */
public void testDynamicJustEnough() {
- Factory f = Utils.getFactoryByName(context, "FooProviderType-Dyn2");
+ Factory f = Utils.getFactoryByName(context, "Factories-FooProviderType-Dyn2");
Properties p = new Properties();
p.put("name", "ok");
@@ -190,8 +223,11 @@
}
}
+ /**
+ * Check good configuration.
+ */
public void testDynamicMix() {
- Factory f = Utils.getFactoryByName(context, "FooProviderType-Dyn2");
+ Factory f = Utils.getFactoryByName(context, "Factories-FooProviderType-Dyn2");
Properties p = new Properties();
p.put("name", "ok");
@@ -209,8 +245,11 @@
}
}
+ /**
+ * Check uncomplete configuration.
+ */
public void testDynamicUncomplete() {
- Factory f = Utils.getFactoryByName(context, "FooProviderType-Dyn2");
+ Factory f = Utils.getFactoryByName(context, "Factories-FooProviderType-Dyn2");
Properties p = new Properties();
p.put("name", "ok");
@@ -227,8 +266,11 @@
fail("An unacceptable configuration is accepted");
}
+ /**
+ * Check good configuration (more properties).
+ */
public void testDynamicMore() {
- Factory f = Utils.getFactoryByName(context, "FooProviderType-Dyn2");
+ Factory f = Utils.getFactoryByName(context, "Factories-FooProviderType-Dyn2");
Properties p = new Properties();
p.put("name", "ok");
@@ -248,8 +290,11 @@
}
}
+ /**
+ * Check properties affecting services and component.
+ */
public void testDoubleProps() {
- Factory f = Utils.getFactoryByName(context, "FooProviderType-Dyn2");
+ Factory f = Utils.getFactoryByName(context, "Factories-FooProviderType-Dyn2");
Properties p = new Properties();
p.put("name", "ok");
@@ -270,8 +315,11 @@
}
}
+ /**
+ * Check instance name unicity.
+ */
public void testUnicity1() {
- Factory f = Utils.getFactoryByName(context, "FooProviderType-2");
+ Factory f = Utils.getFactoryByName(context, "Factories-FooProviderType-2");
ComponentInstance ci1,ci2, ci3 = null;
try {
@@ -287,8 +335,11 @@
} catch(Exception e) { fail("An acceptable configuration is refused"); }
}
+ /**
+ * Check instance name unicity.
+ */
public void testUnicity2() {
- Factory f = Utils.getFactoryByName(context, "FooProviderType-2");
+ Factory f = Utils.getFactoryByName(context, "Factories-FooProviderType-2");
ComponentInstance ci1,ci2, ci3 = null;
try {
@@ -310,8 +361,11 @@
} catch(Exception e) { fail("An acceptable configuration is refused"); }
}
+ /**
+ * Check instance name unicity.
+ */
public void testUnicity3() {
- Factory f = Utils.getFactoryByName(context, "FooProviderType-2");
+ Factory f = Utils.getFactoryByName(context, "Factories-FooProviderType-2");
ComponentInstance ci1 = null,ci2 = null, ci3 = null;
try {
@@ -334,9 +388,12 @@
fail("An unacceptable configuration is acceptable");
}
+ /**
+ * Check instance name unicity.
+ */
public void testUnicity4() {
- Factory f = Utils.getFactoryByName(context, "FooProviderType-2");
- Factory f2 = Utils.getFactoryByName(context, "FooProviderType-1");
+ Factory f = Utils.getFactoryByName(context, "Factories-FooProviderType-2");
+ Factory f2 = Utils.getFactoryByName(context, "Factories-FooProviderType-1");
ComponentInstance ci1 = null,ci2 = null, ci3 = null;
try {
diff --git a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/service/BarService.java b/ipojo/tests/tests.core.factories/src/main/java/org/apache/felix/ipojo/test/scenarios/factories/service/BarService.java
similarity index 93%
copy from ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/service/BarService.java
copy to ipojo/tests/tests.core.factories/src/main/java/org/apache/felix/ipojo/test/scenarios/factories/service/BarService.java
index 727e845..e29c179 100644
--- a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/service/BarService.java
+++ b/ipojo/tests/tests.core.factories/src/main/java/org/apache/felix/ipojo/test/scenarios/factories/service/BarService.java
@@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
-package org.apache.felix.ipojo.test.scenarios.service;
+package org.apache.felix.ipojo.test.scenarios.factories.service;
import java.util.Properties;
diff --git a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/service/CheckService.java b/ipojo/tests/tests.core.factories/src/main/java/org/apache/felix/ipojo/test/scenarios/factories/service/CheckService.java
similarity index 93%
copy from ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/service/CheckService.java
copy to ipojo/tests/tests.core.factories/src/main/java/org/apache/felix/ipojo/test/scenarios/factories/service/CheckService.java
index 62f254c..3fd1e2f 100644
--- a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/service/CheckService.java
+++ b/ipojo/tests/tests.core.factories/src/main/java/org/apache/felix/ipojo/test/scenarios/factories/service/CheckService.java
@@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
-package org.apache.felix.ipojo.test.scenarios.service;
+package org.apache.felix.ipojo.test.scenarios.factories.service;
import java.util.Properties;
diff --git a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/service/FooService.java b/ipojo/tests/tests.core.factories/src/main/java/org/apache/felix/ipojo/test/scenarios/factories/service/FooService.java
similarity index 93%
copy from ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/service/FooService.java
copy to ipojo/tests/tests.core.factories/src/main/java/org/apache/felix/ipojo/test/scenarios/factories/service/FooService.java
index 78693cf..9ba67c9 100644
--- a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/service/FooService.java
+++ b/ipojo/tests/tests.core.factories/src/main/java/org/apache/felix/ipojo/test/scenarios/factories/service/FooService.java
@@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
-package org.apache.felix.ipojo.test.scenarios.service;
+package org.apache.felix.ipojo.test.scenarios.factories.service;
import java.util.Properties;
diff --git a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/util/Utils.java b/ipojo/tests/tests.core.factories/src/main/java/org/apache/felix/ipojo/test/scenarios/util/Utils.java
similarity index 100%
rename from ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/util/Utils.java
rename to ipojo/tests/tests.core.factories/src/main/java/org/apache/felix/ipojo/test/scenarios/util/Utils.java
diff --git a/ipojo/tests/tests.core.factories/src/main/resources/metadata.xml b/ipojo/tests/tests.core.factories/src/main/resources/metadata.xml
new file mode 100644
index 0000000..2d10ac8
--- /dev/null
+++ b/ipojo/tests/tests.core.factories/src/main/resources/metadata.xml
@@ -0,0 +1,69 @@
+<ipojo>
+ <!-- Simple provider -->
+ <component
+ className="org.apache.felix.ipojo.test.scenarios.component.FooProviderType1"
+ factory="Factories-FooProviderType-1" architecture="true">
+ <provides />
+ </component>
+
+ <!-- Provider providing 2 services -->
+ <component
+ className="org.apache.felix.ipojo.test.scenarios.component.FooBarProviderType1"
+ factory="Factories-FooBarProviderType-1" architecture="true">
+ <provides />
+ </component>
+
+ <!-- Provider with dynamic property -->
+ <component
+ className="org.apache.felix.ipojo.test.scenarios.component.FooProviderTypeDyn"
+ name="Factories-FooProviderType-Dyn" architecture="true">
+ <provides>
+ <property name="int" field="intProp" value="2" />
+ <property name="boolean" field="boolProp" value="false" />
+ <property name="string" field="strProp" value="foo" />
+ <property name="strAProp" field="strAProp"
+ value="{foo, bar}" />
+ <property name="intAProp" field="intAProp" value="{ 1,2,3}" />
+ </provides>
+ </component>
+
+ <component
+ className="org.apache.felix.ipojo.test.scenarios.component.FooProviderType1"
+ name="Factories-FooProviderType-2" architecture="true">
+ <provides>
+ <property name="int" type="int" value="2" />
+ <property name="long" type="long" value="40" />
+ <property name="string" type="java.lang.String" value="foo" />
+ <property name="strAProp" type="java.lang.String[]"
+ value="{foo, bar}" />
+ <property name="intAProp" type="int[]" value="{1,2,3}" />
+ </provides>
+ </component>
+
+ <component
+ className="org.apache.felix.ipojo.test.scenarios.component.FooProviderTypeDyn2"
+ name="Factories-FooProviderType-Dyn2" factory="true" architecture="true">
+ <provides>
+ <property name="int" field="intProp" value="4" />
+ <property name="boolean" field="boolProp" />
+ <property name="string" field="strProp" />
+ <property name="strAProp" field="strAProp" />
+ <property name="intAProp" field="intAProp"
+ value="{1, 2,3 }" />
+ </provides>
+ </component>
+
+ <component
+ className="org.apache.felix.ipojo.test.scenarios.component.FooProviderType1"
+ factory="Factories-FooProviderType-3" architecture="true">
+ <provides>
+ <property name="foo" field="m_foo" />
+ <property name="bar" field="m_bar" />
+ <property name="baz" type="java.lang.String" />
+ </provides>
+ <properties propagation="true">
+ <property name="foo" field="m_foo" />
+ <property name="bar" field="m_bar" />
+ </properties>
+ </component>
+</ipojo>
diff --git a/ipojo/tests/tests.core/pom.xml b/ipojo/tests/tests.core.lifecycle.callback/pom.xml
similarity index 87%
copy from ipojo/tests/tests.core/pom.xml
copy to ipojo/tests/tests.core.lifecycle.callback/pom.xml
index 4795777..ef77750 100644
--- a/ipojo/tests/tests.core/pom.xml
+++ b/ipojo/tests/tests.core.lifecycle.callback/pom.xml
@@ -19,8 +19,8 @@
<project>
<modelVersion>4.0.0</modelVersion>
<packaging>bundle</packaging>
- <name>iPOJO Test Suite</name>
- <artifactId>tests.core</artifactId>
+ <name>iPOJO Lifecycle callback Test Suite</name>
+ <artifactId>tests.core.lifecycle.callback</artifactId>
<groupId>ipojo.tests</groupId>
<version>0.7.6-SNAPSHOT</version>
<dependencies>
@@ -31,11 +31,6 @@
</dependency>
<dependency>
<groupId>org.apache.felix</groupId>
- <artifactId>org.apache.felix.ipojo.composite</artifactId>
- <version>0.7.6-SNAPSHOT</version>
- </dependency>
- <dependency>
- <groupId>org.apache.felix</groupId>
<artifactId>org.apache.felix.ipojo.metadata</artifactId>
<version>0.7.6-SNAPSHOT</version>
</dependency>
@@ -65,7 +60,7 @@
<configuration>
<instructions>
<Export-Package>
- org.apache.felix.ipojo.test.scenarios.service
+ org.apache.felix.ipojo.test.scenarios.lifecycle.callback.service
</Export-Package>
<Bundle-SymbolicName>
${pom.artifactId}
@@ -74,7 +69,7 @@
org.apache.felix.ipojo.test*
</Private-Package>
<Test-Suite>
- org.apache.felix.ipojo.test.IPOJOTestSuite
+ org.apache.felix.ipojo.test.scenarios.lifecycle.callback.LifeCycleCallbackTest
</Test-Suite>
</instructions>
</configuration>
@@ -98,8 +93,8 @@
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
- <source>1.5</source>
- <target>1.5</target>
+ <source>1.4</source>
+ <target>1.4</target>
</configuration>
</plugin>
</plugins>
diff --git a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/component/CallbackCheckService.java b/ipojo/tests/tests.core.lifecycle.callback/src/main/java/org/apache/felix/ipojo/test/scenarios/component/CallbackCheckService.java
similarity index 90%
copy from ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/component/CallbackCheckService.java
copy to ipojo/tests/tests.core.lifecycle.callback/src/main/java/org/apache/felix/ipojo/test/scenarios/component/CallbackCheckService.java
index 76176c8..edffc63 100644
--- a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/component/CallbackCheckService.java
+++ b/ipojo/tests/tests.core.lifecycle.callback/src/main/java/org/apache/felix/ipojo/test/scenarios/component/CallbackCheckService.java
@@ -20,8 +20,8 @@
import java.util.Properties;
-import org.apache.felix.ipojo.test.scenarios.service.CheckService;
-import org.apache.felix.ipojo.test.scenarios.service.FooService;
+import org.apache.felix.ipojo.test.scenarios.lifecycle.callback.service.CheckService;
+import org.apache.felix.ipojo.test.scenarios.lifecycle.callback.service.FooService;
public class CallbackCheckService extends ParentClass implements CheckService {
diff --git a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/component/FooProviderType1.java b/ipojo/tests/tests.core.lifecycle.callback/src/main/java/org/apache/felix/ipojo/test/scenarios/component/FooProviderType1.java
similarity index 92%
copy from ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/component/FooProviderType1.java
copy to ipojo/tests/tests.core.lifecycle.callback/src/main/java/org/apache/felix/ipojo/test/scenarios/component/FooProviderType1.java
index 3fe9bad..d4ad3bf 100644
--- a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/component/FooProviderType1.java
+++ b/ipojo/tests/tests.core.lifecycle.callback/src/main/java/org/apache/felix/ipojo/test/scenarios/component/FooProviderType1.java
@@ -20,7 +20,7 @@
import java.util.Properties;
-import org.apache.felix.ipojo.test.scenarios.service.FooService;
+import org.apache.felix.ipojo.test.scenarios.lifecycle.callback.service.FooService;
import org.osgi.framework.BundleContext;
public class FooProviderType1 implements FooService {
@@ -84,14 +84,6 @@
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; }
diff --git a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/component/ParentClass.java b/ipojo/tests/tests.core.lifecycle.callback/src/main/java/org/apache/felix/ipojo/test/scenarios/component/ParentClass.java
similarity index 100%
copy from ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/component/ParentClass.java
copy to ipojo/tests/tests.core.lifecycle.callback/src/main/java/org/apache/felix/ipojo/test/scenarios/component/ParentClass.java
diff --git a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/lifecycle/CallbackTestCase.java b/ipojo/tests/tests.core.lifecycle.callback/src/main/java/org/apache/felix/ipojo/test/scenarios/lifecycle/callback/CallbackTestCase.java
similarity index 92%
rename from ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/lifecycle/CallbackTestCase.java
rename to ipojo/tests/tests.core.lifecycle.callback/src/main/java/org/apache/felix/ipojo/test/scenarios/lifecycle/callback/CallbackTestCase.java
index 019bec5..6f229e7 100644
--- a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/lifecycle/CallbackTestCase.java
+++ b/ipojo/tests/tests.core.lifecycle.callback/src/main/java/org/apache/felix/ipojo/test/scenarios/lifecycle/callback/CallbackTestCase.java
@@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
-package org.apache.felix.ipojo.test.scenarios.lifecycle;
+package org.apache.felix.ipojo.test.scenarios.lifecycle.callback;
import java.util.Properties;
@@ -24,7 +24,7 @@
import org.apache.felix.ipojo.architecture.Architecture;
import org.apache.felix.ipojo.architecture.InstanceDescription;
import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
-import org.apache.felix.ipojo.test.scenarios.service.CheckService;
+import org.apache.felix.ipojo.test.scenarios.lifecycle.callback.service.CheckService;
import org.apache.felix.ipojo.test.scenarios.util.Utils;
import org.osgi.framework.ServiceReference;
@@ -36,12 +36,12 @@
public void setUp() {
Properties p2 = new Properties();
p2.put("name", "fooProvider");
- fooProvider = Utils.getComponentInstance(context, "FooProviderType-1", p2);
+ fooProvider = Utils.getComponentInstance(context, "LFCB-FooProviderType-1", p2);
fooProvider.stop();
Properties p1 = new Properties();
p1.put("name", "callback");
- instance = Utils.getComponentInstance(context, "CallbackCheckService", p1);
+ instance = Utils.getComponentInstance(context, "LFCB-CallbackCheckService", p1);
}
diff --git a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/lifecycle/ImmediateCallbackSeveralFactoryTest.java b/ipojo/tests/tests.core.lifecycle.callback/src/main/java/org/apache/felix/ipojo/test/scenarios/lifecycle/callback/ImmediateCallbackSeveralFactoryTest.java
similarity index 93%
rename from ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/lifecycle/ImmediateCallbackSeveralFactoryTest.java
rename to ipojo/tests/tests.core.lifecycle.callback/src/main/java/org/apache/felix/ipojo/test/scenarios/lifecycle/callback/ImmediateCallbackSeveralFactoryTest.java
index 19b7df9..0cfd554 100644
--- a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/lifecycle/ImmediateCallbackSeveralFactoryTest.java
+++ b/ipojo/tests/tests.core.lifecycle.callback/src/main/java/org/apache/felix/ipojo/test/scenarios/lifecycle/callback/ImmediateCallbackSeveralFactoryTest.java
@@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
-package org.apache.felix.ipojo.test.scenarios.lifecycle;
+package org.apache.felix.ipojo.test.scenarios.lifecycle.callback;
import java.util.Properties;
@@ -25,7 +25,7 @@
import org.apache.felix.ipojo.architecture.InstanceDescription;
import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
import org.apache.felix.ipojo.test.scenarios.component.CallbackCheckService;
-import org.apache.felix.ipojo.test.scenarios.service.CheckService;
+import org.apache.felix.ipojo.test.scenarios.lifecycle.callback.service.CheckService;
import org.apache.felix.ipojo.test.scenarios.util.Utils;
import org.osgi.framework.ServiceReference;
@@ -37,12 +37,12 @@
public void setUp() {
Properties p2 = new Properties();
p2.put("name", "fooProvider");
- fooProvider = Utils.getComponentInstance(context, "FooProviderType-1", p2);
+ fooProvider = Utils.getComponentInstance(context, "LFCB-FooProviderType-1", p2);
fooProvider.stop();
Properties p1 = new Properties();
p1.put("name", "callback");
- instance = Utils.getComponentInstance(context, "ImmediateCallbackCheckServiceSeveral", p1);
+ instance = Utils.getComponentInstance(context, "LFCB-ImmediateCallbackCheckServiceSeveral", p1);
}
diff --git a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/lifecycle/ImmediateCallbackSingletonFactoryTest.java b/ipojo/tests/tests.core.lifecycle.callback/src/main/java/org/apache/felix/ipojo/test/scenarios/lifecycle/callback/ImmediateCallbackSingletonFactoryTest.java
similarity index 92%
rename from ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/lifecycle/ImmediateCallbackSingletonFactoryTest.java
rename to ipojo/tests/tests.core.lifecycle.callback/src/main/java/org/apache/felix/ipojo/test/scenarios/lifecycle/callback/ImmediateCallbackSingletonFactoryTest.java
index a86911f..310d7ce 100644
--- a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/lifecycle/ImmediateCallbackSingletonFactoryTest.java
+++ b/ipojo/tests/tests.core.lifecycle.callback/src/main/java/org/apache/felix/ipojo/test/scenarios/lifecycle/callback/ImmediateCallbackSingletonFactoryTest.java
@@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
-package org.apache.felix.ipojo.test.scenarios.lifecycle;
+package org.apache.felix.ipojo.test.scenarios.lifecycle.callback;
import java.util.Properties;
@@ -25,7 +25,7 @@
import org.apache.felix.ipojo.architecture.InstanceDescription;
import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
import org.apache.felix.ipojo.test.scenarios.component.CallbackCheckService;
-import org.apache.felix.ipojo.test.scenarios.service.CheckService;
+import org.apache.felix.ipojo.test.scenarios.lifecycle.callback.service.CheckService;
import org.apache.felix.ipojo.test.scenarios.util.Utils;
import org.osgi.framework.ServiceReference;
@@ -37,12 +37,12 @@
public void setUp() {
Properties p2 = new Properties();
p2.put("name", "fooProvider");
- fooProvider = Utils.getComponentInstance(context, "FooProviderType-1", p2);
+ fooProvider = Utils.getComponentInstance(context, "LFCB-FooProviderType-1", p2);
fooProvider.stop();
Properties p1 = new Properties();
p1.put("name", "callback");
- instance = Utils.getComponentInstance(context, "ImmediateCallbackCheckServiceSingleton", p1);
+ instance = Utils.getComponentInstance(context, "LFCB-ImmediateCallbackCheckServiceSingleton", p1);
}
diff --git a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/lifecycle/ImmediateCallbackTest.java b/ipojo/tests/tests.core.lifecycle.callback/src/main/java/org/apache/felix/ipojo/test/scenarios/lifecycle/callback/ImmediateCallbackTest.java
similarity index 92%
rename from ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/lifecycle/ImmediateCallbackTest.java
rename to ipojo/tests/tests.core.lifecycle.callback/src/main/java/org/apache/felix/ipojo/test/scenarios/lifecycle/callback/ImmediateCallbackTest.java
index dad0c1d..a8e1795 100644
--- a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/lifecycle/ImmediateCallbackTest.java
+++ b/ipojo/tests/tests.core.lifecycle.callback/src/main/java/org/apache/felix/ipojo/test/scenarios/lifecycle/callback/ImmediateCallbackTest.java
@@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
-package org.apache.felix.ipojo.test.scenarios.lifecycle;
+package org.apache.felix.ipojo.test.scenarios.lifecycle.callback;
import java.util.Properties;
@@ -24,7 +24,7 @@
import org.apache.felix.ipojo.architecture.Architecture;
import org.apache.felix.ipojo.architecture.InstanceDescription;
import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
-import org.apache.felix.ipojo.test.scenarios.service.CheckService;
+import org.apache.felix.ipojo.test.scenarios.lifecycle.callback.service.CheckService;
import org.apache.felix.ipojo.test.scenarios.util.Utils;
import org.osgi.framework.ServiceReference;
@@ -36,12 +36,12 @@
public void setUp() {
Properties p2 = new Properties();
p2.put("name", "fooProvider");
- fooProvider = Utils.getComponentInstance(context, "FooProviderType-1", p2);
+ fooProvider = Utils.getComponentInstance(context, "LFCB-FooProviderType-1", p2);
fooProvider.stop();
Properties p1 = new Properties();
p1.put("name", "callback");
- instance = Utils.getComponentInstance(context, "ImmediateCallbackCheckService", p1);
+ instance = Utils.getComponentInstance(context, "LFCB-ImmediateCallbackCheckService", p1);
}
diff --git a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/controller/ImmediateLifeCycleControllerTest.java b/ipojo/tests/tests.core.lifecycle.callback/src/main/java/org/apache/felix/ipojo/test/scenarios/lifecycle/callback/ImmediateLifeCycleControllerTest.java
similarity index 91%
copy from ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/controller/ImmediateLifeCycleControllerTest.java
copy to ipojo/tests/tests.core.lifecycle.callback/src/main/java/org/apache/felix/ipojo/test/scenarios/lifecycle/callback/ImmediateLifeCycleControllerTest.java
index c5f5e20..fe53fb4 100644
--- a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/controller/ImmediateLifeCycleControllerTest.java
+++ b/ipojo/tests/tests.core.lifecycle.callback/src/main/java/org/apache/felix/ipojo/test/scenarios/lifecycle/callback/ImmediateLifeCycleControllerTest.java
@@ -16,14 +16,14 @@
* specific language governing permissions and limitations
* under the License.
*/
-package org.apache.felix.ipojo.test.scenarios.controller;
+package org.apache.felix.ipojo.test.scenarios.lifecycle.callback;
import java.util.Properties;
import org.apache.felix.ipojo.ComponentInstance;
import org.apache.felix.ipojo.Factory;
import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
-import org.apache.felix.ipojo.test.scenarios.service.CheckService;
+import org.apache.felix.ipojo.test.scenarios.lifecycle.callback.service.CheckService;
import org.apache.felix.ipojo.test.scenarios.util.Utils;
import org.osgi.framework.ServiceReference;
@@ -33,14 +33,14 @@
private Factory factory;
public void setUp() {
- factory = Utils.getFactoryByName(context, "lcTest2");
+ factory = Utils.getFactoryByName(context, "LFC-Test-Immediate");
}
public void testOne() {
Properties props = new Properties();
props.put("conf", "foo");
props.put("name", "under");
- under = Utils.getComponentInstance(context, "lcTest2", props);
+ under = Utils.getComponentInstance(context, "LFC-Test-Immediate", props);
// The conf is correct, the PS must be provided
ServiceReference ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), "under");
@@ -84,7 +84,7 @@
Properties props = new Properties();
props.put("conf", "bar");
props.put("name", "under");
- under = Utils.getComponentInstance(context, "lcTest2", props);
+ under = Utils.getComponentInstance(context, "LFC-Test-Immediate", props);
assertEquals("check under state", under.getState(), ComponentInstance.INVALID);
diff --git a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/lifecycle/LifeCycleCallbackTest.java b/ipojo/tests/tests.core.lifecycle.callback/src/main/java/org/apache/felix/ipojo/test/scenarios/lifecycle/callback/LifeCycleCallbackTest.java
similarity index 95%
rename from ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/lifecycle/LifeCycleCallbackTest.java
rename to ipojo/tests/tests.core.lifecycle.callback/src/main/java/org/apache/felix/ipojo/test/scenarios/lifecycle/callback/LifeCycleCallbackTest.java
index 69b171a..ed5a6bc 100644
--- a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/lifecycle/LifeCycleCallbackTest.java
+++ b/ipojo/tests/tests.core.lifecycle.callback/src/main/java/org/apache/felix/ipojo/test/scenarios/lifecycle/callback/LifeCycleCallbackTest.java
@@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
-package org.apache.felix.ipojo.test.scenarios.lifecycle;
+package org.apache.felix.ipojo.test.scenarios.lifecycle.callback;
import junit.framework.Test;
import junit.framework.TestSuite;
diff --git a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/lifecycle/ParentCallbackTestCase.java b/ipojo/tests/tests.core.lifecycle.callback/src/main/java/org/apache/felix/ipojo/test/scenarios/lifecycle/callback/ParentCallbackTestCase.java
similarity index 91%
rename from ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/lifecycle/ParentCallbackTestCase.java
rename to ipojo/tests/tests.core.lifecycle.callback/src/main/java/org/apache/felix/ipojo/test/scenarios/lifecycle/callback/ParentCallbackTestCase.java
index 1f4901c..fef421b 100644
--- a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/lifecycle/ParentCallbackTestCase.java
+++ b/ipojo/tests/tests.core.lifecycle.callback/src/main/java/org/apache/felix/ipojo/test/scenarios/lifecycle/callback/ParentCallbackTestCase.java
@@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
-package org.apache.felix.ipojo.test.scenarios.lifecycle;
+package org.apache.felix.ipojo.test.scenarios.lifecycle.callback;
import java.util.Properties;
@@ -24,7 +24,7 @@
import org.apache.felix.ipojo.architecture.Architecture;
import org.apache.felix.ipojo.architecture.InstanceDescription;
import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
-import org.apache.felix.ipojo.test.scenarios.service.CheckService;
+import org.apache.felix.ipojo.test.scenarios.lifecycle.callback.service.CheckService;
import org.apache.felix.ipojo.test.scenarios.util.Utils;
import org.osgi.framework.ServiceReference;
@@ -36,12 +36,12 @@
public void setUp() {
Properties p2 = new Properties();
p2.put("name", "fooProvider");
- fooProvider = Utils.getComponentInstance(context, "FooProviderType-1", p2);
+ fooProvider = Utils.getComponentInstance(context, "LFCB-FooProviderType-1", p2);
fooProvider.stop();
Properties p1 = new Properties();
p1.put("name", "callback");
- instance = Utils.getComponentInstance(context, "ParentCallbackCheckService", p1);
+ instance = Utils.getComponentInstance(context, "LFCB-ParentCallbackCheckService", p1);
}
diff --git a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/service/CheckService.java b/ipojo/tests/tests.core.lifecycle.callback/src/main/java/org/apache/felix/ipojo/test/scenarios/lifecycle/callback/service/CheckService.java
similarity index 92%
copy from ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/service/CheckService.java
copy to ipojo/tests/tests.core.lifecycle.callback/src/main/java/org/apache/felix/ipojo/test/scenarios/lifecycle/callback/service/CheckService.java
index 62f254c..45684ab 100644
--- a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/service/CheckService.java
+++ b/ipojo/tests/tests.core.lifecycle.callback/src/main/java/org/apache/felix/ipojo/test/scenarios/lifecycle/callback/service/CheckService.java
@@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
-package org.apache.felix.ipojo.test.scenarios.service;
+package org.apache.felix.ipojo.test.scenarios.lifecycle.callback.service;
import java.util.Properties;
diff --git a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/service/FooService.java b/ipojo/tests/tests.core.lifecycle.callback/src/main/java/org/apache/felix/ipojo/test/scenarios/lifecycle/callback/service/FooService.java
similarity index 92%
copy from ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/service/FooService.java
copy to ipojo/tests/tests.core.lifecycle.callback/src/main/java/org/apache/felix/ipojo/test/scenarios/lifecycle/callback/service/FooService.java
index 78693cf..b1fdd34 100644
--- a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/service/FooService.java
+++ b/ipojo/tests/tests.core.lifecycle.callback/src/main/java/org/apache/felix/ipojo/test/scenarios/lifecycle/callback/service/FooService.java
@@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
-package org.apache.felix.ipojo.test.scenarios.service;
+package org.apache.felix.ipojo.test.scenarios.lifecycle.callback.service;
import java.util.Properties;
diff --git a/ipojo/tests/tests.core.lifecycle.callback/src/main/java/org/apache/felix/ipojo/test/scenarios/util/Utils.java b/ipojo/tests/tests.core.lifecycle.callback/src/main/java/org/apache/felix/ipojo/test/scenarios/util/Utils.java
new file mode 100644
index 0000000..7dbb8d0
--- /dev/null
+++ b/ipojo/tests/tests.core.lifecycle.callback/src/main/java/org/apache/felix/ipojo/test/scenarios/util/Utils.java
@@ -0,0 +1,325 @@
+/*
+ * 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.util;
+
+import java.util.Dictionary;
+import java.util.Properties;
+
+import junit.framework.Assert;
+
+import org.apache.felix.ipojo.ComponentInstance;
+import org.apache.felix.ipojo.Factory;
+import org.apache.felix.ipojo.Handler;
+import org.apache.felix.ipojo.HandlerFactory;
+import org.apache.felix.ipojo.ServiceContext;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.InvalidSyntaxException;
+import org.osgi.framework.ServiceReference;
+import org.osgi.service.cm.ManagedServiceFactory;
+
+public class Utils {
+
+ public static Factory getFactoryByName(BundleContext bc, String factoryName) {
+ ServiceReference[] refs;
+ try {
+ refs = bc.getServiceReferences(Factory.class.getName(), "(factory.name=" + factoryName + ")");
+ if (refs == null) {
+ System.err.println("Cannot get the factory " + factoryName);
+ return null;
+ }
+ return ((Factory) bc.getService(refs[0]));
+ } catch (InvalidSyntaxException e) {
+ System.err.println("Cannot get the factory " + factoryName + " : " + e.getMessage());
+ return null;
+ }
+ }
+
+ public static HandlerFactory getHandlerFactoryByName(BundleContext bc, String factoryName) {
+ ServiceReference[] refs;
+ try {
+ refs = bc.getServiceReferences(Factory.class.getName(), "(" + Handler.HANDLER_NAME_PROPERTY + "=" + factoryName + ")");
+ if (refs == null) {
+ System.err.println("Cannot get the factory " + factoryName);
+ return null;
+ }
+ return (HandlerFactory) bc.getService(refs[0]);
+ } catch (InvalidSyntaxException e) {
+ System.err.println("Cannot get the factory " + factoryName + " : " + e.getMessage());
+ return null;
+ }
+ }
+
+ public static ComponentInstance getComponentInstance(BundleContext bc, String factoryName, Dictionary configuration) {
+ Factory fact = getFactoryByName(bc, factoryName);
+
+ if (fact == null) {
+ System.err.println("Factory " + factoryName + " not found");
+ return null;
+ }
+
+ // if(fact.isAcceptable(configuration)) {
+ try {
+ return fact.createComponentInstance(configuration);
+ } catch (Exception e) {
+ e.printStackTrace();
+ Assert.fail("Cannot create the instance from " + factoryName + " : " + e.getMessage());
+ return null;
+ }
+ // }
+ // else {
+ // System.err.println("Configuration not accepted by : " + factoryName);
+ // return null;
+ // }
+ }
+
+ public static ComponentInstance getComponentInstanceByName(BundleContext bc, String factoryName, String name) {
+ Factory fact = getFactoryByName(bc, factoryName);
+
+ if (fact == null) {
+ System.err.println("Factory " + factoryName + " not found");
+ return null;
+ }
+
+ try {
+ Properties props = new Properties();
+ props.put("name", name);
+ return fact.createComponentInstance(props);
+ } catch (Exception e) {
+ System.err.println("Cannot create the instance from " + factoryName + " : " + e.getMessage());
+ e.printStackTrace();
+ return null;
+ }
+ }
+
+ public static ServiceReference[] getServiceReferences(BundleContext bc, String itf, String filter) {
+ ServiceReference[] refs = null;
+ try {
+ refs = bc.getServiceReferences(itf, filter);
+ } catch (InvalidSyntaxException e) {
+ System.err.println("Invalid Filter : " + filter);
+ }
+ if (refs == null) {
+ return new ServiceReference[0];
+ } else {
+ return refs;
+ }
+ }
+
+ public static ServiceReference getServiceReference(BundleContext bc, String itf, String filter) {
+ ServiceReference[] refs = null;
+ try {
+ refs = bc.getServiceReferences(itf, filter);
+ } catch (InvalidSyntaxException e) {
+ System.err.println("Invalid Filter : " + filter);
+ }
+ if (refs == null) {
+ return null;
+ } else {
+ return refs[0];
+ }
+ }
+
+ public static ServiceReference getServiceReferenceByName(BundleContext bc, String itf, String name) {
+ ServiceReference[] refs = null;
+ String filter = null;
+ if (itf.equals(Factory.class.getName()) || itf.equals(ManagedServiceFactory.class.getName())) {
+ filter = "(" + "factory.name" + "=" + name + ")";
+ } else {
+ filter = "(" + "instance.name" + "=" + name + ")";
+ }
+ try {
+ refs = bc.getServiceReferences(itf, filter);
+ } catch (InvalidSyntaxException e) {
+ System.err.println("Invalid Filter : " + filter);
+ }
+ if (refs == null) {
+ return null;
+ } else {
+ return refs[0];
+ }
+ }
+
+ public static ServiceReference getServiceReferenceByPID(BundleContext bc, String itf, String pid) {
+ ServiceReference[] refs = null;
+ String filter = "(" + "service.pid" + "=" + pid + ")";
+ try {
+ refs = bc.getServiceReferences(itf, filter);
+ } catch (InvalidSyntaxException e) {
+ System.err.println("Invalid Filter : " + filter);
+ }
+ if (refs == null) {
+ return null;
+ } else if (refs.length == 1) {
+ return refs[0];
+ } else {
+ Assert.fail("A service lookup by PID returned several providers (" + refs.length + ")" + " for " + itf + " with " + pid);
+ return null;
+ }
+ }
+
+ public static Object getServiceObject(BundleContext bc, String itf, String filter) {
+ ServiceReference ref = getServiceReference(bc, itf, filter);
+ if (ref != null) {
+ return bc.getService(ref);
+ } else {
+ return null;
+ }
+ }
+
+ public static Object[] getServiceObjects(BundleContext bc, String itf, String filter) {
+ ServiceReference[] refs = getServiceReferences(bc, itf, filter);
+ if (refs != null) {
+ Object[] list = new Object[refs.length];
+ for (int i = 0; i < refs.length; i++) {
+ list[i] = bc.getService(refs[i]);
+ }
+ return list;
+ } else {
+ return new Object[0];
+ }
+ }
+
+// public static ServiceContext getServiceContext(ComponentInstance ci) {
+// if (ci instanceof CompositeManager) {
+// return ((CompositeManager) ci).getServiceContext();
+// } else {
+// throw new RuntimeException("Cannot get the service context form an non composite instance");
+// }
+// }
+
+ public static Factory getFactoryByName(ServiceContext bc, String factoryName) {
+ ServiceReference[] refs;
+ try {
+ refs = bc.getServiceReferences(Factory.class.getName(), "(factory.name=" + factoryName + ")");
+ if (refs == null) { return null; }
+ return ((Factory) bc.getService(refs[0]));
+ } catch (InvalidSyntaxException e) {
+ System.err.println("Cannot get the factory " + factoryName + " : " + e.getMessage());
+ return null;
+ }
+ }
+
+ public static ComponentInstance getComponentInstance(ServiceContext bc, String factoryName, Dictionary configuration) {
+ Factory fact = getFactoryByName(bc, factoryName);
+
+ if (fact == null) { return null; }
+
+ if (fact.isAcceptable(configuration)) {
+ try {
+ return fact.createComponentInstance(configuration);
+ } catch (Exception e) {
+ System.err.println(e.getMessage());
+ e.printStackTrace();
+ return null;
+ }
+ } else {
+ System.err.println("Configuration not accepted by : " + factoryName);
+ return null;
+ }
+ }
+
+ public static ServiceReference[] getServiceReferences(ServiceContext bc, String itf, String filter) {
+ ServiceReference[] refs = null;
+ try {
+ refs = bc.getServiceReferences(itf, filter);
+ } catch (InvalidSyntaxException e) {
+ System.err.println("Invalid Filter : " + filter);
+ }
+ if (refs == null) {
+ return new ServiceReference[0];
+ } else {
+ return refs;
+ }
+ }
+
+ public static ServiceReference getServiceReference(ServiceContext bc, String itf, String filter) {
+ ServiceReference[] refs = null;
+ try {
+ refs = bc.getServiceReferences(itf, filter);
+ } catch (InvalidSyntaxException e) {
+ System.err.println("Invalid Filter : " + filter);
+ }
+ if (refs == null) {
+ return null;
+ } else {
+ return refs[0];
+ }
+ }
+
+ public static ServiceReference getServiceReferenceByName(ServiceContext bc, String itf, String name) {
+ ServiceReference[] refs = null;
+ String filter = null;
+ if (itf.equals(Factory.class.getName()) || itf.equals(ManagedServiceFactory.class.getName())) {
+ filter = "(" + "factory.name" + "=" + name + ")";
+ } else {
+ filter = "(" + "instance.name" + "=" + name + ")";
+ }
+ try {
+ refs = bc.getServiceReferences(itf, filter);
+ } catch (InvalidSyntaxException e) {
+ System.err.println("Invalid Filter : " + filter);
+ }
+ if (refs == null) {
+ return null;
+ } else {
+ return refs[0];
+ }
+ }
+
+ public static Object getServiceObject(ServiceContext bc, String itf, String filter) {
+ ServiceReference ref = getServiceReference(bc, itf, filter);
+ if (ref != null) {
+ return bc.getService(ref);
+ } else {
+ return null;
+ }
+ }
+
+ public static Object[] getServiceObjects(ServiceContext bc, String itf, String filter) {
+ ServiceReference[] refs = getServiceReferences(bc, itf, filter);
+ if (refs != null) {
+ Object[] list = new Object[refs.length];
+ for (int i = 0; i < refs.length; i++) {
+ list[i] = bc.getService(refs[i]);
+ }
+ return list;
+ } else {
+ return new Object[0];
+ }
+ }
+
+ public static boolean contains(String string, String[] array) {
+ for (int i = 0; array != null && i < array.length; i++) {
+ if (array[i] != null && array[i].equals(string)) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ public static boolean contains(int value, int[] array) {
+ for (int i = 0; array != null && i < array.length; i++) {
+ if (array[i] == value) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+}
diff --git a/ipojo/tests/tests.core.lifecycle.callback/src/main/resources/metadata.xml b/ipojo/tests/tests.core.lifecycle.callback/src/main/resources/metadata.xml
new file mode 100644
index 0000000..c60c239
--- /dev/null
+++ b/ipojo/tests/tests.core.lifecycle.callback/src/main/resources/metadata.xml
@@ -0,0 +1,52 @@
+<ipojo>
+ <component
+ className="org.apache.felix.ipojo.test.scenarios.component.FooProviderType1"
+ factory="LFCB-FooProviderType-1" architecture="true">
+ <provides />
+ </component>
+
+ <!-- Lifecycle Callback -->
+ <component
+ className="org.apache.felix.ipojo.test.scenarios.component.CallbackCheckService"
+ factory="LFCB-CallbackCheckService" architecture="true">
+ <requires field="fs" />
+ <provides />
+ <callback transition="validate" method="start" />
+ <callback transition="invalidate" method="stop" />
+ </component>
+ <component
+ className="org.apache.felix.ipojo.test.scenarios.component.CallbackCheckService"
+ factory="LFCB-ParentCallbackCheckService" architecture="true">
+ <requires field="fs" />
+ <provides />
+ <callback transition="validate" method="parentStart" />
+ <callback transition="invalidate" method="parentStop" />
+ </component>
+ <component
+ className="org.apache.felix.ipojo.test.scenarios.component.CallbackCheckService"
+ immediate="true" factory="LFCB-ImmediateCallbackCheckService"
+ architecture="true">
+ <requires field="fs" />
+ <provides />
+ <callback transition="validate" method="start" />
+ <callback transition="invalidate" method="stop" />
+ </component>
+ <component
+ className="org.apache.felix.ipojo.test.scenarios.component.CallbackCheckService"
+ immediate="true" factory="LFCB-ImmediateCallbackCheckServiceSingleton"
+ factory-method="singleton" architecture="true">
+ <requires field="fs" />
+ <provides />
+ <callback transition="validate" method="start" />
+ <callback transition="invalidate" method="stop" />
+ </component>
+ <component
+ className="org.apache.felix.ipojo.test.scenarios.component.CallbackCheckService"
+ immediate="true" factory="LFCB-ImmediateCallbackCheckServiceSeveral"
+ factory-method="several" architecture="true">
+ <requires field="fs" />
+ <provides />
+ <callback transition="validate" method="start" />
+ <callback transition="invalidate" method="stop" />
+ </component>
+</ipojo>
diff --git a/ipojo/tests/tests.core/pom.xml b/ipojo/tests/tests.core.lifecycle.controller/pom.xml
similarity index 87%
copy from ipojo/tests/tests.core/pom.xml
copy to ipojo/tests/tests.core.lifecycle.controller/pom.xml
index 4795777..386b5e0 100644
--- a/ipojo/tests/tests.core/pom.xml
+++ b/ipojo/tests/tests.core.lifecycle.controller/pom.xml
@@ -19,8 +19,8 @@
<project>
<modelVersion>4.0.0</modelVersion>
<packaging>bundle</packaging>
- <name>iPOJO Test Suite</name>
- <artifactId>tests.core</artifactId>
+ <name>iPOJO Lifecycle controller Test Suite</name>
+ <artifactId>tests.core.lifecycle.controller</artifactId>
<groupId>ipojo.tests</groupId>
<version>0.7.6-SNAPSHOT</version>
<dependencies>
@@ -31,11 +31,6 @@
</dependency>
<dependency>
<groupId>org.apache.felix</groupId>
- <artifactId>org.apache.felix.ipojo.composite</artifactId>
- <version>0.7.6-SNAPSHOT</version>
- </dependency>
- <dependency>
- <groupId>org.apache.felix</groupId>
<artifactId>org.apache.felix.ipojo.metadata</artifactId>
<version>0.7.6-SNAPSHOT</version>
</dependency>
@@ -65,7 +60,7 @@
<configuration>
<instructions>
<Export-Package>
- org.apache.felix.ipojo.test.scenarios.service
+ org.apache.felix.ipojo.test.scenarios.lfc.service
</Export-Package>
<Bundle-SymbolicName>
${pom.artifactId}
@@ -74,7 +69,7 @@
org.apache.felix.ipojo.test*
</Private-Package>
<Test-Suite>
- org.apache.felix.ipojo.test.IPOJOTestSuite
+ org.apache.felix.ipojo.test.scenarios.lfc.LifeCycleControllerTestSuite
</Test-Suite>
</instructions>
</configuration>
@@ -98,8 +93,8 @@
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
- <source>1.5</source>
- <target>1.5</target>
+ <source>1.4</source>
+ <target>1.4</target>
</configuration>
</plugin>
</plugins>
diff --git a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/component/LifecycleControllerTest.java b/ipojo/tests/tests.core.lifecycle.controller/src/main/java/org/apache/felix/ipojo/test/scenarios/component/LifecycleControllerTest.java
similarity index 95%
copy from ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/component/LifecycleControllerTest.java
copy to ipojo/tests/tests.core.lifecycle.controller/src/main/java/org/apache/felix/ipojo/test/scenarios/component/LifecycleControllerTest.java
index c69bad5..9027ed1 100644
--- a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/component/LifecycleControllerTest.java
+++ b/ipojo/tests/tests.core.lifecycle.controller/src/main/java/org/apache/felix/ipojo/test/scenarios/component/LifecycleControllerTest.java
@@ -20,7 +20,7 @@
import java.util.Properties;
-import org.apache.felix.ipojo.test.scenarios.service.CheckService;
+import org.apache.felix.ipojo.test.scenarios.lfc.service.CheckService;
public class LifecycleControllerTest implements CheckService {
diff --git a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/controller/ImmediateLifeCycleControllerTest.java b/ipojo/tests/tests.core.lifecycle.controller/src/main/java/org/apache/felix/ipojo/test/scenarios/lfc/ImmediateLifeCycleControllerTest.java
similarity index 91%
rename from ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/controller/ImmediateLifeCycleControllerTest.java
rename to ipojo/tests/tests.core.lifecycle.controller/src/main/java/org/apache/felix/ipojo/test/scenarios/lfc/ImmediateLifeCycleControllerTest.java
index c5f5e20..9a27445 100644
--- a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/controller/ImmediateLifeCycleControllerTest.java
+++ b/ipojo/tests/tests.core.lifecycle.controller/src/main/java/org/apache/felix/ipojo/test/scenarios/lfc/ImmediateLifeCycleControllerTest.java
@@ -16,14 +16,14 @@
* specific language governing permissions and limitations
* under the License.
*/
-package org.apache.felix.ipojo.test.scenarios.controller;
+package org.apache.felix.ipojo.test.scenarios.lfc;
import java.util.Properties;
import org.apache.felix.ipojo.ComponentInstance;
import org.apache.felix.ipojo.Factory;
import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
-import org.apache.felix.ipojo.test.scenarios.service.CheckService;
+import org.apache.felix.ipojo.test.scenarios.lfc.service.CheckService;
import org.apache.felix.ipojo.test.scenarios.util.Utils;
import org.osgi.framework.ServiceReference;
@@ -33,14 +33,14 @@
private Factory factory;
public void setUp() {
- factory = Utils.getFactoryByName(context, "lcTest2");
+ factory = Utils.getFactoryByName(context, "LFC-Test-Immediate");
}
public void testOne() {
Properties props = new Properties();
props.put("conf", "foo");
props.put("name", "under");
- under = Utils.getComponentInstance(context, "lcTest2", props);
+ under = Utils.getComponentInstance(context, "LFC-Test-Immediate", props);
// The conf is correct, the PS must be provided
ServiceReference ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), "under");
@@ -84,7 +84,7 @@
Properties props = new Properties();
props.put("conf", "bar");
props.put("name", "under");
- under = Utils.getComponentInstance(context, "lcTest2", props);
+ under = Utils.getComponentInstance(context, "LFC-Test-Immediate", props);
assertEquals("check under state", under.getState(), ComponentInstance.INVALID);
diff --git a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/controller/LifeCycleControllerTest.java b/ipojo/tests/tests.core.lifecycle.controller/src/main/java/org/apache/felix/ipojo/test/scenarios/lfc/LifeCycleControllerTest.java
similarity index 93%
rename from ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/controller/LifeCycleControllerTest.java
rename to ipojo/tests/tests.core.lifecycle.controller/src/main/java/org/apache/felix/ipojo/test/scenarios/lfc/LifeCycleControllerTest.java
index d86b997..d9cc88f 100644
--- a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/controller/LifeCycleControllerTest.java
+++ b/ipojo/tests/tests.core.lifecycle.controller/src/main/java/org/apache/felix/ipojo/test/scenarios/lfc/LifeCycleControllerTest.java
@@ -16,14 +16,14 @@
* specific language governing permissions and limitations
* under the License.
*/
-package org.apache.felix.ipojo.test.scenarios.controller;
+package org.apache.felix.ipojo.test.scenarios.lfc;
import java.util.Properties;
import org.apache.felix.ipojo.ComponentInstance;
import org.apache.felix.ipojo.Factory;
import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
-import org.apache.felix.ipojo.test.scenarios.service.CheckService;
+import org.apache.felix.ipojo.test.scenarios.lfc.service.CheckService;
import org.apache.felix.ipojo.test.scenarios.util.Utils;
import org.osgi.framework.ServiceReference;
@@ -38,14 +38,14 @@
private Factory factory;
public void setUp() {
- factory = Utils.getFactoryByName(context, "lcTest");
+ factory = Utils.getFactoryByName(context, "LFC-Test");
}
public void testOne() {
Properties props = new Properties();
props.put("conf", "foo");
props.put("name", "under");
- under = Utils.getComponentInstance(context, "lcTest", props);
+ under = Utils.getComponentInstance(context, "LFC-Test", props);
// The conf is correct, the PS must be provided
ServiceReference ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), "under");
@@ -93,7 +93,7 @@
Properties props = new Properties();
props.put("conf", "bar");
props.put("name", "under");
- under = Utils.getComponentInstance(context, "lcTest", props);
+ under = Utils.getComponentInstance(context, "LFC-Test", props);
// The conf is incorrect, but the test can appears only when the object is created : the PS must be provided
ServiceReference ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), "under");
diff --git a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/controller/LifeCycleControllerTestSuite.java b/ipojo/tests/tests.core.lifecycle.controller/src/main/java/org/apache/felix/ipojo/test/scenarios/lfc/LifeCycleControllerTestSuite.java
similarity index 95%
rename from ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/controller/LifeCycleControllerTestSuite.java
rename to ipojo/tests/tests.core.lifecycle.controller/src/main/java/org/apache/felix/ipojo/test/scenarios/lfc/LifeCycleControllerTestSuite.java
index 423088f..9ed3bd8 100644
--- a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/controller/LifeCycleControllerTestSuite.java
+++ b/ipojo/tests/tests.core.lifecycle.controller/src/main/java/org/apache/felix/ipojo/test/scenarios/lfc/LifeCycleControllerTestSuite.java
@@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
-package org.apache.felix.ipojo.test.scenarios.controller;
+package org.apache.felix.ipojo.test.scenarios.lfc;
import junit.framework.Test;
diff --git a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/service/CheckService.java b/ipojo/tests/tests.core.lifecycle.controller/src/main/java/org/apache/felix/ipojo/test/scenarios/lfc/service/CheckService.java
similarity index 93%
copy from ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/service/CheckService.java
copy to ipojo/tests/tests.core.lifecycle.controller/src/main/java/org/apache/felix/ipojo/test/scenarios/lfc/service/CheckService.java
index 62f254c..3741060 100644
--- a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/service/CheckService.java
+++ b/ipojo/tests/tests.core.lifecycle.controller/src/main/java/org/apache/felix/ipojo/test/scenarios/lfc/service/CheckService.java
@@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
-package org.apache.felix.ipojo.test.scenarios.service;
+package org.apache.felix.ipojo.test.scenarios.lfc.service;
import java.util.Properties;
diff --git a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/util/Utils.java b/ipojo/tests/tests.core.lifecycle.controller/src/main/java/org/apache/felix/ipojo/test/scenarios/util/Utils.java
similarity index 100%
copy from ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/util/Utils.java
copy to ipojo/tests/tests.core.lifecycle.controller/src/main/java/org/apache/felix/ipojo/test/scenarios/util/Utils.java
diff --git a/ipojo/tests/tests.core.lifecycle.controller/src/main/resources/metadata.xml b/ipojo/tests/tests.core.lifecycle.controller/src/main/resources/metadata.xml
new file mode 100644
index 0000000..e7ffacb
--- /dev/null
+++ b/ipojo/tests/tests.core.lifecycle.controller/src/main/resources/metadata.xml
@@ -0,0 +1,21 @@
+<ipojo>
+ <component
+ classname="org.apache.felix.ipojo.test.scenarios.component.LifecycleControllerTest"
+ name="LFC-Test">
+ <provides />
+ <controller field="m_state" />
+ <properties>
+ <property name="conf" field="m_conf" method="setConf" />
+ </properties>
+ </component>
+
+ <component
+ classname="org.apache.felix.ipojo.test.scenarios.component.LifecycleControllerTest"
+ name="LFC-Test-Immediate" immediate="true" architecture="true">
+ <provides />
+ <controller field="m_state" />
+ <properties>
+ <property name="conf" field="m_conf" method="setConf" />
+ </properties>
+ </component>
+</ipojo>
diff --git a/ipojo/tests/tests.core/pom.xml b/ipojo/tests/tests.core.manipulation/pom.xml
similarity index 87%
copy from ipojo/tests/tests.core/pom.xml
copy to ipojo/tests/tests.core.manipulation/pom.xml
index 4795777..6b88d30 100644
--- a/ipojo/tests/tests.core/pom.xml
+++ b/ipojo/tests/tests.core.manipulation/pom.xml
@@ -19,8 +19,8 @@
<project>
<modelVersion>4.0.0</modelVersion>
<packaging>bundle</packaging>
- <name>iPOJO Test Suite</name>
- <artifactId>tests.core</artifactId>
+ <name>iPOJO Manipulation Test Suite</name>
+ <artifactId>tests.core.manipulation</artifactId>
<groupId>ipojo.tests</groupId>
<version>0.7.6-SNAPSHOT</version>
<dependencies>
@@ -31,11 +31,6 @@
</dependency>
<dependency>
<groupId>org.apache.felix</groupId>
- <artifactId>org.apache.felix.ipojo.composite</artifactId>
- <version>0.7.6-SNAPSHOT</version>
- </dependency>
- <dependency>
- <groupId>org.apache.felix</groupId>
<artifactId>org.apache.felix.ipojo.metadata</artifactId>
<version>0.7.6-SNAPSHOT</version>
</dependency>
@@ -65,7 +60,7 @@
<configuration>
<instructions>
<Export-Package>
- org.apache.felix.ipojo.test.scenarios.service
+ org.apache.felix.ipojo.test.scenarios.manipulation.service
</Export-Package>
<Bundle-SymbolicName>
${pom.artifactId}
@@ -74,7 +69,7 @@
org.apache.felix.ipojo.test*
</Private-Package>
<Test-Suite>
- org.apache.felix.ipojo.test.IPOJOTestSuite
+ org.apache.felix.ipojo.test.scenarios.manipulation.ManipulationTestSuite
</Test-Suite>
</instructions>
</configuration>
@@ -98,8 +93,8 @@
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
- <source>1.5</source>
- <target>1.5</target>
+ <source>1.4</source>
+ <target>1.4</target>
</configuration>
</plugin>
</plugins>
diff --git a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/component/A123/Manipulation23Tester.java b/ipojo/tests/tests.core.manipulation/src/main/java/org/apache/felix/ipojo/test/scenarios/component/A123/Manipulation23Tester.java
similarity index 96%
rename from ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/component/A123/Manipulation23Tester.java
rename to ipojo/tests/tests.core.manipulation/src/main/java/org/apache/felix/ipojo/test/scenarios/component/A123/Manipulation23Tester.java
index fe17b96..019980f 100644
--- a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/component/A123/Manipulation23Tester.java
+++ b/ipojo/tests/tests.core.manipulation/src/main/java/org/apache/felix/ipojo/test/scenarios/component/A123/Manipulation23Tester.java
@@ -18,7 +18,7 @@
*/
package org.apache.felix.ipojo.test.scenarios.component.A123;
-import org.apache.felix.ipojo.test.scenarios.service.PrimitiveManipulationTestService;
+import org.apache.felix.ipojo.test.scenarios.manipulation.service.PrimitiveManipulationTestService;
public class Manipulation23Tester implements PrimitiveManipulationTestService {
diff --git a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/component/CheckProviderParentClass.java b/ipojo/tests/tests.core.manipulation/src/main/java/org/apache/felix/ipojo/test/scenarios/component/CheckProviderParentClass.java
similarity index 94%
copy from ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/component/CheckProviderParentClass.java
copy to ipojo/tests/tests.core.manipulation/src/main/java/org/apache/felix/ipojo/test/scenarios/component/CheckProviderParentClass.java
index 675fe41..b7ec87c 100644
--- a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/component/CheckProviderParentClass.java
+++ b/ipojo/tests/tests.core.manipulation/src/main/java/org/apache/felix/ipojo/test/scenarios/component/CheckProviderParentClass.java
@@ -18,7 +18,7 @@
*/
package org.apache.felix.ipojo.test.scenarios.component;
-import org.apache.felix.ipojo.test.scenarios.service.FooService;
+import org.apache.felix.ipojo.test.scenarios.manipulation.service.FooService;
import org.osgi.framework.ServiceReference;
public abstract class CheckProviderParentClass {
diff --git a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/component/CheckServiceProvider.java b/ipojo/tests/tests.core.manipulation/src/main/java/org/apache/felix/ipojo/test/scenarios/component/CheckServiceProvider.java
similarity index 93%
copy from ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/component/CheckServiceProvider.java
copy to ipojo/tests/tests.core.manipulation/src/main/java/org/apache/felix/ipojo/test/scenarios/component/CheckServiceProvider.java
index cd2b927..5164e04 100644
--- a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/component/CheckServiceProvider.java
+++ b/ipojo/tests/tests.core.manipulation/src/main/java/org/apache/felix/ipojo/test/scenarios/component/CheckServiceProvider.java
@@ -20,8 +20,8 @@
import java.util.Properties;
-import org.apache.felix.ipojo.test.scenarios.service.CheckService;
-import org.apache.felix.ipojo.test.scenarios.service.FooService;
+import org.apache.felix.ipojo.test.scenarios.manipulation.service.CheckService;
+import org.apache.felix.ipojo.test.scenarios.manipulation.service.FooService;
import org.osgi.framework.ServiceReference;
public class CheckServiceProvider extends CheckProviderParentClass implements CheckService {
diff --git a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/component/FooBarProviderType1.java b/ipojo/tests/tests.core.manipulation/src/main/java/org/apache/felix/ipojo/test/scenarios/component/FooBarProviderType1.java
similarity index 89%
copy from ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/component/FooBarProviderType1.java
copy to ipojo/tests/tests.core.manipulation/src/main/java/org/apache/felix/ipojo/test/scenarios/component/FooBarProviderType1.java
index 2b739b4..e49ede4 100644
--- a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/component/FooBarProviderType1.java
+++ b/ipojo/tests/tests.core.manipulation/src/main/java/org/apache/felix/ipojo/test/scenarios/component/FooBarProviderType1.java
@@ -20,8 +20,8 @@
import java.util.Properties;
-import org.apache.felix.ipojo.test.scenarios.service.BarService;
-import org.apache.felix.ipojo.test.scenarios.service.FooService;
+import org.apache.felix.ipojo.test.scenarios.manipulation.service.BarService;
+import org.apache.felix.ipojo.test.scenarios.manipulation.service.FooService;
public class FooBarProviderType1 implements FooService, BarService {
diff --git a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/component/FooProviderType1.java b/ipojo/tests/tests.core.manipulation/src/main/java/org/apache/felix/ipojo/test/scenarios/component/FooProviderType1.java
similarity index 97%
copy from ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/component/FooProviderType1.java
copy to ipojo/tests/tests.core.manipulation/src/main/java/org/apache/felix/ipojo/test/scenarios/component/FooProviderType1.java
index 3fe9bad..eec3052 100644
--- a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/component/FooProviderType1.java
+++ b/ipojo/tests/tests.core.manipulation/src/main/java/org/apache/felix/ipojo/test/scenarios/component/FooProviderType1.java
@@ -20,7 +20,7 @@
import java.util.Properties;
-import org.apache.felix.ipojo.test.scenarios.service.FooService;
+import org.apache.felix.ipojo.test.scenarios.manipulation.service.FooService;
import org.osgi.framework.BundleContext;
public class FooProviderType1 implements FooService {
diff --git a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/component/FooProviderTypeDyn.java b/ipojo/tests/tests.core.manipulation/src/main/java/org/apache/felix/ipojo/test/scenarios/component/FooProviderTypeDyn.java
similarity index 95%
copy from ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/component/FooProviderTypeDyn.java
copy to ipojo/tests/tests.core.manipulation/src/main/java/org/apache/felix/ipojo/test/scenarios/component/FooProviderTypeDyn.java
index 39f3918..d5a9c87 100644
--- a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/component/FooProviderTypeDyn.java
+++ b/ipojo/tests/tests.core.manipulation/src/main/java/org/apache/felix/ipojo/test/scenarios/component/FooProviderTypeDyn.java
@@ -20,7 +20,7 @@
import java.util.Properties;
-import org.apache.felix.ipojo.test.scenarios.service.FooService;
+import org.apache.felix.ipojo.test.scenarios.manipulation.service.FooService;
public class FooProviderTypeDyn implements FooService {
diff --git a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/component/Manipulation23Tester.java b/ipojo/tests/tests.core.manipulation/src/main/java/org/apache/felix/ipojo/test/scenarios/component/Manipulation23Tester.java
similarity index 96%
rename from ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/component/Manipulation23Tester.java
rename to ipojo/tests/tests.core.manipulation/src/main/java/org/apache/felix/ipojo/test/scenarios/component/Manipulation23Tester.java
index deff64e..fb273c5 100644
--- a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/component/Manipulation23Tester.java
+++ b/ipojo/tests/tests.core.manipulation/src/main/java/org/apache/felix/ipojo/test/scenarios/component/Manipulation23Tester.java
@@ -18,7 +18,7 @@
*/
package org.apache.felix.ipojo.test.scenarios.component;
-import org.apache.felix.ipojo.test.scenarios.service.PrimitiveManipulationTestService;
+import org.apache.felix.ipojo.test.scenarios.manipulation.service.PrimitiveManipulationTestService;
public class Manipulation23Tester implements PrimitiveManipulationTestService {
diff --git a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/component/MultipleCheckService.java b/ipojo/tests/tests.core.manipulation/src/main/java/org/apache/felix/ipojo/test/scenarios/component/MultipleCheckService.java
similarity index 95%
copy from ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/component/MultipleCheckService.java
copy to ipojo/tests/tests.core.manipulation/src/main/java/org/apache/felix/ipojo/test/scenarios/component/MultipleCheckService.java
index efbc972..79dc2ef 100644
--- a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/component/MultipleCheckService.java
+++ b/ipojo/tests/tests.core.manipulation/src/main/java/org/apache/felix/ipojo/test/scenarios/component/MultipleCheckService.java
@@ -20,8 +20,8 @@
import java.util.Properties;
-import org.apache.felix.ipojo.test.scenarios.service.CheckService;
-import org.apache.felix.ipojo.test.scenarios.service.FooService;
+import org.apache.felix.ipojo.test.scenarios.manipulation.service.CheckService;
+import org.apache.felix.ipojo.test.scenarios.manipulation.service.FooService;
import org.osgi.framework.ServiceReference;
public class MultipleCheckService implements CheckService {
diff --git a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/manipulation/ExceptionTest.java b/ipojo/tests/tests.core.manipulation/src/main/java/org/apache/felix/ipojo/test/scenarios/manipulation/ExceptionTest.java
similarity index 89%
rename from ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/manipulation/ExceptionTest.java
rename to ipojo/tests/tests.core.manipulation/src/main/java/org/apache/felix/ipojo/test/scenarios/manipulation/ExceptionTest.java
index 975e2a6..898e83e 100644
--- a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/manipulation/ExceptionTest.java
+++ b/ipojo/tests/tests.core.manipulation/src/main/java/org/apache/felix/ipojo/test/scenarios/manipulation/ExceptionTest.java
@@ -24,11 +24,14 @@
import org.apache.felix.ipojo.architecture.Architecture;
import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
import org.apache.felix.ipojo.test.scenarios.component.FooProviderType1;
-import org.apache.felix.ipojo.test.scenarios.service.FooService;
+import org.apache.felix.ipojo.test.scenarios.manipulation.service.FooService;
import org.apache.felix.ipojo.test.scenarios.util.Utils;
import org.osgi.framework.InvalidSyntaxException;
import org.osgi.framework.ServiceReference;
+/**
+ * Test execption handling. POJO exception must be propagated.
+ */
public class ExceptionTest extends OSGiTestCase {
private ComponentInstance ci_lazzy;
@@ -38,14 +41,14 @@
private ServiceReference immRef;
public void setUp() {
- String factName = "FooProviderType-1";
+ String factName = "Manipulation-FooProviderType-1";
String compName = "FooProvider-1";
Properties p = new Properties();
p.put("name", compName);
ci_lazzy = Utils.getComponentInstance(context, factName, p);
- String factName2 = "ImmediateFooProviderType";
+ String factName2 = "Manipulation-ImmediateFooProviderType";
String compName2 = "FooProvider-2";
Properties p2 = new Properties();
@@ -66,6 +69,9 @@
}
+ /**
+ * Check that the exception is correctly propagated.
+ */
public void testException() {
ServiceReference[] refs = null;
try {
@@ -82,6 +88,9 @@
}
}
+ /**
+ * Check that the exception is correctly catch by the POJO.
+ */
public void testTry() {
ServiceReference[] refs = null;
try {
diff --git a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/manipulation/GetComponentInstanceTest.java b/ipojo/tests/tests.core.manipulation/src/main/java/org/apache/felix/ipojo/test/scenarios/manipulation/GetComponentInstanceTest.java
similarity index 89%
rename from ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/manipulation/GetComponentInstanceTest.java
rename to ipojo/tests/tests.core.manipulation/src/main/java/org/apache/felix/ipojo/test/scenarios/manipulation/GetComponentInstanceTest.java
index e82a011..6567fad 100644
--- a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/manipulation/GetComponentInstanceTest.java
+++ b/ipojo/tests/tests.core.manipulation/src/main/java/org/apache/felix/ipojo/test/scenarios/manipulation/GetComponentInstanceTest.java
@@ -25,19 +25,26 @@
import org.apache.felix.ipojo.Pojo;
import org.apache.felix.ipojo.architecture.InstanceDescription;
import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
-import org.apache.felix.ipojo.test.scenarios.service.FooService;
+import org.apache.felix.ipojo.test.scenarios.manipulation.service.FooService;
import org.apache.felix.ipojo.test.scenarios.util.Utils;
import org.osgi.framework.InvalidSyntaxException;
import org.osgi.framework.ServiceReference;
+/**
+ * Check the getComponentInstance method on a POJO
+ */
public class GetComponentInstanceTest extends OSGiTestCase {
-
+
+ /**
+ * Check if a pojo can correctly be cast in POJO.
+ * Check the getComponentInstance method.
+ */
public void testGetComponentInstance() {
- String factName = "FooProviderType-1";
+ String factName = "Manipulation-FooProviderType-1";
String compName = "FooProvider-1";
ServiceReference[] refs = null;
- // Get the facotry to create a component instance
+ // Get the factory to create a component instance
Factory fact = Utils.getFactoryByName(context, factName);
assertNotNull("Cannot find the factory FooProvider-1", fact);
diff --git a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/manipulation/ManipulationMetadata.java b/ipojo/tests/tests.core.manipulation/src/main/java/org/apache/felix/ipojo/test/scenarios/manipulation/ManipulationMetadata.java
similarity index 91%
rename from ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/manipulation/ManipulationMetadata.java
rename to ipojo/tests/tests.core.manipulation/src/main/java/org/apache/felix/ipojo/test/scenarios/manipulation/ManipulationMetadata.java
index 69c788e..0276e2f 100644
--- a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/manipulation/ManipulationMetadata.java
+++ b/ipojo/tests/tests.core.manipulation/src/main/java/org/apache/felix/ipojo/test/scenarios/manipulation/ManipulationMetadata.java
@@ -23,28 +23,31 @@
import org.apache.felix.ipojo.parser.ManifestMetadataParser;
import org.apache.felix.ipojo.parser.ParseException;
import org.apache.felix.ipojo.parser.ParseUtils;
-import org.apache.felix.ipojo.test.scenarios.service.BarService;
-import org.apache.felix.ipojo.test.scenarios.service.FooService;
+import org.apache.felix.ipojo.test.scenarios.manipulation.service.BarService;
+import org.apache.felix.ipojo.test.scenarios.manipulation.service.FooService;
+/**
+ * Check manipulation metadata written in the manifest.
+ */
public class ManipulationMetadata extends OSGiTestCase {
public void testGetMetadata() {
String header = (String) context.getBundle().getHeaders().get("iPOJO-Components");
Element elem = null;
try {
- elem = ManifestMetadataParser.parse(header);
+ elem = ManifestMetadataParser.parseHeaderMetadata(header);
} catch (ParseException e) {
fail("Parse Exception when parsing iPOJO-Component");
}
assertNotNull("Check elem not null", elem);
- Element manip = getManipulationForComponent(elem, "FooProviderType-1");
+ Element manip = getManipulationForComponent(elem, "Manipulation-FooProviderType-1");
assertNotNull("Check manipulation metadata not null for " + "FooProviderType-1", manip);
}
public void testInterface() {
- String comp_name = "FooProviderType-1";
+ String comp_name = "Manipulation-FooProviderType-1";
Element manip = getManipulationForComponent(comp_name);
Element[] itf = manip.getElements("Interface");
assertEquals("Check interfaces number", itf.length, 1);
@@ -52,7 +55,7 @@
}
public void testInterfaces() {
- String comp_name = "FooBarProviderType-1";
+ String comp_name = "Manipulation-FooBarProviderType-1";
Element manip = getManipulationForComponent(comp_name);
Element[] itf = manip.getElements("Interface");
assertEquals("Check interfaces number", itf.length, 2);
@@ -61,7 +64,7 @@
}
public void testFields() {
- String comp_name = "FooProviderType-Dyn";
+ String comp_name = "Manipulation-FooProviderType-Dyn";
Element manip = getManipulationForComponent(comp_name);
Element[] fields = manip.getElements("field");
assertEquals("Check field count " + fields.length, fields.length, 5);
@@ -97,7 +100,7 @@
}
public void testPrimitivesFields() {
- String comp_name = "PrimitiveManipulationTester";
+ String comp_name = "Manipulation-PrimitiveManipulationTester";
Element manip = getManipulationForComponent(comp_name);
Element[] fields = manip.getElements("Field");
assertEquals("Check field count", fields.length, 16);
@@ -157,7 +160,7 @@
}
public void testNoArgMethod() {
- String comp_name = "SimpleMultipleCheckServiceProvider";
+ String comp_name = "Manipulation-SimpleMultipleCheckServiceProvider";
Element manip = getManipulationForComponent(comp_name);
Element method = getMethodFromName(manip, "check");
assertFalse("Check no args", method.containsAttribute("arguments"));
@@ -165,7 +168,7 @@
}
public void testOneArgsMethod() {
- String comp_name = "SimpleMultipleCheckServiceProvider";
+ String comp_name = "Manipulation-SimpleMultipleCheckServiceProvider";
Element manip = getManipulationForComponent(comp_name);
Element method = getMethodFromName(manip, "refBind");
assertEquals("Check args", method.getAttribute("arguments"), "{org.osgi.framework.ServiceReference}");
@@ -174,7 +177,7 @@
}
public void testTwoArgsMethod() {
- String comp_name = "SimpleMultipleCheckServiceProvider";
+ String comp_name = "Manipulation-SimpleMultipleCheckServiceProvider";
Element manip = getManipulationForComponent(comp_name);
Element method = getMethodFromName(manip, "doNothing");
assertEquals("Check args", method.getAttribute("arguments"), "{java.lang.Object,java.lang.String}");
@@ -199,13 +202,12 @@
String header = (String) context.getBundle().getHeaders().get("iPOJO-Components");
Element elem = null;
try {
- elem = ManifestMetadataParser.parse(header);
+ elem = ManifestMetadataParser.parseHeaderMetadata(header);
} catch (ParseException e) {
fail("Parse Exception when parsing iPOJO-Component");
}
- assertNotNull("Check elem not null", elem);
-
+ assertNotNull("Check elem not null", elem);
Element manip = getManipulationForComponent(elem, comp_name);
assertNotNull("Check manipulation metadata not null for " + comp_name, manip);
return manip;
diff --git a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/manipulation/ManipulationMetadataAPI.java b/ipojo/tests/tests.core.manipulation/src/main/java/org/apache/felix/ipojo/test/scenarios/manipulation/ManipulationMetadataAPI.java
similarity index 94%
rename from ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/manipulation/ManipulationMetadataAPI.java
rename to ipojo/tests/tests.core.manipulation/src/main/java/org/apache/felix/ipojo/test/scenarios/manipulation/ManipulationMetadataAPI.java
index 598267e..5006f0c 100644
--- a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/manipulation/ManipulationMetadataAPI.java
+++ b/ipojo/tests/tests.core.manipulation/src/main/java/org/apache/felix/ipojo/test/scenarios/manipulation/ManipulationMetadataAPI.java
@@ -25,27 +25,27 @@
import org.apache.felix.ipojo.parser.MethodMetadata;
import org.apache.felix.ipojo.parser.ParseException;
import org.apache.felix.ipojo.parser.PojoMetadata;
-import org.apache.felix.ipojo.test.scenarios.service.BarService;
-import org.apache.felix.ipojo.test.scenarios.service.FooService;
+import org.apache.felix.ipojo.test.scenarios.manipulation.service.BarService;
+import org.apache.felix.ipojo.test.scenarios.manipulation.service.FooService;
public class ManipulationMetadataAPI extends OSGiTestCase {
PojoMetadata FooProviderType1, FooBarProviderType1, FooProviderTypeDyn, PrimitiveManipulationTester, SimpleMultipleCheckServiceProvider;
public void setUp() {
- String comp_name = "FooProviderType-1";
+ String comp_name = "Manipulation-FooProviderType-1";
FooProviderType1 = getManipulationMetadataForComponent(comp_name);
- comp_name = "FooBarProviderType-1";
+ comp_name = "Manipulation-FooBarProviderType-1";
FooBarProviderType1 = getManipulationMetadataForComponent(comp_name);
- comp_name = "FooProviderType-Dyn";
+ comp_name = "Manipulation-FooProviderType-Dyn";
FooProviderTypeDyn = getManipulationMetadataForComponent(comp_name);
- comp_name = "PrimitiveManipulationTester";
+ comp_name = "Manipulation-PrimitiveManipulationTester";
PrimitiveManipulationTester = getManipulationMetadataForComponent(comp_name);
- comp_name = "SimpleMultipleCheckServiceProvider";
+ comp_name = "Manipulation-SimpleMultipleCheckServiceProvider";
SimpleMultipleCheckServiceProvider = getManipulationMetadataForComponent(comp_name);
}
@@ -53,15 +53,15 @@
String header = (String) context.getBundle().getHeaders().get("iPOJO-Components");
Element elem = null;
try {
- elem = ManifestMetadataParser.parse(header);
+ elem = ManifestMetadataParser.parseHeaderMetadata(header);
} catch (ParseException e) {
fail("Parse Exception when parsing iPOJO-Component");
}
assertNotNull("Check elem not null", elem);
- Element manip = getMetadataForComponent(elem, "FooProviderType-1");
- assertNotNull("Check manipulation metadata not null for " + "FooProviderType-1", manip);
+ Element manip = getMetadataForComponent(elem, "Manipulation-FooProviderType-1");
+ assertNotNull("Check manipulation metadata not null for " + "Manipulation-FooProviderType-1", manip);
PojoMetadata mm = new PojoMetadata(manip);
assertNotNull("Check mm not null", mm);
}
@@ -263,7 +263,7 @@
String header = (String) context.getBundle().getHeaders().get("iPOJO-Components");
Element elem = null;
try {
- elem = ManifestMetadataParser.parse(header);
+ elem = ManifestMetadataParser.parseHeaderMetadata(header);
} catch (ParseException e) {
fail("Parse Exception when parsing iPOJO-Component");
}
diff --git a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/manipulation/ManipulationTestSuite.java b/ipojo/tests/tests.core.manipulation/src/main/java/org/apache/felix/ipojo/test/scenarios/manipulation/ManipulationTestSuite.java
similarity index 96%
rename from ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/manipulation/ManipulationTestSuite.java
rename to ipojo/tests/tests.core.manipulation/src/main/java/org/apache/felix/ipojo/test/scenarios/manipulation/ManipulationTestSuite.java
index 7bae413..ef634e0 100644
--- a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/manipulation/ManipulationTestSuite.java
+++ b/ipojo/tests/tests.core.manipulation/src/main/java/org/apache/felix/ipojo/test/scenarios/manipulation/ManipulationTestSuite.java
@@ -33,6 +33,7 @@
ots.addTestSuite(GetComponentInstanceTest.class);
ots.addTestSuite(ManipulationMetadataAPI.class);
ots.addTestSuite(ExceptionTest.class);
+ ots.addTestSuite(POJOCreation.class);
return ots;
}
diff --git a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/core/POJOCreation.java b/ipojo/tests/tests.core.manipulation/src/main/java/org/apache/felix/ipojo/test/scenarios/manipulation/POJOCreation.java
similarity index 91%
rename from ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/core/POJOCreation.java
rename to ipojo/tests/tests.core.manipulation/src/main/java/org/apache/felix/ipojo/test/scenarios/manipulation/POJOCreation.java
index 7c76bbf..1a7766d 100644
--- a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/core/POJOCreation.java
+++ b/ipojo/tests/tests.core.manipulation/src/main/java/org/apache/felix/ipojo/test/scenarios/manipulation/POJOCreation.java
@@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
-package org.apache.felix.ipojo.test.scenarios.core;
+package org.apache.felix.ipojo.test.scenarios.manipulation;
import java.util.Properties;
@@ -24,11 +24,14 @@
import org.apache.felix.ipojo.architecture.Architecture;
import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
import org.apache.felix.ipojo.test.scenarios.component.FooProviderType1;
-import org.apache.felix.ipojo.test.scenarios.service.FooService;
+import org.apache.felix.ipojo.test.scenarios.manipulation.service.FooService;
import org.apache.felix.ipojo.test.scenarios.util.Utils;
import org.osgi.framework.InvalidSyntaxException;
import org.osgi.framework.ServiceReference;
+/**
+ * Check the different method to create POJO object.
+ */
public class POJOCreation extends OSGiTestCase {
private ComponentInstance ci_lazzy;
@@ -56,43 +59,43 @@
private Architecture lazzyArchSevM;
public void setUp() {
- String factName = "FooProviderType-1";
+ String factName = "Manipulation-FooProviderType-1";
String compName = "FooProvider-1";
Properties p = new Properties();
p.put("name", compName);
ci_lazzy = Utils.getComponentInstance(context, factName ,p);
- String factName2 = "ImmediateFooProviderType";
+ String factName2 = "Manipulation-ImmediateFooProviderType";
String compName2 = "FooProvider-2";
Properties p2 = new Properties();
p2.put("name", compName2);
ci_immediate = Utils.getComponentInstance(context, factName2, p2);
- String factName3 = "ImmediateFooProviderTypeSingleton";
+ String factName3 = "Manipulation-ImmediateFooProviderTypeSingleton";
String compName3 = "FooProvider-3";
Properties p3 = new Properties();
p3.put("name", compName3);
ci_immediate_singleton = Utils.getComponentInstance(context, factName3, p3);
- String factName4 = "FooProviderType-1-Sing";
+ String factName4 = "Manipulation-FooProviderType-1-Sing";
String compName4 = "FooProvider-1-Sing";
Properties p4 = new Properties();
p4.put("name", compName4);
ci_lazzy_sing = Utils.getComponentInstance(context, factName4 ,p4);
- String factName5 = "FooProviderType-1-Sev";
+ String factName5 = "Manipulation-FooProviderType-1-Sev";
String compName5 = "FooProvider-1-Sev";
Properties p5 = new Properties();
p5.put("name", compName5);
ci_lazzy_sev = Utils.getComponentInstance(context, factName5 ,p5);
- String factName6 = "FooProviderType-1-SingM";
+ String factName6 = "Manipulation-FooProviderType-1-SingM";
String compName6 = "FooProvider-1-SingM";
Properties p6 = new Properties();
p6.put("name", compName6);
ci_lazzy_singM = Utils.getComponentInstance(context, factName6 ,p6);
- String factName7 = "FooProviderType-1-SevM";
+ String factName7 = "Manipulation-FooProviderType-1-SevM";
String compName7 = "FooProvider-1-SevM";
Properties p7 = new Properties();
p7.put("name", compName7);
@@ -139,6 +142,9 @@
ci_lazzy_sevM.dispose();
}
+ /**
+ * Check lazy creation.
+ */
public void testLazyCreation() {
assertEquals("Check that no objects are created ", 0, lazzyArch.getInstanceDescription().getCreatedObjects().length);
ServiceReference[] refs = null;
@@ -152,6 +158,9 @@
context.ungetService(refs[0]);
}
+ /**
+ * Check lazy and singleton creation.
+ */
public void testLazyCreationSingleton() {
assertEquals("Check that no objects are created ", 0, lazzyArchSing.getInstanceDescription().getCreatedObjects().length);
ServiceReference[] refs = null;
@@ -165,6 +174,9 @@
context.ungetService(refs[0]);
}
+ /**
+ * Check lazy and "several" creation.
+ */
public void testLazyCreationSeveral() {
assertEquals("Check that no objects are created ", 0, lazzyArchSev.getInstanceDescription().getCreatedObjects().length);
ServiceReference[] refs = null;
@@ -180,6 +192,9 @@
context.ungetService(refs[0]);
}
+ /**
+ * Check immediate creation.
+ */
public void testImmediateCreation() {
assertEquals("Check that one object is created ", 1, immeArch.getInstanceDescription().getCreatedObjects().length);
ServiceReference[] refs = null;
@@ -193,6 +208,9 @@
context.ungetService(refs[0]);
}
+ /**
+ * Check bundle context injection.
+ */
public void testBundleContext() {
ServiceReference[] refs = null;
try {
@@ -206,6 +224,9 @@
context.ungetService(refs[0]);
}
+ /**
+ * Test immediate singleton creation.
+ */
public void testImmediateSingletonCreation() {
assertEquals("Check that one object is created ", 1, immeArchSing.getInstanceDescription().getCreatedObjects().length);
ServiceReference[] refs = null;
@@ -219,6 +240,10 @@
context.ungetService(refs[0]);
}
+ /**
+ * Check creation through a factory method.
+ * (lazy & singleton creation)
+ */
public void testLazyCreationSingletonM() {
assertEquals("Check that no objects are created ", 0, lazzyArchSingM.getInstanceDescription().getCreatedObjects().length);
ServiceReference[] refs = null;
@@ -234,6 +259,10 @@
context.ungetService(refs[0]);
}
+ /**
+ * Check creation through a factory method.
+ * (lazy & several creation)
+ */
public void testLazyCreationSeveralM() {
assertEquals("Check that no objects are created ", 0, lazzyArchSevM.getInstanceDescription().getCreatedObjects().length);
ServiceReference[] refs = null;
@@ -251,6 +280,10 @@
context.ungetService(refs[0]);
}
+ /**
+ * Test a custom constructor.
+ * Not manipulated.
+ */
public void testCustomConstuctor() {
FooService fs = new FooProviderType1(0, "foo", context);
Properties props = fs.fooProps();
diff --git a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/manipulation/PrimitiveTypeTest.java b/ipojo/tests/tests.core.manipulation/src/main/java/org/apache/felix/ipojo/test/scenarios/manipulation/PrimitiveTypeTest.java
similarity index 91%
rename from ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/manipulation/PrimitiveTypeTest.java
rename to ipojo/tests/tests.core.manipulation/src/main/java/org/apache/felix/ipojo/test/scenarios/manipulation/PrimitiveTypeTest.java
index defd46e..b1c22ee 100644
--- a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/manipulation/PrimitiveTypeTest.java
+++ b/ipojo/tests/tests.core.manipulation/src/main/java/org/apache/felix/ipojo/test/scenarios/manipulation/PrimitiveTypeTest.java
@@ -22,10 +22,13 @@
import org.apache.felix.ipojo.ComponentInstance;
import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
-import org.apache.felix.ipojo.test.scenarios.service.PrimitiveManipulationTestService;
+import org.apache.felix.ipojo.test.scenarios.manipulation.service.PrimitiveManipulationTestService;
import org.apache.felix.ipojo.test.scenarios.util.Utils;
import org.osgi.framework.ServiceReference;
+/**
+ * Check the manipulation of primitive type (boxed and unboxed).
+ */
public class PrimitiveTypeTest extends OSGiTestCase {
ComponentInstance instance; // Instance under test
@@ -35,7 +38,7 @@
public void setUp() {
Properties p1 = new Properties();
p1.put("name", "primitives");
- instance = Utils.getComponentInstance(context, "PrimitiveManipulationTester", p1);
+ instance = Utils.getComponentInstance(context, "Manipulation-PrimitiveManipulationTester", p1);
assertTrue("check instance state", instance.getState() == ComponentInstance.VALID);
prim_ref = Utils.getServiceReferenceByName(context, PrimitiveManipulationTestService.class.getName(), instance.getInstanceName());
assertNotNull("Check prim availability", prim_ref);
diff --git a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/manipulation/PrimitiveTypeTest2.java b/ipojo/tests/tests.core.manipulation/src/main/java/org/apache/felix/ipojo/test/scenarios/manipulation/PrimitiveTypeTest2.java
similarity index 80%
rename from ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/manipulation/PrimitiveTypeTest2.java
rename to ipojo/tests/tests.core.manipulation/src/main/java/org/apache/felix/ipojo/test/scenarios/manipulation/PrimitiveTypeTest2.java
index a3e7dd3..d69a1fc 100644
--- a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/manipulation/PrimitiveTypeTest2.java
+++ b/ipojo/tests/tests.core.manipulation/src/main/java/org/apache/felix/ipojo/test/scenarios/manipulation/PrimitiveTypeTest2.java
@@ -22,10 +22,14 @@
import org.apache.felix.ipojo.ComponentInstance;
import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
-import org.apache.felix.ipojo.test.scenarios.service.PrimitiveManipulationTestService;
+import org.apache.felix.ipojo.test.scenarios.manipulation.service.PrimitiveManipulationTestService;
import org.apache.felix.ipojo.test.scenarios.util.Utils;
import org.osgi.framework.ServiceReference;
+/**
+ * Check the manipulation of primitive type (boxed and unboxed).
+ * The targeted implementation contains numbers.
+ */
public class PrimitiveTypeTest2 extends OSGiTestCase {
ComponentInstance instance; // Instance under test
@@ -37,7 +41,7 @@
public void setUp() {
Properties p1 = new Properties();
p1.put("name", "primitives");
- instance = Utils.getComponentInstance(context, "PrimitiveManipulationTesterA", p1);
+ instance = Utils.getComponentInstance(context, "Manipulation-PrimitiveManipulationTesterA", p1);
assertTrue("check instance state", instance.getState() == ComponentInstance.VALID);
prim_ref = Utils.getServiceReferenceByName(context, PrimitiveManipulationTestService.class.getName(), instance.getInstanceName());
assertNotNull("Check prim availability", prim_ref);
@@ -81,19 +85,20 @@
assertEquals("Check - 2", prim.getLong(), 2);
}
- public void testLongFromObject() {
- assertEquals("Check - 1", prim.getLong(), 1);
- Long l = new Long(2);
- prim.setLong(l);
- assertEquals("Check - 2", prim.getLong(), 2);
- }
-
- public void testLongFromObject2() {
- assertEquals("Check - 1", prim.getLong(), 1);
- Long l = new Long(2);
- prim.setLong(l, "ss");
- assertEquals("Check - 2", prim.getLong(), 2);
- }
+ //TODO : how to tests these two Java 5 methods ...
+// public void testLongFromObject() {
+// assertEquals("Check - 1", prim.getLong(), 1);
+// Long l = new Long(2);
+// prim.setLong(l);
+// assertEquals("Check - 2", prim.getLong(), 2);
+// }
+//
+// public void testLongFromObject2() {
+// assertEquals("Check - 1", prim.getLong(), 1);
+// Long l = new Long(2);
+// prim.setLong(l, "ss");
+// assertEquals("Check - 2", prim.getLong(), 2);
+// }
public void testFloat() {
assertEquals("Check - 1", prim.getFloat(), 1.1f);
diff --git a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/service/A123/CheckService2.java b/ipojo/tests/tests.core.manipulation/src/main/java/org/apache/felix/ipojo/test/scenarios/manipulation/service/A123/CheckService2.java
similarity index 91%
rename from ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/service/A123/CheckService2.java
rename to ipojo/tests/tests.core.manipulation/src/main/java/org/apache/felix/ipojo/test/scenarios/manipulation/service/A123/CheckService2.java
index 6b0aafc..5f5b74b 100644
--- a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/service/A123/CheckService2.java
+++ b/ipojo/tests/tests.core.manipulation/src/main/java/org/apache/felix/ipojo/test/scenarios/manipulation/service/A123/CheckService2.java
@@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
-package org.apache.felix.ipojo.test.scenarios.service.A123;
+package org.apache.felix.ipojo.test.scenarios.manipulation.service.A123;
public interface CheckService2 {
diff --git a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/service/BarService.java b/ipojo/tests/tests.core.manipulation/src/main/java/org/apache/felix/ipojo/test/scenarios/manipulation/service/BarService.java
similarity index 92%
copy from ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/service/BarService.java
copy to ipojo/tests/tests.core.manipulation/src/main/java/org/apache/felix/ipojo/test/scenarios/manipulation/service/BarService.java
index 727e845..dfe2b9c 100644
--- a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/service/BarService.java
+++ b/ipojo/tests/tests.core.manipulation/src/main/java/org/apache/felix/ipojo/test/scenarios/manipulation/service/BarService.java
@@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
-package org.apache.felix.ipojo.test.scenarios.service;
+package org.apache.felix.ipojo.test.scenarios.manipulation.service;
import java.util.Properties;
diff --git a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/service/CheckService.java b/ipojo/tests/tests.core.manipulation/src/main/java/org/apache/felix/ipojo/test/scenarios/manipulation/service/CheckService.java
similarity index 93%
copy from ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/service/CheckService.java
copy to ipojo/tests/tests.core.manipulation/src/main/java/org/apache/felix/ipojo/test/scenarios/manipulation/service/CheckService.java
index 62f254c..ef7e1ee 100644
--- a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/service/CheckService.java
+++ b/ipojo/tests/tests.core.manipulation/src/main/java/org/apache/felix/ipojo/test/scenarios/manipulation/service/CheckService.java
@@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
-package org.apache.felix.ipojo.test.scenarios.service;
+package org.apache.felix.ipojo.test.scenarios.manipulation.service;
import java.util.Properties;
diff --git a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/service/FooService.java b/ipojo/tests/tests.core.manipulation/src/main/java/org/apache/felix/ipojo/test/scenarios/manipulation/service/FooService.java
similarity index 93%
copy from ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/service/FooService.java
copy to ipojo/tests/tests.core.manipulation/src/main/java/org/apache/felix/ipojo/test/scenarios/manipulation/service/FooService.java
index 78693cf..f1e8dc0 100644
--- a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/service/FooService.java
+++ b/ipojo/tests/tests.core.manipulation/src/main/java/org/apache/felix/ipojo/test/scenarios/manipulation/service/FooService.java
@@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
-package org.apache.felix.ipojo.test.scenarios.service;
+package org.apache.felix.ipojo.test.scenarios.manipulation.service;
import java.util.Properties;
diff --git a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/service/PrimitiveManipulationTestService.java b/ipojo/tests/tests.core.manipulation/src/main/java/org/apache/felix/ipojo/test/scenarios/manipulation/service/PrimitiveManipulationTestService.java
similarity index 95%
rename from ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/service/PrimitiveManipulationTestService.java
rename to ipojo/tests/tests.core.manipulation/src/main/java/org/apache/felix/ipojo/test/scenarios/manipulation/service/PrimitiveManipulationTestService.java
index d87118b..cd61e3b 100644
--- a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/service/PrimitiveManipulationTestService.java
+++ b/ipojo/tests/tests.core.manipulation/src/main/java/org/apache/felix/ipojo/test/scenarios/manipulation/service/PrimitiveManipulationTestService.java
@@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
-package org.apache.felix.ipojo.test.scenarios.service;
+package org.apache.felix.ipojo.test.scenarios.manipulation.service;
public interface PrimitiveManipulationTestService {
diff --git a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/util/Utils.java b/ipojo/tests/tests.core.manipulation/src/main/java/org/apache/felix/ipojo/test/scenarios/util/Utils.java
similarity index 100%
copy from ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/util/Utils.java
copy to ipojo/tests/tests.core.manipulation/src/main/java/org/apache/felix/ipojo/test/scenarios/util/Utils.java
diff --git a/ipojo/tests/tests.core.manipulation/src/main/resources/metadata.xml b/ipojo/tests/tests.core.manipulation/src/main/resources/metadata.xml
new file mode 100644
index 0000000..9f386f3
--- /dev/null
+++ b/ipojo/tests/tests.core.manipulation/src/main/resources/metadata.xml
@@ -0,0 +1,94 @@
+<ipojo>
+ <!-- Simple provider used for manipulation analysis -->
+ <component
+ className="org.apache.felix.ipojo.test.scenarios.component.FooProviderType1"
+ factory="Manipulation-FooProviderType-1" architecture="true">
+ <provides />
+ </component>
+
+ <!-- Non lazzy service provider, to check instantiation -->
+ <component
+ className="org.apache.felix.ipojo.test.scenarios.component.FooProviderType1"
+ factory="Manipulation-ImmediateFooProviderType" immediate="true"
+ architecture="true">
+ <provides />
+ </component>
+
+ <!-- Provider providing 2 services -->
+ <component
+ className="org.apache.felix.ipojo.test.scenarios.component.FooBarProviderType1"
+ factory="Manipulation-FooBarProviderType-1" architecture="true">
+ <provides />
+ </component>
+
+ <!-- Provider with dynamic property -->
+ <component
+ className="org.apache.felix.ipojo.test.scenarios.component.FooProviderTypeDyn"
+ name="Manipulation-FooProviderType-Dyn" architecture="true">
+ <provides>
+ <property name="int" field="intProp" value="2" />
+ <property name="boolean" field="boolProp" value="false" />
+ <property name="string" field="strProp" value="foo" />
+ <property name="strAProp" field="strAProp"
+ value="{foo, bar}" />
+ <property name="intAProp" field="intAProp" value="{ 1,2,3}" />
+ </provides>
+ </component>
+
+ <!-- Manipulation -->
+ <component
+ className="org.apache.felix.ipojo.test.scenarios.component.Manipulation23Tester"
+ factory="Manipulation-PrimitiveManipulationTester" architecture="true">
+ <provides />
+ </component>
+
+ <!-- Manipulation with numbers -->
+ <component
+ className="org.apache.felix.ipojo.test.scenarios.component.A123.Manipulation23Tester"
+ factory="Manipulation-PrimitiveManipulationTesterA" architecture="true">
+ <provides />
+ </component>
+
+ <component
+ className="org.apache.felix.ipojo.test.scenarios.component.MultipleCheckService"
+ factory="Manipulation-SimpleMultipleCheckServiceProvider" architecture="true">
+ <requires field="fs" />
+ <provides />
+ </component>
+
+ <!-- Type checking different creation policy -->
+ <component
+ className="org.apache.felix.ipojo.test.scenarios.component.FooProviderType1"
+ factory="Manipulation-FooProviderType-1-Sing" factory-method="singleton"
+ architecture="true">
+ <provides />
+ </component>
+
+ <component
+ className="org.apache.felix.ipojo.test.scenarios.component.FooProviderType1"
+ factory="Manipulation-FooProviderType-1-Sev" factory-method="several"
+ architecture="true">
+ <provides />
+ </component>
+
+ <component
+ className="org.apache.felix.ipojo.test.scenarios.component.FooProviderType1"
+ factory="Manipulation-FooProviderType-1-SingM" factory-method="singleton"
+ architecture="true">
+ <provides factory="method" />
+ </component>
+
+ <component
+ className="org.apache.felix.ipojo.test.scenarios.component.FooProviderType1"
+ factory="Manipulation-FooProviderType-1-SevM" factory-method="several"
+ architecture="true">
+ <provides factory="method" />
+ </component>
+
+ <component
+ className="org.apache.felix.ipojo.test.scenarios.component.FooProviderType1"
+ factory="Manipulation-ImmediateFooProviderTypeSingleton" immediate="true"
+ factory-method="singleton" architecture="true">
+ <provides />
+ </component>
+</ipojo>
diff --git a/ipojo/tests/tests.core/pom.xml b/ipojo/tests/tests.core.service.dependency/pom.xml
similarity index 87%
copy from ipojo/tests/tests.core/pom.xml
copy to ipojo/tests/tests.core.service.dependency/pom.xml
index 4795777..b4abb5e 100644
--- a/ipojo/tests/tests.core/pom.xml
+++ b/ipojo/tests/tests.core.service.dependency/pom.xml
@@ -19,8 +19,8 @@
<project>
<modelVersion>4.0.0</modelVersion>
<packaging>bundle</packaging>
- <name>iPOJO Test Suite</name>
- <artifactId>tests.core</artifactId>
+ <name>iPOJO Service Dependency Test Suite</name>
+ <artifactId>tests.core.service.dependency</artifactId>
<groupId>ipojo.tests</groupId>
<version>0.7.6-SNAPSHOT</version>
<dependencies>
@@ -31,11 +31,6 @@
</dependency>
<dependency>
<groupId>org.apache.felix</groupId>
- <artifactId>org.apache.felix.ipojo.composite</artifactId>
- <version>0.7.6-SNAPSHOT</version>
- </dependency>
- <dependency>
- <groupId>org.apache.felix</groupId>
<artifactId>org.apache.felix.ipojo.metadata</artifactId>
<version>0.7.6-SNAPSHOT</version>
</dependency>
@@ -65,7 +60,7 @@
<configuration>
<instructions>
<Export-Package>
- org.apache.felix.ipojo.test.scenarios.service
+ org.apache.felix.ipojo.test.scenarios.service.dependency.service
</Export-Package>
<Bundle-SymbolicName>
${pom.artifactId}
@@ -74,7 +69,7 @@
org.apache.felix.ipojo.test*
</Private-Package>
<Test-Suite>
- org.apache.felix.ipojo.test.IPOJOTestSuite
+ org.apache.felix.ipojo.test.scenarios.service.dependency.DependencyTestSuite
</Test-Suite>
</instructions>
</configuration>
@@ -98,8 +93,8 @@
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
- <source>1.5</source>
- <target>1.5</target>
+ <source>1.4</source>
+ <target>1.4</target>
</configuration>
</plugin>
</plugins>
diff --git a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/component/CheckProviderParentClass.java b/ipojo/tests/tests.core.service.dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/component/CheckProviderParentClass.java
similarity index 94%
copy from ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/component/CheckProviderParentClass.java
copy to ipojo/tests/tests.core.service.dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/component/CheckProviderParentClass.java
index 675fe41..72050c3 100644
--- a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/component/CheckProviderParentClass.java
+++ b/ipojo/tests/tests.core.service.dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/component/CheckProviderParentClass.java
@@ -18,7 +18,7 @@
*/
package org.apache.felix.ipojo.test.scenarios.component;
-import org.apache.felix.ipojo.test.scenarios.service.FooService;
+import org.apache.felix.ipojo.test.scenarios.service.dependency.service.FooService;
import org.osgi.framework.ServiceReference;
public abstract class CheckProviderParentClass {
diff --git a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/component/CheckServiceProvider.java b/ipojo/tests/tests.core.service.dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/component/CheckServiceProvider.java
similarity index 93%
copy from ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/component/CheckServiceProvider.java
copy to ipojo/tests/tests.core.service.dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/component/CheckServiceProvider.java
index cd2b927..5ef4d3f 100644
--- a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/component/CheckServiceProvider.java
+++ b/ipojo/tests/tests.core.service.dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/component/CheckServiceProvider.java
@@ -20,8 +20,8 @@
import java.util.Properties;
-import org.apache.felix.ipojo.test.scenarios.service.CheckService;
-import org.apache.felix.ipojo.test.scenarios.service.FooService;
+import org.apache.felix.ipojo.test.scenarios.service.dependency.service.CheckService;
+import org.apache.felix.ipojo.test.scenarios.service.dependency.service.FooService;
import org.osgi.framework.ServiceReference;
public class CheckServiceProvider extends CheckProviderParentClass implements CheckService {
diff --git a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/component/CheckServiceProvider.java b/ipojo/tests/tests.core.service.dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/component/DynCheckServiceProvider.java
similarity index 83%
copy from ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/component/CheckServiceProvider.java
copy to ipojo/tests/tests.core.service.dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/component/DynCheckServiceProvider.java
index cd2b927..151b6dd 100644
--- a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/component/CheckServiceProvider.java
+++ b/ipojo/tests/tests.core.service.dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/component/DynCheckServiceProvider.java
@@ -20,11 +20,11 @@
import java.util.Properties;
-import org.apache.felix.ipojo.test.scenarios.service.CheckService;
-import org.apache.felix.ipojo.test.scenarios.service.FooService;
+import org.apache.felix.ipojo.test.scenarios.service.dependency.service.CheckService;
+import org.apache.felix.ipojo.test.scenarios.service.dependency.service.FooService;
import org.osgi.framework.ServiceReference;
-public class CheckServiceProvider extends CheckProviderParentClass implements CheckService {
+public class DynCheckServiceProvider extends CheckProviderParentClass implements CheckService {
FooService fs;
@@ -48,11 +48,7 @@
props.put("refU", new Integer(refU));
props.put("bothU", new Integer(bothU));
if (fs != null) {
- props.put("result", new Boolean(fs.foo()));
- props.put("boolean", new Boolean(fs.getBoolean()));
props.put("int", new Integer(fs.getInt()));
- props.put("long", new Long(fs.getLong()));
- props.put("double", new Double(fs.getDouble()));
if(fs.getObject() != null) { props.put("object", fs.getObject()); }
}
props.put("static", CheckService.foo);
diff --git a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/component/FilterCheckProvider.java b/ipojo/tests/tests.core.service.dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/component/FilterCheckProvider.java
similarity index 92%
rename from ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/component/FilterCheckProvider.java
rename to ipojo/tests/tests.core.service.dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/component/FilterCheckProvider.java
index c05090d..7d5313d 100644
--- a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/component/FilterCheckProvider.java
+++ b/ipojo/tests/tests.core.service.dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/component/FilterCheckProvider.java
@@ -20,8 +20,8 @@
import java.util.Properties;
-import org.apache.felix.ipojo.test.scenarios.service.CheckService;
-import org.apache.felix.ipojo.test.scenarios.service.FooService;
+import org.apache.felix.ipojo.test.scenarios.service.dependency.service.CheckService;
+import org.apache.felix.ipojo.test.scenarios.service.dependency.service.FooService;
public class FilterCheckProvider implements CheckService, FooService {
diff --git a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/component/FilterCheckSubscriber.java b/ipojo/tests/tests.core.service.dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/component/FilterCheckSubscriber.java
similarity index 89%
rename from ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/component/FilterCheckSubscriber.java
rename to ipojo/tests/tests.core.service.dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/component/FilterCheckSubscriber.java
index 2c25e8c..a3ffe20 100644
--- a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/component/FilterCheckSubscriber.java
+++ b/ipojo/tests/tests.core.service.dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/component/FilterCheckSubscriber.java
@@ -21,8 +21,9 @@
import java.util.Properties;
import org.apache.felix.ipojo.Nullable;
-import org.apache.felix.ipojo.test.scenarios.service.CheckService;
-import org.apache.felix.ipojo.test.scenarios.service.FooService;
+
+import org.apache.felix.ipojo.test.scenarios.service.dependency.service.CheckService;
+import org.apache.felix.ipojo.test.scenarios.service.dependency.service.FooService;
public class FilterCheckSubscriber implements CheckService {
diff --git a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/component/FooProviderType1.java b/ipojo/tests/tests.core.service.dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/component/FooProviderType1.java
similarity index 92%
copy from ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/component/FooProviderType1.java
copy to ipojo/tests/tests.core.service.dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/component/FooProviderType1.java
index 3fe9bad..534c85f 100644
--- a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/component/FooProviderType1.java
+++ b/ipojo/tests/tests.core.service.dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/component/FooProviderType1.java
@@ -20,7 +20,7 @@
import java.util.Properties;
-import org.apache.felix.ipojo.test.scenarios.service.FooService;
+import org.apache.felix.ipojo.test.scenarios.service.dependency.service.FooService;
import org.osgi.framework.BundleContext;
public class FooProviderType1 implements FooService {
@@ -84,14 +84,6 @@
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; }
diff --git a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/component/FooServiceDefaultImpl.java b/ipojo/tests/tests.core.service.dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/component/FooServiceDefaultImpl.java
similarity index 93%
rename from ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/component/FooServiceDefaultImpl.java
rename to ipojo/tests/tests.core.service.dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/component/FooServiceDefaultImpl.java
index 8455c23..6231d15 100644
--- a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/component/FooServiceDefaultImpl.java
+++ b/ipojo/tests/tests.core.service.dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/component/FooServiceDefaultImpl.java
@@ -20,7 +20,7 @@
import java.util.Properties;
-import org.apache.felix.ipojo.test.scenarios.service.FooService;
+import org.apache.felix.ipojo.test.scenarios.service.dependency.service.FooService;
public class FooServiceDefaultImpl implements FooService {
diff --git a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/component/MethodCheckServiceProvider.java b/ipojo/tests/tests.core.service.dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/component/MethodCheckServiceProvider.java
similarity index 94%
rename from ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/component/MethodCheckServiceProvider.java
rename to ipojo/tests/tests.core.service.dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/component/MethodCheckServiceProvider.java
index c069b09..d48e0c7 100644
--- a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/component/MethodCheckServiceProvider.java
+++ b/ipojo/tests/tests.core.service.dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/component/MethodCheckServiceProvider.java
@@ -20,11 +20,12 @@
import java.util.Properties;
-import org.apache.felix.ipojo.test.scenarios.service.CheckService;
-import org.apache.felix.ipojo.test.scenarios.service.FooService;
import org.osgi.framework.BundleContext;
import org.osgi.framework.ServiceReference;
+import org.apache.felix.ipojo.test.scenarios.service.dependency.service.CheckService;
+import org.apache.felix.ipojo.test.scenarios.service.dependency.service.FooService;
+
public class MethodCheckServiceProvider implements CheckService {
FooService fs;
diff --git a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/component/MethodMultipleCheckService.java b/ipojo/tests/tests.core.service.dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/component/MethodMultipleCheckService.java
similarity index 95%
rename from ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/component/MethodMultipleCheckService.java
rename to ipojo/tests/tests.core.service.dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/component/MethodMultipleCheckService.java
index 32d4b1d..18ffacc 100644
--- a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/component/MethodMultipleCheckService.java
+++ b/ipojo/tests/tests.core.service.dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/component/MethodMultipleCheckService.java
@@ -22,11 +22,12 @@
import java.util.List;
import java.util.Properties;
-import org.apache.felix.ipojo.test.scenarios.service.CheckService;
-import org.apache.felix.ipojo.test.scenarios.service.FooService;
import org.osgi.framework.BundleContext;
import org.osgi.framework.ServiceReference;
+import org.apache.felix.ipojo.test.scenarios.service.dependency.service.CheckService;
+import org.apache.felix.ipojo.test.scenarios.service.dependency.service.FooService;
+
public class MethodMultipleCheckService implements CheckService {
List fs = new ArrayList();
diff --git a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/component/MultipleCheckService.java b/ipojo/tests/tests.core.service.dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/component/MultipleCheckService.java
similarity index 95%
rename from ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/component/MultipleCheckService.java
rename to ipojo/tests/tests.core.service.dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/component/MultipleCheckService.java
index efbc972..ca8c966 100644
--- a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/component/MultipleCheckService.java
+++ b/ipojo/tests/tests.core.service.dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/component/MultipleCheckService.java
@@ -20,10 +20,11 @@
import java.util.Properties;
-import org.apache.felix.ipojo.test.scenarios.service.CheckService;
-import org.apache.felix.ipojo.test.scenarios.service.FooService;
import org.osgi.framework.ServiceReference;
+import org.apache.felix.ipojo.test.scenarios.service.dependency.service.CheckService;
+import org.apache.felix.ipojo.test.scenarios.service.dependency.service.FooService;
+
public class MultipleCheckService implements CheckService {
FooService fs[];
diff --git a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/component/MultipleFilterCheckSubscriber.java b/ipojo/tests/tests.core.service.dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/component/MultipleFilterCheckSubscriber.java
similarity index 89%
rename from ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/component/MultipleFilterCheckSubscriber.java
rename to ipojo/tests/tests.core.service.dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/component/MultipleFilterCheckSubscriber.java
index 6b7370e..15f7dbe 100644
--- a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/component/MultipleFilterCheckSubscriber.java
+++ b/ipojo/tests/tests.core.service.dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/component/MultipleFilterCheckSubscriber.java
@@ -20,8 +20,8 @@
import java.util.Properties;
-import org.apache.felix.ipojo.test.scenarios.service.CheckService;
-import org.apache.felix.ipojo.test.scenarios.service.FooService;
+import org.apache.felix.ipojo.test.scenarios.service.dependency.service.CheckService;
+import org.apache.felix.ipojo.test.scenarios.service.dependency.service.FooService;
public class MultipleFilterCheckSubscriber implements CheckService {
diff --git a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/component/ParentClass.java b/ipojo/tests/tests.core.service.dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/component/ParentClass.java
similarity index 100%
copy from ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/component/ParentClass.java
copy to ipojo/tests/tests.core.service.dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/component/ParentClass.java
diff --git a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/component/BazProviderType1.java b/ipojo/tests/tests.core.service.dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/component/RankedFooProviderType1.java
similarity index 79%
rename from ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/component/BazProviderType1.java
rename to ipojo/tests/tests.core.service.dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/component/RankedFooProviderType1.java
index 4d9a9bb..6b25a0c 100644
--- a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/component/BazProviderType1.java
+++ b/ipojo/tests/tests.core.service.dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/component/RankedFooProviderType1.java
@@ -20,32 +20,33 @@
import java.util.Properties;
-import org.apache.felix.ipojo.test.scenarios.service.BazService;
+import org.apache.felix.ipojo.test.scenarios.service.dependency.service.FooService;
-public class BazProviderType1 implements BazService {
-
- private int m_bar;
- private String m_foo;
-
+public class RankedFooProviderType1 implements FooService {
+ private int m_grade;
+
+
public boolean foo() {
+ m_grade = m_grade + 2;
return true;
}
public Properties fooProps() {
Properties p = new Properties();
- p.put("bar", new Integer(m_bar));
- p.put("foo", m_foo);
+ p.put("grade", new Integer(m_grade));
+
return p;
}
-
+
public boolean getBoolean() { return true; }
public double getDouble() { return 1.0; }
- public int getInt() { return 1; }
+ public int getInt() {
+ return m_grade; }
public long getLong() { return 1; }
public Boolean getObject() { return new Boolean(true); }
-
+
}
diff --git a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/dependency/DelayedMultipleDependencies.java b/ipojo/tests/tests.core.service.dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/DelayedMultipleDependencies.java
similarity index 98%
rename from ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/dependency/DelayedMultipleDependencies.java
rename to ipojo/tests/tests.core.service.dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/DelayedMultipleDependencies.java
index edc0b2f..18092df 100644
--- a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/dependency/DelayedMultipleDependencies.java
+++ b/ipojo/tests/tests.core.service.dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/DelayedMultipleDependencies.java
@@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
-package org.apache.felix.ipojo.test.scenarios.dependency;
+package org.apache.felix.ipojo.test.scenarios.service.dependency;
import java.util.Properties;
@@ -24,10 +24,11 @@
import org.apache.felix.ipojo.architecture.Architecture;
import org.apache.felix.ipojo.architecture.InstanceDescription;
import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
-import org.apache.felix.ipojo.test.scenarios.service.CheckService;
import org.apache.felix.ipojo.test.scenarios.util.Utils;
import org.osgi.framework.ServiceReference;
+import org.apache.felix.ipojo.test.scenarios.service.dependency.service.CheckService;
+
public class DelayedMultipleDependencies extends OSGiTestCase {
ComponentInstance instance1, instance2, instance3, instance4, instance5;
diff --git a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/dependency/DelayedOptionalDependencies.java b/ipojo/tests/tests.core.service.dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/DelayedOptionalDependencies.java
similarity index 98%
rename from ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/dependency/DelayedOptionalDependencies.java
rename to ipojo/tests/tests.core.service.dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/DelayedOptionalDependencies.java
index 763ebca..e9f3948 100644
--- a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/dependency/DelayedOptionalDependencies.java
+++ b/ipojo/tests/tests.core.service.dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/DelayedOptionalDependencies.java
@@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
-package org.apache.felix.ipojo.test.scenarios.dependency;
+package org.apache.felix.ipojo.test.scenarios.service.dependency;
import java.util.Properties;
@@ -24,10 +24,11 @@
import org.apache.felix.ipojo.architecture.Architecture;
import org.apache.felix.ipojo.architecture.InstanceDescription;
import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
-import org.apache.felix.ipojo.test.scenarios.service.CheckService;
+import org.apache.felix.ipojo.test.scenarios.service.dependency.service.CheckService;
import org.apache.felix.ipojo.test.scenarios.util.Utils;
import org.osgi.framework.ServiceReference;
+
public class DelayedOptionalDependencies extends OSGiTestCase {
ComponentInstance instance1, instance2, instance3, instance4, instance5;
diff --git a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/dependency/DelayedOptionalMultipleDependencies.java b/ipojo/tests/tests.core.service.dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/DelayedOptionalMultipleDependencies.java
similarity index 98%
rename from ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/dependency/DelayedOptionalMultipleDependencies.java
rename to ipojo/tests/tests.core.service.dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/DelayedOptionalMultipleDependencies.java
index 2546039..bd48b88 100644
--- a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/dependency/DelayedOptionalMultipleDependencies.java
+++ b/ipojo/tests/tests.core.service.dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/DelayedOptionalMultipleDependencies.java
@@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
-package org.apache.felix.ipojo.test.scenarios.dependency;
+package org.apache.felix.ipojo.test.scenarios.service.dependency;
import java.util.Properties;
@@ -24,7 +24,7 @@
import org.apache.felix.ipojo.architecture.Architecture;
import org.apache.felix.ipojo.architecture.InstanceDescription;
import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
-import org.apache.felix.ipojo.test.scenarios.service.CheckService;
+import org.apache.felix.ipojo.test.scenarios.service.dependency.service.CheckService;
import org.apache.felix.ipojo.test.scenarios.util.Utils;
import org.osgi.framework.ServiceReference;
diff --git a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/dependency/DelayedSimpleDependencies.java b/ipojo/tests/tests.core.service.dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/DelayedSimpleDependencies.java
similarity index 98%
rename from ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/dependency/DelayedSimpleDependencies.java
rename to ipojo/tests/tests.core.service.dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/DelayedSimpleDependencies.java
index 489c161..b0fde79 100644
--- a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/dependency/DelayedSimpleDependencies.java
+++ b/ipojo/tests/tests.core.service.dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/DelayedSimpleDependencies.java
@@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
-package org.apache.felix.ipojo.test.scenarios.dependency;
+package org.apache.felix.ipojo.test.scenarios.service.dependency;
import java.util.Properties;
@@ -24,10 +24,9 @@
import org.apache.felix.ipojo.architecture.Architecture;
import org.apache.felix.ipojo.architecture.InstanceDescription;
import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
-import org.apache.felix.ipojo.test.scenarios.service.CheckService;
+import org.apache.felix.ipojo.test.scenarios.service.dependency.service.CheckService;
import org.apache.felix.ipojo.test.scenarios.util.Utils;
import org.osgi.framework.ServiceReference;
-
public class DelayedSimpleDependencies extends OSGiTestCase {
ComponentInstance instance1, instance2, instance3, instance4, instance5;
diff --git a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/architecture/DependencyTest.java b/ipojo/tests/tests.core.service.dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/DependencyArchitectureTest.java
similarity index 98%
rename from ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/architecture/DependencyTest.java
rename to ipojo/tests/tests.core.service.dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/DependencyArchitectureTest.java
index 102df0b..6d2d907 100644
--- a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/architecture/DependencyTest.java
+++ b/ipojo/tests/tests.core.service.dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/DependencyArchitectureTest.java
@@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
-package org.apache.felix.ipojo.test.scenarios.architecture;
+package org.apache.felix.ipojo.test.scenarios.service.dependency;
import java.util.Properties;
@@ -26,12 +26,13 @@
import org.apache.felix.ipojo.handlers.dependency.DependencyHandlerDescription;
import org.apache.felix.ipojo.handlers.providedservice.ProvidedServiceHandlerDescription;
import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
-import org.apache.felix.ipojo.test.scenarios.service.CheckService;
-import org.apache.felix.ipojo.test.scenarios.service.FooService;
import org.apache.felix.ipojo.test.scenarios.util.Utils;
import org.osgi.framework.ServiceReference;
-public class DependencyTest extends OSGiTestCase {
+import org.apache.felix.ipojo.test.scenarios.service.dependency.service.CheckService;
+import org.apache.felix.ipojo.test.scenarios.service.dependency.service.FooService;
+
+public class DependencyArchitectureTest extends OSGiTestCase {
ComponentInstance fooProvider1, fooProvider2;
diff --git a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/dependency/DependencyTestSuite.java b/ipojo/tests/tests.core.service.dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/DependencyTestSuite.java
similarity index 82%
rename from ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/dependency/DependencyTestSuite.java
rename to ipojo/tests/tests.core.service.dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/DependencyTestSuite.java
index 5326834..5a63567 100644
--- a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/dependency/DependencyTestSuite.java
+++ b/ipojo/tests/tests.core.service.dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/DependencyTestSuite.java
@@ -16,13 +16,14 @@
* specific language governing permissions and limitations
* under the License.
*/
-package org.apache.felix.ipojo.test.scenarios.dependency;
+package org.apache.felix.ipojo.test.scenarios.service.dependency;
import junit.framework.Test;
import org.apache.felix.ipojo.junit4osgi.OSGiTestSuite;
-import org.apache.felix.ipojo.test.scenarios.dependency.di.DefaultImplementationTestSuite;
-import org.apache.felix.ipojo.test.scenarios.dependency.statics.StaticDependencyTestSuite;
+import org.apache.felix.ipojo.test.scenarios.service.dependency.di.DefaultImplementationTestSuite;
+import org.apache.felix.ipojo.test.scenarios.service.dependency.dynamic.priority.DynamicPriorityDependencyTestSuite;
+import org.apache.felix.ipojo.test.scenarios.service.dependency.statics.StaticDependencyTestSuite;
import org.osgi.framework.BundleContext;
public class DependencyTestSuite {
@@ -52,6 +53,8 @@
ots.addTestSuite(OptionalMultipleFilterDependencies.class);
ots.addTest(StaticDependencyTestSuite.suite(bc));
ots.addTest(DefaultImplementationTestSuite.suite(bc));
+ ots.addTestSuite(DependencyArchitectureTest.class);
+ ots.addTest(DynamicPriorityDependencyTestSuite.suite(bc));
return ots;
}
diff --git a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/dependency/MethodDelayedMultipleDependencies.java b/ipojo/tests/tests.core.service.dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/MethodDelayedMultipleDependencies.java
similarity index 98%
rename from ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/dependency/MethodDelayedMultipleDependencies.java
rename to ipojo/tests/tests.core.service.dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/MethodDelayedMultipleDependencies.java
index 822be4b..8e373ff 100644
--- a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/dependency/MethodDelayedMultipleDependencies.java
+++ b/ipojo/tests/tests.core.service.dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/MethodDelayedMultipleDependencies.java
@@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
-package org.apache.felix.ipojo.test.scenarios.dependency;
+package org.apache.felix.ipojo.test.scenarios.service.dependency;
import java.util.Properties;
@@ -24,7 +24,7 @@
import org.apache.felix.ipojo.architecture.Architecture;
import org.apache.felix.ipojo.architecture.InstanceDescription;
import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
-import org.apache.felix.ipojo.test.scenarios.service.CheckService;
+import org.apache.felix.ipojo.test.scenarios.service.dependency.service.CheckService;
import org.apache.felix.ipojo.test.scenarios.util.Utils;
import org.osgi.framework.ServiceReference;
diff --git a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/dependency/MethodDelayedOptionalDependencies.java b/ipojo/tests/tests.core.service.dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/MethodDelayedOptionalDependencies.java
similarity index 98%
rename from ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/dependency/MethodDelayedOptionalDependencies.java
rename to ipojo/tests/tests.core.service.dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/MethodDelayedOptionalDependencies.java
index 72f9271..5c7d0d1 100644
--- a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/dependency/MethodDelayedOptionalDependencies.java
+++ b/ipojo/tests/tests.core.service.dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/MethodDelayedOptionalDependencies.java
@@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
-package org.apache.felix.ipojo.test.scenarios.dependency;
+package org.apache.felix.ipojo.test.scenarios.service.dependency;
import java.util.Properties;
@@ -24,7 +24,7 @@
import org.apache.felix.ipojo.architecture.Architecture;
import org.apache.felix.ipojo.architecture.InstanceDescription;
import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
-import org.apache.felix.ipojo.test.scenarios.service.CheckService;
+import org.apache.felix.ipojo.test.scenarios.service.dependency.service.CheckService;
import org.apache.felix.ipojo.test.scenarios.util.Utils;
import org.osgi.framework.ServiceReference;
diff --git a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/dependency/MethodDelayedOptionalMultipleDependencies.java b/ipojo/tests/tests.core.service.dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/MethodDelayedOptionalMultipleDependencies.java
similarity index 98%
rename from ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/dependency/MethodDelayedOptionalMultipleDependencies.java
rename to ipojo/tests/tests.core.service.dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/MethodDelayedOptionalMultipleDependencies.java
index f08366b..e1c7931 100644
--- a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/dependency/MethodDelayedOptionalMultipleDependencies.java
+++ b/ipojo/tests/tests.core.service.dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/MethodDelayedOptionalMultipleDependencies.java
@@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
-package org.apache.felix.ipojo.test.scenarios.dependency;
+package org.apache.felix.ipojo.test.scenarios.service.dependency;
import java.util.Properties;
@@ -24,7 +24,7 @@
import org.apache.felix.ipojo.architecture.Architecture;
import org.apache.felix.ipojo.architecture.InstanceDescription;
import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
-import org.apache.felix.ipojo.test.scenarios.service.CheckService;
+import org.apache.felix.ipojo.test.scenarios.service.dependency.service.CheckService;
import org.apache.felix.ipojo.test.scenarios.util.Utils;
import org.osgi.framework.ServiceReference;
diff --git a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/dependency/MethodDelayedSimpleDependencies.java b/ipojo/tests/tests.core.service.dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/MethodDelayedSimpleDependencies.java
similarity index 97%
rename from ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/dependency/MethodDelayedSimpleDependencies.java
rename to ipojo/tests/tests.core.service.dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/MethodDelayedSimpleDependencies.java
index bc7af12..d564958 100644
--- a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/dependency/MethodDelayedSimpleDependencies.java
+++ b/ipojo/tests/tests.core.service.dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/MethodDelayedSimpleDependencies.java
@@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
-package org.apache.felix.ipojo.test.scenarios.dependency;
+package org.apache.felix.ipojo.test.scenarios.service.dependency;
import java.util.Properties;
@@ -24,7 +24,7 @@
import org.apache.felix.ipojo.architecture.Architecture;
import org.apache.felix.ipojo.architecture.InstanceDescription;
import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
-import org.apache.felix.ipojo.test.scenarios.service.CheckService;
+import org.apache.felix.ipojo.test.scenarios.service.dependency.service.CheckService;
import org.apache.felix.ipojo.test.scenarios.util.Utils;
import org.osgi.framework.ServiceReference;
diff --git a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/dependency/MethodMultipleDependencies.java b/ipojo/tests/tests.core.service.dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/MethodMultipleDependencies.java
similarity index 98%
rename from ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/dependency/MethodMultipleDependencies.java
rename to ipojo/tests/tests.core.service.dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/MethodMultipleDependencies.java
index 20cca5b..92eb42c 100644
--- a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/dependency/MethodMultipleDependencies.java
+++ b/ipojo/tests/tests.core.service.dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/MethodMultipleDependencies.java
@@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
-package org.apache.felix.ipojo.test.scenarios.dependency;
+package org.apache.felix.ipojo.test.scenarios.service.dependency;
import java.util.Properties;
@@ -24,7 +24,7 @@
import org.apache.felix.ipojo.architecture.Architecture;
import org.apache.felix.ipojo.architecture.InstanceDescription;
import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
-import org.apache.felix.ipojo.test.scenarios.service.CheckService;
+import org.apache.felix.ipojo.test.scenarios.service.dependency.service.CheckService;
import org.apache.felix.ipojo.test.scenarios.util.Utils;
import org.osgi.framework.ServiceReference;
diff --git a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/dependency/MethodOptionalDependencies.java b/ipojo/tests/tests.core.service.dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/MethodOptionalDependencies.java
similarity index 98%
rename from ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/dependency/MethodOptionalDependencies.java
rename to ipojo/tests/tests.core.service.dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/MethodOptionalDependencies.java
index e7e075f..c104188 100644
--- a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/dependency/MethodOptionalDependencies.java
+++ b/ipojo/tests/tests.core.service.dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/MethodOptionalDependencies.java
@@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
-package org.apache.felix.ipojo.test.scenarios.dependency;
+package org.apache.felix.ipojo.test.scenarios.service.dependency;
import java.util.Properties;
@@ -24,7 +24,7 @@
import org.apache.felix.ipojo.architecture.Architecture;
import org.apache.felix.ipojo.architecture.InstanceDescription;
import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
-import org.apache.felix.ipojo.test.scenarios.service.CheckService;
+import org.apache.felix.ipojo.test.scenarios.service.dependency.service.CheckService;
import org.apache.felix.ipojo.test.scenarios.util.Utils;
import org.osgi.framework.ServiceReference;
diff --git a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/dependency/MethodOptionalMultipleDependencies.java b/ipojo/tests/tests.core.service.dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/MethodOptionalMultipleDependencies.java
similarity index 98%
rename from ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/dependency/MethodOptionalMultipleDependencies.java
rename to ipojo/tests/tests.core.service.dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/MethodOptionalMultipleDependencies.java
index fa571eb..ef5f20c 100644
--- a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/dependency/MethodOptionalMultipleDependencies.java
+++ b/ipojo/tests/tests.core.service.dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/MethodOptionalMultipleDependencies.java
@@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
-package org.apache.felix.ipojo.test.scenarios.dependency;
+package org.apache.felix.ipojo.test.scenarios.service.dependency;
import java.util.Properties;
@@ -24,7 +24,7 @@
import org.apache.felix.ipojo.architecture.Architecture;
import org.apache.felix.ipojo.architecture.InstanceDescription;
import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
-import org.apache.felix.ipojo.test.scenarios.service.CheckService;
+import org.apache.felix.ipojo.test.scenarios.service.dependency.service.CheckService;
import org.apache.felix.ipojo.test.scenarios.util.Utils;
import org.osgi.framework.ServiceReference;
diff --git a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/dependency/MethodSimpleDependencies.java b/ipojo/tests/tests.core.service.dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/MethodSimpleDependencies.java
similarity index 97%
rename from ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/dependency/MethodSimpleDependencies.java
rename to ipojo/tests/tests.core.service.dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/MethodSimpleDependencies.java
index bf314a4..71ebfe6 100644
--- a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/dependency/MethodSimpleDependencies.java
+++ b/ipojo/tests/tests.core.service.dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/MethodSimpleDependencies.java
@@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
-package org.apache.felix.ipojo.test.scenarios.dependency;
+package org.apache.felix.ipojo.test.scenarios.service.dependency;
import java.util.Properties;
@@ -24,7 +24,7 @@
import org.apache.felix.ipojo.architecture.Architecture;
import org.apache.felix.ipojo.architecture.InstanceDescription;
import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
-import org.apache.felix.ipojo.test.scenarios.service.CheckService;
+import org.apache.felix.ipojo.test.scenarios.service.dependency.service.CheckService;
import org.apache.felix.ipojo.test.scenarios.util.Utils;
import org.osgi.framework.ServiceReference;
diff --git a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/dependency/MultipleDependencies.java b/ipojo/tests/tests.core.service.dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/MultipleDependencies.java
similarity index 98%
rename from ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/dependency/MultipleDependencies.java
rename to ipojo/tests/tests.core.service.dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/MultipleDependencies.java
index aaa401c..d539d32 100644
--- a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/dependency/MultipleDependencies.java
+++ b/ipojo/tests/tests.core.service.dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/MultipleDependencies.java
@@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
-package org.apache.felix.ipojo.test.scenarios.dependency;
+package org.apache.felix.ipojo.test.scenarios.service.dependency;
import java.util.Properties;
@@ -24,7 +24,7 @@
import org.apache.felix.ipojo.architecture.Architecture;
import org.apache.felix.ipojo.architecture.InstanceDescription;
import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
-import org.apache.felix.ipojo.test.scenarios.service.CheckService;
+import org.apache.felix.ipojo.test.scenarios.service.dependency.service.CheckService;
import org.apache.felix.ipojo.test.scenarios.util.Utils;
import org.osgi.framework.ServiceReference;
diff --git a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/dependency/MultipleFilterDependencies.java b/ipojo/tests/tests.core.service.dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/MultipleFilterDependencies.java
similarity index 99%
rename from ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/dependency/MultipleFilterDependencies.java
rename to ipojo/tests/tests.core.service.dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/MultipleFilterDependencies.java
index 8c55bb1..580f60c 100644
--- a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/dependency/MultipleFilterDependencies.java
+++ b/ipojo/tests/tests.core.service.dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/MultipleFilterDependencies.java
@@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
-package org.apache.felix.ipojo.test.scenarios.dependency;
+package org.apache.felix.ipojo.test.scenarios.service.dependency;
import java.util.Properties;
@@ -24,10 +24,11 @@
import org.apache.felix.ipojo.architecture.Architecture;
import org.apache.felix.ipojo.architecture.InstanceDescription;
import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
-import org.apache.felix.ipojo.test.scenarios.service.CheckService;
import org.apache.felix.ipojo.test.scenarios.util.Utils;
import org.osgi.framework.ServiceReference;
+import org.apache.felix.ipojo.test.scenarios.service.dependency.service.CheckService;
+
public class MultipleFilterDependencies extends OSGiTestCase {
ComponentInstance instance1, instance2, instance3;
diff --git a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/dependency/OptionalDependencies.java b/ipojo/tests/tests.core.service.dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/OptionalDependencies.java
similarity index 98%
rename from ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/dependency/OptionalDependencies.java
rename to ipojo/tests/tests.core.service.dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/OptionalDependencies.java
index 773ea6c..1357c65 100644
--- a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/dependency/OptionalDependencies.java
+++ b/ipojo/tests/tests.core.service.dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/OptionalDependencies.java
@@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
-package org.apache.felix.ipojo.test.scenarios.dependency;
+package org.apache.felix.ipojo.test.scenarios.service.dependency;
import java.util.Properties;
@@ -24,10 +24,11 @@
import org.apache.felix.ipojo.architecture.Architecture;
import org.apache.felix.ipojo.architecture.InstanceDescription;
import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
-import org.apache.felix.ipojo.test.scenarios.service.CheckService;
import org.apache.felix.ipojo.test.scenarios.util.Utils;
import org.osgi.framework.ServiceReference;
+import org.apache.felix.ipojo.test.scenarios.service.dependency.service.CheckService;
+
public class OptionalDependencies extends OSGiTestCase {
ComponentInstance instance1, instance2, instance3, instance4, instance5;
diff --git a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/dependency/OptionalMultipleDependencies.java b/ipojo/tests/tests.core.service.dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/OptionalMultipleDependencies.java
similarity index 99%
rename from ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/dependency/OptionalMultipleDependencies.java
rename to ipojo/tests/tests.core.service.dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/OptionalMultipleDependencies.java
index 91e222d..07520d6 100644
--- a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/dependency/OptionalMultipleDependencies.java
+++ b/ipojo/tests/tests.core.service.dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/OptionalMultipleDependencies.java
@@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
-package org.apache.felix.ipojo.test.scenarios.dependency;
+package org.apache.felix.ipojo.test.scenarios.service.dependency;
import java.util.Properties;
@@ -24,10 +24,11 @@
import org.apache.felix.ipojo.architecture.Architecture;
import org.apache.felix.ipojo.architecture.InstanceDescription;
import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
-import org.apache.felix.ipojo.test.scenarios.service.CheckService;
import org.apache.felix.ipojo.test.scenarios.util.Utils;
import org.osgi.framework.ServiceReference;
+import org.apache.felix.ipojo.test.scenarios.service.dependency.service.CheckService;
+
public class OptionalMultipleDependencies extends OSGiTestCase {
ComponentInstance instance1, instance2, instance3, instance4;
diff --git a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/dependency/OptionalMultipleFilterDependencies.java b/ipojo/tests/tests.core.service.dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/OptionalMultipleFilterDependencies.java
similarity index 99%
rename from ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/dependency/OptionalMultipleFilterDependencies.java
rename to ipojo/tests/tests.core.service.dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/OptionalMultipleFilterDependencies.java
index 5d0ae74..298bce6 100644
--- a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/dependency/OptionalMultipleFilterDependencies.java
+++ b/ipojo/tests/tests.core.service.dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/OptionalMultipleFilterDependencies.java
@@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
-package org.apache.felix.ipojo.test.scenarios.dependency;
+package org.apache.felix.ipojo.test.scenarios.service.dependency;
import java.util.Properties;
@@ -24,10 +24,11 @@
import org.apache.felix.ipojo.architecture.Architecture;
import org.apache.felix.ipojo.architecture.InstanceDescription;
import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
-import org.apache.felix.ipojo.test.scenarios.service.CheckService;
import org.apache.felix.ipojo.test.scenarios.util.Utils;
import org.osgi.framework.ServiceReference;
+import org.apache.felix.ipojo.test.scenarios.service.dependency.service.CheckService;
+
public class OptionalMultipleFilterDependencies extends OSGiTestCase {
ComponentInstance instance1, instance2, instance3;
diff --git a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/dependency/OptionalNoNullableDependencies.java b/ipojo/tests/tests.core.service.dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/OptionalNoNullableDependencies.java
similarity index 98%
rename from ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/dependency/OptionalNoNullableDependencies.java
rename to ipojo/tests/tests.core.service.dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/OptionalNoNullableDependencies.java
index 1e4a34b..894f987 100644
--- a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/dependency/OptionalNoNullableDependencies.java
+++ b/ipojo/tests/tests.core.service.dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/OptionalNoNullableDependencies.java
@@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
-package org.apache.felix.ipojo.test.scenarios.dependency;
+package org.apache.felix.ipojo.test.scenarios.service.dependency;
import java.util.Properties;
@@ -24,10 +24,11 @@
import org.apache.felix.ipojo.architecture.Architecture;
import org.apache.felix.ipojo.architecture.InstanceDescription;
import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
-import org.apache.felix.ipojo.test.scenarios.service.CheckService;
import org.apache.felix.ipojo.test.scenarios.util.Utils;
import org.osgi.framework.ServiceReference;
+import org.apache.felix.ipojo.test.scenarios.service.dependency.service.CheckService;
+
public class OptionalNoNullableDependencies extends OSGiTestCase {
ComponentInstance instance1, instance2, instance3, instance4, instance5;
diff --git a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/dependency/OptionalSimpleFilterDependencies.java b/ipojo/tests/tests.core.service.dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/OptionalSimpleFilterDependencies.java
similarity index 99%
rename from ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/dependency/OptionalSimpleFilterDependencies.java
rename to ipojo/tests/tests.core.service.dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/OptionalSimpleFilterDependencies.java
index 061d08e..07cab6f 100644
--- a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/dependency/OptionalSimpleFilterDependencies.java
+++ b/ipojo/tests/tests.core.service.dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/OptionalSimpleFilterDependencies.java
@@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
-package org.apache.felix.ipojo.test.scenarios.dependency;
+package org.apache.felix.ipojo.test.scenarios.service.dependency;
import java.util.Properties;
@@ -24,10 +24,11 @@
import org.apache.felix.ipojo.architecture.Architecture;
import org.apache.felix.ipojo.architecture.InstanceDescription;
import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
-import org.apache.felix.ipojo.test.scenarios.service.CheckService;
import org.apache.felix.ipojo.test.scenarios.util.Utils;
import org.osgi.framework.ServiceReference;
+import org.apache.felix.ipojo.test.scenarios.service.dependency.service.CheckService;
+
public class OptionalSimpleFilterDependencies extends OSGiTestCase {
ComponentInstance instance1, instance2, instance3;
diff --git a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/dependency/SimpleDependencies.java b/ipojo/tests/tests.core.service.dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/SimpleDependencies.java
similarity index 98%
rename from ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/dependency/SimpleDependencies.java
rename to ipojo/tests/tests.core.service.dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/SimpleDependencies.java
index ad02a8f..ea3a29b 100644
--- a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/dependency/SimpleDependencies.java
+++ b/ipojo/tests/tests.core.service.dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/SimpleDependencies.java
@@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
-package org.apache.felix.ipojo.test.scenarios.dependency;
+package org.apache.felix.ipojo.test.scenarios.service.dependency;
import java.util.Properties;
@@ -24,10 +24,11 @@
import org.apache.felix.ipojo.architecture.Architecture;
import org.apache.felix.ipojo.architecture.InstanceDescription;
import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
-import org.apache.felix.ipojo.test.scenarios.service.CheckService;
import org.apache.felix.ipojo.test.scenarios.util.Utils;
import org.osgi.framework.ServiceReference;
+import org.apache.felix.ipojo.test.scenarios.service.dependency.service.CheckService;
+
public class SimpleDependencies extends OSGiTestCase {
ComponentInstance instance1, instance2, instance3, instance4, instance5, instance6;
diff --git a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/dependency/SimpleFilterDependencies.java b/ipojo/tests/tests.core.service.dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/SimpleFilterDependencies.java
similarity index 98%
rename from ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/dependency/SimpleFilterDependencies.java
rename to ipojo/tests/tests.core.service.dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/SimpleFilterDependencies.java
index c6a2333..db8103a 100644
--- a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/dependency/SimpleFilterDependencies.java
+++ b/ipojo/tests/tests.core.service.dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/SimpleFilterDependencies.java
@@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
-package org.apache.felix.ipojo.test.scenarios.dependency;
+package org.apache.felix.ipojo.test.scenarios.service.dependency;
import java.util.Properties;
@@ -24,10 +24,11 @@
import org.apache.felix.ipojo.architecture.Architecture;
import org.apache.felix.ipojo.architecture.InstanceDescription;
import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
-import org.apache.felix.ipojo.test.scenarios.service.CheckService;
import org.apache.felix.ipojo.test.scenarios.util.Utils;
import org.osgi.framework.ServiceReference;
+import org.apache.felix.ipojo.test.scenarios.service.dependency.service.CheckService;
+
public class SimpleFilterDependencies extends OSGiTestCase {
ComponentInstance instance1, instance2, instance3;
diff --git a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/dependency/di/DefaultImplementationTestSuite.java b/ipojo/tests/tests.core.service.dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/di/DefaultImplementationTestSuite.java
similarity index 94%
rename from ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/dependency/di/DefaultImplementationTestSuite.java
rename to ipojo/tests/tests.core.service.dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/di/DefaultImplementationTestSuite.java
index fa045d7..f754ce6 100644
--- a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/dependency/di/DefaultImplementationTestSuite.java
+++ b/ipojo/tests/tests.core.service.dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/di/DefaultImplementationTestSuite.java
@@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
-package org.apache.felix.ipojo.test.scenarios.dependency.di;
+package org.apache.felix.ipojo.test.scenarios.service.dependency.di;
import junit.framework.Test;
diff --git a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/dependency/di/DelayedOptionalDependencies.java b/ipojo/tests/tests.core.service.dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/di/DelayedOptionalDependencies.java
similarity index 98%
rename from ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/dependency/di/DelayedOptionalDependencies.java
rename to ipojo/tests/tests.core.service.dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/di/DelayedOptionalDependencies.java
index 29a3efe..996fbfd 100644
--- a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/dependency/di/DelayedOptionalDependencies.java
+++ b/ipojo/tests/tests.core.service.dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/di/DelayedOptionalDependencies.java
@@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
-package org.apache.felix.ipojo.test.scenarios.dependency.di;
+package org.apache.felix.ipojo.test.scenarios.service.dependency.di;
import java.util.Properties;
@@ -24,10 +24,11 @@
import org.apache.felix.ipojo.architecture.Architecture;
import org.apache.felix.ipojo.architecture.InstanceDescription;
import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
-import org.apache.felix.ipojo.test.scenarios.service.CheckService;
import org.apache.felix.ipojo.test.scenarios.util.Utils;
import org.osgi.framework.ServiceReference;
+import org.apache.felix.ipojo.test.scenarios.service.dependency.service.CheckService;
+
public class DelayedOptionalDependencies extends OSGiTestCase {
ComponentInstance instance1, instance2, instance3, instance4, instance5;
diff --git a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/dependency/di/MethodDelayedOptionalDependencies.java b/ipojo/tests/tests.core.service.dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/di/MethodDelayedOptionalDependencies.java
similarity index 98%
rename from ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/dependency/di/MethodDelayedOptionalDependencies.java
rename to ipojo/tests/tests.core.service.dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/di/MethodDelayedOptionalDependencies.java
index 4d404c7..fa71482 100644
--- a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/dependency/di/MethodDelayedOptionalDependencies.java
+++ b/ipojo/tests/tests.core.service.dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/di/MethodDelayedOptionalDependencies.java
@@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
-package org.apache.felix.ipojo.test.scenarios.dependency.di;
+package org.apache.felix.ipojo.test.scenarios.service.dependency.di;
import java.util.Properties;
@@ -24,10 +24,11 @@
import org.apache.felix.ipojo.architecture.Architecture;
import org.apache.felix.ipojo.architecture.InstanceDescription;
import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
-import org.apache.felix.ipojo.test.scenarios.service.CheckService;
import org.apache.felix.ipojo.test.scenarios.util.Utils;
import org.osgi.framework.ServiceReference;
+import org.apache.felix.ipojo.test.scenarios.service.dependency.service.CheckService;
+
public class MethodDelayedOptionalDependencies extends OSGiTestCase {
ComponentInstance instance3, instance4, instance5;
diff --git a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/dependency/di/MethodOptionalDependencies.java b/ipojo/tests/tests.core.service.dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/di/MethodOptionalDependencies.java
similarity index 98%
rename from ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/dependency/di/MethodOptionalDependencies.java
rename to ipojo/tests/tests.core.service.dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/di/MethodOptionalDependencies.java
index 2713fbe..00600ff 100644
--- a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/dependency/di/MethodOptionalDependencies.java
+++ b/ipojo/tests/tests.core.service.dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/di/MethodOptionalDependencies.java
@@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
-package org.apache.felix.ipojo.test.scenarios.dependency.di;
+package org.apache.felix.ipojo.test.scenarios.service.dependency.di;
import java.util.Properties;
@@ -24,10 +24,11 @@
import org.apache.felix.ipojo.architecture.Architecture;
import org.apache.felix.ipojo.architecture.InstanceDescription;
import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
-import org.apache.felix.ipojo.test.scenarios.service.CheckService;
import org.apache.felix.ipojo.test.scenarios.util.Utils;
import org.osgi.framework.ServiceReference;
+import org.apache.felix.ipojo.test.scenarios.service.dependency.service.CheckService;
+
public class MethodOptionalDependencies extends OSGiTestCase {
ComponentInstance instance3, instance4, instance5;
diff --git a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/dependency/di/OptionalDependencies.java b/ipojo/tests/tests.core.service.dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/di/OptionalDependencies.java
similarity index 98%
rename from ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/dependency/di/OptionalDependencies.java
rename to ipojo/tests/tests.core.service.dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/di/OptionalDependencies.java
index 1a1d359..033b0f9 100644
--- a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/dependency/di/OptionalDependencies.java
+++ b/ipojo/tests/tests.core.service.dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/di/OptionalDependencies.java
@@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
-package org.apache.felix.ipojo.test.scenarios.dependency.di;
+package org.apache.felix.ipojo.test.scenarios.service.dependency.di;
import java.util.Properties;
@@ -24,10 +24,11 @@
import org.apache.felix.ipojo.architecture.Architecture;
import org.apache.felix.ipojo.architecture.InstanceDescription;
import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
-import org.apache.felix.ipojo.test.scenarios.service.CheckService;
import org.apache.felix.ipojo.test.scenarios.util.Utils;
import org.osgi.framework.ServiceReference;
+import org.apache.felix.ipojo.test.scenarios.service.dependency.service.CheckService;
+
public class OptionalDependencies extends OSGiTestCase {
ComponentInstance instance1, instance2, instance3, instance4, instance5;
diff --git a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/handler/ExternalHandlerTestSuite.java b/ipojo/tests/tests.core.service.dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/dynamic/priority/DynamicPriorityDependencyTestSuite.java
similarity index 78%
copy from ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/handler/ExternalHandlerTestSuite.java
copy to ipojo/tests/tests.core.service.dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/dynamic/priority/DynamicPriorityDependencyTestSuite.java
index f37d2ec..c60fe79 100644
--- a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/handler/ExternalHandlerTestSuite.java
+++ b/ipojo/tests/tests.core.service.dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/dynamic/priority/DynamicPriorityDependencyTestSuite.java
@@ -16,19 +16,18 @@
* specific language governing permissions and limitations
* under the License.
*/
-package org.apache.felix.ipojo.test.scenarios.handler;
+package org.apache.felix.ipojo.test.scenarios.service.dependency.dynamic.priority;
import junit.framework.Test;
-import junit.framework.TestSuite;
import org.apache.felix.ipojo.junit4osgi.OSGiTestSuite;
import org.osgi.framework.BundleContext;
-public class ExternalHandlerTestSuite extends TestSuite {
+public class DynamicPriorityDependencyTestSuite {
public static Test suite(BundleContext bc) {
- OSGiTestSuite ots = new OSGiTestSuite("External Handler Test Suite", bc);
- ots.addTestSuite(HandlerTest.class);
+ OSGiTestSuite ots = new OSGiTestSuite("Dynamic-Priority Dependency Test Suite", bc);
+ ots.addTestSuite( SimpleDependencies.class);
return ots;
}
diff --git a/ipojo/tests/tests.core.service.dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/dynamic/priority/SimpleDependencies.java b/ipojo/tests/tests.core.service.dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/dynamic/priority/SimpleDependencies.java
new file mode 100644
index 0000000..f942819
--- /dev/null
+++ b/ipojo/tests/tests.core.service.dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/dynamic/priority/SimpleDependencies.java
@@ -0,0 +1,157 @@
+/*
+ * 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.service.dependency.dynamic.priority;
+
+import java.util.Properties;
+
+import org.apache.felix.ipojo.ComponentInstance;
+import org.apache.felix.ipojo.architecture.Architecture;
+import org.apache.felix.ipojo.architecture.InstanceDescription;
+import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
+import org.apache.felix.ipojo.test.scenarios.util.Utils;
+import org.osgi.framework.ServiceReference;
+
+import org.apache.felix.ipojo.test.scenarios.service.dependency.service.CheckService;
+import org.apache.felix.ipojo.test.scenarios.service.dependency.service.FooService;
+
+public class SimpleDependencies extends OSGiTestCase {
+
+ ComponentInstance instance1, instance3;
+ ComponentInstance fooProvider;
+ ComponentInstance fooProvider2;
+
+ public void setUp() {
+ try {
+ Properties prov = new Properties();
+ prov.put("name", "FooProvider-1");
+ prov.put("service.ranking", "1");
+ fooProvider = Utils.getFactoryByName(context, "RankedFooProviderType").createComponentInstance(prov);
+ fooProvider.stop();
+
+ Properties prov2 = new Properties();
+ prov2.put("name", "FooProvider-2");
+ prov2.put("service.ranking", "0");
+ fooProvider2 = Utils.getFactoryByName(context, "RankedFooProviderType").createComponentInstance(prov2);
+ fooProvider2.stop();
+
+ Properties i1 = new Properties();
+ i1.put("name", "Simple");
+ instance1 = Utils.getFactoryByName(context, "DPSimpleCheckServiceProvider").createComponentInstance(i1);
+
+ Properties i3 = new Properties();
+ i3.put("name", "Object");
+ instance3 = Utils.getFactoryByName(context, "DPObjectCheckServiceProvider").createComponentInstance(i3);
+
+ } catch(Exception e) {
+ e.printStackTrace();
+ fail(e.getMessage()); }
+
+ }
+
+ public void tearDown() {
+ instance1.dispose();
+ instance3.dispose();
+ fooProvider.dispose();
+ fooProvider2.dispose();
+ instance1 = null;
+ instance3 = null;
+ fooProvider = null;
+ fooProvider2 = null;
+ }
+
+ public void testSimple() {
+ ServiceReference arch_ref = Utils.getServiceReferenceByName(context, Architecture.class.getName(), instance1.getInstanceName());
+ assertNotNull("Check architecture availability", arch_ref);
+ InstanceDescription id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+ assertTrue("Check instance invalidity - 1", id.getState() == ComponentInstance.INVALID);
+
+ fooProvider.start();
+ fooProvider2.start();
+
+ id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+ assertTrue("Check instance validity - 1", id.getState() == ComponentInstance.VALID);
+
+ ServiceReference cs_ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance1.getInstanceName());
+ assertNotNull("Check CheckService availability", cs_ref);
+ CheckService cs = (CheckService) context.getService(cs_ref);
+ // Check grade
+ Integer grade = (Integer) cs.getProps().get("int");
+ assertEquals("Check first grade", 1, grade.intValue());
+
+ fooProvider.stop(); // Turn off the best provider.
+
+ id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+ assertTrue("Check instance validity - 1", id.getState() == ComponentInstance.VALID);
+
+ cs_ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance1.getInstanceName());
+ assertNotNull("Check CheckService availability", cs_ref);
+ cs = (CheckService) context.getService(cs_ref);
+ // Check grade
+ grade = (Integer) cs.getProps().get("int");
+ assertEquals("Check second grade", 0, grade.intValue());
+
+ fooProvider.start(); // Turn on the best provider.
+
+ id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+ assertTrue("Check instance validity - 1", id.getState() == ComponentInstance.VALID);
+
+ cs_ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance1.getInstanceName());
+ assertNotNull("Check CheckService availability", cs_ref);
+ cs = (CheckService) context.getService(cs_ref);
+ // Check grade
+ grade = (Integer) cs.getProps().get("int");
+ assertEquals("Check third grade", 1, grade.intValue());
+
+
+ // Increase the second provider grade.
+ ServiceReference fs_ref = Utils.getServiceReferenceByName(context, FooService.class.getName(), fooProvider2.getInstanceName());
+ assertNotNull("Check foo service (2) reference", fs_ref);
+ FooService fs = (FooService) context.getService(fs_ref);
+
+ fs.foo(); // Increase the grade (now = 2)
+
+ cs_ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance1.getInstanceName());
+ assertNotNull("Check CheckService availability", cs_ref);
+ cs = (CheckService) context.getService(cs_ref);
+ // Check grade
+ grade = (Integer) cs.getProps().get("int");
+ assertEquals("Check fourth grade", 2, grade.intValue());
+
+ // Increase the other provider grade.
+ fs_ref = Utils.getServiceReferenceByName(context, FooService.class.getName(), fooProvider.getInstanceName());
+ assertNotNull("Check foo service (1) reference", fs_ref);
+ fs = (FooService) context.getService(fs_ref);
+ fs.foo(); //(grade = 3)
+
+ cs_ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance1.getInstanceName());
+ assertNotNull("Check CheckService availability", cs_ref);
+ cs = (CheckService) context.getService(cs_ref);
+ // Check grade
+ grade = (Integer) cs.getProps().get("int");
+ assertEquals("Check fifth grade", 3, grade.intValue());
+
+ id = null;
+ cs = null;
+ context.ungetService(arch_ref);
+ context.ungetService(cs_ref);
+ context.ungetService(fs_ref);
+ fooProvider.stop();
+ fooProvider2.stop();
+ }
+}
diff --git a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/service/CheckService.java b/ipojo/tests/tests.core.service.dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/service/CheckService.java
similarity index 92%
copy from ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/service/CheckService.java
copy to ipojo/tests/tests.core.service.dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/service/CheckService.java
index 62f254c..2fed64e 100644
--- a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/service/CheckService.java
+++ b/ipojo/tests/tests.core.service.dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/service/CheckService.java
@@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
-package org.apache.felix.ipojo.test.scenarios.service;
+package org.apache.felix.ipojo.test.scenarios.service.dependency.service;
import java.util.Properties;
diff --git a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/service/FooService.java b/ipojo/tests/tests.core.service.dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/service/FooService.java
similarity index 92%
copy from ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/service/FooService.java
copy to ipojo/tests/tests.core.service.dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/service/FooService.java
index 78693cf..c5932c3 100644
--- a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/service/FooService.java
+++ b/ipojo/tests/tests.core.service.dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/service/FooService.java
@@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
-package org.apache.felix.ipojo.test.scenarios.service;
+package org.apache.felix.ipojo.test.scenarios.service.dependency.service;
import java.util.Properties;
diff --git a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/dependency/statics/MethodOptionalDependencies.java b/ipojo/tests/tests.core.service.dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/statics/MethodOptionalDependencies.java
similarity index 98%
rename from ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/dependency/statics/MethodOptionalDependencies.java
rename to ipojo/tests/tests.core.service.dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/statics/MethodOptionalDependencies.java
index 310f131..a2c4cd5 100644
--- a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/dependency/statics/MethodOptionalDependencies.java
+++ b/ipojo/tests/tests.core.service.dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/statics/MethodOptionalDependencies.java
@@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
-package org.apache.felix.ipojo.test.scenarios.dependency.statics;
+package org.apache.felix.ipojo.test.scenarios.service.dependency.statics;
import java.util.Properties;
@@ -24,10 +24,11 @@
import org.apache.felix.ipojo.architecture.Architecture;
import org.apache.felix.ipojo.architecture.InstanceDescription;
import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
-import org.apache.felix.ipojo.test.scenarios.service.CheckService;
import org.apache.felix.ipojo.test.scenarios.util.Utils;
import org.osgi.framework.ServiceReference;
+import org.apache.felix.ipojo.test.scenarios.service.dependency.service.CheckService;
+
public class MethodOptionalDependencies extends OSGiTestCase {
ComponentInstance instance3, instance4, instance5;
diff --git a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/dependency/statics/MethodSimpleDependencies.java b/ipojo/tests/tests.core.service.dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/statics/MethodSimpleDependencies.java
similarity index 97%
rename from ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/dependency/statics/MethodSimpleDependencies.java
rename to ipojo/tests/tests.core.service.dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/statics/MethodSimpleDependencies.java
index 70fef81..4fa5043 100644
--- a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/dependency/statics/MethodSimpleDependencies.java
+++ b/ipojo/tests/tests.core.service.dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/statics/MethodSimpleDependencies.java
@@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
-package org.apache.felix.ipojo.test.scenarios.dependency.statics;
+package org.apache.felix.ipojo.test.scenarios.service.dependency.statics;
import java.util.Properties;
@@ -24,10 +24,11 @@
import org.apache.felix.ipojo.architecture.Architecture;
import org.apache.felix.ipojo.architecture.InstanceDescription;
import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
-import org.apache.felix.ipojo.test.scenarios.service.CheckService;
import org.apache.felix.ipojo.test.scenarios.util.Utils;
import org.osgi.framework.ServiceReference;
+import org.apache.felix.ipojo.test.scenarios.service.dependency.service.CheckService;
+
public class MethodSimpleDependencies extends OSGiTestCase {
ComponentInstance instance3, instance4, instance5;
diff --git a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/dependency/statics/MultipleDependencies.java b/ipojo/tests/tests.core.service.dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/statics/MultipleDependencies.java
similarity index 98%
rename from ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/dependency/statics/MultipleDependencies.java
rename to ipojo/tests/tests.core.service.dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/statics/MultipleDependencies.java
index 251adc7..e533fb0 100644
--- a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/dependency/statics/MultipleDependencies.java
+++ b/ipojo/tests/tests.core.service.dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/statics/MultipleDependencies.java
@@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
-package org.apache.felix.ipojo.test.scenarios.dependency.statics;
+package org.apache.felix.ipojo.test.scenarios.service.dependency.statics;
import java.util.Properties;
@@ -24,10 +24,11 @@
import org.apache.felix.ipojo.architecture.Architecture;
import org.apache.felix.ipojo.architecture.InstanceDescription;
import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
-import org.apache.felix.ipojo.test.scenarios.service.CheckService;
import org.apache.felix.ipojo.test.scenarios.util.Utils;
import org.osgi.framework.ServiceReference;
+import org.apache.felix.ipojo.test.scenarios.service.dependency.service.CheckService;
+
public class MultipleDependencies extends OSGiTestCase {
ComponentInstance instance1, instance2, instance3, instance4;
diff --git a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/dependency/statics/OptionalDependencies.java b/ipojo/tests/tests.core.service.dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/statics/OptionalDependencies.java
similarity index 99%
rename from ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/dependency/statics/OptionalDependencies.java
rename to ipojo/tests/tests.core.service.dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/statics/OptionalDependencies.java
index 601cd08..c90f161 100644
--- a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/dependency/statics/OptionalDependencies.java
+++ b/ipojo/tests/tests.core.service.dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/statics/OptionalDependencies.java
@@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
-package org.apache.felix.ipojo.test.scenarios.dependency.statics;
+package org.apache.felix.ipojo.test.scenarios.service.dependency.statics;
import java.util.Properties;
@@ -27,10 +27,11 @@
import org.apache.felix.ipojo.architecture.Architecture;
import org.apache.felix.ipojo.architecture.InstanceDescription;
import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
-import org.apache.felix.ipojo.test.scenarios.service.CheckService;
import org.apache.felix.ipojo.test.scenarios.util.Utils;
import org.osgi.framework.ServiceReference;
+import org.apache.felix.ipojo.test.scenarios.service.dependency.service.CheckService;
+
public class OptionalDependencies extends OSGiTestCase {
ComponentInstance instance1, instance2, instance3, instance4, instance5;
diff --git a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/dependency/statics/SimpleDependencies.java b/ipojo/tests/tests.core.service.dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/statics/SimpleDependencies.java
similarity index 98%
rename from ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/dependency/statics/SimpleDependencies.java
rename to ipojo/tests/tests.core.service.dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/statics/SimpleDependencies.java
index 8623784..cb089ae 100644
--- a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/dependency/statics/SimpleDependencies.java
+++ b/ipojo/tests/tests.core.service.dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/statics/SimpleDependencies.java
@@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
-package org.apache.felix.ipojo.test.scenarios.dependency.statics;
+package org.apache.felix.ipojo.test.scenarios.service.dependency.statics;
import java.util.Properties;
@@ -24,10 +24,11 @@
import org.apache.felix.ipojo.architecture.Architecture;
import org.apache.felix.ipojo.architecture.InstanceDescription;
import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
-import org.apache.felix.ipojo.test.scenarios.service.CheckService;
import org.apache.felix.ipojo.test.scenarios.util.Utils;
import org.osgi.framework.ServiceReference;
+import org.apache.felix.ipojo.test.scenarios.service.dependency.service.CheckService;
+
public class SimpleDependencies extends OSGiTestCase {
ComponentInstance instance1, instance2, instance3, instance4, instance5;
diff --git a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/dependency/statics/StaticDependencyTestSuite.java b/ipojo/tests/tests.core.service.dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/statics/StaticDependencyTestSuite.java
similarity index 94%
rename from ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/dependency/statics/StaticDependencyTestSuite.java
rename to ipojo/tests/tests.core.service.dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/statics/StaticDependencyTestSuite.java
index 656c635..0d8ea4b 100644
--- a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/dependency/statics/StaticDependencyTestSuite.java
+++ b/ipojo/tests/tests.core.service.dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/statics/StaticDependencyTestSuite.java
@@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
-package org.apache.felix.ipojo.test.scenarios.dependency.statics;
+package org.apache.felix.ipojo.test.scenarios.service.dependency.statics;
import junit.framework.Test;
diff --git a/ipojo/tests/tests.core.service.dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/util/Utils.java b/ipojo/tests/tests.core.service.dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/util/Utils.java
new file mode 100644
index 0000000..7dbb8d0
--- /dev/null
+++ b/ipojo/tests/tests.core.service.dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/util/Utils.java
@@ -0,0 +1,325 @@
+/*
+ * 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.util;
+
+import java.util.Dictionary;
+import java.util.Properties;
+
+import junit.framework.Assert;
+
+import org.apache.felix.ipojo.ComponentInstance;
+import org.apache.felix.ipojo.Factory;
+import org.apache.felix.ipojo.Handler;
+import org.apache.felix.ipojo.HandlerFactory;
+import org.apache.felix.ipojo.ServiceContext;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.InvalidSyntaxException;
+import org.osgi.framework.ServiceReference;
+import org.osgi.service.cm.ManagedServiceFactory;
+
+public class Utils {
+
+ public static Factory getFactoryByName(BundleContext bc, String factoryName) {
+ ServiceReference[] refs;
+ try {
+ refs = bc.getServiceReferences(Factory.class.getName(), "(factory.name=" + factoryName + ")");
+ if (refs == null) {
+ System.err.println("Cannot get the factory " + factoryName);
+ return null;
+ }
+ return ((Factory) bc.getService(refs[0]));
+ } catch (InvalidSyntaxException e) {
+ System.err.println("Cannot get the factory " + factoryName + " : " + e.getMessage());
+ return null;
+ }
+ }
+
+ public static HandlerFactory getHandlerFactoryByName(BundleContext bc, String factoryName) {
+ ServiceReference[] refs;
+ try {
+ refs = bc.getServiceReferences(Factory.class.getName(), "(" + Handler.HANDLER_NAME_PROPERTY + "=" + factoryName + ")");
+ if (refs == null) {
+ System.err.println("Cannot get the factory " + factoryName);
+ return null;
+ }
+ return (HandlerFactory) bc.getService(refs[0]);
+ } catch (InvalidSyntaxException e) {
+ System.err.println("Cannot get the factory " + factoryName + " : " + e.getMessage());
+ return null;
+ }
+ }
+
+ public static ComponentInstance getComponentInstance(BundleContext bc, String factoryName, Dictionary configuration) {
+ Factory fact = getFactoryByName(bc, factoryName);
+
+ if (fact == null) {
+ System.err.println("Factory " + factoryName + " not found");
+ return null;
+ }
+
+ // if(fact.isAcceptable(configuration)) {
+ try {
+ return fact.createComponentInstance(configuration);
+ } catch (Exception e) {
+ e.printStackTrace();
+ Assert.fail("Cannot create the instance from " + factoryName + " : " + e.getMessage());
+ return null;
+ }
+ // }
+ // else {
+ // System.err.println("Configuration not accepted by : " + factoryName);
+ // return null;
+ // }
+ }
+
+ public static ComponentInstance getComponentInstanceByName(BundleContext bc, String factoryName, String name) {
+ Factory fact = getFactoryByName(bc, factoryName);
+
+ if (fact == null) {
+ System.err.println("Factory " + factoryName + " not found");
+ return null;
+ }
+
+ try {
+ Properties props = new Properties();
+ props.put("name", name);
+ return fact.createComponentInstance(props);
+ } catch (Exception e) {
+ System.err.println("Cannot create the instance from " + factoryName + " : " + e.getMessage());
+ e.printStackTrace();
+ return null;
+ }
+ }
+
+ public static ServiceReference[] getServiceReferences(BundleContext bc, String itf, String filter) {
+ ServiceReference[] refs = null;
+ try {
+ refs = bc.getServiceReferences(itf, filter);
+ } catch (InvalidSyntaxException e) {
+ System.err.println("Invalid Filter : " + filter);
+ }
+ if (refs == null) {
+ return new ServiceReference[0];
+ } else {
+ return refs;
+ }
+ }
+
+ public static ServiceReference getServiceReference(BundleContext bc, String itf, String filter) {
+ ServiceReference[] refs = null;
+ try {
+ refs = bc.getServiceReferences(itf, filter);
+ } catch (InvalidSyntaxException e) {
+ System.err.println("Invalid Filter : " + filter);
+ }
+ if (refs == null) {
+ return null;
+ } else {
+ return refs[0];
+ }
+ }
+
+ public static ServiceReference getServiceReferenceByName(BundleContext bc, String itf, String name) {
+ ServiceReference[] refs = null;
+ String filter = null;
+ if (itf.equals(Factory.class.getName()) || itf.equals(ManagedServiceFactory.class.getName())) {
+ filter = "(" + "factory.name" + "=" + name + ")";
+ } else {
+ filter = "(" + "instance.name" + "=" + name + ")";
+ }
+ try {
+ refs = bc.getServiceReferences(itf, filter);
+ } catch (InvalidSyntaxException e) {
+ System.err.println("Invalid Filter : " + filter);
+ }
+ if (refs == null) {
+ return null;
+ } else {
+ return refs[0];
+ }
+ }
+
+ public static ServiceReference getServiceReferenceByPID(BundleContext bc, String itf, String pid) {
+ ServiceReference[] refs = null;
+ String filter = "(" + "service.pid" + "=" + pid + ")";
+ try {
+ refs = bc.getServiceReferences(itf, filter);
+ } catch (InvalidSyntaxException e) {
+ System.err.println("Invalid Filter : " + filter);
+ }
+ if (refs == null) {
+ return null;
+ } else if (refs.length == 1) {
+ return refs[0];
+ } else {
+ Assert.fail("A service lookup by PID returned several providers (" + refs.length + ")" + " for " + itf + " with " + pid);
+ return null;
+ }
+ }
+
+ public static Object getServiceObject(BundleContext bc, String itf, String filter) {
+ ServiceReference ref = getServiceReference(bc, itf, filter);
+ if (ref != null) {
+ return bc.getService(ref);
+ } else {
+ return null;
+ }
+ }
+
+ public static Object[] getServiceObjects(BundleContext bc, String itf, String filter) {
+ ServiceReference[] refs = getServiceReferences(bc, itf, filter);
+ if (refs != null) {
+ Object[] list = new Object[refs.length];
+ for (int i = 0; i < refs.length; i++) {
+ list[i] = bc.getService(refs[i]);
+ }
+ return list;
+ } else {
+ return new Object[0];
+ }
+ }
+
+// public static ServiceContext getServiceContext(ComponentInstance ci) {
+// if (ci instanceof CompositeManager) {
+// return ((CompositeManager) ci).getServiceContext();
+// } else {
+// throw new RuntimeException("Cannot get the service context form an non composite instance");
+// }
+// }
+
+ public static Factory getFactoryByName(ServiceContext bc, String factoryName) {
+ ServiceReference[] refs;
+ try {
+ refs = bc.getServiceReferences(Factory.class.getName(), "(factory.name=" + factoryName + ")");
+ if (refs == null) { return null; }
+ return ((Factory) bc.getService(refs[0]));
+ } catch (InvalidSyntaxException e) {
+ System.err.println("Cannot get the factory " + factoryName + " : " + e.getMessage());
+ return null;
+ }
+ }
+
+ public static ComponentInstance getComponentInstance(ServiceContext bc, String factoryName, Dictionary configuration) {
+ Factory fact = getFactoryByName(bc, factoryName);
+
+ if (fact == null) { return null; }
+
+ if (fact.isAcceptable(configuration)) {
+ try {
+ return fact.createComponentInstance(configuration);
+ } catch (Exception e) {
+ System.err.println(e.getMessage());
+ e.printStackTrace();
+ return null;
+ }
+ } else {
+ System.err.println("Configuration not accepted by : " + factoryName);
+ return null;
+ }
+ }
+
+ public static ServiceReference[] getServiceReferences(ServiceContext bc, String itf, String filter) {
+ ServiceReference[] refs = null;
+ try {
+ refs = bc.getServiceReferences(itf, filter);
+ } catch (InvalidSyntaxException e) {
+ System.err.println("Invalid Filter : " + filter);
+ }
+ if (refs == null) {
+ return new ServiceReference[0];
+ } else {
+ return refs;
+ }
+ }
+
+ public static ServiceReference getServiceReference(ServiceContext bc, String itf, String filter) {
+ ServiceReference[] refs = null;
+ try {
+ refs = bc.getServiceReferences(itf, filter);
+ } catch (InvalidSyntaxException e) {
+ System.err.println("Invalid Filter : " + filter);
+ }
+ if (refs == null) {
+ return null;
+ } else {
+ return refs[0];
+ }
+ }
+
+ public static ServiceReference getServiceReferenceByName(ServiceContext bc, String itf, String name) {
+ ServiceReference[] refs = null;
+ String filter = null;
+ if (itf.equals(Factory.class.getName()) || itf.equals(ManagedServiceFactory.class.getName())) {
+ filter = "(" + "factory.name" + "=" + name + ")";
+ } else {
+ filter = "(" + "instance.name" + "=" + name + ")";
+ }
+ try {
+ refs = bc.getServiceReferences(itf, filter);
+ } catch (InvalidSyntaxException e) {
+ System.err.println("Invalid Filter : " + filter);
+ }
+ if (refs == null) {
+ return null;
+ } else {
+ return refs[0];
+ }
+ }
+
+ public static Object getServiceObject(ServiceContext bc, String itf, String filter) {
+ ServiceReference ref = getServiceReference(bc, itf, filter);
+ if (ref != null) {
+ return bc.getService(ref);
+ } else {
+ return null;
+ }
+ }
+
+ public static Object[] getServiceObjects(ServiceContext bc, String itf, String filter) {
+ ServiceReference[] refs = getServiceReferences(bc, itf, filter);
+ if (refs != null) {
+ Object[] list = new Object[refs.length];
+ for (int i = 0; i < refs.length; i++) {
+ list[i] = bc.getService(refs[i]);
+ }
+ return list;
+ } else {
+ return new Object[0];
+ }
+ }
+
+ public static boolean contains(String string, String[] array) {
+ for (int i = 0; array != null && i < array.length; i++) {
+ if (array[i] != null && array[i].equals(string)) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ public static boolean contains(int value, int[] array) {
+ for (int i = 0; array != null && i < array.length; i++) {
+ if (array[i] == value) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+}
diff --git a/ipojo/tests/tests.core/src/main/resources/metadata.xml b/ipojo/tests/tests.core.service.dependency/src/main/resources/metadata.xml
similarity index 64%
rename from ipojo/tests/tests.core/src/main/resources/metadata.xml
rename to ipojo/tests/tests.core.service.dependency/src/main/resources/metadata.xml
index 3e295e2..6b84847 100644
--- a/ipojo/tests/tests.core/src/main/resources/metadata.xml
+++ b/ipojo/tests/tests.core.service.dependency/src/main/resources/metadata.xml
@@ -1,260 +1,10 @@
-<ipojo
- xmlns:cs="org.apache.felix.ipojo.test.handler.checkservice">
- <component classname="org.apache.felix.ipojo.test.log.LogImpl"
- factory="true" name="log">
- <provides />
- </component>
-
- <!-- Component Types used inside tests -->
- <!-- Service Providing -->
+<ipojo>
<component
className="org.apache.felix.ipojo.test.scenarios.component.FooProviderType1"
factory="FooProviderType-1" architecture="true">
<provides />
</component>
- <component
- className="org.apache.felix.ipojo.test.scenarios.component.FooProviderType1"
- factory="FooProviderType-1-Sing" factory-method="singleton"
- architecture="true">
- <provides />
- </component>
- <component
- className="org.apache.felix.ipojo.test.scenarios.component.FooProviderType1"
- factory="FooProviderType-1-Sev" factory-method="several"
- architecture="true">
- <provides />
- </component>
- <component
- className="org.apache.felix.ipojo.test.scenarios.component.FooProviderType1"
- factory="FooProviderType-1-SingM" factory-method="singleton"
- architecture="true">
- <provides factory="method" />
- </component>
- <component
- className="org.apache.felix.ipojo.test.scenarios.component.FooProviderType1"
- factory="FooProviderType-1-SevM" factory-method="several"
- architecture="true">
- <provides factory="method" />
- </component>
- <component
- className="org.apache.felix.ipojo.test.scenarios.component.FooProviderType1"
- name="FooProviderType-2" architecture="true">
- <provides>
- <property name="int" type="int" value="2" />
- <property name="long" type="long" value="40" />
- <property name="string" type="java.lang.String" value="foo" />
- <property name="strAProp" type="java.lang.String[]"
- value="{foo, bar}" />
- <property name="intAProp" type="int[]" value="{1,2,3}" />
- </provides>
- </component>
- <component
- className="org.apache.felix.ipojo.test.scenarios.component.FooProviderTypeDyn"
- name="FooProviderType-Dyn" architecture="true">
- <provides>
- <property name="int" field="intProp" value="2" />
- <property name="boolean" field="boolProp" value="false" />
- <property name="string" field="strProp" value="foo" />
- <property name="strAProp" field="strAProp"
- value="{foo, bar}" />
- <property name="intAProp" field="intAProp" value="{ 1,2,3}" />
- </provides>
- </component>
- <component
- className="org.apache.felix.ipojo.test.scenarios.component.FooProviderTypeDyn2"
- name="FooProviderType-Dyn2" factory="true" architecture="true">
- <provides>
- <property name="int" field="intProp" value="4" />
- <property name="boolean" field="boolProp" />
- <property name="string" field="strProp" />
- <property name="strAProp" field="strAProp" />
- <property name="intAProp" field="intAProp"
- value="{1, 2,3 }" />
- </provides>
- </component>
- <component
- className="org.apache.felix.ipojo.test.scenarios.component.FooProviderTypeDyn"
- factory="FooProviderType-Conf" architecture="true">
- <provides />
- <properties propagation="false">
- <property name="int" field="intProp" value="2" />
- <property name="boolean" field="boolProp" value="false" />
- <property name="string" field="strProp" value="foo" />
- <property name="strAProp" field="strAProp"
- value="{foo, bar}" />
- <property name="intAProp" field="intAProp" value="{1,2, 3}" />
- </properties>
- </component>
- <component
- className="org.apache.felix.ipojo.test.scenarios.component.FooProviderType1"
- factory="FooProviderType-3" architecture="true">
- <provides>
- <property name="foo" field="m_foo" />
- <property name="bar" field="m_bar" />
- <property name="baz" type="java.lang.String" />
- </provides>
- <properties propagation="true">
- <property name="foo" field="m_foo" />
- <property name="bar" field="m_bar" />
- </properties>
- </component>
- <component
- className="org.apache.felix.ipojo.test.scenarios.component.FooProviderType1"
- factory="FooProviderType-4" architecture="true">
- <provides>
- <property name="foo" field="m_foo" />
- <property name="bar" field="m_bar" />
- <property name="baz" type="java.lang.String" />
- </provides>
- <properties propagation="true" pid="FooProvider-3">
- <property name="foo" field="m_foo" />
- <property name="bar" field="m_bar" />
- </properties>
- </component>
- <component
- className="org.apache.felix.ipojo.test.scenarios.component.FooProviderType1"
- factory="FooProviderType-itf" architecture="true">
- <provides
- interface="org.apache.felix.ipojo.test.scenarios.service.FooService" />
- </component>
- <component
- className="org.apache.felix.ipojo.test.scenarios.component.FooBarProviderType1"
- factory="FooBarProviderType-1" architecture="true">
- <provides />
- </component>
- <component
- className="org.apache.felix.ipojo.test.scenarios.component.FooBarProviderType1"
- factory="FooBarProviderType-2" architecture="true">
- <provides
- interface="{org.apache.felix.ipojo.test.scenarios.service.FooService, org.apache.felix.ipojo.test.scenarios.service.BarService }" />
- </component>
- <component
- className="org.apache.felix.ipojo.test.scenarios.component.FooBarProviderType1"
- factory="FooBarProviderType-3" architecture="true">
- <provides
- interface="{org.apache.felix.ipojo.test.scenarios.service.FooService}">
- <property name="baz" type="java.lang.String" value="foo" />
- </provides>
- <provides
- interface="{org.apache.felix.ipojo.test.scenarios.service.BarService}">
- <property name="baz" type="java.lang.String" value="bar" />
- </provides>
- </component>
-
- <!-- Immediate Component -->
- <component
- className="org.apache.felix.ipojo.test.scenarios.component.FooProviderType1"
- factory="ImmediateFooProviderType" immediate="true"
- architecture="true">
- <provides />
- </component>
-
- <component
- className="org.apache.felix.ipojo.test.scenarios.component.FooProviderType1"
- factory="ImmediateFooProviderTypeSingleton" immediate="true"
- factory-method="singleton" architecture="true">
- <provides />
- </component>
-
- <!-- Simple Filter Dependencies -->
- <component
- className="org.apache.felix.ipojo.test.scenarios.component.FilterCheckProvider"
- factory="SimpleFilterCheckServiceProvider" architecture="true">
- <provides>
- <property field="m_toto" name="toto" value="A" />
- </provides>
- </component>
-
- <component
- className="org.apache.felix.ipojo.test.scenarios.component.FilterCheckSubscriber"
- factory="SimpleFilterCheckServiceSubscriber" architecture="true">
- <requires field="m_foo" filter="(toto=B)" id="id1">
- <callback type="bind" method="Bind" />
- <callback type="unbind" method="Unbind" />
- </requires>
- <provides />
- </component>
-
- <component
- className="org.apache.felix.ipojo.test.scenarios.component.FilterCheckSubscriber"
- factory="SimpleFilterCheckServiceSubscriber2" architecture="true">
- <requires field="m_foo" id="id2">
- <callback type="bind" method="Bind" />
- <callback type="unbind" method="Unbind" />
- </requires>
- <provides />
- </component>
-
- <!-- Optional Simple Filter Dependencies -->
- <component
- className="org.apache.felix.ipojo.test.scenarios.component.FilterCheckSubscriber"
- factory="OptionalSimpleFilterCheckServiceSubscriber"
- architecture="true">
- <requires field="m_foo" filter="(toto=B)" id="id1"
- optional="true">
- <callback type="bind" method="Bind" />
- <callback type="unbind" method="Unbind" />
- </requires>
- <provides />
- </component>
-
- <component
- className="org.apache.felix.ipojo.test.scenarios.component.FilterCheckSubscriber"
- factory="OptionalSimpleFilterCheckServiceSubscriber2"
- architecture="true">
- <requires field="m_foo" id="id2" optional="true">
- <callback type="bind" method="Bind" />
- <callback type="unbind" method="Unbind" />
- </requires>
- <provides />
- </component>
-
- <!-- Aggregate filter Dependencies-->
- <component
- className="org.apache.felix.ipojo.test.scenarios.component.MultipleFilterCheckSubscriber"
- factory="MultipleFilterCheckServiceSubscriber" architecture="true">
- <requires field="m_foo" filter="(toto=B)" id="id1">
- <callback type="bind" method="Bind" />
- <callback type="unbind" method="Unbind" />
- </requires>
- <provides />
- </component>
-
- <component
- className="org.apache.felix.ipojo.test.scenarios.component.MultipleFilterCheckSubscriber"
- factory="MultipleFilterCheckServiceSubscriber2" architecture="true">
- <requires field="m_foo" id="id2">
- <callback type="bind" method="Bind" />
- <callback type="unbind" method="Unbind" />
- </requires>
- <provides />
- </component>
-
- <!-- Optional Aggregate Filter Dependencies -->
- <component
- className="org.apache.felix.ipojo.test.scenarios.component.MultipleFilterCheckSubscriber"
- factory="OptionalMultipleFilterCheckServiceSubscriber"
- architecture="true">
- <requires field="m_foo" filter="(toto=B)" id="id1"
- optional="true">
- <callback type="bind" method="Bind" />
- <callback type="unbind" method="Unbind" />
- </requires>
- <provides />
- </component>
-
- <component
- className="org.apache.felix.ipojo.test.scenarios.component.MultipleFilterCheckSubscriber"
- factory="OptionalMultipleFilterCheckServiceSubscriber2"
- architecture="true">
- <requires field="m_foo" id="id2" optional="true">
- <callback type="bind" method="Bind" />
- <callback type="unbind" method="Unbind" />
- </requires>
- <provides />
- </component>
-
-
+
<!-- Simple Dependencies -->
<component
className="org.apache.felix.ipojo.test.scenarios.component.CheckServiceProvider"
@@ -322,7 +72,7 @@
className="org.apache.felix.ipojo.test.scenarios.component.MethodCheckServiceProvider"
factory="MRefCheckServiceProvider" architecture="true">
<requires
- interface="org.apache.felix.ipojo.test.scenarios.service.FooService">
+ interface="org.apache.felix.ipojo.test.scenarios.service.dependency.service.FooService">
<callback type="bind" method="refBind" />
<callback type="unbind" method="refUnbind" />
</requires>
@@ -437,7 +187,7 @@
className="org.apache.felix.ipojo.test.scenarios.component.MethodCheckServiceProvider"
factory="MRefOptionalCheckServiceProvider" architecture="true">
<requires
- interface="org.apache.felix.ipojo.test.scenarios.service.FooService"
+ interface="org.apache.felix.ipojo.test.scenarios.service.dependency.service.FooService"
optional="true">
<callback type="bind" method="refBind" />
<callback type="unbind" method="refUnbind" />
@@ -448,7 +198,7 @@
className="org.apache.felix.ipojo.test.scenarios.component.MethodCheckServiceProvider"
factory="MBothOptionalCheckServiceProvider" architecture="true">
<requires
- interface="org.apache.felix.ipojo.test.scenarios.service.FooService"
+ interface="org.apache.felix.ipojo.test.scenarios.service.dependency.service.FooService"
optional="true">
<callback type="bind" method="bothBind" />
<callback type="unbind" method="bothUnbind" />
@@ -519,7 +269,7 @@
className="org.apache.felix.ipojo.test.scenarios.component.MethodCheckServiceProvider"
factory="DIMRefOptionalCheckServiceProvider" architecture="true">
<requires
- interface="org.apache.felix.ipojo.test.scenarios.service.FooService"
+ interface="org.apache.felix.ipojo.test.scenarios.service.dependency.service.FooService"
optional="true"
default-implementation="org.apache.felix.ipojo.test.scenarios.component.FooServiceDefaultImpl">
<callback type="bind" method="refBind" />
@@ -531,7 +281,7 @@
className="org.apache.felix.ipojo.test.scenarios.component.MethodCheckServiceProvider"
factory="DIMBothOptionalCheckServiceProvider" architecture="true">
<requires
- interface="org.apache.felix.ipojo.test.scenarios.service.FooService"
+ interface="org.apache.felix.ipojo.test.scenarios.service.dependency.service.FooService"
optional="true"
default-implementation="org.apache.felix.ipojo.test.scenarios.component.FooServiceDefaultImpl">
<callback type="bind" method="bothBind" />
@@ -596,7 +346,7 @@
className="org.apache.felix.ipojo.test.scenarios.component.MethodMultipleCheckService"
factory="MRefMultipleCheckServiceProvider" architecture="true">
<requires
- interface="org.apache.felix.ipojo.test.scenarios.service.FooService"
+ interface="org.apache.felix.ipojo.test.scenarios.service.dependency.service.FooService"
aggregate="true">
<callback type="bind" method="refBind" />
<callback type="unbind" method="refUnbind" />
@@ -666,7 +416,7 @@
factory="MRefOptionalMultipleCheckServiceProvider"
architecture="true">
<requires
- interface="org.apache.felix.ipojo.test.scenarios.service.FooService"
+ interface="org.apache.felix.ipojo.test.scenarios.service.dependency.service.FooService"
aggregate="true" optional="true">
<callback type="bind" method="refBind" />
<callback type="unbind" method="refUnbind" />
@@ -730,7 +480,7 @@
className="org.apache.felix.ipojo.test.scenarios.component.MethodCheckServiceProvider"
factory="StaticMRefCheckServiceProvider" architecture="true">
<requires
- interface="org.apache.felix.ipojo.test.scenarios.service.FooService"
+ interface="org.apache.felix.ipojo.test.scenarios.service.dependency.service.FooService"
policy="static">
<callback type="bind" method="refBind" />
<callback type="unbind" method="refUnbind" />
@@ -809,7 +559,7 @@
factory="StaticMRefOptionalCheckServiceProvider"
architecture="true">
<requires
- interface="org.apache.felix.ipojo.test.scenarios.service.FooService"
+ interface="org.apache.felix.ipojo.test.scenarios.service.dependency.service.FooService"
optional="true" policy="static">
<callback type="bind" method="refBind" />
<callback type="unbind" method="refUnbind" />
@@ -821,7 +571,7 @@
factory="StaticMBothOptionalCheckServiceProvider"
architecture="true">
<requires
- interface="org.apache.felix.ipojo.test.scenarios.service.FooService"
+ interface="org.apache.felix.ipojo.test.scenarios.service.dependency.service.FooService"
optional="true" policy="static">
<callback type="bind" method="bothBind" />
<callback type="unbind" method="bothUnbind" />
@@ -890,7 +640,7 @@
factory="StaticMRefMultipleCheckServiceProvider"
architecture="true">
<requires
- interface="org.apache.felix.ipojo.test.scenarios.service.FooService"
+ interface="org.apache.felix.ipojo.test.scenarios.service.dependency.service.FooService"
aggregate="true" policy="static">
<callback type="bind" method="refBind" />
<callback type="unbind" method="refUnbind" />
@@ -907,254 +657,127 @@
</requires>
<provides />
</component>
-
-
- <!-- Lifecycle Callback -->
+
+ <!-- Simple Filter Dependencies -->
<component
- className="org.apache.felix.ipojo.test.scenarios.component.CallbackCheckService"
- factory="CallbackCheckService" architecture="true">
- <requires field="fs" />
- <provides />
- <callback transition="validate" method="start" />
- <callback transition="invalidate" method="stop" />
+ className="org.apache.felix.ipojo.test.scenarios.component.FilterCheckProvider"
+ factory="SimpleFilterCheckServiceProvider" architecture="true">
+ <provides>
+ <property field="m_toto" name="toto" value="A" />
+ </provides>
</component>
+
<component
- className="org.apache.felix.ipojo.test.scenarios.component.CallbackCheckService"
- factory="ParentCallbackCheckService" architecture="true">
- <requires field="fs" />
+ className="org.apache.felix.ipojo.test.scenarios.component.FilterCheckSubscriber"
+ factory="SimpleFilterCheckServiceSubscriber" architecture="true">
+ <requires field="m_foo" filter="(toto=B)" id="id1">
+ <callback type="bind" method="Bind" />
+ <callback type="unbind" method="Unbind" />
+ </requires>
<provides />
- <callback transition="validate" method="parentStart" />
- <callback transition="invalidate" method="parentStop" />
</component>
+
<component
- className="org.apache.felix.ipojo.test.scenarios.component.CallbackCheckService"
- immediate="true" factory="ImmediateCallbackCheckService"
+ className="org.apache.felix.ipojo.test.scenarios.component.FilterCheckSubscriber"
+ factory="SimpleFilterCheckServiceSubscriber2" architecture="true">
+ <requires field="m_foo" id="id2">
+ <callback type="bind" method="Bind" />
+ <callback type="unbind" method="Unbind" />
+ </requires>
+ <provides />
+ </component>
+
+ <!-- Optional Simple Filter Dependencies -->
+ <component
+ className="org.apache.felix.ipojo.test.scenarios.component.FilterCheckSubscriber"
+ factory="OptionalSimpleFilterCheckServiceSubscriber"
architecture="true">
- <requires field="fs" />
- <provides />
- <callback transition="validate" method="start" />
- <callback transition="invalidate" method="stop" />
- </component>
- <component
- className="org.apache.felix.ipojo.test.scenarios.component.CallbackCheckService"
- immediate="true" factory="ImmediateCallbackCheckServiceSingleton"
- factory-method="singleton" architecture="true">
- <requires field="fs" />
- <provides />
- <callback transition="validate" method="start" />
- <callback transition="invalidate" method="stop" />
- </component>
- <component
- className="org.apache.felix.ipojo.test.scenarios.component.CallbackCheckService"
- immediate="true" factory="ImmediateCallbackCheckServiceSeveral"
- factory-method="several" architecture="true">
- <requires field="fs" />
- <provides />
- <callback transition="validate" method="start" />
- <callback transition="invalidate" method="stop" />
- </component>
-
- <!-- Manipulation -->
- <component
- className="org.apache.felix.ipojo.test.scenarios.component.Manipulation23Tester"
- factory="PrimitiveManipulationTester" architecture="true">
+ <requires field="m_foo" filter="(toto=B)" id="id1"
+ optional="true">
+ <callback type="bind" method="Bind" />
+ <callback type="unbind" method="Unbind" />
+ </requires>
<provides />
</component>
<component
- className="org.apache.felix.ipojo.test.scenarios.component.A123.Manipulation23Tester"
- factory="PrimitiveManipulationTesterA" architecture="true">
- <provides />
- </component>
-
- <!-- Configuration Management Test -->
- <component factory="FieldConfigurableCheckService"
- className="org.apache.felix.ipojo.test.scenarios.component.ConfigurableCheckServiceProvider"
+ className="org.apache.felix.ipojo.test.scenarios.component.FilterCheckSubscriber"
+ factory="OptionalSimpleFilterCheckServiceSubscriber2"
architecture="true">
+ <requires field="m_foo" id="id2" optional="true">
+ <callback type="bind" method="Bind" />
+ <callback type="unbind" method="Unbind" />
+ </requires>
<provides />
- <properties propagation="true">
- <property field="b" />
- <property field="s" />
- <property field="i" />
- <property field="l" />
- <property field="d" />
- <property field="f" />
- <property field="c" />
- <property field="bool" />
- <property field="bs" />
- <property field="ss" />
- <property field="is" />
- <property field="ls" />
- <property field="ds" />
- <property field="fs" />
- <property field="cs" />
- <property field="bools" />
- <property field="string" />
- <property field="strings" />
- </properties>
</component>
- <component factory="BothConfigurableCheckService"
- className="org.apache.felix.ipojo.test.scenarios.component.ConfigurableCheckServiceProvider"
+ <!-- Aggregate filter Dependencies-->
+ <component
+ className="org.apache.felix.ipojo.test.scenarios.component.MultipleFilterCheckSubscriber"
+ factory="MultipleFilterCheckServiceSubscriber" architecture="true">
+ <requires field="m_foo" filter="(toto=B)" id="id1">
+ <callback type="bind" method="Bind" />
+ <callback type="unbind" method="Unbind" />
+ </requires>
+ <provides />
+ </component>
+
+ <component
+ className="org.apache.felix.ipojo.test.scenarios.component.MultipleFilterCheckSubscriber"
+ factory="MultipleFilterCheckServiceSubscriber2" architecture="true">
+ <requires field="m_foo" id="id2">
+ <callback type="bind" method="Bind" />
+ <callback type="unbind" method="Unbind" />
+ </requires>
+ <provides />
+ </component>
+
+ <!-- Optional Aggregate Filter Dependencies -->
+ <component
+ className="org.apache.felix.ipojo.test.scenarios.component.MultipleFilterCheckSubscriber"
+ factory="OptionalMultipleFilterCheckServiceSubscriber"
architecture="true">
+ <requires field="m_foo" filter="(toto=B)" id="id1"
+ optional="true">
+ <callback type="bind" method="Bind" />
+ <callback type="unbind" method="Unbind" />
+ </requires>
<provides />
- <properties propagation="true">
- <property field="b" method="updateB" />
- <property field="s" method="updateS" />
- <property field="i" method="updateI" />
- <property field="l" method="updateL" />
- <property field="d" method="updateD" />
- <property field="f" method="updateF" />
- <property field="c" method="updateC" />
- <property field="bool" method="updateBool" />
- <property field="bs" method="updateBs" />
- <property field="ss" method="updateSs" />
- <property field="is" method="updateIs" />
- <property field="ls" method="updateLs" />
- <property field="ds" method="updateDs" />
- <property field="fs" method="updateFs" />
- <property field="cs" method="updateCs" />
- <property field="bools" method="updateBools" />
- <property field="string" method="updateString" />
- <property field="strings" method="updateStrings" />
- </properties>
</component>
- <component factory="MethodConfigurableCheckService"
- className="org.apache.felix.ipojo.test.scenarios.component.ConfigurableCheckServiceProvider"
+ <component
+ className="org.apache.felix.ipojo.test.scenarios.component.MultipleFilterCheckSubscriber"
+ factory="OptionalMultipleFilterCheckServiceSubscriber2"
architecture="true">
- <provides />
- <properties propagation="true">
- <property method="updateB" name="b" />
- <property method="updateS" name="s" />
- <property method="updateI" name="i" />
- <property method="updateL" name="l" />
- <property method="updateD" name="d" />
- <property method="updateF" name="f" />
- <property method="updateC" name="c" />
- <property method="updateBool" name="bool" />
- <property method="updateBs" name="bs" />
- <property method="updateSs" name="ss" />
- <property method="updateIs" name="is" />
- <property method="updateLs" name="ls" />
- <property method="updateDs" name="ds" />
- <property method="updateFs" name="fs" />
- <property method="updateCs" name="cs" />
- <property method="updateBools" name="bools" />
- <property method="updateString" name="string" />
- <property method="updateStrings" name="strings" />
- </properties>
- </component>
-
- <component factory="ParentMethodConfigurableCheckService"
- className="org.apache.felix.ipojo.test.scenarios.component.ParentConfigurableCheckServiceProvider"
- architecture="true">
- <provides />
- <properties propagation="true">
- <property method="updateB" name="b" />
- <property method="updateS" name="s" />
- <property method="updateI" name="i" />
- <property method="updateL" name="l" />
- <property method="updateD" name="d" />
- <property method="updateF" name="f" />
- <property method="updateC" name="c" />
- <property method="updateBool" name="bool" />
- <property method="updateBs" name="bs" />
- <property method="updateSs" name="ss" />
- <property method="updateIs" name="is" />
- <property method="updateLs" name="ls" />
- <property method="updateDs" name="ds" />
- <property method="updateFs" name="fs" />
- <property method="updateCs" name="cs" />
- <property method="updateBools" name="bools" />
- <property method="updateString" name="string" type="string" />
- <property method="updateStrings" name="strings"
- type="java.lang.String[]" />
- </properties>
- </component>
-
- <!-- Handler test -->
- <handler
- classname="org.apache.felix.ipojo.test.handler.CheckServiceHandler"
- name="check"
- namespace="org.apache.felix.ipojo.test.handler.checkservice"
- architecture="false">
- <controller field="isValid" />
- </handler>
- <component
- className="org.apache.felix.ipojo.test.scenarios.component.FooProviderType1"
- factory="HandlerTester" architecture="true">
- <cs:check />
- </component>
- <instance name="HandlerTest-2" component="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>
-
- <!-- Test lifecycle controller -->
- <component
- classname="org.apache.felix.ipojo.test.scenarios.component.LifecycleControllerTest"
- name="lcTest">
- <provides />
- <controller field="m_state" />
- <properties>
- <property name="conf" field="m_conf" method="setConf" />
- </properties>
- </component>
-
- <component
- classname="org.apache.felix.ipojo.test.scenarios.component.LifecycleControllerTest"
- name="lcTest2" immediate="true" architecture="true">
- <provides />
- <controller field="m_state" />
- <properties>
- <property name="conf" field="m_conf" method="setConf" />
- </properties>
- </component>
-
- <!-- Inherited Provides -->
- <component
- classname="org.apache.felix.ipojo.test.scenarios.component.inherited.ProcessImplementation1"
- name="PI1" architecture="true">
+ <requires field="m_foo" id="id2" optional="true">
+ <callback type="bind" method="Bind" />
+ <callback type="unbind" method="Unbind" />
+ </requires>
<provides />
</component>
-
+
+
+ <!-- Dynamic-Priority -->
<component
- classname="org.apache.felix.ipojo.test.scenarios.component.inherited.ProcessImplementation1"
- name="PI1-1" architecture="true">
- <provides
- interface="org.apache.felix.ipojo.test.scenarios.service.ParentParentInterface" />
+ className="org.apache.felix.ipojo.test.scenarios.component.RankedFooProviderType1"
+ factory="RankedFooProviderType" architecture="true">
+ <provides>
+ <property field="m_grade" name="service.ranking"/>
+ </provides>
</component>
-
<component
- classname="org.apache.felix.ipojo.test.scenarios.component.inherited.ProcessImplementation1"
- name="PI1-2" architecture="true">
- <provides
- interface="{org.apache.felix.ipojo.test.scenarios.service.ParentParentInterface, org.apache.felix.ipojo.test.scenarios.service.ParentInterface2}" />
- </component>
-
- <component
- classname="org.apache.felix.ipojo.test.scenarios.component.inherited.ProcessImplementation2"
- name="PI2" architecture="true">
+ className="org.apache.felix.ipojo.test.scenarios.component.DynCheckServiceProvider"
+ factory="DPSimpleCheckServiceProvider" architecture="true">
+ <requires field="fs" policy="dynamic-priority" />
<provides />
</component>
-
<component
- classname="org.apache.felix.ipojo.test.scenarios.component.inherited.ProcessImplementation2"
- name="PI2-1" architecture="true">
- <provides
- interface="org.apache.felix.ipojo.test.scenarios.service.ParentParentInterface" />
- </component>
-
- <component
- classname="org.apache.felix.ipojo.test.scenarios.component.inherited.ProcessImplementation3"
- name="PI3" architecture="true">
+ className="org.apache.felix.ipojo.test.scenarios.component.DynCheckServiceProvider"
+ factory="DPObjectCheckServiceProvider" architecture="true">
+ <requires field="fs" policy="dynamic-priority">
+ <callback type="bind" method="objectBind" />
+ <callback type="unbind" method="objectUnbind" />
+ </requires>
<provides />
</component>
-
- <instance component="log" name="MyLogger" />
</ipojo>
diff --git a/ipojo/tests/tests.core/pom.xml b/ipojo/tests/tests.core.service.providing/pom.xml
similarity index 87%
copy from ipojo/tests/tests.core/pom.xml
copy to ipojo/tests/tests.core.service.providing/pom.xml
index 4795777..ad48a52 100644
--- a/ipojo/tests/tests.core/pom.xml
+++ b/ipojo/tests/tests.core.service.providing/pom.xml
@@ -19,8 +19,8 @@
<project>
<modelVersion>4.0.0</modelVersion>
<packaging>bundle</packaging>
- <name>iPOJO Test Suite</name>
- <artifactId>tests.core</artifactId>
+ <name>iPOJO Service Providing Test Suite</name>
+ <artifactId>tests.core.ps</artifactId>
<groupId>ipojo.tests</groupId>
<version>0.7.6-SNAPSHOT</version>
<dependencies>
@@ -31,11 +31,6 @@
</dependency>
<dependency>
<groupId>org.apache.felix</groupId>
- <artifactId>org.apache.felix.ipojo.composite</artifactId>
- <version>0.7.6-SNAPSHOT</version>
- </dependency>
- <dependency>
- <groupId>org.apache.felix</groupId>
<artifactId>org.apache.felix.ipojo.metadata</artifactId>
<version>0.7.6-SNAPSHOT</version>
</dependency>
@@ -65,7 +60,7 @@
<configuration>
<instructions>
<Export-Package>
- org.apache.felix.ipojo.test.scenarios.service
+ org.apache.felix.ipojo.test.scenarios.ps.service
</Export-Package>
<Bundle-SymbolicName>
${pom.artifactId}
@@ -74,7 +69,7 @@
org.apache.felix.ipojo.test*
</Private-Package>
<Test-Suite>
- org.apache.felix.ipojo.test.IPOJOTestSuite
+ org.apache.felix.ipojo.test.scenarios.ps.ProvidedServiceTestSuite
</Test-Suite>
</instructions>
</configuration>
@@ -98,8 +93,8 @@
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
- <source>1.5</source>
- <target>1.5</target>
+ <source>1.4</source>
+ <target>1.4</target>
</configuration>
</plugin>
</plugins>
diff --git a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/component/CheckProviderParentClass.java b/ipojo/tests/tests.core.service.providing/src/main/java/org/apache/felix/ipojo/test/scenarios/component/CheckProviderParentClass.java
similarity index 95%
copy from ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/component/CheckProviderParentClass.java
copy to ipojo/tests/tests.core.service.providing/src/main/java/org/apache/felix/ipojo/test/scenarios/component/CheckProviderParentClass.java
index 675fe41..cef0891 100644
--- a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/component/CheckProviderParentClass.java
+++ b/ipojo/tests/tests.core.service.providing/src/main/java/org/apache/felix/ipojo/test/scenarios/component/CheckProviderParentClass.java
@@ -18,7 +18,7 @@
*/
package org.apache.felix.ipojo.test.scenarios.component;
-import org.apache.felix.ipojo.test.scenarios.service.FooService;
+import org.apache.felix.ipojo.test.scenarios.ps.service.FooService;
import org.osgi.framework.ServiceReference;
public abstract class CheckProviderParentClass {
diff --git a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/component/CheckServiceProvider.java b/ipojo/tests/tests.core.service.providing/src/main/java/org/apache/felix/ipojo/test/scenarios/component/CheckServiceProvider.java
similarity index 94%
copy from ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/component/CheckServiceProvider.java
copy to ipojo/tests/tests.core.service.providing/src/main/java/org/apache/felix/ipojo/test/scenarios/component/CheckServiceProvider.java
index cd2b927..a41f977 100644
--- a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/component/CheckServiceProvider.java
+++ b/ipojo/tests/tests.core.service.providing/src/main/java/org/apache/felix/ipojo/test/scenarios/component/CheckServiceProvider.java
@@ -20,8 +20,8 @@
import java.util.Properties;
-import org.apache.felix.ipojo.test.scenarios.service.CheckService;
-import org.apache.felix.ipojo.test.scenarios.service.FooService;
+import org.apache.felix.ipojo.test.scenarios.ps.service.CheckService;
+import org.apache.felix.ipojo.test.scenarios.ps.service.FooService;
import org.osgi.framework.ServiceReference;
public class CheckServiceProvider extends CheckProviderParentClass implements CheckService {
diff --git a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/component/FooBarProviderType1.java b/ipojo/tests/tests.core.service.providing/src/main/java/org/apache/felix/ipojo/test/scenarios/component/FooBarProviderType1.java
similarity index 90%
rename from ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/component/FooBarProviderType1.java
rename to ipojo/tests/tests.core.service.providing/src/main/java/org/apache/felix/ipojo/test/scenarios/component/FooBarProviderType1.java
index 2b739b4..5fbac9f 100644
--- a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/component/FooBarProviderType1.java
+++ b/ipojo/tests/tests.core.service.providing/src/main/java/org/apache/felix/ipojo/test/scenarios/component/FooBarProviderType1.java
@@ -20,8 +20,8 @@
import java.util.Properties;
-import org.apache.felix.ipojo.test.scenarios.service.BarService;
-import org.apache.felix.ipojo.test.scenarios.service.FooService;
+import org.apache.felix.ipojo.test.scenarios.ps.service.BarService;
+import org.apache.felix.ipojo.test.scenarios.ps.service.FooService;
public class FooBarProviderType1 implements FooService, BarService {
diff --git a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/component/FooProviderType1.java b/ipojo/tests/tests.core.service.providing/src/main/java/org/apache/felix/ipojo/test/scenarios/component/FooProviderType1.java
similarity index 97%
copy from ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/component/FooProviderType1.java
copy to ipojo/tests/tests.core.service.providing/src/main/java/org/apache/felix/ipojo/test/scenarios/component/FooProviderType1.java
index 3fe9bad..6abb0b1 100644
--- a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/component/FooProviderType1.java
+++ b/ipojo/tests/tests.core.service.providing/src/main/java/org/apache/felix/ipojo/test/scenarios/component/FooProviderType1.java
@@ -20,7 +20,7 @@
import java.util.Properties;
-import org.apache.felix.ipojo.test.scenarios.service.FooService;
+import org.apache.felix.ipojo.test.scenarios.ps.service.FooService;
import org.osgi.framework.BundleContext;
public class FooProviderType1 implements FooService {
diff --git a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/component/FooProviderTypeDyn.java b/ipojo/tests/tests.core.service.providing/src/main/java/org/apache/felix/ipojo/test/scenarios/component/FooProviderTypeDyn.java
similarity index 96%
rename from ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/component/FooProviderTypeDyn.java
rename to ipojo/tests/tests.core.service.providing/src/main/java/org/apache/felix/ipojo/test/scenarios/component/FooProviderTypeDyn.java
index 39f3918..a83cd7a 100644
--- a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/component/FooProviderTypeDyn.java
+++ b/ipojo/tests/tests.core.service.providing/src/main/java/org/apache/felix/ipojo/test/scenarios/component/FooProviderTypeDyn.java
@@ -20,7 +20,8 @@
import java.util.Properties;
-import org.apache.felix.ipojo.test.scenarios.service.FooService;
+import org.apache.felix.ipojo.test.scenarios.ps.service.FooService;
+
public class FooProviderTypeDyn implements FooService {
diff --git a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/component/FooProviderTypeDyn2.java b/ipojo/tests/tests.core.service.providing/src/main/java/org/apache/felix/ipojo/test/scenarios/component/FooProviderTypeDyn2.java
similarity index 95%
rename from ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/component/FooProviderTypeDyn2.java
rename to ipojo/tests/tests.core.service.providing/src/main/java/org/apache/felix/ipojo/test/scenarios/component/FooProviderTypeDyn2.java
index f5f233a..40f6698 100644
--- a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/component/FooProviderTypeDyn2.java
+++ b/ipojo/tests/tests.core.service.providing/src/main/java/org/apache/felix/ipojo/test/scenarios/component/FooProviderTypeDyn2.java
@@ -20,7 +20,7 @@
import java.util.Properties;
-import org.apache.felix.ipojo.test.scenarios.service.FooService;
+import org.apache.felix.ipojo.test.scenarios.ps.service.FooService;
public class FooProviderTypeDyn2 implements FooService {
diff --git a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/component/inherited/ProcessImplementation1.java b/ipojo/tests/tests.core.service.providing/src/main/java/org/apache/felix/ipojo/test/scenarios/component/inherited/ProcessImplementation1.java
similarity index 94%
rename from ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/component/inherited/ProcessImplementation1.java
rename to ipojo/tests/tests.core.service.providing/src/main/java/org/apache/felix/ipojo/test/scenarios/component/inherited/ProcessImplementation1.java
index 3ffab2f..46488a8 100644
--- a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/component/inherited/ProcessImplementation1.java
+++ b/ipojo/tests/tests.core.service.providing/src/main/java/org/apache/felix/ipojo/test/scenarios/component/inherited/ProcessImplementation1.java
@@ -18,7 +18,7 @@
*/
package org.apache.felix.ipojo.test.scenarios.component.inherited;
-import org.apache.felix.ipojo.test.scenarios.service.ChildInterface;
+import org.apache.felix.ipojo.test.scenarios.ps.service.ChildInterface;
public class ProcessImplementation1 implements ChildInterface {
diff --git a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/component/inherited/ProcessImplementation2.java b/ipojo/tests/tests.core.service.providing/src/main/java/org/apache/felix/ipojo/test/scenarios/component/inherited/ProcessImplementation2.java
similarity index 100%
rename from ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/component/inherited/ProcessImplementation2.java
rename to ipojo/tests/tests.core.service.providing/src/main/java/org/apache/felix/ipojo/test/scenarios/component/inherited/ProcessImplementation2.java
diff --git a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/component/inherited/ProcessImplementation3.java b/ipojo/tests/tests.core.service.providing/src/main/java/org/apache/felix/ipojo/test/scenarios/component/inherited/ProcessImplementation3.java
similarity index 96%
rename from ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/component/inherited/ProcessImplementation3.java
rename to ipojo/tests/tests.core.service.providing/src/main/java/org/apache/felix/ipojo/test/scenarios/component/inherited/ProcessImplementation3.java
index cc576d8..d59adbd 100644
--- a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/component/inherited/ProcessImplementation3.java
+++ b/ipojo/tests/tests.core.service.providing/src/main/java/org/apache/felix/ipojo/test/scenarios/component/inherited/ProcessImplementation3.java
@@ -20,7 +20,7 @@
import java.util.Properties;
-import org.apache.felix.ipojo.test.scenarios.service.FooService;
+import org.apache.felix.ipojo.test.scenarios.ps.service.FooService;
public class ProcessImplementation3 extends ProcessParentImplementation implements FooService {
diff --git a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/component/inherited/ProcessParentImplementation.java b/ipojo/tests/tests.core.service.providing/src/main/java/org/apache/felix/ipojo/test/scenarios/component/inherited/ProcessParentImplementation.java
similarity index 94%
rename from ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/component/inherited/ProcessParentImplementation.java
rename to ipojo/tests/tests.core.service.providing/src/main/java/org/apache/felix/ipojo/test/scenarios/component/inherited/ProcessParentImplementation.java
index 69ebace..4872be4 100644
--- a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/component/inherited/ProcessParentImplementation.java
+++ b/ipojo/tests/tests.core.service.providing/src/main/java/org/apache/felix/ipojo/test/scenarios/component/inherited/ProcessParentImplementation.java
@@ -18,7 +18,7 @@
*/
package org.apache.felix.ipojo.test.scenarios.component.inherited;
-import org.apache.felix.ipojo.test.scenarios.service.ChildInterface;
+import org.apache.felix.ipojo.test.scenarios.ps.service.ChildInterface;
public class ProcessParentImplementation implements ChildInterface {
diff --git a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/service/providing/DynamicProps.java b/ipojo/tests/tests.core.service.providing/src/main/java/org/apache/felix/ipojo/test/scenarios/ps/DynamicProps.java
similarity index 97%
rename from ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/service/providing/DynamicProps.java
rename to ipojo/tests/tests.core.service.providing/src/main/java/org/apache/felix/ipojo/test/scenarios/ps/DynamicProps.java
index 6f615ae..4437f1b 100644
--- a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/service/providing/DynamicProps.java
+++ b/ipojo/tests/tests.core.service.providing/src/main/java/org/apache/felix/ipojo/test/scenarios/ps/DynamicProps.java
@@ -16,13 +16,13 @@
* specific language governing permissions and limitations
* under the License.
*/
-package org.apache.felix.ipojo.test.scenarios.service.providing;
+package org.apache.felix.ipojo.test.scenarios.ps;
import java.util.Properties;
import org.apache.felix.ipojo.ComponentInstance;
import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
-import org.apache.felix.ipojo.test.scenarios.service.FooService;
+import org.apache.felix.ipojo.test.scenarios.ps.service.FooService;
import org.apache.felix.ipojo.test.scenarios.util.Utils;
import org.osgi.framework.ServiceReference;
@@ -33,7 +33,7 @@
ComponentInstance fooProvider3;
public void setUp() {
- String type = "FooProviderType-Dyn";
+ String type = "PS-FooProviderType-Dyn";
Properties p1 = new Properties();
p1.put("name", "FooProvider-1");
@@ -48,7 +48,7 @@
p2.put("intAProp", new int[] {1, 2, 3});
fooProvider2 = Utils.getComponentInstance(context, type, p2);
- String type2 = "FooProviderType-Dyn2";
+ String type2 = "PS-FooProviderType-Dyn2";
Properties p3 = new Properties();
p3.put("name", "FooProvider-3");
p3.put("int", new Integer(0));
diff --git a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/service/providing/DynamicPropsReconfiguration.java b/ipojo/tests/tests.core.service.providing/src/main/java/org/apache/felix/ipojo/test/scenarios/ps/DynamicPropsReconfiguration.java
similarity index 96%
rename from ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/service/providing/DynamicPropsReconfiguration.java
rename to ipojo/tests/tests.core.service.providing/src/main/java/org/apache/felix/ipojo/test/scenarios/ps/DynamicPropsReconfiguration.java
index baeaa9d..4384b23 100644
--- a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/service/providing/DynamicPropsReconfiguration.java
+++ b/ipojo/tests/tests.core.service.providing/src/main/java/org/apache/felix/ipojo/test/scenarios/ps/DynamicPropsReconfiguration.java
@@ -16,14 +16,14 @@
* specific language governing permissions and limitations
* under the License.
*/
-package org.apache.felix.ipojo.test.scenarios.service.providing;
+package org.apache.felix.ipojo.test.scenarios.ps;
import java.util.Properties;
import org.apache.felix.ipojo.ComponentInstance;
import org.apache.felix.ipojo.Factory;
import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
-import org.apache.felix.ipojo.test.scenarios.service.FooService;
+import org.apache.felix.ipojo.test.scenarios.ps.service.FooService;
import org.apache.felix.ipojo.test.scenarios.util.Utils;
import org.osgi.framework.ServiceReference;
import org.osgi.service.cm.ConfigurationException;
@@ -33,7 +33,7 @@
ComponentInstance fooProvider3;
public void setUp() {
- String type2 = "FooProviderType-Dyn2";
+ String type2 = "PS-FooProviderType-Dyn2";
Properties p3 = new Properties();
p3.put("name", "FooProvider-3");
p3.put("int", new Integer(0));
@@ -75,7 +75,7 @@
}
// Reconfiguration
- ServiceReference fact_ref = Utils.getServiceReferenceByName(context, Factory.class.getName() , "FooProviderType-Dyn2");
+ ServiceReference fact_ref = Utils.getServiceReferenceByName(context, Factory.class.getName() , "PS-FooProviderType-Dyn2");
Factory fact = (Factory) context.getService(fact_ref);
Properties p3 = new Properties();
p3.put("name", "FooProvider-3");
@@ -136,7 +136,7 @@
assertNull("Check intAProp hidding (no value)", intAProp);
// Reconfiguration
- fact_ref = Utils.getServiceReferenceByName(context, Factory.class.getName() , "FooProviderType-Dyn2");
+ fact_ref = Utils.getServiceReferenceByName(context, Factory.class.getName() , "PS-FooProviderType-Dyn2");
fact = (Factory) context.getService(fact_ref);
p3 = new Properties();
p3.put("name", "FooProvider-3");
@@ -207,7 +207,7 @@
}
// Reconfiguration
- ServiceReference fact_ref = Utils.getServiceReferenceByName(context, Factory.class.getName() , "FooProviderType-Dyn2");
+ ServiceReference fact_ref = Utils.getServiceReferenceByName(context, Factory.class.getName() , "PS-FooProviderType-Dyn2");
Factory fact = (Factory) context.getService(fact_ref);
Properties p3 = new Properties();
p3.put("name", "FooProvider-3");
@@ -268,7 +268,7 @@
assertNull("Check intAProp hidding (no value)", intAProp);
// Reconfiguration
- fact_ref = Utils.getServiceReferenceByName(context, Factory.class.getName() , "FooProviderType-Dyn2");
+ fact_ref = Utils.getServiceReferenceByName(context, Factory.class.getName() , "PS-FooProviderType-Dyn2");
fact = (Factory) context.getService(fact_ref);
p3 = new Properties();
p3.put("name", "FooProvider-3");
@@ -339,7 +339,7 @@
}
// Reconfiguration
- ServiceReference fact_ref = Utils.getServiceReferenceByName(context, ManagedServiceFactory.class.getName() , "FooProviderType-Dyn2");
+ ServiceReference fact_ref = Utils.getServiceReferenceByName(context, ManagedServiceFactory.class.getName() , "PS-FooProviderType-Dyn2");
ManagedServiceFactory fact = (ManagedServiceFactory) context.getService(fact_ref);
Properties p3 = new Properties();
p3.put("int", new Integer(1));
@@ -399,7 +399,7 @@
assertNull("Check intAProp hidding (no value)", intAProp);
// Reconfiguration
- fact_ref = Utils.getServiceReferenceByName(context, ManagedServiceFactory.class.getName() , "FooProviderType-Dyn2");
+ fact_ref = Utils.getServiceReferenceByName(context, ManagedServiceFactory.class.getName() , "PS-FooProviderType-Dyn2");
fact = (ManagedServiceFactory) context.getService(fact_ref);
p3 = new Properties();
p3.put("int", new Integer(1));
@@ -469,7 +469,7 @@
}
// Reconfiguration
- ServiceReference fact_ref = Utils.getServiceReferenceByName(context, ManagedServiceFactory.class.getName() , "FooProviderType-Dyn2");
+ ServiceReference fact_ref = Utils.getServiceReferenceByName(context, ManagedServiceFactory.class.getName() , "PS-FooProviderType-Dyn2");
ManagedServiceFactory fact = (ManagedServiceFactory) context.getService(fact_ref);
Properties p3 = new Properties();
p3.put("int", "1");
@@ -529,7 +529,7 @@
assertNull("Check intAProp hidding (no value)", intAProp);
// Reconfiguration
- fact_ref = Utils.getServiceReferenceByName(context, ManagedServiceFactory.class.getName() , "FooProviderType-Dyn2");
+ fact_ref = Utils.getServiceReferenceByName(context, ManagedServiceFactory.class.getName() , "PS-FooProviderType-Dyn2");
fact = (ManagedServiceFactory) context.getService(fact_ref);
p3 = new Properties();
p3.put("int", "1");
diff --git a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/service/providing/Exposition.java b/ipojo/tests/tests.core.service.providing/src/main/java/org/apache/felix/ipojo/test/scenarios/ps/Exposition.java
similarity index 92%
rename from ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/service/providing/Exposition.java
rename to ipojo/tests/tests.core.service.providing/src/main/java/org/apache/felix/ipojo/test/scenarios/ps/Exposition.java
index ee7aca2..69dca5d 100644
--- a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/service/providing/Exposition.java
+++ b/ipojo/tests/tests.core.service.providing/src/main/java/org/apache/felix/ipojo/test/scenarios/ps/Exposition.java
@@ -16,14 +16,14 @@
* specific language governing permissions and limitations
* under the License.
*/
-package org.apache.felix.ipojo.test.scenarios.service.providing;
+package org.apache.felix.ipojo.test.scenarios.ps;
import java.util.Properties;
import org.apache.felix.ipojo.ComponentInstance;
import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
-import org.apache.felix.ipojo.test.scenarios.service.BarService;
-import org.apache.felix.ipojo.test.scenarios.service.FooService;
+import org.apache.felix.ipojo.test.scenarios.ps.service.BarService;
+import org.apache.felix.ipojo.test.scenarios.ps.service.FooService;
import org.apache.felix.ipojo.test.scenarios.util.Utils;
import org.osgi.framework.ServiceReference;
@@ -38,23 +38,23 @@
public void setUp(){
Properties p1 = new Properties();
p1.put("name", "fooProviderSimple");
- fooProviderSimple = Utils.getComponentInstance(context, "FooProviderType-1", p1);
+ fooProviderSimple = Utils.getComponentInstance(context, "PS-FooProviderType-1", p1);
Properties p2 = new Properties();
p2.put("name", "fooProviderItf");
- fooProviderItf = Utils.getComponentInstance(context, "FooProviderType-itf", p2);
+ fooProviderItf = Utils.getComponentInstance(context, "PS-FooProviderType-itf", p2);
Properties p3 = new Properties();
p3.put("name", "fooProviderItfs");
- fooBarProvider = Utils.getComponentInstance(context, "FooBarProviderType-1", p3);
+ fooBarProvider = Utils.getComponentInstance(context, "PS-FooBarProviderType-1", p3);
Properties p4 = new Properties();
p4.put("name", "fooProviderItfs2");
- fooBarProvider2 = Utils.getComponentInstance(context, "FooBarProviderType-2", p4);
+ fooBarProvider2 = Utils.getComponentInstance(context, "PS-FooBarProviderType-2", p4);
Properties p5 = new Properties();
p5.put("name", "fooProviderItfs3");
- fooBarProvider3 = Utils.getComponentInstance(context, "FooBarProviderType-3", p5);
+ fooBarProvider3 = Utils.getComponentInstance(context, "PS-FooBarProviderType-3", p5);
assertNotNull("Check the instance creation of fooProviderSimple", fooProviderSimple);
assertNotNull("Check the instance creation of fooProviderItf", fooProviderItf);
diff --git a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/service/providing/inherited/InheritedTest.java b/ipojo/tests/tests.core.service.providing/src/main/java/org/apache/felix/ipojo/test/scenarios/ps/InheritedTest.java
similarity index 90%
rename from ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/service/providing/inherited/InheritedTest.java
rename to ipojo/tests/tests.core.service.providing/src/main/java/org/apache/felix/ipojo/test/scenarios/ps/InheritedTest.java
index a2c52f3..0653496 100644
--- a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/service/providing/inherited/InheritedTest.java
+++ b/ipojo/tests/tests.core.service.providing/src/main/java/org/apache/felix/ipojo/test/scenarios/ps/InheritedTest.java
@@ -16,16 +16,16 @@
* specific language governing permissions and limitations
* under the License.
*/
-package org.apache.felix.ipojo.test.scenarios.service.providing.inherited;
+package org.apache.felix.ipojo.test.scenarios.ps;
import org.apache.felix.ipojo.ComponentInstance;
import org.apache.felix.ipojo.Factory;
import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
-import org.apache.felix.ipojo.test.scenarios.service.ChildInterface;
-import org.apache.felix.ipojo.test.scenarios.service.FooService;
-import org.apache.felix.ipojo.test.scenarios.service.ParentInterface1;
-import org.apache.felix.ipojo.test.scenarios.service.ParentInterface2;
-import org.apache.felix.ipojo.test.scenarios.service.ParentParentInterface;
+import org.apache.felix.ipojo.test.scenarios.ps.service.ChildInterface;
+import org.apache.felix.ipojo.test.scenarios.ps.service.FooService;
+import org.apache.felix.ipojo.test.scenarios.ps.service.ParentInterface1;
+import org.apache.felix.ipojo.test.scenarios.ps.service.ParentInterface2;
+import org.apache.felix.ipojo.test.scenarios.ps.service.ParentParentInterface;
import org.apache.felix.ipojo.test.scenarios.util.Utils;
import org.osgi.framework.ServiceReference;
@@ -34,14 +34,14 @@
private Factory pi1, pi11, pi12, pi2, pi21, pi3;
public void setUp() {
- pi1 = Utils.getFactoryByName(context, "PI1");
- pi11 = Utils.getFactoryByName(context, "PI1-1");
- pi12 = Utils.getFactoryByName(context, "PI1-2");
+ pi1 = Utils.getFactoryByName(context, "PS-PI1");
+ pi11 = Utils.getFactoryByName(context, "PS-PI1-1");
+ pi12 = Utils.getFactoryByName(context, "PS-PI1-2");
- pi2 = Utils.getFactoryByName(context, "PI2");
- pi21 = Utils.getFactoryByName(context, "PI2-1");
+ pi2 = Utils.getFactoryByName(context, "PS-PI2");
+ pi21 = Utils.getFactoryByName(context, "PS-PI2-1");
- pi3 = Utils.getFactoryByName(context, "PI3");
+ pi3 = Utils.getFactoryByName(context, "PS-PI3");
}
private boolean contains(String[] arr, String txt) {
diff --git a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/architecture/ProvidedServiceTest.java b/ipojo/tests/tests.core.service.providing/src/main/java/org/apache/felix/ipojo/test/scenarios/ps/ProvidedServiceArchitectureTest.java
similarity index 94%
rename from ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/architecture/ProvidedServiceTest.java
rename to ipojo/tests/tests.core.service.providing/src/main/java/org/apache/felix/ipojo/test/scenarios/ps/ProvidedServiceArchitectureTest.java
index efcd2da..21627d3 100644
--- a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/architecture/ProvidedServiceTest.java
+++ b/ipojo/tests/tests.core.service.providing/src/main/java/org/apache/felix/ipojo/test/scenarios/ps/ProvidedServiceArchitectureTest.java
@@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
-package org.apache.felix.ipojo.test.scenarios.architecture;
+package org.apache.felix.ipojo.test.scenarios.ps;
import java.util.Properties;
@@ -28,16 +28,16 @@
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.test.scenarios.service.BarService;
-import org.apache.felix.ipojo.test.scenarios.service.FooService;
+import org.apache.felix.ipojo.test.scenarios.ps.service.BarService;
+import org.apache.felix.ipojo.test.scenarios.ps.service.FooService;
import org.apache.felix.ipojo.test.scenarios.util.Utils;
import org.osgi.framework.ServiceReference;
-public class ProvidedServiceTest extends OSGiTestCase {
+public class ProvidedServiceArchitectureTest extends OSGiTestCase {
public void testExposition() {
- String factName = "FooProviderType-1";
+ String factName = "PS-FooProviderType-1";
String compName = "FooProvider-1";
// Get the factory to create a component instance
@@ -90,7 +90,7 @@
}
public void testProps() {
- String factName = "FooProviderType-3";
+ String factName = "PS-FooProviderType-3";
String compName = "FooProvider";
// Get the factory to create a component instance
@@ -148,7 +148,7 @@
}
public void testDoubleProviding() {
- String factName = "FooBarProviderType-1";
+ String factName = "PS-FooBarProviderType-1";
String compName = "FooProvider";
// Get the factory to create a component instance
diff --git a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/service/providing/ProvidedServiceTestSuite.java b/ipojo/tests/tests.core.service.providing/src/main/java/org/apache/felix/ipojo/test/scenarios/ps/ProvidedServiceTestSuite.java
similarity index 88%
rename from ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/service/providing/ProvidedServiceTestSuite.java
rename to ipojo/tests/tests.core.service.providing/src/main/java/org/apache/felix/ipojo/test/scenarios/ps/ProvidedServiceTestSuite.java
index d12c206..c5d8866 100644
--- a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/service/providing/ProvidedServiceTestSuite.java
+++ b/ipojo/tests/tests.core.service.providing/src/main/java/org/apache/felix/ipojo/test/scenarios/ps/ProvidedServiceTestSuite.java
@@ -16,13 +16,12 @@
* specific language governing permissions and limitations
* under the License.
*/
-package org.apache.felix.ipojo.test.scenarios.service.providing;
+package org.apache.felix.ipojo.test.scenarios.ps;
import junit.framework.Test;
import junit.framework.TestSuite;
import org.apache.felix.ipojo.junit4osgi.OSGiTestSuite;
-import org.apache.felix.ipojo.test.scenarios.service.providing.inherited.InheritedTest;
import org.osgi.framework.BundleContext;
public class ProvidedServiceTestSuite extends TestSuite {
@@ -33,10 +32,10 @@
ots.addTestSuite(SimplePS.class);
ots.addTestSuite(StaticProps.class);
ots.addTestSuite(DynamicProps.class);
- ots.addTestSuite(FactoryProps.class);
ots.addTestSuite(StaticPropsReconfiguration.class);
ots.addTestSuite(DynamicPropsReconfiguration.class);
ots.addTestSuite(InheritedTest.class);
+ ots.addTestSuite(ProvidedServiceArchitectureTest.class);
return ots;
}
diff --git a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/service/providing/SimplePS.java b/ipojo/tests/tests.core.service.providing/src/main/java/org/apache/felix/ipojo/test/scenarios/ps/SimplePS.java
similarity index 93%
rename from ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/service/providing/SimplePS.java
rename to ipojo/tests/tests.core.service.providing/src/main/java/org/apache/felix/ipojo/test/scenarios/ps/SimplePS.java
index 8e52b1c..6f1f8c2 100644
--- a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/service/providing/SimplePS.java
+++ b/ipojo/tests/tests.core.service.providing/src/main/java/org/apache/felix/ipojo/test/scenarios/ps/SimplePS.java
@@ -16,14 +16,14 @@
* specific language governing permissions and limitations
* under the License.
*/
-package org.apache.felix.ipojo.test.scenarios.service.providing;
+package org.apache.felix.ipojo.test.scenarios.ps;
import java.util.Properties;
import org.apache.felix.ipojo.ComponentInstance;
import org.apache.felix.ipojo.Factory;
import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
-import org.apache.felix.ipojo.test.scenarios.service.FooService;
+import org.apache.felix.ipojo.test.scenarios.ps.service.FooService;
import org.apache.felix.ipojo.test.scenarios.util.Utils;
import org.osgi.framework.InvalidSyntaxException;
import org.osgi.framework.ServiceReference;
@@ -31,7 +31,7 @@
public class SimplePS extends OSGiTestCase {
public void testPS() {
- String factName = "FooProviderType-1";
+ String factName = "PS-FooProviderType-1";
String compName = "FooProvider-1";
ServiceReference[] refs = null;
diff --git a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/service/providing/StaticProps.java b/ipojo/tests/tests.core.service.providing/src/main/java/org/apache/felix/ipojo/test/scenarios/ps/StaticProps.java
similarity index 95%
rename from ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/service/providing/StaticProps.java
rename to ipojo/tests/tests.core.service.providing/src/main/java/org/apache/felix/ipojo/test/scenarios/ps/StaticProps.java
index 4894900..afcfe08 100644
--- a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/service/providing/StaticProps.java
+++ b/ipojo/tests/tests.core.service.providing/src/main/java/org/apache/felix/ipojo/test/scenarios/ps/StaticProps.java
@@ -16,13 +16,13 @@
* specific language governing permissions and limitations
* under the License.
*/
-package org.apache.felix.ipojo.test.scenarios.service.providing;
+package org.apache.felix.ipojo.test.scenarios.ps;
import java.util.Properties;
import org.apache.felix.ipojo.ComponentInstance;
import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
-import org.apache.felix.ipojo.test.scenarios.service.FooService;
+import org.apache.felix.ipojo.test.scenarios.ps.service.FooService;
import org.apache.felix.ipojo.test.scenarios.util.Utils;
import org.osgi.framework.ServiceReference;
@@ -32,7 +32,7 @@
ComponentInstance fooProvider2;
public void setUp() {
- String type = "FooProviderType-2";
+ String type = "PS-FooProviderType-2";
Properties p1 = new Properties();
p1.put("name", "FooProvider-1");
diff --git a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/service/providing/StaticPropsReconfiguration.java b/ipojo/tests/tests.core.service.providing/src/main/java/org/apache/felix/ipojo/test/scenarios/ps/StaticPropsReconfiguration.java
similarity index 96%
rename from ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/service/providing/StaticPropsReconfiguration.java
rename to ipojo/tests/tests.core.service.providing/src/main/java/org/apache/felix/ipojo/test/scenarios/ps/StaticPropsReconfiguration.java
index 215d41e..5f9baf9 100644
--- a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/service/providing/StaticPropsReconfiguration.java
+++ b/ipojo/tests/tests.core.service.providing/src/main/java/org/apache/felix/ipojo/test/scenarios/ps/StaticPropsReconfiguration.java
@@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
-package org.apache.felix.ipojo.test.scenarios.service.providing;
+package org.apache.felix.ipojo.test.scenarios.ps;
import java.util.Dictionary;
import java.util.Properties;
@@ -24,7 +24,7 @@
import org.apache.felix.ipojo.ComponentInstance;
import org.apache.felix.ipojo.Factory;
import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
-import org.apache.felix.ipojo.test.scenarios.service.FooService;
+import org.apache.felix.ipojo.test.scenarios.ps.service.FooService;
import org.apache.felix.ipojo.test.scenarios.util.Utils;
import org.osgi.framework.ServiceReference;
import org.osgi.service.cm.ConfigurationException;
@@ -36,7 +36,7 @@
ComponentInstance fooProvider2;
public void setUp() {
- String type = "FooProviderType-2";
+ String type = "PS-FooProviderType-2";
Properties p1 = new Properties();
p1.put("name", "FooProvider-1");
@@ -86,7 +86,7 @@
}
// Reconfiguration
- ServiceReference fact_ref = Utils.getServiceReferenceByName(context, Factory.class.getName(), "FooProviderType-2");
+ ServiceReference fact_ref = Utils.getServiceReferenceByName(context, Factory.class.getName(), "PS-FooProviderType-2");
Dictionary reconf = new Properties();
reconf.put("name", "FooProvider-1");
reconf.put("int", new Integer(5));
@@ -157,7 +157,7 @@
}
// Reconfiguration
- ServiceReference fact_ref = Utils.getServiceReferenceByName(context, Factory.class.getName(), "FooProviderType-2");
+ ServiceReference fact_ref = Utils.getServiceReferenceByName(context, Factory.class.getName(), "PS-FooProviderType-2");
Dictionary reconf = new Properties();
reconf.put("name", "FooProvider-2");
reconf.put("int", new Integer(5));
@@ -223,7 +223,7 @@
}
// Reconfiguration
- ServiceReference fact_ref = Utils.getServiceReferenceByName(context, ManagedServiceFactory.class.getName(), "FooProviderType-2");
+ ServiceReference fact_ref = Utils.getServiceReferenceByName(context, ManagedServiceFactory.class.getName(), "PS-FooProviderType-2");
Dictionary reconf = new Properties();
reconf.put("int", new Integer(5));
reconf.put("long", new Long(43));
@@ -293,7 +293,7 @@
}
// Reconfiguration
- ServiceReference fact_ref = Utils.getServiceReferenceByName(context, ManagedServiceFactory.class.getName(), "FooProviderType-2");
+ ServiceReference fact_ref = Utils.getServiceReferenceByName(context, ManagedServiceFactory.class.getName(), "PS-FooProviderType-2");
Dictionary reconf = new Properties();
reconf.put("int", new Integer(5));
reconf.put("long", new Long(43));
diff --git a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/service/BarService.java b/ipojo/tests/tests.core.service.providing/src/main/java/org/apache/felix/ipojo/test/scenarios/ps/service/BarService.java
similarity index 93%
copy from ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/service/BarService.java
copy to ipojo/tests/tests.core.service.providing/src/main/java/org/apache/felix/ipojo/test/scenarios/ps/service/BarService.java
index 727e845..7ccee67 100644
--- a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/service/BarService.java
+++ b/ipojo/tests/tests.core.service.providing/src/main/java/org/apache/felix/ipojo/test/scenarios/ps/service/BarService.java
@@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
-package org.apache.felix.ipojo.test.scenarios.service;
+package org.apache.felix.ipojo.test.scenarios.ps.service;
import java.util.Properties;
diff --git a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/service/CheckService.java b/ipojo/tests/tests.core.service.providing/src/main/java/org/apache/felix/ipojo/test/scenarios/ps/service/CheckService.java
similarity index 94%
rename from ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/service/CheckService.java
rename to ipojo/tests/tests.core.service.providing/src/main/java/org/apache/felix/ipojo/test/scenarios/ps/service/CheckService.java
index 62f254c..f500f79 100644
--- a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/service/CheckService.java
+++ b/ipojo/tests/tests.core.service.providing/src/main/java/org/apache/felix/ipojo/test/scenarios/ps/service/CheckService.java
@@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
-package org.apache.felix.ipojo.test.scenarios.service;
+package org.apache.felix.ipojo.test.scenarios.ps.service;
import java.util.Properties;
diff --git a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/service/ChildInterface.java b/ipojo/tests/tests.core.service.providing/src/main/java/org/apache/felix/ipojo/test/scenarios/ps/service/ChildInterface.java
similarity index 93%
rename from ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/service/ChildInterface.java
rename to ipojo/tests/tests.core.service.providing/src/main/java/org/apache/felix/ipojo/test/scenarios/ps/service/ChildInterface.java
index cb7c6c1..b3d8974 100644
--- a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/service/ChildInterface.java
+++ b/ipojo/tests/tests.core.service.providing/src/main/java/org/apache/felix/ipojo/test/scenarios/ps/service/ChildInterface.java
@@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
-package org.apache.felix.ipojo.test.scenarios.service;
+package org.apache.felix.ipojo.test.scenarios.ps.service;
public interface ChildInterface extends ParentInterface1, ParentInterface2 {
diff --git a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/service/FooService.java b/ipojo/tests/tests.core.service.providing/src/main/java/org/apache/felix/ipojo/test/scenarios/ps/service/FooService.java
similarity index 94%
copy from ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/service/FooService.java
copy to ipojo/tests/tests.core.service.providing/src/main/java/org/apache/felix/ipojo/test/scenarios/ps/service/FooService.java
index 78693cf..7bf3e25 100644
--- a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/service/FooService.java
+++ b/ipojo/tests/tests.core.service.providing/src/main/java/org/apache/felix/ipojo/test/scenarios/ps/service/FooService.java
@@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
-package org.apache.felix.ipojo.test.scenarios.service;
+package org.apache.felix.ipojo.test.scenarios.ps.service;
import java.util.Properties;
diff --git a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/service/ParentInterface1.java b/ipojo/tests/tests.core.service.providing/src/main/java/org/apache/felix/ipojo/test/scenarios/ps/service/ParentInterface1.java
similarity index 93%
rename from ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/service/ParentInterface1.java
rename to ipojo/tests/tests.core.service.providing/src/main/java/org/apache/felix/ipojo/test/scenarios/ps/service/ParentInterface1.java
index f70daf3..f032f3e 100644
--- a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/service/ParentInterface1.java
+++ b/ipojo/tests/tests.core.service.providing/src/main/java/org/apache/felix/ipojo/test/scenarios/ps/service/ParentInterface1.java
@@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
-package org.apache.felix.ipojo.test.scenarios.service;
+package org.apache.felix.ipojo.test.scenarios.ps.service;
public interface ParentInterface1 extends ParentParentInterface {
diff --git a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/service/ParentInterface2.java b/ipojo/tests/tests.core.service.providing/src/main/java/org/apache/felix/ipojo/test/scenarios/ps/service/ParentInterface2.java
similarity index 93%
rename from ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/service/ParentInterface2.java
rename to ipojo/tests/tests.core.service.providing/src/main/java/org/apache/felix/ipojo/test/scenarios/ps/service/ParentInterface2.java
index 78c3d35..8369a14 100644
--- a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/service/ParentInterface2.java
+++ b/ipojo/tests/tests.core.service.providing/src/main/java/org/apache/felix/ipojo/test/scenarios/ps/service/ParentInterface2.java
@@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
-package org.apache.felix.ipojo.test.scenarios.service;
+package org.apache.felix.ipojo.test.scenarios.ps.service;
public interface ParentInterface2 {
diff --git a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/service/ParentParentInterface.java b/ipojo/tests/tests.core.service.providing/src/main/java/org/apache/felix/ipojo/test/scenarios/ps/service/ParentParentInterface.java
similarity index 93%
rename from ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/service/ParentParentInterface.java
rename to ipojo/tests/tests.core.service.providing/src/main/java/org/apache/felix/ipojo/test/scenarios/ps/service/ParentParentInterface.java
index 29767d4..d9fa406 100644
--- a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/service/ParentParentInterface.java
+++ b/ipojo/tests/tests.core.service.providing/src/main/java/org/apache/felix/ipojo/test/scenarios/ps/service/ParentParentInterface.java
@@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
-package org.apache.felix.ipojo.test.scenarios.service;
+package org.apache.felix.ipojo.test.scenarios.ps.service;
public interface ParentParentInterface {
diff --git a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/util/Utils.java b/ipojo/tests/tests.core.service.providing/src/main/java/org/apache/felix/ipojo/test/scenarios/util/Utils.java
similarity index 100%
copy from ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/util/Utils.java
copy to ipojo/tests/tests.core.service.providing/src/main/java/org/apache/felix/ipojo/test/scenarios/util/Utils.java
diff --git a/ipojo/tests/tests.core.service.providing/src/main/resources/metadata.xml b/ipojo/tests/tests.core.service.providing/src/main/resources/metadata.xml
new file mode 100644
index 0000000..3588872
--- /dev/null
+++ b/ipojo/tests/tests.core.service.providing/src/main/resources/metadata.xml
@@ -0,0 +1,135 @@
+<ipojo>
+ <!-- Simple provider -->
+ <component
+ className="org.apache.felix.ipojo.test.scenarios.component.FooProviderType1"
+ factory="PS-FooProviderType-1" architecture="true">
+ <provides />
+ </component>
+
+ <component
+ className="org.apache.felix.ipojo.test.scenarios.component.FooProviderType1"
+ factory="PS-FooProviderType-itf" architecture="true">
+ <provides
+ interface="org.apache.felix.ipojo.test.scenarios.ps.service.FooService" />
+ </component>
+
+ <component
+ className="org.apache.felix.ipojo.test.scenarios.component.FooProviderType1"
+ factory="PS-FooProviderType-3" architecture="true">
+ <provides>
+ <property name="foo" field="m_foo" />
+ <property name="bar" field="m_bar" />
+ <property name="baz" type="java.lang.String" />
+ </provides>
+ <properties propagation="true">
+ <property name="foo" field="m_foo" />
+ <property name="bar" field="m_bar" />
+ </properties>
+ </component>
+
+ <!-- Providers providing 2 services -->
+ <component
+ className="org.apache.felix.ipojo.test.scenarios.component.FooBarProviderType1"
+ factory="PS-FooBarProviderType-1" architecture="true">
+ <provides />
+ </component>
+ <component
+ className="org.apache.felix.ipojo.test.scenarios.component.FooBarProviderType1"
+ factory="PS-FooBarProviderType-2" architecture="true">
+ <provides
+ interface="{org.apache.felix.ipojo.test.scenarios.ps.service.FooService, org.apache.felix.ipojo.test.scenarios.ps.service.BarService }" />
+ </component>
+ <component
+ className="org.apache.felix.ipojo.test.scenarios.component.FooBarProviderType1"
+ factory="PS-FooBarProviderType-3" architecture="true">
+ <provides
+ interface="{org.apache.felix.ipojo.test.scenarios.ps.service.FooService}">
+ <property name="baz" type="java.lang.String" value="foo" />
+ </provides>
+ <provides
+ interface="{org.apache.felix.ipojo.test.scenarios.ps.service.BarService}">
+ <property name="baz" type="java.lang.String" value="bar" />
+ </provides>
+ </component>
+
+
+ <!-- Provider with dynamic property -->
+ <component
+ className="org.apache.felix.ipojo.test.scenarios.component.FooProviderTypeDyn"
+ name="PS-FooProviderType-Dyn" architecture="true">
+ <provides>
+ <property name="int" field="intProp" value="2" />
+ <property name="boolean" field="boolProp" value="false" />
+ <property name="string" field="strProp" value="foo" />
+ <property name="strAProp" field="strAProp"
+ value="{foo, bar}" />
+ <property name="intAProp" field="intAProp" value="{ 1,2,3}" />
+ </provides>
+ </component>
+
+ <component
+ className="org.apache.felix.ipojo.test.scenarios.component.FooProviderType1"
+ name="PS-FooProviderType-2" architecture="true">
+ <provides>
+ <property name="int" type="int" value="2" />
+ <property name="long" type="long" value="40" />
+ <property name="string" type="java.lang.String" value="foo" />
+ <property name="strAProp" type="java.lang.String[]"
+ value="{foo, bar}" />
+ <property name="intAProp" type="int[]" value="{1,2,3}" />
+ </provides>
+ </component>
+
+ <component
+ className="org.apache.felix.ipojo.test.scenarios.component.FooProviderTypeDyn2"
+ name="PS-FooProviderType-Dyn2" factory="true" architecture="true">
+ <provides>
+ <property name="int" field="intProp" value="4" />
+ <property name="boolean" field="boolProp" />
+ <property name="string" field="strProp" />
+ <property name="strAProp" field="strAProp" />
+ <property name="intAProp" field="intAProp"
+ value="{1, 2,3 }" />
+ </provides>
+ </component>
+
+ <!-- Inherited Provides -->
+ <component
+ classname="org.apache.felix.ipojo.test.scenarios.component.inherited.ProcessImplementation1"
+ name="PS-PI1" architecture="true">
+ <provides />
+ </component>
+
+ <component
+ classname="org.apache.felix.ipojo.test.scenarios.component.inherited.ProcessImplementation1"
+ name="PS-PI1-1" architecture="true">
+ <provides
+ interface="org.apache.felix.ipojo.test.scenarios.ps.service.ParentParentInterface" />
+ </component>
+
+ <component
+ classname="org.apache.felix.ipojo.test.scenarios.component.inherited.ProcessImplementation1"
+ name="PS-PI1-2" architecture="true">
+ <provides
+ interface="{org.apache.felix.ipojo.test.scenarios.ps.service.ParentParentInterface, org.apache.felix.ipojo.test.scenarios.ps.service.ParentInterface2}" />
+ </component>
+
+ <component
+ classname="org.apache.felix.ipojo.test.scenarios.component.inherited.ProcessImplementation2"
+ name="PS-PI2" architecture="true">
+ <provides />
+ </component>
+
+ <component
+ classname="org.apache.felix.ipojo.test.scenarios.component.inherited.ProcessImplementation2"
+ name="PS-PI2-1" architecture="true">
+ <provides
+ interface="org.apache.felix.ipojo.test.scenarios.ps.service.ParentParentInterface" />
+ </component>
+
+ <component
+ classname="org.apache.felix.ipojo.test.scenarios.component.inherited.ProcessImplementation3"
+ name="PS-PI3" architecture="true">
+ <provides />
+ </component>
+</ipojo>
diff --git a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/IPOJOTestSuite.java b/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/IPOJOTestSuite.java
deleted file mode 100644
index b9fbeb9..0000000
--- a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/IPOJOTestSuite.java
+++ /dev/null
@@ -1,55 +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.test;
-
-import junit.framework.Test;
-
-import org.apache.felix.ipojo.junit4osgi.OSGiTestSuite;
-import org.apache.felix.ipojo.test.scenarios.architecture.ArchitectureTestSuite;
-import org.apache.felix.ipojo.test.scenarios.bad.BadTestSuite;
-import org.apache.felix.ipojo.test.scenarios.configuration.ConfigurationTestSuite;
-import org.apache.felix.ipojo.test.scenarios.controller.LifeCycleControllerTestSuite;
-import org.apache.felix.ipojo.test.scenarios.core.CoreTestSuite;
-import org.apache.felix.ipojo.test.scenarios.dependency.DependencyTestSuite;
-import org.apache.felix.ipojo.test.scenarios.factory.FactoryTestSuite;
-import org.apache.felix.ipojo.test.scenarios.handler.ExternalHandlerTestSuite;
-import org.apache.felix.ipojo.test.scenarios.lifecycle.LifeCycleCallbackTest;
-import org.apache.felix.ipojo.test.scenarios.manipulation.ManipulationTestSuite;
-import org.apache.felix.ipojo.test.scenarios.service.providing.ProvidedServiceTestSuite;
-import org.osgi.framework.BundleContext;
-
-public class IPOJOTestSuite {
-
- public static Test suite(BundleContext bc) {
- OSGiTestSuite ots = new OSGiTestSuite("IPojo Core Test Suite", bc);
- ots.addTest(ManipulationTestSuite.suite(bc));
- ots.addTest(CoreTestSuite.suite(bc));
- ots.addTest(FactoryTestSuite.suite(bc));
- ots.addTest(ProvidedServiceTestSuite.suite(bc));
- ots.addTest(LifeCycleControllerTestSuite.suite(bc));
- ots.addTest(LifeCycleCallbackTest.suite(bc));
- ots.addTest(DependencyTestSuite.suite(bc));
- ots.addTest(ArchitectureTestSuite.suite(bc));
- ots.addTest(ConfigurationTestSuite.suite(bc));
- ots.addTest(ExternalHandlerTestSuite.suite(bc));
- ots.addTest(BadTestSuite.suite(bc));
- return ots;
- }
-
-}
diff --git a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/log/DefaultLogImpl.java b/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/log/DefaultLogImpl.java
deleted file mode 100644
index bbde9eb..0000000
--- a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/log/DefaultLogImpl.java
+++ /dev/null
@@ -1,65 +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.test.log;
-
-import org.osgi.framework.ServiceReference;
-import org.osgi.service.log.LogService;
-
-public class DefaultLogImpl implements LogService {
-
-
- public void log(int arg0, String arg1) {
- dispatch(arg0, arg1);
- }
-
- public void log(int arg0, String arg1, Throwable arg2) {
- dispatch(arg0, arg1 + " (" + arg2.getMessage() + ")");
- }
-
- public void log(ServiceReference arg0, int arg1, String arg2) {
- dispatch(arg1, arg2 + " (" + arg0.toString() + ")");
- }
-
- public void log(ServiceReference arg0, int arg1, String arg2, Throwable arg3) {
- dispatch(arg1, arg2 + " (" + arg0.toString() + ")" + " (" + arg3.getMessage() + ")");
- }
-
-
- private void dispatch(int level, String message) {
- switch (level) {
- case LogService.LOG_DEBUG:
- System.out.println("[DEBUG] " + message);
- break;
- case LogService.LOG_INFO:
- System.out.println("[INFO] " + message);
- break;
- case LogService.LOG_WARNING:
- System.out.println("[WARNING] " + message);
- break;
- case LogService.LOG_ERROR:
- System.out.println("[ERROR] " + message);
- break;
- default:
- System.out.println("[" + level + "] " + message);
- break;
- }
- }
-
-
-}
diff --git a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/log/LogImpl.java b/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/log/LogImpl.java
deleted file mode 100644
index 9f23faf..0000000
--- a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/log/LogImpl.java
+++ /dev/null
@@ -1,131 +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.test.log;
-
-import java.util.Enumeration;
-import java.util.Vector;
-
-import org.osgi.framework.Bundle;
-import org.osgi.framework.ServiceReference;
-import org.osgi.service.log.LogEntry;
-import org.osgi.service.log.LogListener;
-import org.osgi.service.log.LogReaderService;
-import org.osgi.service.log.LogService;
-
-public class LogImpl implements LogService, LogReaderService {
-
- Vector m_messages = new Vector();
-
- public void log(int arg0, String arg1) {
- add(new LogEntryImpl(arg0, arg1, null, null));
- }
-
- public void log(final int arg0, final String arg1, final Throwable arg2) {
- Runnable runnable = new Runnable() {
- public void run() {
- add(new LogEntryImpl(arg0, arg1, arg2, null));
- }
- };
- Thread thread = new Thread(runnable);
- thread.start();
- }
-
- public void log(final ServiceReference arg0, final int arg1, final String arg2) {
- Runnable runnable = new Runnable() {
- public void run() {
- add(new LogEntryImpl(arg1, arg2, null, arg0));
- }
- };
- Thread thread = new Thread(runnable);
- thread.start();
- }
-
- public void log(final ServiceReference arg0, final int arg1, final String arg2, final Throwable arg3) {
-// Runnable runnable = new Runnable() {
-// public void run() {
-// add(new LogEntryImpl(arg1, arg2, arg3, arg0));
-// }
-// };
-// Thread thread = new Thread(runnable);
-// thread.start();
- }
-
- private void add(LogEntry entry) {
- m_messages.add(entry);
- }
-
- public void addLogListener(LogListener arg0) {
- throw new UnsupportedOperationException("Log Listener not supported");
-
- }
-
- public Enumeration getLog() {
- return m_messages.elements();
- }
-
- public void removeLogListener(LogListener arg0) {
- throw new UnsupportedOperationException("Log Listener not supported");
-
- }
-
- private class LogEntryImpl implements LogEntry {
-
- private int level;
- private String message;
- private Throwable exception;
- private ServiceReference reference;
- private long time;
-
-
- LogEntryImpl(int l, String m, Throwable e, ServiceReference ref) {
- level = l;
- message = m;
- exception = e;
- reference = ref;
- time = System.currentTimeMillis();
- }
-
-
- public Bundle getBundle() {
- return null;
- }
-
- public Throwable getException() {
- return exception;
- }
-
- public int getLevel() {
- return level;
- }
-
- public String getMessage() {
- return message;
- }
-
- public ServiceReference getServiceReference() {
- return reference;
- }
-
- public long getTime() {
- return time;
- }
-
- }
-
-}
diff --git a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/architecture/ArchitectureTestSuite.java b/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/architecture/ArchitectureTestSuite.java
deleted file mode 100644
index ef287b6..0000000
--- a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/architecture/ArchitectureTestSuite.java
+++ /dev/null
@@ -1,35 +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.test.scenarios.architecture;
-
-import junit.framework.Test;
-
-import org.apache.felix.ipojo.junit4osgi.OSGiTestSuite;
-import org.osgi.framework.BundleContext;
-
-public class ArchitectureTestSuite {
-
- public static Test suite(BundleContext bc) {
- OSGiTestSuite ots = new OSGiTestSuite("Architecture Test Suite", bc);
- ots.addTestSuite(ProvidedServiceTest.class);
- ots.addTestSuite(DependencyTest.class);
- return ots;
- }
-
-}
diff --git a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/component/A123/CheckService2Provider.java b/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/component/A123/CheckService2Provider.java
deleted file mode 100644
index 9202b1d..0000000
--- a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/component/A123/CheckService2Provider.java
+++ /dev/null
@@ -1,30 +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.test.scenarios.component.A123;
-
-import org.apache.felix.ipojo.test.scenarios.service.A123.CheckService2;
-
-public class CheckService2Provider implements CheckService2 {
-
- public boolean check() {
- // TODO Auto-generated method stub
- return false;
- }
-
-}
diff --git a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/component/Baz2CheckProvider.java b/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/component/Baz2CheckProvider.java
deleted file mode 100644
index 1e7cb1d..0000000
--- a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/component/Baz2CheckProvider.java
+++ /dev/null
@@ -1,81 +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.test.scenarios.component;
-
-import java.util.Properties;
-
-import org.apache.felix.ipojo.test.scenarios.service.BazService;
-import org.apache.felix.ipojo.test.scenarios.service.CheckService;
-import org.apache.felix.ipojo.test.scenarios.service.FooService;
-import org.osgi.framework.ServiceReference;
-
-public class Baz2CheckProvider implements CheckService {
-
- BazService fs;
-
- int simpleB = 0;
- int objectB = 0;
- int refB = 0;
- int simpleU = 0;
- int objectU = 0;
- int refU = 0;
-
- public boolean check() {
- return fs.foo();
- }
-
- public Properties getProps() {
- Properties props = new Properties();
- props.put("result", new Boolean(fs.foo()));
- props.put("voidB", new Integer(simpleB));
- props.put("objectB", new Integer(objectB));
- props.put("refB", new Integer(refB));
- props.put("voidU", new Integer(simpleU));
- props.put("objectU", new Integer(objectU));
- props.put("refU", new Integer(refU));
- props.put("boolean", new Boolean(fs.getBoolean()));
- props.put("int", new Integer(fs.getInt()));
- props.put("long", new Long(fs.getLong()));
- props.put("double", new Double(fs.getDouble()));
- if(fs.getObject() != null) { props.put("object", fs.getObject()); }
-
- return props;
- }
-
- private void voidBind() {
- simpleB++;
- }
- private void voidUnbind() {
- simpleU++;
- }
-
- protected void objectBind(Object o) {
- if(o != null && o instanceof FooService) { objectB++; }
- }
- protected void objectUnbind(Object o) {
- if(o != null && o instanceof FooService) { objectU++; }
- }
-
- public void refBind(ServiceReference sr) {
- if(sr != null) { refB++; }
- }
- public void refUnbind(ServiceReference sr) {
- if(sr != null) { refU++; }
- }
-}
diff --git a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/core/CoreTestSuite.java b/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/core/CoreTestSuite.java
deleted file mode 100644
index bc87ae4..0000000
--- a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/core/CoreTestSuite.java
+++ /dev/null
@@ -1,37 +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.test.scenarios.core;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-import org.apache.felix.ipojo.junit4osgi.OSGiTestSuite;
-import org.osgi.framework.BundleContext;
-
-public class CoreTestSuite extends TestSuite {
-
-
- public static Test suite(BundleContext bc) {
- OSGiTestSuite ots = new OSGiTestSuite("Contre Test Suite", bc);
- ots.addTestSuite(POJOCreation.class);
- ots.addTestSuite(ComponentDesc.class);
- return ots;
- }
-
-}
diff --git a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/factory/FactoryTestSuite.java b/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/factory/FactoryTestSuite.java
deleted file mode 100644
index 4c45c4c..0000000
--- a/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/factory/FactoryTestSuite.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.test.scenarios.factory;
-
-import junit.framework.Test;
-
-import org.apache.felix.ipojo.junit4osgi.OSGiTestSuite;
-import org.osgi.framework.BundleContext;
-
-public class FactoryTestSuite {
-
- public static Test suite(BundleContext bc) {
- OSGiTestSuite ots = new OSGiTestSuite("Factories Test Suite", bc);
-
- ots.addTestSuite( UnacceptableConfigurationTest.class);
- ots.addTestSuite( ConfigAdminTest.class);
- ots.addTestSuite( ObedienceTest.class);
-
- return ots;
- }
-
-}