Author: mduerig
Date: Sat Feb 25 20:20:59 2017
New Revision: 1784401
URL: http://svn.apache.org/viewvc?rev=1784401&view=rev
Log:
OAK-5843: Test failure: testGetUserByRef LdapProviderTest
Added null check in test teardown after failed assumption in test setup
Modified:
jackrabbit/oak/trunk/oak-auth-ldap/src/test/java/org/apache/jackrabbit/oak/security/authentication/ldap/LdapProviderTest.java
Modified:
jackrabbit/oak/trunk/oak-auth-ldap/src/test/java/org/apache/jackrabbit/oak/security/authentication/ldap/LdapProviderTest.java
URL:
http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-auth-ldap/src/test/java/org/apache/jackrabbit/oak/security/authentication/ldap/LdapProviderTest.java?rev=1784401&r1=1784400&r2=1784401&view=diff
==============================================================================
---
jackrabbit/oak/trunk/oak-auth-ldap/src/test/java/org/apache/jackrabbit/oak/security/authentication/ldap/LdapProviderTest.java
(original)
+++
jackrabbit/oak/trunk/oak-auth-ldap/src/test/java/org/apache/jackrabbit/oak/security/authentication/ldap/LdapProviderTest.java
Sat Feb 25 20:20:59 2017
@@ -17,6 +17,14 @@
package org.apache.jackrabbit.oak.security.authentication.ldap;
+import static junit.framework.Assert.assertEquals;
+import static junit.framework.Assert.assertNotNull;
+import static junit.framework.Assert.assertNull;
+import static junit.framework.Assert.assertTrue;
+import static junit.framework.Assert.fail;
+import static org.junit.Assert.assertArrayEquals;
+import static org.junit.Assert.assertThat;
+
import java.io.InputStream;
import java.util.Arrays;
import java.util.Collection;
@@ -46,15 +54,6 @@ import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
-import static junit.framework.Assert.assertEquals;
-import static junit.framework.Assert.assertNotNull;
-import static junit.framework.Assert.assertNull;
-import static junit.framework.Assert.assertTrue;
-import static junit.framework.Assert.fail;
-
-import static org.junit.Assert.assertArrayEquals;
-import static org.junit.Assert.assertThat;
-
public class LdapProviderTest {
protected static final InternalLdapServer LDAP_SERVER = new
InternalLdapServer();
@@ -101,8 +100,10 @@ public class LdapProviderTest {
if (!USE_COMMON_LDAP_FIXTURE) {
LDAP_SERVER.tearDown();
}
- idp.close();
- idp = null;
+ if (idp != null) {
+ idp.close();
+ idp = null;
+ }
}
protected LdapIdentityProvider createIDP() {