You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ace.apache.org by ja...@apache.org on 2016/01/27 14:24:04 UTC

svn commit: r1727044 [4/4] - in /ace/trunk: cnf/localrepo/ cnf/localrepo/org.apache.felix.configadmin/ cnf/localrepo/org.apache.felix.deployment.rp.autoconf/ cnf/localrepo/org.apache.felix.deploymentadmin/ cnf/localrepo/org.apache.felix.eventadmin/ cnf...

Modified: ace/trunk/org.apache.ace.repository/bnd.bnd
URL: http://svn.apache.org/viewvc/ace/trunk/org.apache.ace.repository/bnd.bnd?rev=1727044&r1=1727043&r2=1727044&view=diff
==============================================================================
--- ace/trunk/org.apache.ace.repository/bnd.bnd (original)
+++ ace/trunk/org.apache.ace.repository/bnd.bnd Wed Jan 27 13:24:03 2016
@@ -5,7 +5,7 @@
 	osgi.core;version=6.0.0,\
 	osgi.cmpn,\
 	org.apache.felix.dependencymanager,\
-	javax.servlet,\
+	org.apache.felix.http.servlet-api,\
 	org.apache.ace.range.api;version=latest,\
 	org.apache.ace.test;version=latest,\
 	org.apache.ace.authentication.api;version=latest,\

Modified: ace/trunk/org.apache.ace.test/src/org/apache/ace/it/ExampleTest.java
URL: http://svn.apache.org/viewvc/ace/trunk/org.apache.ace.test/src/org/apache/ace/it/ExampleTest.java?rev=1727044&r1=1727043&r2=1727044&view=diff
==============================================================================
--- ace/trunk/org.apache.ace.test/src/org/apache/ace/it/ExampleTest.java (original)
+++ ace/trunk/org.apache.ace.test/src/org/apache/ace/it/ExampleTest.java Wed Jan 27 13:24:03 2016
@@ -29,6 +29,7 @@ import org.osgi.service.packageadmin.Pac
  * This class serves as a minimal example of our integration tests. Also, if this test fails, something is likely
  * wrong with the environment
  */
+@SuppressWarnings("deprecation")
 public class ExampleTest extends IntegrationTestBase {
 
 //    @Configuration

Modified: ace/trunk/org.apache.ace.test/src/org/apache/ace/it/IntegrationTestBase.java
URL: http://svn.apache.org/viewvc/ace/trunk/org.apache.ace.test/src/org/apache/ace/it/IntegrationTestBase.java?rev=1727044&r1=1727043&r2=1727044&view=diff
==============================================================================
--- ace/trunk/org.apache.ace.test/src/org/apache/ace/it/IntegrationTestBase.java (original)
+++ ace/trunk/org.apache.ace.test/src/org/apache/ace/it/IntegrationTestBase.java Wed Jan 27 13:24:03 2016
@@ -19,7 +19,7 @@
 package org.apache.ace.it;
 
 import static java.util.concurrent.TimeUnit.SECONDS;
-import static org.apache.ace.test.utils.Util.properties;
+import static org.apache.ace.test.utils.Util.dictionary;
 
 import java.io.FileNotFoundException;
 import java.io.IOException;
@@ -29,6 +29,7 @@ import java.net.ConnectException;
 import java.net.URL;
 import java.util.ArrayList;
 import java.util.Arrays;
+import java.util.Dictionary;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
@@ -90,31 +91,16 @@ public class IntegrationTestBase extends
             return result.toString();
         }
 
-//        public void started(Component component) {
-//            m_components.remove(component);
-//            m_latch.countDown();
-//        }
-//
-//        public void starting(Component component) {
-//        }
-//
-//        public void stopped(Component component) {
-//        }
-//
-//        public void stopping(Component component) {
-//        }
-
         public boolean waitForEmpty(long timeout, TimeUnit unit) throws InterruptedException {
             return m_latch.await(timeout, unit);
         }
 
-		@Override
-		public void changed(Component component, ComponentState state) {
-			if (state == ComponentState.TRACKING_OPTIONAL) {
-	            m_components.remove(component);
-	            m_latch.countDown();
-			}
-		}
+        @Override
+        public void changed(Component component, ComponentState state) {
+            if (state == ComponentState.TRACKING_OPTIONAL && m_components.remove(component)) {
+                m_latch.countDown();
+            }
+        }
     }
 
     /**
@@ -155,12 +141,14 @@ public class IntegrationTestBase extends
                 tearDown();
             }
             catch (Throwable tearingDown) {
-                if (exception == null)
+                if (exception == null) {
                     exception = tearingDown;
+                }
             }
         }
-        if (exception != null)
+        if (exception != null) {
             throw exception;
+        }
     }
 
     /**
@@ -177,7 +165,7 @@ public class IntegrationTestBase extends
      *            the configuration key/values (as pairs).
      */
     protected void configure(String pid, String... configuration) throws IOException {
-        Properties props = properties(configuration);
+        Dictionary<String, Object> props = dictionary(configuration);
         Configuration config = getConfiguration(pid);
         config.update(props);
         m_trackedConfigurations.add(config);
@@ -198,7 +186,7 @@ public class IntegrationTestBase extends
      * @return The PID of newly created configuration.
      */
     protected String configureFactory(String factoryPid, String... configuration) throws IOException {
-        Properties props = properties(configuration);
+        Dictionary<String, Object> props = dictionary(configuration);
         Configuration config = createFactoryConfiguration(factoryPid);
         config.update(props);
         m_trackedConfigurations.add(config);
@@ -225,7 +213,7 @@ public class IntegrationTestBase extends
         final String expectedPort = Integer.toString(port);
 
         // Do not track this configuration (yet)...
-        Properties props = properties(configuration);
+        Dictionary<String, Object> props = dictionary(configuration);
         props.put(portProperty, expectedPort);
 
         Configuration config = getConfiguration(httpPID);
@@ -613,6 +601,9 @@ public class IntegrationTestBase extends
             if (!listener.waitForEmpty(SERVICE_TIMEOUT, SECONDS)) {
                 fail("Not all components were started. Still missing the following:\n" + listener.componentsString());
             }
+            
+            // XXX it appears we run into race conditions between the setup and configuration of our services, use a little delay to get things settled seems to help here...
+            TimeUnit.MILLISECONDS.sleep(100);
 
             configureAdditionalServices();
         }

Modified: ace/trunk/org.apache.ace.test/src/org/apache/ace/test/utils/Util.java
URL: http://svn.apache.org/viewvc/ace/trunk/org.apache.ace.test/src/org/apache/ace/test/utils/Util.java?rev=1727044&r1=1727043&r2=1727044&view=diff
==============================================================================
--- ace/trunk/org.apache.ace.test/src/org/apache/ace/test/utils/Util.java (original)
+++ ace/trunk/org.apache.ace.test/src/org/apache/ace/test/utils/Util.java Wed Jan 27 13:24:03 2016
@@ -18,6 +18,8 @@
  */
 package org.apache.ace.test.utils;
 
+import java.util.Dictionary;
+import java.util.Hashtable;
 import java.util.Properties;
 
 public class Util {
@@ -33,6 +35,20 @@ public class Util {
         for (int i = 0; i < values.length; i += 2) {
             props.put(values[i], values[i+1]);
         }
+        return props;
+    }
+
+    /**
+     * Creates a Dictionary object from a list of key-value pairs, e.g.
+     * <pre>
+     * properties("key", "value", "key2", "value2");
+     * </pre>
+     */
+    public static Dictionary<String, Object> dictionary(String... values) {
+        Dictionary<String, Object>  props = new Hashtable<>();
+        for (int i = 0; i < values.length; i += 2) {
+            props.put(values[i], values[i+1]);
+        }
         return props;
     }
 }

Modified: ace/trunk/org.apache.ace.useradmin.ui.itest/bnd.bnd
URL: http://svn.apache.org/viewvc/ace/trunk/org.apache.ace.useradmin.ui.itest/bnd.bnd?rev=1727044&r1=1727043&r2=1727044&view=diff
==============================================================================
--- ace/trunk/org.apache.ace.useradmin.ui.itest/bnd.bnd (original)
+++ ace/trunk/org.apache.ace.useradmin.ui.itest/bnd.bnd Wed Jan 27 13:24:03 2016
@@ -9,6 +9,7 @@ Private-Package: org.apache.ace.useradmi
 	org.apache.felix.configadmin,\
 	org.apache.felix.dependencymanager,\
 	org.apache.felix.eventadmin,\
+	org.apache.felix.http.servlet-api,\
 	org.apache.felix.http.jetty,\
 	org.apache.felix.log,\
 	org.apache.felix.prefs,\

Modified: ace/trunk/org.apache.ace.useradmin.ui/bnd.bnd
URL: http://svn.apache.org/viewvc/ace/trunk/org.apache.ace.useradmin.ui/bnd.bnd?rev=1727044&r1=1727043&r2=1727044&view=diff
==============================================================================
--- ace/trunk/org.apache.ace.useradmin.ui/bnd.bnd (original)
+++ ace/trunk/org.apache.ace.useradmin.ui/bnd.bnd Wed Jan 27 13:24:03 2016
@@ -10,7 +10,7 @@
 	org.apache.ace.connectionfactory;version=latest,\
 	org.apache.ace.authentication.api;version=latest,\
 	org.apache.ace.authentication.impl;version=latest,\
-	javax.servlet,\
+	org.apache.felix.http.servlet-api,\
 	org.apache.ace.webui.vaadin;version=latest
 Bundle-Activator: org.apache.ace.useradmin.ui.osgi.Activator
 Bundle-Version: 2.0.1

Modified: ace/trunk/org.apache.ace.verifier/bnd.bnd
URL: http://svn.apache.org/viewvc/ace/trunk/org.apache.ace.verifier/bnd.bnd?rev=1727044&r1=1727043&r2=1727044&view=diff
==============================================================================
--- ace/trunk/org.apache.ace.verifier/bnd.bnd (original)
+++ ace/trunk/org.apache.ace.verifier/bnd.bnd Wed Jan 27 13:24:03 2016
@@ -4,7 +4,7 @@
 	${^-buildpath},\
 	osgi.core;version=6.0.0,\
 	osgi.cmpn;version=4.3.1,\
-	javax.servlet,\
+	org.apache.felix.http.servlet-api,\
 	org.apache.felix.dependencymanager,\
 	com.vaadin,\
 	org.apache.ace.authentication.api;version=latest,\

Modified: ace/trunk/org.apache.ace.webui.vaadin/bnd.bnd
URL: http://svn.apache.org/viewvc/ace/trunk/org.apache.ace.webui.vaadin/bnd.bnd?rev=1727044&r1=1727043&r2=1727044&view=diff
==============================================================================
--- ace/trunk/org.apache.ace.webui.vaadin/bnd.bnd (original)
+++ ace/trunk/org.apache.ace.webui.vaadin/bnd.bnd Wed Jan 27 13:24:03 2016
@@ -9,7 +9,7 @@
 	org.apache.ace.connectionfactory;version=latest,\
 	org.apache.ace.authentication.api;version=latest,\
 	org.apache.ace.authentication.impl;version=latest,\
-	javax.servlet,\
+	org.apache.felix.http.servlet-api,\
 	osgi.core;version=6.0.0
 Private-Package: org.apache.ace.webui.domain,\
 	org.apache.ace.webui.vaadin,\