ace-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject svn commit: r821573 - in /incubator/ace/trunk/test/src/org/apache/ace: deployment/streamgenerator/impl/ discovery/property/ discovery/upnp/ obr/servlet/ test/constants/ test/deployment/ test/http/listener/ test/log/ test/repository/ test/repositoryadmi...
Date Sun, 04 Oct 2009 18:37:47 GMT
Author: marrs
Date: Sun Oct  4 18:37:46 2009
New Revision: 821573

URL: http://svn.apache.org/viewvc?rev=821573&view=rev
Log:
Extracted the webserver port from all test classes into a TestConstants class. Set its value
to 9000.

Added:
    incubator/ace/trunk/test/src/org/apache/ace/test/constants/
    incubator/ace/trunk/test/src/org/apache/ace/test/constants/TestConstants.java
Modified:
    incubator/ace/trunk/test/src/org/apache/ace/deployment/streamgenerator/impl/StreamTest.java
    incubator/ace/trunk/test/src/org/apache/ace/discovery/property/SimpleDiscoveryTest.java
    incubator/ace/trunk/test/src/org/apache/ace/discovery/upnp/SimpleDiscoveryTest.java
    incubator/ace/trunk/test/src/org/apache/ace/obr/servlet/BundleServletTest.java
    incubator/ace/trunk/test/src/org/apache/ace/test/deployment/DeploymentIntegrationTest.java
    incubator/ace/trunk/test/src/org/apache/ace/test/http/listener/ServletConfiguratorIntegrationTest.java
    incubator/ace/trunk/test/src/org/apache/ace/test/log/Activator.java
    incubator/ace/trunk/test/src/org/apache/ace/test/log/LogIntegrationTest.java
    incubator/ace/trunk/test/src/org/apache/ace/test/repository/RepositoryTest.java
    incubator/ace/trunk/test/src/org/apache/ace/test/repositoryadmin/RepositoryAdminTest.java
    incubator/ace/trunk/test/src/org/apache/ace/test/tools/RepositoryTool.java
    incubator/ace/trunk/test/src/org/apache/ace/test/useradminconfigurator/Activator.java

Modified: incubator/ace/trunk/test/src/org/apache/ace/deployment/streamgenerator/impl/StreamTest.java
URL: http://svn.apache.org/viewvc/incubator/ace/trunk/test/src/org/apache/ace/deployment/streamgenerator/impl/StreamTest.java?rev=821573&r1=821572&r2=821573&view=diff
==============================================================================
--- incubator/ace/trunk/test/src/org/apache/ace/deployment/streamgenerator/impl/StreamTest.java
(original)
+++ incubator/ace/trunk/test/src/org/apache/ace/deployment/streamgenerator/impl/StreamTest.java
Sun Oct  4 18:37:46 2009
@@ -34,6 +34,7 @@
 import java.util.jar.Manifest;
 
 import org.apache.ace.deployment.provider.DeploymentProvider;
+import org.apache.ace.test.constants.TestConstants;
 import org.apache.ace.test.utils.TestUtils;
 import org.apache.ace.test.utils.deployment.TestProvider;
 import org.osgi.service.log.LogService;
@@ -69,7 +70,7 @@
         for (int i = 1; i <= 250; i++) {
             final String id = "gateway-" + i;
             try {
-                streams[i - 1] = new URL("http://127.0.0.1:8080/data/" + id + "/versions/1.0.0").openStream();
+                streams[i - 1] = new URL("http://127.0.0.1:" + TestConstants.PORT + "/data/"
+ id + "/versions/1.0.0").openStream();
             }
             catch (IOException ex) {
                 ex.printStackTrace();
@@ -188,7 +189,7 @@
                     for (int i = 250; i < 300; i++) {
                         try {
                             if (streams[i] == null) {
-                                streams[i] = new URL("http://127.0.0.1:8080/data/gateway-"
+ (i + 1) + "/versions/1.0.0").openStream();
+                                streams[i] = new URL("http://127.0.0.1:" + TestConstants.PORT
+ "/data/gateway-" + (i + 1) + "/versions/1.0.0").openStream();
                             }
                             int in = streams[i].read();
                             if (in == -1) {

Modified: incubator/ace/trunk/test/src/org/apache/ace/discovery/property/SimpleDiscoveryTest.java
URL: http://svn.apache.org/viewvc/incubator/ace/trunk/test/src/org/apache/ace/discovery/property/SimpleDiscoveryTest.java?rev=821573&r1=821572&r2=821573&view=diff
==============================================================================
--- incubator/ace/trunk/test/src/org/apache/ace/discovery/property/SimpleDiscoveryTest.java
(original)
+++ incubator/ace/trunk/test/src/org/apache/ace/discovery/property/SimpleDiscoveryTest.java
Sun Oct  4 18:37:46 2009
@@ -25,6 +25,7 @@
 import java.util.Hashtable;
 
 import org.apache.ace.discovery.property.constants.DiscoveryConstants;
+import org.apache.ace.test.constants.TestConstants;
 import org.osgi.service.cm.ConfigurationException;
 import org.testng.annotations.BeforeTest;
 import org.testng.annotations.Test;
@@ -32,7 +33,7 @@
 public class SimpleDiscoveryTest {
 
     private static final String SERVERURL_KEY = DiscoveryConstants.DISCOVERY_URL_KEY;
-    private static final String VALID_URL = "http://test.url.com:8080";
+    private static final String VALID_URL = "http://test.url.com:" + TestConstants.PORT;
     private static final String INVALID_URL = "malformed url";
 
     private PropertyBasedDiscovery m_discovery;

Modified: incubator/ace/trunk/test/src/org/apache/ace/discovery/upnp/SimpleDiscoveryTest.java
URL: http://svn.apache.org/viewvc/incubator/ace/trunk/test/src/org/apache/ace/discovery/upnp/SimpleDiscoveryTest.java?rev=821573&r1=821572&r2=821573&view=diff
==============================================================================
--- incubator/ace/trunk/test/src/org/apache/ace/discovery/upnp/SimpleDiscoveryTest.java (original)
+++ incubator/ace/trunk/test/src/org/apache/ace/discovery/upnp/SimpleDiscoveryTest.java Sun
Oct  4 18:37:46 2009
@@ -23,6 +23,7 @@
 import java.net.URL;
 import java.util.Properties;
 
+import org.apache.ace.test.constants.TestConstants;
 import org.easymock.EasyMock;
 import org.easymock.IMocksControl;
 import org.osgi.framework.ServiceReference;
@@ -35,7 +36,7 @@
 
 public class SimpleDiscoveryTest {
 
-    private static final String VALID_URL = "http://test.url.com:8080";
+    private static final String VALID_URL = "http://test.url.com:" + TestConstants.PORT;
     private static final String INVALID_URL = "malformed url";
 
     private UPnPBasedDiscovery m_discovery;

Modified: incubator/ace/trunk/test/src/org/apache/ace/obr/servlet/BundleServletTest.java
URL: http://svn.apache.org/viewvc/incubator/ace/trunk/test/src/org/apache/ace/obr/servlet/BundleServletTest.java?rev=821573&r1=821572&r2=821573&view=diff
==============================================================================
--- incubator/ace/trunk/test/src/org/apache/ace/obr/servlet/BundleServletTest.java (original)
+++ incubator/ace/trunk/test/src/org/apache/ace/obr/servlet/BundleServletTest.java Sun Oct
 4 18:37:46 2009
@@ -37,6 +37,7 @@
 import javax.servlet.http.HttpServletResponse;
 
 import org.apache.ace.obr.storage.BundleStore;
+import org.apache.ace.test.constants.TestConstants;
 import org.apache.ace.test.utils.FileUtils;
 import org.apache.ace.test.utils.TestUtils;
 import org.osgi.service.log.LogService;
@@ -76,7 +77,7 @@
 
             @SuppressWarnings("unused")
             public StringBuffer getRequestURL() {
-                return new StringBuffer("http://localhost:8080/obr/" + m_requestFile);
+                return new StringBuffer("http://localhost:" + TestConstants.PORT + "/obr/"
+ m_requestFile);
             }
 
             @SuppressWarnings("unused")

Added: incubator/ace/trunk/test/src/org/apache/ace/test/constants/TestConstants.java
URL: http://svn.apache.org/viewvc/incubator/ace/trunk/test/src/org/apache/ace/test/constants/TestConstants.java?rev=821573&view=auto
==============================================================================
--- incubator/ace/trunk/test/src/org/apache/ace/test/constants/TestConstants.java (added)
+++ incubator/ace/trunk/test/src/org/apache/ace/test/constants/TestConstants.java Sun Oct
 4 18:37:46 2009
@@ -0,0 +1,29 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.ace.test.constants;
+
+/**
+ * Constants for global test parameters. Use these throughout the test
+ * codebase. Make sure to only use public static finals here, which
+ * can be inlined by the compiler.
+ */
+public interface TestConstants {
+    /** The port the webserver is running on for testing. */
+    public static final int PORT = 9000;
+}

Modified: incubator/ace/trunk/test/src/org/apache/ace/test/deployment/DeploymentIntegrationTest.java
URL: http://svn.apache.org/viewvc/incubator/ace/trunk/test/src/org/apache/ace/test/deployment/DeploymentIntegrationTest.java?rev=821573&r1=821572&r2=821573&view=diff
==============================================================================
--- incubator/ace/trunk/test/src/org/apache/ace/test/deployment/DeploymentIntegrationTest.java
(original)
+++ incubator/ace/trunk/test/src/org/apache/ace/test/deployment/DeploymentIntegrationTest.java
Sun Oct  4 18:37:46 2009
@@ -40,6 +40,7 @@
 import org.apache.ace.http.listener.constants.HttpConstants;
 import org.apache.ace.identification.property.constants.IdentificationConstants;
 import org.apache.ace.scheduler.constants.SchedulerConstants;
+import org.apache.ace.test.constants.TestConstants;
 import org.apache.ace.test.utils.deployment.BundleStreamGenerator;
 import org.osgi.framework.Bundle;
 import org.osgi.framework.BundleContext;
@@ -60,9 +61,7 @@
 import org.testng.annotations.Test;
 
 public class DeploymentIntegrationTest implements BundleListener, EventHandler {
-
     public static final String HOST = "localhost";
-    public static final int PORT = 8080;
     public static final String GWID = "gw-id";
     public static final long POLL_INTERVAL = 1000;
     private static Object instance;
@@ -319,7 +318,7 @@
 
     private void configureGateway() throws IOException {
         // configure discovery bundle
-        setProperty(DiscoveryConstants.DISCOVERY_PID, new Object[][] { { DiscoveryConstants.DISCOVERY_URL_KEY,
"http://" + HOST + ":" + PORT } });
+        setProperty(DiscoveryConstants.DISCOVERY_PID, new Object[][] { { DiscoveryConstants.DISCOVERY_URL_KEY,
"http://" + HOST + ":" + TestConstants.PORT } });
         // configure identification bundle
         setProperty(IdentificationConstants.IDENTIFICATION_PID, new Object[][] { { IdentificationConstants.IDENTIFICATION_GATEWAYID_KEY,
GWID } });
         // configure scheduler

Modified: incubator/ace/trunk/test/src/org/apache/ace/test/http/listener/ServletConfiguratorIntegrationTest.java
URL: http://svn.apache.org/viewvc/incubator/ace/trunk/test/src/org/apache/ace/test/http/listener/ServletConfiguratorIntegrationTest.java?rev=821573&r1=821572&r2=821573&view=diff
==============================================================================
--- incubator/ace/trunk/test/src/org/apache/ace/test/http/listener/ServletConfiguratorIntegrationTest.java
(original)
+++ incubator/ace/trunk/test/src/org/apache/ace/test/http/listener/ServletConfiguratorIntegrationTest.java
Sun Oct  4 18:37:46 2009
@@ -31,6 +31,7 @@
 import javax.servlet.http.HttpServlet;
 
 import org.apache.ace.http.listener.constants.HttpConstants;
+import org.apache.ace.test.constants.TestConstants;
 import org.apache.felix.dependencymanager.DependencyManager;
 import org.apache.felix.dependencymanager.Service;
 import org.osgi.framework.Bundle;
@@ -184,16 +185,15 @@
 
     }
 
-
-
     /**
-     * now the server should be made available at
-     * http://localhost:8080/echoservlet
-     * if it is not available after 2000 ms, the test is failed anyway
+     * Now the server should be made available at
+     * http://SERVER:PORT/echoservlet and if it is not available after
+     * some time, the test is failed anyway.
      *
      * The expectSuccess parameter indicated if this method should expect a working echoservlet
or a non-working one.
      *
-     * This method returns whether the expect result was met. So if you expect it to work
(and it does), true will be returned.
+     * This method returns whether the expect result was met. So if you expect
+     * it to work (and it does), true will be returned.
      * If you expect it to NOT work (and it doesn't), false will be returned.
      */
     private boolean waitForEchoServlet(boolean expectedResult) {
@@ -204,7 +204,7 @@
         boolean success = !expectedResult;
         try {
             while ((expectedResult != success) && (System.currentTimeMillis() <
startTimeMillis + 30000)) {
-                URL echoServletUrl = new URL("http://localhost:8080/echoServlet?test");
+                URL echoServletUrl = new URL("http://localhost:" + TestConstants.PORT + "/echoServlet?test");
                 String echoString = null;
                 try {
                     bufReader = new BufferedReader(new InputStreamReader(echoServletUrl.openStream()));

Modified: incubator/ace/trunk/test/src/org/apache/ace/test/log/Activator.java
URL: http://svn.apache.org/viewvc/incubator/ace/trunk/test/src/org/apache/ace/test/log/Activator.java?rev=821573&r1=821572&r2=821573&view=diff
==============================================================================
--- incubator/ace/trunk/test/src/org/apache/ace/test/log/Activator.java (original)
+++ incubator/ace/trunk/test/src/org/apache/ace/test/log/Activator.java Sun Oct  4 18:37:46
2009
@@ -28,6 +28,7 @@
 import org.apache.ace.identification.property.constants.IdentificationConstants;
 import org.apache.ace.log.Log;
 import org.apache.ace.server.log.store.LogStore;
+import org.apache.ace.test.constants.TestConstants;
 import org.apache.ace.test.osgi.dm.TestActivatorBase;
 import org.apache.felix.dependencymanager.DependencyManager;
 import org.osgi.framework.BundleContext;
@@ -43,7 +44,6 @@
     @SuppressWarnings("unchecked")
     private Class[] m_classes = new Class[] { LogIntegrationTest.class };
     public static final String HOST = "localhost";
-    public static final int PORT = 8080;
     public static final String GWID = "gw-id";
     public static final String POLL_INTERVAL = "2";
     private volatile ConfigurationAdmin m_config;
@@ -93,7 +93,7 @@
     }
 
     private void configureGateway() throws IOException {
-        setProperty(DiscoveryConstants.DISCOVERY_PID, new Object[][] { { DiscoveryConstants.DISCOVERY_URL_KEY,
"http://" + HOST + ":" + PORT } });
+        setProperty(DiscoveryConstants.DISCOVERY_PID, new Object[][] { { DiscoveryConstants.DISCOVERY_URL_KEY,
"http://" + HOST + ":" + TestConstants.PORT } });
         setProperty(IdentificationConstants.IDENTIFICATION_PID, new Object[][] { { IdentificationConstants.IDENTIFICATION_GATEWAYID_KEY,
GWID } });
         createFactoryInstance("org.apache.ace.gateway.log.store.factory", new Object[][]
{ {"name", "auditlog"} });
         createFactoryInstance("org.apache.ace.gateway.log.factory", new Object[][] { {"name",
"auditlog"} });

Modified: incubator/ace/trunk/test/src/org/apache/ace/test/log/LogIntegrationTest.java
URL: http://svn.apache.org/viewvc/incubator/ace/trunk/test/src/org/apache/ace/test/log/LogIntegrationTest.java?rev=821573&r1=821572&r2=821573&view=diff
==============================================================================
--- incubator/ace/trunk/test/src/org/apache/ace/test/log/LogIntegrationTest.java (original)
+++ incubator/ace/trunk/test/src/org/apache/ace/test/log/LogIntegrationTest.java Sun Oct 
4 18:37:46 2009
@@ -32,6 +32,7 @@
 import org.apache.ace.log.LogDescriptor;
 import org.apache.ace.log.LogEvent;
 import org.apache.ace.server.log.store.LogStore;
+import org.apache.ace.test.constants.TestConstants;
 import org.testng.annotations.Factory;
 import org.testng.annotations.Test;
 
@@ -111,25 +112,25 @@
         events.add(new LogEvent("47", 2, 2, 1, 1, new Properties()));
         m_serverStore.put(events);
 
-        List<String> result = getResponse("http://localhost:8080/auditlog/query");
+        List<String> result = getResponse("http://localhost:" + TestConstants.PORT
+ "/auditlog/query");
         assert result.size() > 1 : "We expect at least two logs on the server.";
 
-        result = getResponse("http://localhost:8080/auditlog/receive?gwid=42");
+        result = getResponse("http://localhost:" + TestConstants.PORT + "/auditlog/receive?gwid=42");
         assert result.size() == 1 : "Gateway 42 has a single audit log event.";
 
-        result = getResponse("http://localhost:8080/auditlog/receive?gwid=47");
+        result = getResponse("http://localhost:" + TestConstants.PORT + "/auditlog/receive?gwid=47");
         assert result.size() == 3 : "Gateway 47 has 3 audit log events.";
 
-        result = getResponse("http://localhost:8080/auditlog/receive?gwid=47&logid=1");
+        result = getResponse("http://localhost:" + TestConstants.PORT + "/auditlog/receive?gwid=47&logid=1");
         assert result.size() == 1 : "Gateway 47, logid 1 has 1 audit log event.";
 
-        result = getResponse("http://localhost:8080/auditlog/receive?gwid=47&logid=2");
+        result = getResponse("http://localhost:" + TestConstants.PORT + "/auditlog/receive?gwid=47&logid=2");
         assert result.size() == 2 : "Gateway 47, logid 2 has 2 audit log events.";
 
-        result = getResponse("http://localhost:8080/auditlog/receive?gwid=47&logid=2&range=1");
+        result = getResponse("http://localhost:" + TestConstants.PORT + "/auditlog/receive?gwid=47&logid=2&range=1");
         assert result.size() == 1 : "Gateway 47, logid 2, range 1 has 1 audit log event.";
 
-        result = getResponse("http://localhost:8080/auditlog/receive?gwid=47&logid=2&range=3,5");
+        result = getResponse("http://localhost:" + TestConstants.PORT + "/auditlog/receive?gwid=47&logid=2&range=3,5");
         assert result.size() == 0 : "Gateway 47, logid 2, range 3,5 has 0 audit log event.";
     }
 

Modified: incubator/ace/trunk/test/src/org/apache/ace/test/repository/RepositoryTest.java
URL: http://svn.apache.org/viewvc/incubator/ace/trunk/test/src/org/apache/ace/test/repository/RepositoryTest.java?rev=821573&r1=821572&r2=821573&view=diff
==============================================================================
--- incubator/ace/trunk/test/src/org/apache/ace/test/repository/RepositoryTest.java (original)
+++ incubator/ace/trunk/test/src/org/apache/ace/test/repository/RepositoryTest.java Sun Oct
 4 18:37:46 2009
@@ -39,6 +39,7 @@
 import org.apache.ace.http.listener.constants.HttpConstants;
 import org.apache.ace.repository.Repository;
 import org.apache.ace.repository.impl.constants.RepositoryConstants;
+import org.apache.ace.test.constants.TestConstants;
 import org.osgi.framework.BundleContext;
 import org.osgi.framework.Constants;
 import org.osgi.framework.InvalidSyntaxException;
@@ -56,7 +57,7 @@
 
     private static final int COPY_BUFFER_SIZE = 4096;
     private static final String MIME_APPLICATION_OCTET_STREAM = "application/octet-stream";
-    private static final String HOST = "http://localhost:8080";
+    private static final String HOST = "http://localhost:" + TestConstants.PORT;
 
     private volatile ConfigurationAdmin m_configAdmin;  // Injected by dependency manager
     private volatile BundleContext m_context;           // Injected by dependency manager

Modified: incubator/ace/trunk/test/src/org/apache/ace/test/repositoryadmin/RepositoryAdminTest.java
URL: http://svn.apache.org/viewvc/incubator/ace/trunk/test/src/org/apache/ace/test/repositoryadmin/RepositoryAdminTest.java?rev=821573&r1=821572&r2=821573&view=diff
==============================================================================
--- incubator/ace/trunk/test/src/org/apache/ace/test/repositoryadmin/RepositoryAdminTest.java
(original)
+++ incubator/ace/trunk/test/src/org/apache/ace/test/repositoryadmin/RepositoryAdminTest.java
Sun Oct  4 18:37:46 2009
@@ -84,6 +84,7 @@
 import org.apache.ace.repository.impl.constants.RepositoryConstants;
 import org.apache.ace.scheduler.constants.SchedulerConstants;
 import org.apache.ace.server.log.store.LogStore;
+import org.apache.ace.test.constants.TestConstants;
 import org.apache.ace.test.utils.TestUtils;
 import org.apache.felix.dependencymanager.DependencyManager;
 import org.apache.felix.dependencymanager.Service;
@@ -290,7 +291,7 @@
     }
 
     private static final String ENDPOINT = "/AdminRepTest";
-    private static final String HOST = "http://localhost:8080";
+    private static final String HOST = "http://localhost:" + TestConstants.PORT;
 
     /**
      * Tests the behavior with logging in and out (with multiple users), and communication
@@ -1273,7 +1274,7 @@
 
         // Supply the OBR.
         addObr("/obr", "store");
-        m_artifactRepository.setObrBase(new URL("http://localhost:8080/obr/"));
+        m_artifactRepository.setObrBase(new URL("http://localhost:" + TestConstants.PORT
+ "/obr/"));
 
         m_artifactRepository.importArtifact(temp.toURI().toURL(), true);
 
@@ -1412,8 +1413,8 @@
     @Test( groups = { TestUtils.INTEGRATION } )
     public void testRepostoryLoginDoubleRepository() throws Exception {
         RepositoryAdminLoginContext context = m_repositoryAdmin.createLoginContext(new MockUser("user"));
-        context.addRepositories(new URL("http://localhost:8080"), "apache", "shop", true,
ArtifactRepository.class, Artifact2GroupAssociationRepository.class, GroupRepository.class);
-        context.addRepositories(new URL("http://localhost:8080"), "apache", "deployment",
true, GroupRepository.class, Group2LicenseAssociationRepository.class, LicenseRepository.class);
+        context.addRepositories(new URL("http://localhost:" + TestConstants.PORT), "apache",
"shop", true, ArtifactRepository.class, Artifact2GroupAssociationRepository.class, GroupRepository.class);
+        context.addRepositories(new URL("http://localhost:" + TestConstants.PORT), "apache",
"deployment", true, GroupRepository.class, Group2LicenseAssociationRepository.class, LicenseRepository.class);
         try {
             m_repositoryAdmin.login(context);
             assert false : "We tried to log in with two repositories that try to access the
same repository service; this should not be allowed.";
@@ -1429,8 +1430,8 @@
     @Test( groups = { TestUtils.INTEGRATION } )
     public void testRepostoryLoginRepositoryWithoutImplementation() throws Exception {
         RepositoryAdminLoginContext context = m_repositoryAdmin.createLoginContext(new MockUser("user"));
-        context.addRepositories(new URL("http://localhost:8080"), "apache", "shop", true,
ArtifactRepository.class, Artifact2GroupAssociationRepository.class, GroupRepository.class);
-        context.addRepositories(new URL("http://localhost:8080"), "apache", "deployment",
true, GroupRepository.class, Group2LicenseAssociationRepository.class, newRepository.class);
+        context.addRepositories(new URL("http://localhost:" + TestConstants.PORT), "apache",
"shop", true, ArtifactRepository.class, Artifact2GroupAssociationRepository.class, GroupRepository.class);
+        context.addRepositories(new URL("http://localhost:" + TestConstants.PORT), "apache",
"deployment", true, GroupRepository.class, Group2LicenseAssociationRepository.class, newRepository.class);
         try {
             m_repositoryAdmin.login(context);
             assert false : "We tried to log in with a repository for which no implementation
is available; this should not be allowed.";
@@ -1511,7 +1512,7 @@
     @Test( groups = { TestUtils.INTEGRATION } )
     public void testTemplateProcessing() throws Exception {
         addObr("/obr", "store");
-        m_artifactRepository.setObrBase(new URL("http://localhost:8080/obr/"));
+        m_artifactRepository.setObrBase(new URL("http://localhost:" + TestConstants.PORT
+ "/obr/"));
 
         // create some template things
         String xmlHeader = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<metatype:MetaData
xmlns:metatype= \"http://www.osgi.org/xmlns/metatype/v1.0.0\">\n";
@@ -1798,8 +1799,9 @@
         configServlet.update(propsServlet);
         configStore.update(propsStore);
 
-        // Wait for the enpoint to respond.
-        URL url = new URL("http://localhost:8080" + endpoint + "/repository.xml");
+        // Wait for the endpoint to respond.
+        // TODO below there is a similar url that does put a slash between port and endpoint,
why?
+        URL url = new URL("http://localhost:" + TestConstants.PORT + endpoint + "/repository.xml");
         int response = ((HttpURLConnection) url.openConnection()).getResponseCode();
         int tries = 0;
         while ((response != 200) && (tries < 50)) {
@@ -1822,7 +1824,7 @@
         Configuration configServlet = m_configAdmin.getConfiguration("org.apache.ace.obr.servlet");
         configServlet.update(propsServlet);
 
-        URL url = new URL("http://localhost:8080/" + endpoint + "/repository.xml");
+        URL url = new URL("http://localhost:" + TestConstants.PORT + "/" + endpoint + "/repository.xml");
         int response = ((HttpURLConnection) url.openConnection()).getResponseCode();
         int tries = 0;
         while ((response != 404) && (tries < 50)) {

Modified: incubator/ace/trunk/test/src/org/apache/ace/test/tools/RepositoryTool.java
URL: http://svn.apache.org/viewvc/incubator/ace/trunk/test/src/org/apache/ace/test/tools/RepositoryTool.java?rev=821573&r1=821572&r2=821573&view=diff
==============================================================================
--- incubator/ace/trunk/test/src/org/apache/ace/test/tools/RepositoryTool.java (original)
+++ incubator/ace/trunk/test/src/org/apache/ace/test/tools/RepositoryTool.java Sun Oct  4
18:37:46 2009
@@ -37,6 +37,7 @@
 
 import org.apache.ace.repository.RangeIterator;
 import org.apache.ace.repository.SortedRangeSet;
+import org.apache.ace.test.constants.TestConstants;
 import org.apache.commons.cli.CommandLine;
 import org.apache.commons.cli.HelpFormatter;
 import org.apache.commons.cli.Options;
@@ -73,7 +74,7 @@
         }
         try {
             CommandLine line = parser.parse(options, args, props);
-            String host = line.getOptionValue("host", "http://localhost:8080/");
+            String host = line.getOptionValue("host", "http://localhost:" + TestConstants.PORT
+ "/");
             String cmd = line.getOptionValue("command", "query");
             String customer = line.getOptionValue("customer");
             String name = line.getOptionValue("name");

Modified: incubator/ace/trunk/test/src/org/apache/ace/test/useradminconfigurator/Activator.java
URL: http://svn.apache.org/viewvc/incubator/ace/trunk/test/src/org/apache/ace/test/useradminconfigurator/Activator.java?rev=821573&r1=821572&r2=821573&view=diff
==============================================================================
--- incubator/ace/trunk/test/src/org/apache/ace/test/useradminconfigurator/Activator.java
(original)
+++ incubator/ace/trunk/test/src/org/apache/ace/test/useradminconfigurator/Activator.java
Sun Oct  4 18:37:46 2009
@@ -23,6 +23,7 @@
 
 import org.apache.ace.repository.Repository;
 import org.apache.ace.repository.impl.constants.RepositoryConstants;
+import org.apache.ace.test.constants.TestConstants;
 import org.apache.ace.test.osgi.dm.TestActivatorBase;
 import org.apache.felix.dependencymanager.DependencyManager;
 import org.osgi.framework.BundleContext;
@@ -84,7 +85,7 @@
         props = new Properties();
         props.put("repositoryName", "users");
         props.put("repositoryCustomer", "apache");
-        props.put("repositoryLocation", "http://localhost:8080/repository");
+        props.put("repositoryLocation", "http://localhost:" + TestConstants.PORT + "/repository");
 
         config.update(props);
 



Mime
View raw message