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

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


     *             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

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

        try
        {
            parser.parse( "1.3.6.1.4.1.1466.0=#04024869,O=Test,C=GB" );
            fail( "Hex DNs not supported by fast parser" );
        }
        catch ( TooComplexException tce )
        {
            // expected
View Full Code Here

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

        try
        {
            parser.parse( "SN=Lu\\C4\\8Di\\C4\\87" );
            fail( "Complex DNs not supported by fast parser" );
        }
        catch ( TooComplexException tce )
        {
            // expected
View Full Code Here

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

        try
        {
            parser.parse( "ś=śrasulu,dc=example,dc=com" );
            fail( "the invalid name should never succeed in a parse" );
        }
        catch ( LdapException e )
        {
            assertNotNull( e );
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.