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

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


     * @throws LdapException
     *             if anything goes wrong
     */
    public final void testDnParser()
    {
        DnParser parser = DnParser.getNameParser();

        assertNotNull( parser );
    }
View Full Code Here


     * @throws LdapException
     *             if anything goes wrong
     */
    public final void testParseStringEmpty() throws LdapException
    {
        DnParser parser = DnParser.getNameParser();

        Dn nameEmpty = parser.parse( "" );

        assertNotNull( nameEmpty );
    }
View Full Code Here

     * @throws LdapException
     *             if anything goes wrong
     */
    public final void testParseStringNull() throws LdapException
    {
        DnParser parser = DnParser.getNameParser();

        Dn nameNull = parser.parse( null );

        assertEquals( "Null Dn are legal : ", "", nameNull.toString() );
    }
View Full Code Here

     * @throws LdapException
     *             if anything goes wrong
     */
    public final void testParseStringRFC1779_1() throws LdapException
    {
        DnParser parser = DnParser.getNameParser();

        Dn nameRFC1779_1 = parser
            .parse( "CN=Marshall T. Rose, O=Dover Beach Consulting, L=Santa Clara, ST=California, C=US" );

        assertEquals( "RFC1779_1 : ",
            "CN=Marshall T. Rose, O=Dover Beach Consulting, L=Santa Clara, ST=California, C=US",
            ( (Dn) nameRFC1779_1 ).getName() );
View Full Code Here

     * @throws LdapException
     *             if anything goes wrong
     */
    public final void testParseStringRFC2253_1() throws LdapException
    {
        DnParser parser = DnParser.getNameParser();

        Dn nameRFC2253_1 = parser.parse( "CN=Steve Kille,O=Isode limited,C=GB" );

        assertEquals( "RFC2253_1 : ", "CN=Steve Kille,O=Isode limited,C=GB", ( (Dn) nameRFC2253_1 ).getName() );
    }
View Full Code Here

     * @throws LdapException
     *             if anything goes wrong
     */
    public final void testParseStringRFC2253_2() throws LdapException
    {
        DnParser parser = DnParser.getNameParser();

        Dn nameRFC2253_2 = parser.parse( "CN = Sales + CN =   J. Smith , O = Widget Inc. , C = US" );

        assertEquals( "RFC2253_2 : ", "CN = Sales + CN =   J. Smith , O = Widget Inc. , C = US",
            ( (Dn) nameRFC2253_2 ).getName() );
        assertEquals( "RFC2253_2 : ", "cn=J. Smith+cn=Sales,o=Widget Inc.,c=US", nameRFC2253_2.toString() );
    }
View Full Code Here

     * @throws LdapException
     *             if anything goes wrong
     */
    public final void testParseStringRFC2253_3() throws LdapException
    {
        DnParser parser = DnParser.getNameParser();

        Dn nameRFC2253_3 = parser.parse( "CN=L. Eagle,   O=Sue\\, Grabbit and Runn, C=GB" );

        assertEquals( "RFC2253_3 : ", "CN=L. Eagle,   O=Sue\\, Grabbit and Runn, C=GB", ( (Dn) nameRFC2253_3 )
            .getName() );
        assertEquals( "RFC2253_3 : ", "cn=L. Eagle,o=Sue\\, Grabbit and Runn,c=GB", nameRFC2253_3.toString() );
    }
View Full Code Here

     * @throws LdapException
     *             if anything goes wrong
     */
    public final void testParseStringRFC2253_4() throws LdapException
    {
        DnParser parser = DnParser.getNameParser();

        Dn nameRFC2253_4 = parser.parse( "CN=Before\\0DAfter,O=Test,C=GB" );
        assertEquals( "RFC2253_4 : ", "CN=Before\\0DAfter,O=Test,C=GB", ( (Dn) nameRFC2253_4 ).getName() );
    }
View Full Code Here

     * @throws LdapException
     *             if anything goes wrong
     */
    public final void testParseStringRFC2253_5() throws LdapException
    {
        DnParser parser = DnParser.getNameParser();

        Dn nameRFC2253_5 = parser.parse( "1.3.6.1.4.1.1466.0=#04024869,O=Test,C=GB" );

        assertEquals( "RFC2253_5 : ", "1.3.6.1.4.1.1466.0=#04024869,O=Test,C=GB", ( (Dn) nameRFC2253_5 )
            .getName() );
    }
View Full Code Here

     * @throws LdapException
     *             if anything goes wrong
     */
    public final void testParseStringRFC2253_6() throws LdapException
    {
        DnParser parser = DnParser.getNameParser();

        Dn nameRFC2253_6 = parser.parse( "SN=Lu\\C4\\8Di\\C4\\87" );

        assertEquals( "RFC2253_6 : ", "SN=Lu\\C4\\8Di\\C4\\87", ( (Dn) nameRFC2253_6 ).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.