You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by cp...@apache.org on 2015/08/05 22:05:27 UTC

svn commit: r1694314 - in /lucene/dev/trunk/solr: CHANGES.txt core/src/test/org/apache/solr/cloud/TestAuthenticationFramework.java

Author: cpoerschke
Date: Wed Aug  5 20:05:27 2015
New Revision: 1694314

URL: http://svn.apache.org/r1694314
Log:
SOLR-7877: TestAuthenticationFramework.testBasics to preserve/restore the original request(Username|Password)

Modified:
    lucene/dev/trunk/solr/CHANGES.txt
    lucene/dev/trunk/solr/core/src/test/org/apache/solr/cloud/TestAuthenticationFramework.java

Modified: lucene/dev/trunk/solr/CHANGES.txt
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/CHANGES.txt?rev=1694314&r1=1694313&r2=1694314&view=diff
==============================================================================
--- lucene/dev/trunk/solr/CHANGES.txt (original)
+++ lucene/dev/trunk/solr/CHANGES.txt Wed Aug  5 20:05:27 2015
@@ -420,6 +420,9 @@ Other Changes
 * SOLR-7847: Implement run example logic in Java instead of OS-specific scripts in 
   bin/solr and bin\solr.cmd (Timothy Potter)
 
+* SOLR-7877: TestAuthenticationFramework.testBasics to preserve/restore the original request(Username|Password)
+  (Christine Poerschke)
+
 ==================  5.2.1 ==================
 
 Consult the LUCENE_CHANGES.txt file for additional, low level, changes in this release

Modified: lucene/dev/trunk/solr/core/src/test/org/apache/solr/cloud/TestAuthenticationFramework.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/core/src/test/org/apache/solr/cloud/TestAuthenticationFramework.java?rev=1694314&r1=1694313&r2=1694314&view=diff
==============================================================================
--- lucene/dev/trunk/solr/core/src/test/org/apache/solr/cloud/TestAuthenticationFramework.java (original)
+++ lucene/dev/trunk/solr/core/src/test/org/apache/solr/cloud/TestAuthenticationFramework.java Wed Aug  5 20:05:27 2015
@@ -83,6 +83,10 @@ public class TestAuthenticationFramework
   @Test
   @Override
   public void testBasics() throws Exception {
+    // save original username/password
+    final String originalRequestUsername = requestUsername;
+    final String originalRequestPassword = requestPassword;
+
     requestUsername = MockAuthenticationPlugin.expectedUsername;
     requestPassword = MockAuthenticationPlugin.expectedPassword;
     
@@ -102,6 +106,10 @@ public class TestAuthenticationFramework
       if (!ex.getMessage().contains("Error 401")) {
         fail("Should've returned a 401 error");
       }
+    } finally {
+      // restore original username/password
+      requestUsername = originalRequestUsername;
+      requestPassword = originalRequestPassword;        
     }
   }