Temporarily removed tests for the adapter/aspect "changed" callbacks.
git-svn-id: https://svn.apache.org/repos/asf/felix/trunk@1087619 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/dependencymanager/test/src/main/java/org/apache/felix/dm/test/bundle/annotation/adapter/AdapterTest.java b/dependencymanager/test/src/main/java/org/apache/felix/dm/test/bundle/annotation/adapter/AdapterTest.java
index b9a9200..ffa9053 100644
--- a/dependencymanager/test/src/main/java/org/apache/felix/dm/test/bundle/annotation/adapter/AdapterTest.java
+++ b/dependencymanager/test/src/main/java/org/apache/felix/dm/test/bundle/annotation/adapter/AdapterTest.java
@@ -111,7 +111,6 @@
@AdapterService(adapteeService = S1.class,
properties={@Property(name="adapter", value="true")},
added="bind",
- changed="changed",
removed="removed")
public static class S1ToS3AdapterCallback implements S3
{
@@ -128,23 +127,18 @@
public void run3()
{
- ((S1) m_s1).run(); // s1 will change its properties here
+ ((S1) m_s1).run();
}
-
- void changed(S1 s1)
+
+ @Stop
+ void stop()
{
m_sequencer.step(3);
}
- @Stop
- void stop()
- {
- m_sequencer.step(4);
- }
-
void removed(S1 s1)
{
- m_sequencer.step(5);
+ m_sequencer.step(4);
}
}
@@ -157,22 +151,10 @@
@ServiceDependency
protected S2 m_s2;
- // Injected when started
- ServiceRegistration m_registration;
-
public void run()
{
m_sequencer.step(1);
m_s2.run2();
- Thread update = new Thread() {
- public void run() {
- m_registration.setProperties(new Hashtable<String, String>() {{
- put("param1", "value1");
- put("param2", "value2");
- }});
- }
- };
- update.start();
}
}
diff --git a/dependencymanager/test/src/main/java/org/apache/felix/dm/test/bundle/annotation/aspect/AspectChainTest.java b/dependencymanager/test/src/main/java/org/apache/felix/dm/test/bundle/annotation/aspect/AspectChainTest.java
index 7810f70..86764e0 100644
--- a/dependencymanager/test/src/main/java/org/apache/felix/dm/test/bundle/annotation/aspect/AspectChainTest.java
+++ b/dependencymanager/test/src/main/java/org/apache/felix/dm/test/bundle/annotation/aspect/AspectChainTest.java
@@ -18,8 +18,6 @@
*/
package org.apache.felix.dm.test.bundle.annotation.aspect;
-import java.util.Hashtable;
-
import org.apache.felix.dm.annotation.api.AspectService;
import org.apache.felix.dm.annotation.api.Component;
import org.apache.felix.dm.annotation.api.Destroy;
@@ -43,17 +41,21 @@
protected Sequencer m_sequencer;
// Injected by reflection.
protected ServiceRegistration m_sr;
-
+
+ @Init
+ void init() {
+ System.out.println("ServiceProvider.init");
+ }
+
+ @Destroy
+ void destroy() {
+ System.out.println("ServiceProvider.destroy");
+ }
+
public void invoke(Runnable run)
{
run.run();
m_sequencer.step(6);
- Thread update = new Thread() {
- public void run() {
- m_sr.setProperties(new Hashtable<String, String>() {{ put("foo", "bar");}});
- }
- };
- update.start();
}
}
@@ -65,6 +67,16 @@
// Injected by reflection.
private volatile ServiceInterface m_parentService;
+ @Init
+ void init() {
+ System.out.println("ServiceAspect2.init");
+ }
+
+ @Destroy
+ void destroy() {
+ System.out.println("ServiceAspect2.destroy");
+ }
+
public void invoke(Runnable run)
{
m_sequencer.step(3);
@@ -80,6 +92,16 @@
// Injected using add callback.
private volatile ServiceInterface m_parentService;
+ @Init
+ void init() {
+ System.out.println("ServiceAspect3.init");
+ }
+
+ @Destroy
+ void destroy() {
+ System.out.println("ServiceAspect3.destroy");
+ }
+
void add(ServiceInterface si)
{
m_parentService = si;
@@ -92,7 +114,7 @@
}
}
- @AspectService(ranking = 10, added="added", changed="changed", removed="removed")
+ @AspectService(ranking = 10, added="added", removed="removed")
public static class ServiceAspect1 implements ServiceInterface
{
@ServiceDependency(filter="(name=AspectChainTest.ServiceAspect1)")
@@ -100,25 +122,30 @@
// Injected by reflection.
private volatile ServiceInterface m_parentService;
+ @Init
+ void init() {
+ System.out.println("ServiceAspect1.init");
+ }
+
+ @Destroy
+ void destroy() {
+ System.out.println("ServiceAspect1.destroy");
+ }
+
void added(ServiceInterface si)
{
m_parentService = si;
}
-
- void changed(ServiceInterface si)
+
+ @Stop
+ void stop()
{
m_sequencer.step(7);
}
- @Stop
- void stop()
- {
- m_sequencer.step(8);
- }
-
void removed(ServiceInterface si)
{
- m_sequencer.step(9);
+ m_sequencer.step(8);
}
public void invoke(Runnable run)
@@ -142,7 +169,7 @@
@Init
public void init()
{
- m_thread = new Thread(this);
+ m_thread = new Thread(this, "ServiceConsumer");
m_thread.start();
}
diff --git a/dependencymanager/test/src/test/java/org/apache/felix/dm/test/annotation/AdapterAnnotationTest.java b/dependencymanager/test/src/test/java/org/apache/felix/dm/test/annotation/AdapterAnnotationTest.java
index 46dd846..9380009 100644
--- a/dependencymanager/test/src/test/java/org/apache/felix/dm/test/annotation/AdapterAnnotationTest.java
+++ b/dependencymanager/test/src/test/java/org/apache/felix/dm/test/annotation/AdapterAnnotationTest.java
@@ -93,8 +93,8 @@
// Provide the Sequencer to the org.apache.felix.dm.test.bundle.annotation.adapter.AdapterTest bundle
Component sequencer = makeSequencer(m, "AdapterCallback");
m.add(sequencer);
- m_ensure.waitForStep(3, 10000);
+ m_ensure.waitForStep(2, 10000);
m.remove(sequencer);
- m_ensure.waitForStep(5, 10000);
+ m_ensure.waitForStep(4, 10000);
}
}
diff --git a/dependencymanager/test/src/test/java/org/apache/felix/dm/test/annotation/AspectAnnotationTest.java b/dependencymanager/test/src/test/java/org/apache/felix/dm/test/annotation/AspectAnnotationTest.java
index 854528b..b3b062e 100644
--- a/dependencymanager/test/src/test/java/org/apache/felix/dm/test/annotation/AspectAnnotationTest.java
+++ b/dependencymanager/test/src/test/java/org/apache/felix/dm/test/annotation/AspectAnnotationTest.java
@@ -80,11 +80,11 @@
m.add(sa1Sequencer);
m_ensure.step();
- m_ensure.waitForStep(7, 10000);
+ m_ensure.waitForStep(6, 10000);
// Deactivate service provider
m.remove(spSequencer);
// Make sure that service aspect 1 has been called in ts removed and stop callbacks
- m_ensure.waitForStep(9, 10000);
+ m_ensure.waitForStep(8, 10000);
}
}