incubator-sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jus...@apache.org
Subject svn commit: r1303103 - /sling/trunk/bundles/commons/testing/src/main/java/org/apache/sling/commons/testing/integration/HttpTestBase.java
Date Tue, 20 Mar 2012 19:13:34 GMT
Author: justin
Date: Tue Mar 20 19:13:33 2012
New Revision: 1303103

URL: http://svn.apache.org/viewvc?rev=1303103&view=rev
Log:
SLING-2358 - adding getDefaultCredentials() method in HttpTestBase to allow HTTP tests to
specify alternate credentials

Modified:
    sling/trunk/bundles/commons/testing/src/main/java/org/apache/sling/commons/testing/integration/HttpTestBase.java

Modified: sling/trunk/bundles/commons/testing/src/main/java/org/apache/sling/commons/testing/integration/HttpTestBase.java
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/commons/testing/src/main/java/org/apache/sling/commons/testing/integration/HttpTestBase.java?rev=1303103&r1=1303102&r2=1303103&view=diff
==============================================================================
--- sling/trunk/bundles/commons/testing/src/main/java/org/apache/sling/commons/testing/integration/HttpTestBase.java
(original)
+++ sling/trunk/bundles/commons/testing/src/main/java/org/apache/sling/commons/testing/integration/HttpTestBase.java
Tue Mar 20 19:13:33 2012
@@ -136,7 +136,7 @@ public class HttpTestBase extends TestCa
         // setup HTTP client, with authentication (using default Jackrabbit credentials)
         httpClient = new HttpClient();
         httpClient.getParams().setAuthenticationPreemptive(true);
-        Credentials defaultcreds = new UsernamePasswordCredentials("admin", "admin");
+        Credentials defaultcreds = getDefaultCredentials();
         httpClient.getState().setCredentials(new AuthScope(url.getHost(), url.getPort(),
AuthScope.ANY_REALM), defaultcreds);
 
         testClient = new SlingIntegrationTestClient(httpClient);
@@ -144,6 +144,13 @@ public class HttpTestBase extends TestCa
         waitForSlingStartup();
     }
 
+    /**
+     * Generate default credentials used for HTTP requests.
+     */
+    protected Credentials getDefaultCredentials() {
+        return new UsernamePasswordCredentials("admin", "admin");
+    }
+
     @Override
     protected void tearDown() throws Exception {
         MDC.remove("testcase");



Mime
View raw message