]> source.dussan.org Git - gitblit.git/commitdiff
Add LdapUserServiceTest to suite and adjusted test port from 389 to 1389
authorJames Moger <james.moger@gitblit.com>
Tue, 24 Apr 2012 22:09:11 +0000 (18:09 -0400)
committerJames Moger <james.moger@gitblit.com>
Tue, 24 Apr 2012 22:09:11 +0000 (18:09 -0400)
tests/com/gitblit/tests/GitBlitSuite.java
tests/com/gitblit/tests/LdapUserServiceTest.java

index af18083d5d333df32e82bb1b26f0d686cf4c47b2..cab5b6391542d16d26bdbe4c553dfcf17a0f18c0 100644 (file)
@@ -49,10 +49,11 @@ import com.gitblit.utils.JGitUtils;
 @RunWith(Suite.class)\r
 @SuiteClasses({ ArrayUtilsTest.class, FileUtilsTest.class, TimeUtilsTest.class,\r
                StringUtilsTest.class, Base64Test.class, JsonUtilsTest.class, ByteFormatTest.class,\r
-               ObjectCacheTest.class, UserServiceTest.class, MarkdownUtilsTest.class, JGitUtilsTest.class,\r
-               SyndicationUtilsTest.class, DiffUtilsTest.class, MetricUtilsTest.class,\r
-               TicgitUtilsTest.class, GitBlitTest.class, FederationTests.class, RpcTests.class,\r
-               GitServletTest.class, GroovyScriptTest.class, LuceneExecutorTest.class, IssuesTest.class })\r
+               ObjectCacheTest.class, UserServiceTest.class, LdapUserServiceTest.class,\r
+               MarkdownUtilsTest.class, JGitUtilsTest.class, SyndicationUtilsTest.class,\r
+               DiffUtilsTest.class, MetricUtilsTest.class, TicgitUtilsTest.class,\r
+               GitBlitTest.class, FederationTests.class, RpcTests.class, GitServletTest.class,\r
+               GroovyScriptTest.class, LuceneExecutorTest.class, IssuesTest.class })\r
 public class GitBlitSuite {\r
 \r
        public static final File REPOSITORIES = new File("git");\r
index 43af24f26c0fb91567d2f5a4577abf8259a7479f..48c974163f258b90e083ad0c9c3f63d8008ea5f4 100644 (file)
@@ -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");