Package org.apache.directory.shared.ldap.model.name

Examples of org.apache.directory.shared.ldap.model.name.DnParser


     * test an empty Dn
     */
    @Test
    public void testLdapDNEmpty() throws LdapException
    {
        DnParser dnParser = DnParser.getNameParser();

        assertEquals( "", ( (Dn) dnParser.parse( "" ) ).getName() );
    }
View Full Code Here


     * test a simple Dn : a = b
     */
    @Test
    public void testLdapDNSimple() throws LdapException
    {
        DnParser dnParser = DnParser.getNameParser();

        assertEquals( "a = b", ( (Dn) dnParser.parse( "a = b" ) ).getName() );
        assertEquals( "a=b", ( (Dn) dnParser.parse( "a = b" ) ).getNormName() );
    }
View Full Code Here

     * test a composite Dn : a = b, d = e
     */
    @Test
    public void testLdapDNComposite() throws LdapException
    {
        DnParser dnParser = DnParser.getNameParser();
        Dn dn = (Dn) dnParser.parse( "a = b, c = d" );
        assertEquals( "a=b,c=d", dn.getNormName() );
        assertEquals( "a = b, c = d", dn.getName() );
    }
View Full Code Here

     * test a composite Dn with or without spaces: a=b, a =b, a= b, a = b, a = b
     */
    @Test
    public void testLdapDNCompositeWithSpace() throws LdapException
    {
        DnParser dnParser = DnParser.getNameParser();
        Dn dn = (Dn) dnParser.parse( "a=b, a =b, a= b, a = b, a  =  b" );
        assertEquals( "a=b,a=b,a=b,a=b,a=b", dn.getNormName() );
        assertEquals( "a=b, a =b, a= b, a = b, a  =  b", dn.getName() );
    }
View Full Code Here

     * return a=b,c=d,e=f (the ';' is replaced by a ',')
     */
    @Test
    public void testLdapDNCompositeSepators() throws LdapException
    {
        DnParser dnParser = DnParser.getNameParser();
        Dn dn = (Dn) dnParser.parse( "a=b;c=d,e=f" );
        assertEquals( "a=b,c=d,e=f", dn.getNormName() );
        assertEquals( "a=b;c=d,e=f", dn.getName() );
    }
View Full Code Here

     * test a simple Dn with multiple NameComponents : a = b + c = d
     */
    @Test
    public void testLdapDNSimpleMultivaluedAttribute() throws LdapException
    {
        DnParser dnParser = DnParser.getNameParser();
        Dn dn = (Dn) dnParser.parse( "a = b + c = d" );
        assertEquals( "a=b+c=d", dn.getNormName() );
        assertEquals( "a = b + c = d", dn.getName() );
    }
View Full Code Here

     * i=j
     */
    @Test
    public void testLdapDNCompositeMultivaluedAttribute() throws LdapException
    {
        DnParser dnParser = DnParser.getNameParser();
        Dn dn = (Dn) dnParser.parse( "a=b+c=d, e=f + g=h + i=j" );
        assertEquals( "a=b+c=d,e=f+g=h+i=j", dn.getNormName() );
        assertEquals( "a=b+c=d, e=f + g=h + i=j", dn.getName() );
    }
View Full Code Here

     * test a simple Dn with an oid prefix (uppercase) : OID.12.34.56 = azerty
     */
    @Test
    public void testLdapDNOidUpper() throws LdapException
    {
        DnParser dnParser = DnParser.getNameParser();
        Dn dn = (Dn) dnParser.parse( "OID.12.34.56 = azerty" );
        assertEquals( "oid.12.34.56=azerty", dn.getNormName() );
        assertEquals( "OID.12.34.56 = azerty", dn.getName() );
    }
View Full Code Here

     * test a simple Dn with an oid prefix (lowercase) : oid.12.34.56 = azerty
     */
    @Test
    public void testLdapDNOidLower() throws LdapException
    {
        DnParser dnParser = DnParser.getNameParser();
        Dn dn = (Dn) dnParser.parse( "oid.12.34.56 = azerty" );
        assertEquals( "oid.12.34.56=azerty", dn.getNormName() );
        assertEquals( "oid.12.34.56 = azerty", dn.getName() );
    }
View Full Code Here

     * azerty
     */
    @Test
    public void testLdapDNOidWithoutPrefix() throws LdapException
    {
        DnParser dnParser = DnParser.getNameParser();
        Dn dn = (Dn) dnParser.parse( "12.34.56 = azerty" );
        assertEquals( "12.34.56=azerty", dn.getNormName() );
        assertEquals( "12.34.56 = azerty", dn.getName() );
    }
View Full Code Here

TOP

Related Classes of org.apache.directory.shared.ldap.model.name.DnParser

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.