1 17 package org.apache.ldap.server.prefs; 18 19 20 import junit.framework.TestCase; 21 22 import javax.naming.Name ; 23 import javax.naming.NamingException ; 24 25 26 32 public class PreferencesUtilsTest extends TestCase 33 { 34 40 public void testToSysDn() throws NamingException 41 { 42 44 String test = "/org/apache/kerberos/"; 45 46 Name dn = PreferencesUtils.toSysDn( test ); 47 48 assertEquals( dn.toString(), "prefNodeName=kerberos,prefNodeName=apache,prefNodeName=org," + PreferencesUtils.SYSPREF_BASE ); 49 50 51 52 54 test = "/org/apache/kerberos"; 55 56 dn = PreferencesUtils.toSysDn( test ); 57 58 assertEquals( dn.toString(), "prefNodeName=kerberos,prefNodeName=apache,prefNodeName=org," + PreferencesUtils.SYSPREF_BASE ); 59 60 61 62 64 test = "/"; 65 66 dn = PreferencesUtils.toSysDn( test ); 67 68 assertEquals( dn.toString(), PreferencesUtils.SYSPREF_BASE ); 69 70 71 72 74 test = "//////"; 75 76 dn = PreferencesUtils.toSysDn( test ); 77 78 assertEquals( dn.toString(), PreferencesUtils.SYSPREF_BASE ); 79 80 } 81 } 82 | Popular Tags |