ace-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From j...@apache.org
Subject svn commit: r1586517 - in /ace/trunk: org.apache.ace.agent.controller.itest/src/org/apache/ace/agent/itest/ org.apache.ace.agent/src/org/apache/ace/agent/impl/ org.apache.ace.agent/test/org/apache/ace/agent/impl/ org.apache.ace.test/src/org/apache/ace/...
Date Fri, 11 Apr 2014 00:29:53 GMT
Author: jawi
Date: Fri Apr 11 00:29:53 2014
New Revision: 1586517

URL: http://svn.apache.org/r1586517
Log:
Some test fixes:

- ensure the default port used for itests is something different than 8080, to
  check whether all code is using the correct constant;
- fixed two failing itests that did not correctly configure the right port;
- made the discovery test more robust when testing the fallback to the default
  server URL.


Modified:
    ace/trunk/org.apache.ace.agent.controller.itest/src/org/apache/ace/agent/itest/BaseAgentControllerTest.java
    ace/trunk/org.apache.ace.agent/src/org/apache/ace/agent/impl/DiscoveryHandlerImpl.java
    ace/trunk/org.apache.ace.agent/test/org/apache/ace/agent/impl/DiscoveryHandlerImplTest.java
    ace/trunk/org.apache.ace.test/src/org/apache/ace/test/constants/TestConstants.java
    ace/trunk/org.apache.ace.test/src/org/apache/ace/test/constants/packageinfo

Modified: ace/trunk/org.apache.ace.agent.controller.itest/src/org/apache/ace/agent/itest/BaseAgentControllerTest.java
URL: http://svn.apache.org/viewvc/ace/trunk/org.apache.ace.agent.controller.itest/src/org/apache/ace/agent/itest/BaseAgentControllerTest.java?rev=1586517&r1=1586516&r2=1586517&view=diff
==============================================================================
--- ace/trunk/org.apache.ace.agent.controller.itest/src/org/apache/ace/agent/itest/BaseAgentControllerTest.java
(original)
+++ ace/trunk/org.apache.ace.agent.controller.itest/src/org/apache/ace/agent/itest/BaseAgentControllerTest.java
Fri Apr 11 00:29:53 2014
@@ -291,6 +291,7 @@ public abstract class BaseAgentControlle
         System.setProperty(AgentConstants.CONFIG_CONTROLLER_CLASS, m_controllerName);
         System.setProperty(AgentConstants.CONFIG_IDENTIFICATION_AGENTID, AGENT_ID);
         System.setProperty(AgentConstants.CONFIG_LOGGING_LEVEL, "DEBUG");
+        System.setProperty(AgentConstants.CONFIG_DISCOVERY_SERVERURLS, url);
 
         // We start the bundle activator ourselves (to avoid weird circularities and timing
issues)...
         startAgentBundle();

Modified: ace/trunk/org.apache.ace.agent/src/org/apache/ace/agent/impl/DiscoveryHandlerImpl.java
URL: http://svn.apache.org/viewvc/ace/trunk/org.apache.ace.agent/src/org/apache/ace/agent/impl/DiscoveryHandlerImpl.java?rev=1586517&r1=1586516&r2=1586517&view=diff
==============================================================================
--- ace/trunk/org.apache.ace.agent/src/org/apache/ace/agent/impl/DiscoveryHandlerImpl.java
(original)
+++ ace/trunk/org.apache.ace.agent/src/org/apache/ace/agent/impl/DiscoveryHandlerImpl.java
Fri Apr 11 00:29:53 2014
@@ -84,11 +84,22 @@ public class DiscoveryHandlerImpl extend
     private static final long DEFAULT_CACHE_MILLISECONDS = 30000;
     private final Map<String, CheckedURL> m_checkedURLs = new HashMap<String, CheckedURL>();
 
-    private volatile List<String> m_serverURLs = Arrays.asList(DEFAULT_SERVER_URL);
-    private volatile boolean m_checkURLs = DEFAULT_CHECK_SERVER_URLS;
+    private volatile List<String> m_serverURLs;
+    private volatile boolean m_checkURLs;
 
     public DiscoveryHandlerImpl() {
+        this(DEFAULT_SERVER_URL, DEFAULT_CHECK_SERVER_URLS);
+    }
+
+    DiscoveryHandlerImpl(String serverURL, boolean checkServerURLs) {
+        this(new String[] { serverURL }, checkServerURLs);
+    }
+
+    DiscoveryHandlerImpl(String[] serverURLs, boolean checkServerURLs) {
         super("discovery");
+
+        m_serverURLs = Arrays.asList(serverURLs);
+        m_checkURLs = checkServerURLs;
     }
 
     @Override

Modified: ace/trunk/org.apache.ace.agent/test/org/apache/ace/agent/impl/DiscoveryHandlerImplTest.java
URL: http://svn.apache.org/viewvc/ace/trunk/org.apache.ace.agent/test/org/apache/ace/agent/impl/DiscoveryHandlerImplTest.java?rev=1586517&r1=1586516&r2=1586517&view=diff
==============================================================================
--- ace/trunk/org.apache.ace.agent/test/org/apache/ace/agent/impl/DiscoveryHandlerImplTest.java
(original)
+++ ace/trunk/org.apache.ace.agent/test/org/apache/ace/agent/impl/DiscoveryHandlerImplTest.java
Fri Apr 11 00:29:53 2014
@@ -31,6 +31,7 @@ import org.apache.ace.agent.DiscoveryHan
 import org.apache.ace.agent.EventsHandler;
 import org.apache.ace.agent.testutil.BaseAgentTest;
 import org.apache.ace.agent.testutil.TestWebServer;
+import org.apache.ace.test.constants.TestConstants;
 import org.osgi.framework.BundleContext;
 import org.testng.annotations.AfterClass;
 import org.testng.annotations.BeforeClass;
@@ -61,7 +62,8 @@ public class DiscoveryHandlerImplTest ex
 
         m_agentContextImpl = mockAgentContext();
         m_agentContext = m_agentContextImpl;
-        m_agentContextImpl.setHandler(DiscoveryHandler.class, new DiscoveryHandlerImpl());
+        // Make sure the default server URL is not reachable, as used for this test...
+        m_agentContextImpl.setHandler(DiscoveryHandler.class, new DiscoveryHandlerImpl("http://localhost:"
+ TestConstants.PORT, true));
         m_agentContextImpl.setHandler(EventsHandler.class, new EventsHandlerImpl(bc));
         m_agentContextImpl.setHandler(ConfigurationHandler.class, new ConfigurationHandlerImpl(bc));
         m_agentContextImpl.setHandler(ConnectionHandler.class, new ConnectionHandlerImpl());

Modified: ace/trunk/org.apache.ace.test/src/org/apache/ace/test/constants/TestConstants.java
URL: http://svn.apache.org/viewvc/ace/trunk/org.apache.ace.test/src/org/apache/ace/test/constants/TestConstants.java?rev=1586517&r1=1586516&r2=1586517&view=diff
==============================================================================
--- ace/trunk/org.apache.ace.test/src/org/apache/ace/test/constants/TestConstants.java (original)
+++ ace/trunk/org.apache.ace.test/src/org/apache/ace/test/constants/TestConstants.java Fri
Apr 11 00:29:53 2014
@@ -28,5 +28,5 @@ import aQute.bnd.annotation.ProviderType
 @ProviderType
 public interface TestConstants {
     /** The port the webserver is running on for testing. */
-    public static final int PORT = 8080;
+    public static final int PORT = 18080;
 }

Modified: ace/trunk/org.apache.ace.test/src/org/apache/ace/test/constants/packageinfo
URL: http://svn.apache.org/viewvc/ace/trunk/org.apache.ace.test/src/org/apache/ace/test/constants/packageinfo?rev=1586517&r1=1586516&r2=1586517&view=diff
==============================================================================
--- ace/trunk/org.apache.ace.test/src/org/apache/ace/test/constants/packageinfo (original)
+++ ace/trunk/org.apache.ace.test/src/org/apache/ace/test/constants/packageinfo Fri Apr 11
00:29:53 2014
@@ -1 +1 @@
-version 1.0
\ No newline at end of file
+version 1.0.1
\ No newline at end of file



Mime
View raw message