FELIX-5032 fix index out of bounds exception and concealed test failure

git-svn-id: https://svn.apache.org/repos/asf/felix/trunk@1709501 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/scr/src/test/java/org/apache/felix/scr/integration/ComponentConcurrencyTest.java b/scr/src/test/java/org/apache/felix/scr/integration/ComponentConcurrencyTest.java
index 9c407bd..f24a6e5 100644
--- a/scr/src/test/java/org/apache/felix/scr/integration/ComponentConcurrencyTest.java
+++ b/scr/src/test/java/org/apache/felix/scr/integration/ComponentConcurrencyTest.java
@@ -36,7 +36,8 @@
         		"FrameworkEvent ERROR",
         		"Could not get service from ref",
         		"Failed creating the component instance; see log for reason",
-        		"Cannot create component instance due to failure to bind reference"};
+        		"Cannot create component instance due to failure to bind reference",
+        		"DependencyManager : invokeBindMethod : Service not available from service registry for ServiceReference"};
         DS_LOGLEVEL = "warn";
     }
 
diff --git a/scr/src/test/java/org/apache/felix/scr/integration/ComponentTestBase.java b/scr/src/test/java/org/apache/felix/scr/integration/ComponentTestBase.java
index 8351ceb..2ee0f10 100644
--- a/scr/src/test/java/org/apache/felix/scr/integration/ComponentTestBase.java
+++ b/scr/src/test/java/org/apache/felix/scr/integration/ComponentTestBase.java
@@ -117,7 +117,8 @@
     // method include it when starting the OSGi framework JVM
     protected static String paxRunnerVmOption = null;
 
-    protected static String DS_LOGLEVEL = "debug";
+    //To investigate any problems at all set to "debug"
+    protected static String DS_LOGLEVEL = "warn";
 
     protected static String bsnVersionUniqueness = "single";
 
@@ -916,9 +917,9 @@
                 while ( true )
                 {
                     entry = m_logQueue.take();
-                    if ( entry.getLevel() <= 2 )
+                    if ( entry.getLevel() <= 2 && acceptWarning( entry.getMessage() ) )
                     {
-                        if ( m_warnings.size() < 1024 && acceptWarning( entry.getMessage() ) )
+                        if ( m_warnings.size() < 1024 )
                         {
                             m_warnings.add( entry.getMessage() );
                         }
diff --git a/scr/src/test/java/org/apache/felix/scr/integration/components/concurrency/AFactory.java b/scr/src/test/java/org/apache/felix/scr/integration/components/concurrency/AFactory.java
index 2eb7ff5..92be0f4 100644
--- a/scr/src/test/java/org/apache/felix/scr/integration/components/concurrency/AFactory.java
+++ b/scr/src/test/java/org/apache/felix/scr/integration/components/concurrency/AFactory.java
@@ -15,7 +15,7 @@
 
 public class AFactory implements Runnable {
     private ComponentFactory _aFactory;
-    private Thread[] _threads = new Thread[1];
+    private Thread[] _threads = new Thread[2];
     
     public void bindAFactory(ComponentFactory aFactory) {
       _aFactory = aFactory;
diff --git a/scr/src/test/java/org/apache/felix/scr/integration/components/concurrency/CFactory.java b/scr/src/test/java/org/apache/felix/scr/integration/components/concurrency/CFactory.java
index 98a8a1d..952ea3b 100644
--- a/scr/src/test/java/org/apache/felix/scr/integration/components/concurrency/CFactory.java
+++ b/scr/src/test/java/org/apache/felix/scr/integration/components/concurrency/CFactory.java
@@ -15,7 +15,7 @@
 
 public class CFactory implements Runnable {
     private ComponentFactory _cFactory;
-    private Thread[] _threads = new Thread[1];
+    private Thread[] _threads = new Thread[2];
     
     public void bindCFactory(ComponentFactory cFactory) {
       _cFactory = cFactory;