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

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



    @Test
    public void testVsldapExtras() throws LdapException
    {
        FastDnParser dnParser = FastDnParser.getNameParser();
        try
        {
            dnParser
                .parse( "cn=Billy Bakers, OID.2.5.4.11=Corporate Tax, ou=Fin-Accounting, ou=Americas, ou=Search, o=IMC, c=US" );
            fail( "OID prefix not supported by fast parser" );
        }
        catch ( TooComplexException tce )
        {
View Full Code Here


     *             if anything goes wrong
     */
    @Test
    public final void testDnParser()
    {
        FastDnParser parser = FastDnParser.getNameParser();

        assertNotNull( parser );
    }
View Full Code Here

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

        Dn nameEmpty = parser.parse( "" );

        assertNotNull( nameEmpty );
    }
View Full Code Here

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

        Dn nameNull = parser.parse( null );

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

     *             if anything goes wrong
     */
    @Test
    public final void testParseStringRFC1779_1() throws LdapException
    {
        FastDnParser parser = FastDnParser.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

     *             if anything goes wrong
     */
    @Test
    public final void testParseStringRFC2253_1() throws LdapException
    {
        FastDnParser parser = FastDnParser.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

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

        try
        {
            parser.parse( "CN = Sales + CN =   J. Smith , O = Widget Inc. , C = US" );
            fail( "Multivalued Rdn not supported by fast parser" );
        }
        catch ( TooComplexException tce )
        {
            // expected
View Full Code Here

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

        try
        {
            parser.parse( "CN=L. Eagle,   O=Sue\\, Grabbit and Runn, C=GB" );
            fail( "Complex DNs not supported by fast parser" );
        }
        catch ( TooComplexException tce )
        {
            // expected
View Full Code Here

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

        try
        {
            parser.parse( "CN=Before\\0DAfter,O=Test,C=GB" );
            fail( "Complex DNs not supported by fast parser" );
        }
        catch ( TooComplexException tce )
        {
            // expected
View Full Code Here

     * test an empty Dn
     */
    @Test
    public void testLdapDNEmpty() throws LdapException
    {
        FastDnParser dnParser = FastDnParser.getNameParser();
        assertEquals( "", ( (Dn) dnParser.parse( "" ) ).getName() );
    }
View Full Code Here

TOP

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

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.