package org.apache.ldap.common.util; import javax.naming.NamingException; import org.apache.ldap.common.name.LdapName; import junit.framework.TestCase; public class NamespaceToolsTest extends TestCase { public static void main(String[] args) { junit.textui.TestRunner.run(NamespaceToolsTest.class); } public void testIsSibling() throws NamingException { LdapName name1 = new LdapName("cn=child1,ou=parent2,ou=parent1"); LdapName name2 = new LdapName("cn=child2,ou=parent2,ou=parent1"); LdapName name3 = new LdapName("cn=child3,ou=parent3,ou=parent1"); assertTrue(NamespaceTools.isSibling(name1, name2)); assertFalse(NamespaceTools.isSibling(name1, name3)); } }