Examples of DnParser


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

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

        try
        {
            parser.parse( "ś=śrasulu,dc=example,dc=com" );
            fail( "the invalid name should never succeed in a parse" );
        }
        catch ( Exception e )
        {
            assertNotNull( e );
View Full Code Here

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

     * @throws LdapException
     *             if anything goes wrong on parse()
     */
    public final void testPreserveSpaceAfterEscape() throws LdapException
    {
        DnParser parser = DnParser.getNameParser();
        String input = "ou=some test\\,  something else";
        String result = parser.parse( input ).toString();
        assertEquals( "ou=some test\\,  something else", result );
    }
View Full Code Here

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

    @Test
    public void testWindowsFilePath() throws Exception
    {
        // '\' should be escaped as stated in RFC 2253
        String path = "windowsFilePath=C:\\\\cygwin";
        DnParser parser = DnParser.getNameParser();
        Dn result = parser.parse( path );
        assertEquals( path, ( (Dn) result ).getName() );
        assertEquals( "windowsfilepath=C:\\\\cygwin", ((Dn)result).getNormName() );
    }
View Full Code Here

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

    {
        String cn = new String( new byte[]
            { 'c', 'n', '=', 0x4A, ( byte ) 0xC3, ( byte ) 0xA9, 0x72, ( byte ) 0xC3, ( byte ) 0xB4, 0x6D, 0x65 },
            "UTF-8" );

        DnParser parser = DnParser.getNameParser();
        String result = parser.parse( cn ).toString();

        assertEquals( "cn=J\u00e9r\u00f4me", result.toString() );
    }
View Full Code Here

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

        String cn = new String( new byte[]
            { 'c', 'n', '=', ( byte ) 0xC3, ( byte ) 0x84, ( byte ) 0xC3, ( byte ) 0x96, ( byte ) 0xC3, ( byte ) 0x9C,
                ( byte ) 0xC3, ( byte ) 0x9F, ( byte ) 0xC3, ( byte ) 0xA4, ( byte ) 0xC3, ( byte ) 0xB6,
                ( byte ) 0xC3, ( byte ) 0xBC }, "UTF-8" );

        DnParser parser = DnParser.getNameParser();
        String result = parser.parse( cn ).toString();

        assertEquals( "cn=\u00C4\u00D6\u00DC\u00DF\u00E4\u00F6\u00FC", result.toString() );
    }
View Full Code Here

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

            { 'c', 'n', '=', ( byte ) 0xC4, ( byte ) 0xB0, ( byte ) 0xC4, ( byte ) 0xB1, ( byte ) 0xC5, ( byte ) 0x9E,
                ( byte ) 0xC5, ( byte ) 0x9F, ( byte ) 0xC3, ( byte ) 0x96, ( byte ) 0xC3, ( byte ) 0xB6,
                ( byte ) 0xC3, ( byte ) 0x9C, ( byte ) 0xC3, ( byte ) 0xBC, ( byte ) 0xC4, ( byte ) 0x9E,
                ( byte ) 0xC4, ( byte ) 0x9F }, "UTF-8" );

        DnParser parser = DnParser.getNameParser();
        String result = parser.parse( cn ).toString();

        assertEquals( "cn=\u0130\u0131\u015E\u015F\u00D6\u00F6\u00DC\u00FC\u011E\u011F", result.toString() );
    }
View Full Code Here

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

    public void testAUmlautPlusBytes() throws Exception
    {
        String cn = new String( new byte[] { 'c', 'n', '=', (byte)0xC3, (byte)0x84, 0x5C, 0x32, 0x42 }, "UTF-8" );


        DnParser parser = DnParser.getNameParser();
        String result = ((Dn)parser.parse( cn )).getNormName();
       
        assertEquals( "cn=\u00c4\\+", result );
    }
View Full Code Here

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

    @Test
    public void testAUmlautPlusChar() throws Exception
    {
        String cn = new String( new byte[] { 'c', 'n', '=', (byte)0xC3, (byte)0x84, '\\', '+' }, "UTF-8" );
       
        DnParser parser = DnParser.getNameParser();
        String result = parser.parse( cn ).toString();
       
        assertEquals( "cn=\u00c4\\+", result );
    }
View Full Code Here

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

     * @throws LdapException
     *             if anything goes wrong on parse()
     */
    public final void testNonEscapedChars()
    {
        DnParser parser = DnParser.getNameParser();
        String input = "ou=ou+test";

        try
        {
            parser.parse( input ).toString();
            fail( "Should never rech this point" );
        }
        catch ( LdapException ne )
        {
            assertTrue( true );
View Full Code Here

Examples of org.apache.harmony.security.x509.DNParser

     *
     * @param name - Name as String
     * @throws IOException - if string is wrong
     */
    public Name(String name) throws IOException {
        rdn = new DNParser(name).parse();
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.