From 98b4b9f4b17f9e9d0900b13bf1092eee32499d1b Mon Sep 17 00:00:00 2001
From: James Moger <james.moger@gitblit.com>
Date: Tue, 24 Apr 2012 18:09:11 -0400
Subject: [PATCH] Add LdapUserServiceTest to suite and adjusted test port from 389 to 1389
---
tests/com/gitblit/tests/LdapUserServiceTest.java | 11 +++++++----
1 files changed, 7 insertions(+), 4 deletions(-)
diff --git a/tests/com/gitblit/tests/LdapUserServiceTest.java b/tests/com/gitblit/tests/LdapUserServiceTest.java
index 43af24f..48c9741 100644
--- a/tests/com/gitblit/tests/LdapUserServiceTest.java
+++ b/tests/com/gitblit/tests/LdapUserServiceTest.java
@@ -16,7 +16,9 @@
*/
package com.gitblit.tests;
-import static org.junit.Assert.*;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertTrue;
import java.util.HashMap;
import java.util.Map;
@@ -30,7 +32,6 @@
import com.unboundid.ldap.listener.InMemoryDirectoryServer;
import com.unboundid.ldap.listener.InMemoryDirectoryServerConfig;
import com.unboundid.ldap.listener.InMemoryListenerConfig;
-import com.unboundid.ldap.sdk.LDAPConnection;
import com.unboundid.ldif.LDIFReader;
/**
@@ -44,11 +45,13 @@
private LdapUserService ldapUserService;
+ int ldapPort = 1389;
+
@Before
public void createInMemoryLdapServer() throws Exception {
InMemoryDirectoryServerConfig config = new InMemoryDirectoryServerConfig("dc=MyDomain");
config.addAdditionalBindCredentials("cn=Directory Manager", "password");
- config.setListenerConfigs(InMemoryListenerConfig.createLDAPConfig("default", 389));
+ config.setListenerConfigs(InMemoryListenerConfig.createLDAPConfig("default", ldapPort));
config.setSchema(null);
InMemoryDirectoryServer ds = new InMemoryDirectoryServer(config);
@@ -59,7 +62,7 @@
@Before
public void createLdapUserService() {
Map<Object, Object> backingMap = new HashMap<Object, Object>();
- backingMap.put("realm.ldap.server", "ldap://localhost:389");
+ backingMap.put("realm.ldap.server", "ldap://localhost:" + ldapPort);
backingMap.put("realm.ldap.domain", "");
backingMap.put("realm.ldap.username", "cn=Directory Manager");
backingMap.put("realm.ldap.password", "password");
--
Gitblit v1.9.1