felix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pde...@apache.org
Subject svn commit: r1720958 - /felix/trunk/dependencymanager/org.apache.felix.dependencymanager.itest/src/org/apache/felix/dm/itest/api/FELIX5054_CleanupInstanceBoundDependenciesInDestroy.java
Date Sat, 19 Dec 2015 17:40:29 GMT
Author: pderop
Date: Sat Dec 19 17:40:28 2015
New Revision: 1720958

URL: http://svn.apache.org/viewvc?rev=1720958&view=rev
Log:
deactivate test when the test is done (successful).

Modified:
    felix/trunk/dependencymanager/org.apache.felix.dependencymanager.itest/src/org/apache/felix/dm/itest/api/FELIX5054_CleanupInstanceBoundDependenciesInDestroy.java

Modified: felix/trunk/dependencymanager/org.apache.felix.dependencymanager.itest/src/org/apache/felix/dm/itest/api/FELIX5054_CleanupInstanceBoundDependenciesInDestroy.java
URL: http://svn.apache.org/viewvc/felix/trunk/dependencymanager/org.apache.felix.dependencymanager.itest/src/org/apache/felix/dm/itest/api/FELIX5054_CleanupInstanceBoundDependenciesInDestroy.java?rev=1720958&r1=1720957&r2=1720958&view=diff
==============================================================================
--- felix/trunk/dependencymanager/org.apache.felix.dependencymanager.itest/src/org/apache/felix/dm/itest/api/FELIX5054_CleanupInstanceBoundDependenciesInDestroy.java
(original)
+++ felix/trunk/dependencymanager/org.apache.felix.dependencymanager.itest/src/org/apache/felix/dm/itest/api/FELIX5054_CleanupInstanceBoundDependenciesInDestroy.java
Sat Dec 19 17:40:28 2015
@@ -34,8 +34,9 @@ public class FELIX5054_CleanupInstanceBo
 		DependencyManager m = getDM();
 		m_ensure = new Ensure();
 		
+		A aObject = new A();
 		Component a = m.createComponent()
-				.setImplementation(new A())
+				.setImplementation(aObject)
 				.add(m.createServiceDependency().setService(B.class).setRequired(true).setCallbacks("bindB",
"unbindB"));
 		
 		Component b = m.createComponent()
@@ -54,6 +55,8 @@ public class FELIX5054_CleanupInstanceBo
 		m_ensure.waitForStep(5, 3000);
 		m.add(b);
 		m_ensure.waitForStep(8, 3000);
+		aObject.testDone();
+		m.clear();
 	}
 	
 	public class A {
@@ -63,13 +66,18 @@ public class FELIX5054_CleanupInstanceBo
         private Ensure.Steps m_stepsUnbindC = new Ensure.Steps(4);
         private Ensure.Steps m_stepsInit = new Ensure.Steps(2, 7);
         private Dependency m_depC;
+        private boolean m_done;
 
 		void bindB(B b) {
 			m_ensure.steps(m_stepsBindB);
 		}
 		
-		void unbindB(B b) {
-			m_ensure.steps(m_stepsUnbindB);
+		public void testDone() {
+            m_done = true;           
+        }
+
+        void unbindB(B b) {
+			if (! m_done) m_ensure.steps(m_stepsUnbindB);
 		}
 
 		void init(Component component) {
@@ -84,7 +92,7 @@ public class FELIX5054_CleanupInstanceBo
 		}
 		
 		void unbindC(C c) {
-			m_ensure.steps(m_stepsUnbindC);
+		    if (! m_done) m_ensure.steps(m_stepsUnbindC);
 		}
 	}
 	



Mime
View raw message