summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorJames Moger <james.moger@gitblit.com>2012-04-24 18:09:11 -0400
committerJames Moger <james.moger@gitblit.com>2012-04-24 18:09:11 -0400
commit98b4b9f4b17f9e9d0900b13bf1092eee32499d1b (patch)
tree0120a901a19125703f630e0a8a286e79198986e3 /tests
parent668663dffb73722e2fae12d9f737d80cd54b3f03 (diff)
downloadgitblit-98b4b9f4b17f9e9d0900b13bf1092eee32499d1b.tar.gz
gitblit-98b4b9f4b17f9e9d0900b13bf1092eee32499d1b.zip
Add LdapUserServiceTest to suite and adjusted test port from 389 to 1389
Diffstat (limited to 'tests')
-rw-r--r--tests/com/gitblit/tests/GitBlitSuite.java9
-rw-r--r--tests/com/gitblit/tests/LdapUserServiceTest.java11
2 files changed, 12 insertions, 8 deletions
diff --git a/tests/com/gitblit/tests/GitBlitSuite.java b/tests/com/gitblit/tests/GitBlitSuite.java
index af18083d..cab5b639 100644
--- a/tests/com/gitblit/tests/GitBlitSuite.java
+++ b/tests/com/gitblit/tests/GitBlitSuite.java
@@ -49,10 +49,11 @@ import com.gitblit.utils.JGitUtils;
@RunWith(Suite.class)
@SuiteClasses({ ArrayUtilsTest.class, FileUtilsTest.class, TimeUtilsTest.class,
StringUtilsTest.class, Base64Test.class, JsonUtilsTest.class, ByteFormatTest.class,
- ObjectCacheTest.class, UserServiceTest.class, MarkdownUtilsTest.class, JGitUtilsTest.class,
- SyndicationUtilsTest.class, DiffUtilsTest.class, MetricUtilsTest.class,
- TicgitUtilsTest.class, GitBlitTest.class, FederationTests.class, RpcTests.class,
- GitServletTest.class, GroovyScriptTest.class, LuceneExecutorTest.class, IssuesTest.class })
+ ObjectCacheTest.class, UserServiceTest.class, LdapUserServiceTest.class,
+ MarkdownUtilsTest.class, JGitUtilsTest.class, SyndicationUtilsTest.class,
+ DiffUtilsTest.class, MetricUtilsTest.class, TicgitUtilsTest.class,
+ GitBlitTest.class, FederationTests.class, RpcTests.class, GitServletTest.class,
+ GroovyScriptTest.class, LuceneExecutorTest.class, IssuesTest.class })
public class GitBlitSuite {
public static final File REPOSITORIES = new File("git");
diff --git a/tests/com/gitblit/tests/LdapUserServiceTest.java b/tests/com/gitblit/tests/LdapUserServiceTest.java
index 43af24f2..48c97416 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.gitblit.tests.mock.MemorySettings;
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 @@ public class LdapUserServiceTest {
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 @@ public class LdapUserServiceTest {
@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");