Uncommitted previous commit (latches are initialize to 11).
Made static/required all A References.



git-svn-id: https://svn.apache.org/repos/asf/felix/trunk@1393388 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/scr/src/test/java/org/apache/felix/scr/integration/components/felix3680/Main.java b/scr/src/test/java/org/apache/felix/scr/integration/components/felix3680/Main.java
index e357a0f..1f8f1b2 100644
--- a/scr/src/test/java/org/apache/felix/scr/integration/components/felix3680/Main.java
+++ b/scr/src/test/java/org/apache/felix/scr/integration/components/felix3680/Main.java
@@ -79,11 +79,13 @@
                         {
                             //_logService.log(LogService.LOG_INFO, "enabling component " + _componentNames[i]);
                             _ctx.enableComponent(_componentNames[i]);
+                            _enabledLatch.countDown();
                         }
                         else
                         {
                             //_logService.log(LogService.LOG_INFO, "disabling component " + _componentNames[i]);
                             _ctx.disableComponent(_componentNames[i]);
+                            _disabledLatch.countDown();
                         }
                     }
                 });
@@ -169,8 +171,8 @@
         while (_running)
         {
             _logService.log(LogService.LOG_WARNING, "Performed " + loop + " tests.");            
-            _enabledLatch = new CountDownLatch(1);
-            _disabledLatch = new CountDownLatch(1);
+            _enabledLatch = new CountDownLatch(11); // 10 to make sure all enable tasks are executed + 1 to make sure Main.bindA has been called
+            _disabledLatch = new CountDownLatch(11); // 10 to make sure all disable tasks are executed + 1 to make sure Main.unbindA has been called
 
             EnableManager manager =
                     new EnableManager(new String[] { "B", "C", "D", "E", "F", "G", "H", "I", "J", "K" });
diff --git a/scr/src/test/resources/integration_test_FELIX_3680.xml b/scr/src/test/resources/integration_test_FELIX_3680.xml
index 509615d..aeb743d 100644
--- a/scr/src/test/resources/integration_test_FELIX_3680.xml
+++ b/scr/src/test/resources/integration_test_FELIX_3680.xml
@@ -25,10 +25,10 @@
 			bind='bindC' />
 		<reference name='d'
 			interface='org.apache.felix.scr.integration.components.felix3680.D'
-			cardinality='0..n' bind='bindD' policy='dynamic' />
+			bind='bindD' />
 		<reference name='e'
 			interface='org.apache.felix.scr.integration.components.felix3680.E'
-			cardinality='0..n' bind='bindE' policy='dynamic' />
+			bind='bindE' />
 		<reference name='f'
 			interface='org.apache.felix.scr.integration.components.felix3680.F'
 			bind='bindF' />
@@ -115,7 +115,7 @@
 		</service>
 		<reference name='j'
 			interface='org.apache.felix.scr.integration.components.felix3680.J'
-			cardinality='1..n' bind='bindJ' policy='dynamic' />
+			bind='bindJ' />
 	</scr:component>
 
 	<scr:component xmlns:scr='http://www.osgi.org/xmlns/scr/v1.1.0'
@@ -127,7 +127,7 @@
 		</service>
 		<reference name='k'
 			interface='org.apache.felix.scr.integration.components.felix3680.K'
-			cardinality='1..n' bind='bindK' policy='dynamic' />
+			bind='bindK' />
 	</scr:component>
 
 	<scr:component xmlns:scr='http://www.osgi.org/xmlns/scr/v1.0.0'