Fix FELIX-2323 : Unbind method are no more called during the invalidation process if this process is not triggered by a service departure
Fix FELIX-2279 : Support post-registration and post-unregistration callbacks (injection of the service reference). Add the processing of @PostRegistration and @PostUnregistration.
Reformat the online-manipulator tests.
git-svn-id: https://svn.apache.org/repos/asf/felix/trunk@940905 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/ipojo/tests/online-manipulator/src/test/java/consumer.xml b/ipojo/tests/online-manipulator/src/test/java/consumer.xml
deleted file mode 100644
index 98f82f8..0000000
--- a/ipojo/tests/online-manipulator/src/test/java/consumer.xml
+++ /dev/null
@@ -1,7 +0,0 @@
-<ipojo xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="org.apache.felix.ipojo http://felix.apache.org/ipojo/schemas/SNAPSHOT/core.xsd"
- xmlns="org.apache.felix.ipojo">
- <instance
- component="org.apache.felix.org.apache.felix.ipojo.online.manipulator.test.impl.Consumer"
- name="cons"/>
-</ipojo>
\ No newline at end of file
diff --git a/ipojo/tests/online-manipulator/src/test/java/org/apache/felix/org/apache/felix/ipojo/online/manipulator/test/OSGiHelper.java b/ipojo/tests/online-manipulator/src/test/java/org/apache/felix/ipojo/online/manipulator/test/OSGiHelper.java
similarity index 99%
rename from ipojo/tests/online-manipulator/src/test/java/org/apache/felix/org/apache/felix/ipojo/online/manipulator/test/OSGiHelper.java
rename to ipojo/tests/online-manipulator/src/test/java/org/apache/felix/ipojo/online/manipulator/test/OSGiHelper.java
index 276b6c7..d8c639e 100644
--- a/ipojo/tests/online-manipulator/src/test/java/org/apache/felix/org/apache/felix/ipojo/online/manipulator/test/OSGiHelper.java
+++ b/ipojo/tests/online-manipulator/src/test/java/org/apache/felix/ipojo/online/manipulator/test/OSGiHelper.java
@@ -1,4 +1,4 @@
-package org.apache.felix.org.apache.felix.ipojo.online.manipulator.test;
+package org.apache.felix.ipojo.online.manipulator.test;
import static org.junit.Assert.fail;
diff --git a/ipojo/tests/online-manipulator/src/test/java/org/apache/felix/org/apache/felix/ipojo/online/manipulator/test/OnlineManipulatorTest.java b/ipojo/tests/online-manipulator/src/test/java/org/apache/felix/ipojo/online/manipulator/test/OnlineManipulatorTest.java
similarity index 91%
rename from ipojo/tests/online-manipulator/src/test/java/org/apache/felix/org/apache/felix/ipojo/online/manipulator/test/OnlineManipulatorTest.java
rename to ipojo/tests/online-manipulator/src/test/java/org/apache/felix/ipojo/online/manipulator/test/OnlineManipulatorTest.java
index 30963d5..6c95d08 100644
--- a/ipojo/tests/online-manipulator/src/test/java/org/apache/felix/org/apache/felix/ipojo/online/manipulator/test/OnlineManipulatorTest.java
+++ b/ipojo/tests/online-manipulator/src/test/java/org/apache/felix/ipojo/online/manipulator/test/OnlineManipulatorTest.java
@@ -1,4 +1,4 @@
-package org.apache.felix.org.apache.felix.ipojo.online.manipulator.test;
+package org.apache.felix.ipojo.online.manipulator.test;
import static org.ops4j.pax.exam.CoreOptions.equinox;
@@ -19,9 +19,9 @@
import org.apache.felix.ipojo.ComponentInstance;
import org.apache.felix.ipojo.architecture.Architecture;
import org.apache.felix.ipojo.architecture.InstanceDescription;
-import org.apache.felix.org.apache.felix.ipojo.online.manipulator.test.impl.Consumer;
-import org.apache.felix.org.apache.felix.ipojo.online.manipulator.test.impl.MyProvider;
-import org.apache.felix.org.apache.felix.ipojo.online.manipulator.test.service.Hello;
+import org.apache.felix.ipojo.online.manipulator.test.impl.Consumer;
+import org.apache.felix.ipojo.online.manipulator.test.impl.MyProvider;
+import org.apache.felix.ipojo.online.manipulator.test.service.Hello;
import org.junit.After;
import org.junit.Assert;
import org.junit.Before;
@@ -96,7 +96,7 @@
newBundle()
.add( Hello.class )
.set(Constants.BUNDLE_SYMBOLICNAME,"ServiceInterface")
- .set(Constants.EXPORT_PACKAGE, "org.apache.felix.org.apache.felix.ipojo.online.manipulator.test.service")
+ .set(Constants.EXPORT_PACKAGE, "org.apache.felix.ipojo.online.manipulator.test.service")
.build()
),
systemProperty( "providerWithMetadata" ).value( providerWithMetadata ),
@@ -110,7 +110,7 @@
public InputStream customizeTestProbe( InputStream testProbe )
{
return TinyBundles.modifyBundle(testProbe).set(Constants.IMPORT_PACKAGE,
- "org.apache.felix.org.apache.felix.ipojo.online.manipulator.test.service")
+ "org.apache.felix.ipojo.online.manipulator.test.service")
.build();
}
@@ -155,8 +155,6 @@
assertBundle("Provider");
- Assert.assertNotNull(context.getAllServiceReferences(Hello.class.getName(), null));
-
helper.waitForService(Hello.class.getName(), null, 5000);
assertValidity();
Assert.assertNotNull(context.getServiceReference(Hello.class.getName()));
@@ -240,7 +238,7 @@
.add("metadata.xml", OnlineManipulatorTest.class.getClassLoader().getResource("provider.xml"))
.add(MyProvider.class)
.set(Constants.BUNDLE_SYMBOLICNAME,"Provider")
- .set(Constants.IMPORT_PACKAGE, "org.apache.felix.org.apache.felix.ipojo.online.manipulator.test.service")
+ .set(Constants.IMPORT_PACKAGE, "org.apache.felix.ipojo.online.manipulator.test.service")
.build();
File out = getTemporaryFile("providerWithMetadata");
@@ -258,7 +256,7 @@
.add("META-INF/metadata.xml", OnlineManipulatorTest.class.getClassLoader().getResource("provider.xml"))
.add(MyProvider.class)
.set(Constants.BUNDLE_SYMBOLICNAME,"Provider")
- .set(Constants.IMPORT_PACKAGE, "org.apache.felix.org.apache.felix.ipojo.online.manipulator.test.service")
+ .set(Constants.IMPORT_PACKAGE, "org.apache.felix.ipojo.online.manipulator.test.service")
.build();
File out = getTemporaryFile("providerWithMetadataInMetaInf");
@@ -276,7 +274,7 @@
//.addResource("metadata.xml", this.getClass().getClassLoader().getResource("provider.xml"))
.add(MyProvider.class)
.set(Constants.BUNDLE_SYMBOLICNAME,"Provider")
- .set(Constants.IMPORT_PACKAGE, "org.apache.felix.org.apache.felix.ipojo.online.manipulator.test.service")
+ .set(Constants.IMPORT_PACKAGE, "org.apache.felix.ipojo.online.manipulator.test.service")
.build();
File out = getTemporaryFile("providerWithoutMetadata");
@@ -297,7 +295,7 @@
.add("metadata.xml", OnlineManipulatorTest.class.getClassLoader().getResource("consumer.xml"))
.add(Consumer.class)
.set(Constants.BUNDLE_SYMBOLICNAME, "Consumer")
- .set(Constants.IMPORT_PACKAGE, "org.apache.felix.org.apache.felix.ipojo.online.manipulator.test.service")
+ .set(Constants.IMPORT_PACKAGE, "org.apache.felix.ipojo.online.manipulator.test.service")
.build();
File out = getTemporaryFile("consumerWithMetadata");
@@ -315,7 +313,7 @@
InputStream is = newBundle()
.add(Consumer.class)
.set(Constants.BUNDLE_SYMBOLICNAME, "Consumer")
- .set(Constants.IMPORT_PACKAGE, "org.apache.felix.org.apache.felix.ipojo.online.manipulator.test.service")
+ .set(Constants.IMPORT_PACKAGE, "org.apache.felix.ipojo.online.manipulator.test.service")
.build();
File out = getTemporaryFile("consumerWithoutMetadata");
diff --git a/ipojo/tests/online-manipulator/src/test/java/org/apache/felix/org/apache/felix/ipojo/online/manipulator/test/impl/Consumer.java b/ipojo/tests/online-manipulator/src/test/java/org/apache/felix/ipojo/online/manipulator/test/impl/Consumer.java
similarity index 62%
rename from ipojo/tests/online-manipulator/src/test/java/org/apache/felix/org/apache/felix/ipojo/online/manipulator/test/impl/Consumer.java
rename to ipojo/tests/online-manipulator/src/test/java/org/apache/felix/ipojo/online/manipulator/test/impl/Consumer.java
index 1f83497..dc2698d 100644
--- a/ipojo/tests/online-manipulator/src/test/java/org/apache/felix/org/apache/felix/ipojo/online/manipulator/test/impl/Consumer.java
+++ b/ipojo/tests/online-manipulator/src/test/java/org/apache/felix/ipojo/online/manipulator/test/impl/Consumer.java
@@ -1,8 +1,8 @@
-package org.apache.felix.org.apache.felix.ipojo.online.manipulator.test.impl;
+package org.apache.felix.ipojo.online.manipulator.test.impl;
import org.apache.felix.ipojo.annotations.Component;
import org.apache.felix.ipojo.annotations.Requires;
-import org.apache.felix.org.apache.felix.ipojo.online.manipulator.test.service.Hello;
+import org.apache.felix.ipojo.online.manipulator.test.service.Hello;
@Component
public class Consumer {
diff --git a/ipojo/tests/online-manipulator/src/test/java/org/apache/felix/ipojo/online/manipulator/test/impl/MyProvider.java b/ipojo/tests/online-manipulator/src/test/java/org/apache/felix/ipojo/online/manipulator/test/impl/MyProvider.java
new file mode 100644
index 0000000..a53094f
--- /dev/null
+++ b/ipojo/tests/online-manipulator/src/test/java/org/apache/felix/ipojo/online/manipulator/test/impl/MyProvider.java
@@ -0,0 +1,11 @@
+package org.apache.felix.ipojo.online.manipulator.test.impl;
+
+import org.apache.felix.ipojo.online.manipulator.test.service.Hello;
+
+public class MyProvider implements Hello {
+
+ public String sayHello() {
+ return "Hello";
+ }
+
+}
diff --git a/ipojo/tests/online-manipulator/src/test/java/org/apache/felix/ipojo/online/manipulator/test/service/Hello.java b/ipojo/tests/online-manipulator/src/test/java/org/apache/felix/ipojo/online/manipulator/test/service/Hello.java
new file mode 100644
index 0000000..c785fbf
--- /dev/null
+++ b/ipojo/tests/online-manipulator/src/test/java/org/apache/felix/ipojo/online/manipulator/test/service/Hello.java
@@ -0,0 +1,7 @@
+package org.apache.felix.ipojo.online.manipulator.test.service;
+
+public interface Hello {
+
+ public String sayHello();
+
+}
diff --git a/ipojo/tests/online-manipulator/src/test/java/org/apache/felix/org/apache/felix/ipojo/online/manipulator/test/impl/MyProvider.java b/ipojo/tests/online-manipulator/src/test/java/org/apache/felix/org/apache/felix/ipojo/online/manipulator/test/impl/MyProvider.java
deleted file mode 100644
index 592132a..0000000
--- a/ipojo/tests/online-manipulator/src/test/java/org/apache/felix/org/apache/felix/ipojo/online/manipulator/test/impl/MyProvider.java
+++ /dev/null
@@ -1,11 +0,0 @@
-package org.apache.felix.org.apache.felix.ipojo.online.manipulator.test.impl;
-
-import org.apache.felix.org.apache.felix.ipojo.online.manipulator.test.service.Hello;
-
-public class MyProvider implements Hello {
-
- public String sayHello() {
- return "Hello";
- }
-
-}
diff --git a/ipojo/tests/online-manipulator/src/test/java/org/apache/felix/org/apache/felix/ipojo/online/manipulator/test/service/Hello.java b/ipojo/tests/online-manipulator/src/test/java/org/apache/felix/org/apache/felix/ipojo/online/manipulator/test/service/Hello.java
deleted file mode 100644
index 83de144..0000000
--- a/ipojo/tests/online-manipulator/src/test/java/org/apache/felix/org/apache/felix/ipojo/online/manipulator/test/service/Hello.java
+++ /dev/null
@@ -1,7 +0,0 @@
-package org.apache.felix.org.apache.felix.ipojo.online.manipulator.test.service;
-
-public interface Hello {
-
- public String sayHello();
-
-}
diff --git a/ipojo/tests/online-manipulator/src/test/java/provider.xml b/ipojo/tests/online-manipulator/src/test/java/provider.xml
deleted file mode 100644
index 1171c64..0000000
--- a/ipojo/tests/online-manipulator/src/test/java/provider.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-<ipojo xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="org.apache.felix.ipojo http://felix.apache.org/ipojo/schemas/SNAPSHOT/core.xsd"
- xmlns="org.apache.felix.ipojo">
- <component classname="org.apache.felix.org.apache.felix.ipojo.online.manipulator.test.impl.MyProvider">
- <provides/>
- </component>
-<instance component="org.apache.felix.org.apache.felix.ipojo.online.manipulator.test.impl.MyProvider"/>
-</ipojo>
\ No newline at end of file
diff --git a/ipojo/tests/online-manipulator/src/test/resources/consumer.xml b/ipojo/tests/online-manipulator/src/test/resources/consumer.xml
index 2775f7c..5c8ae28 100644
--- a/ipojo/tests/online-manipulator/src/test/resources/consumer.xml
+++ b/ipojo/tests/online-manipulator/src/test/resources/consumer.xml
@@ -1,3 +1,3 @@
<ipojo>
-<instance component="org.apache.felix.org.apache.felix.ipojo.online.manipulator.test.impl.Consumer"/>
+<instance component="org.apache.felix.ipojo.online.manipulator.test.impl.Consumer"/>
</ipojo>
\ No newline at end of file
diff --git a/ipojo/tests/online-manipulator/src/test/resources/provider.xml b/ipojo/tests/online-manipulator/src/test/resources/provider.xml
index 64bbe01..d6f7187 100644
--- a/ipojo/tests/online-manipulator/src/test/resources/provider.xml
+++ b/ipojo/tests/online-manipulator/src/test/resources/provider.xml
@@ -1,6 +1,6 @@
<ipojo>
-<component classname="org.apache.felix.org.apache.felix.ipojo.online.manipulator.test.impl.MyProvider">
+<component classname="org.apache.felix.ipojo.online.manipulator.test.impl.MyProvider">
<provides/>
</component>
-<instance component="org.apache.felix.org.apache.felix.ipojo.online.manipulator.test.impl.MyProvider"/>
+<instance component="org.apache.felix.ipojo.online.manipulator.test.impl.MyProvider"/>
</ipojo>
\ No newline at end of file