geode-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bschucha...@apache.org
Subject [geode] branch feature/GEODE-3692 updated: GEODE-3692: Intermittent test failure: ClientAuthDUnitTest
Date Tue, 05 Jun 2018 18:38:16 GMT
This is an automated email from the ASF dual-hosted git repository.

bschuchardt pushed a commit to branch feature/GEODE-3692
in repository https://gitbox.apache.org/repos/asf/geode.git


The following commit(s) were added to refs/heads/feature/GEODE-3692 by this push:
     new fa7c772  GEODE-3692: Intermittent test failure: ClientAuthDUnitTest
fa7c772 is described below

commit fa7c77285699f61f4cf2b792ca5c8c4468df98cd
Author: Bruce Schuchardt <bschuchardt@pivotal.io>
AuthorDate: Tue Jun 5 11:36:37 2018 -0700

    GEODE-3692: Intermittent test failure: ClientAuthDUnitTest
    
    Fixed tests that were depending on SecurityUtils.setSecurityManager().
    These now use ThreadContext.bind() instead.
---
 .../org/apache/geode/internal/security/IntegratedSecurityService.java | 1 +
 .../java/org/apache/geode/internal/security/SecurityServiceTest.java  | 4 ++--
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/geode-core/src/main/java/org/apache/geode/internal/security/IntegratedSecurityService.java
b/geode-core/src/main/java/org/apache/geode/internal/security/IntegratedSecurityService.java
index acc9ef8..fe8e4d8 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/security/IntegratedSecurityService.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/security/IntegratedSecurityService.java
@@ -71,6 +71,7 @@ public class IntegratedSecurityService implements SecurityService {
     // service at all.
     this.shiroSecurityManager = provider.getShiroSecurityManager();
     assert this.shiroSecurityManager != null;
+    ThreadContext.bind(this.shiroSecurityManager);
     this.securityManager = provider.getSecurityManager();
     this.postProcessor = postProcessor;
   }
diff --git a/geode-core/src/test/java/org/apache/geode/internal/security/SecurityServiceTest.java
b/geode-core/src/test/java/org/apache/geode/internal/security/SecurityServiceTest.java
index 94fadde..5b1bec6 100644
--- a/geode-core/src/test/java/org/apache/geode/internal/security/SecurityServiceTest.java
+++ b/geode-core/src/test/java/org/apache/geode/internal/security/SecurityServiceTest.java
@@ -22,8 +22,8 @@ import static org.assertj.core.api.Assertions.assertThat;
 
 import java.util.Properties;
 
-import org.apache.shiro.SecurityUtils;
 import org.apache.shiro.mgt.DefaultSecurityManager;
+import org.apache.shiro.util.ThreadContext;
 import org.junit.After;
 import org.junit.Before;
 import org.junit.Test;
@@ -121,7 +121,7 @@ public class SecurityServiceTest {
 
   @Test
   public void testInitWithOutsideShiroSecurityManager() {
-    SecurityUtils.setSecurityManager(new DefaultSecurityManager());
+    ThreadContext.bind(new DefaultSecurityManager());
     this.securityService = SecurityServiceFactory.create(properties);
 
     assertThat(this.securityService.isIntegratedSecurity()).isTrue();

-- 
To stop receiving notification emails like this one, please contact
bschuchardt@apache.org.

Mime
View raw message