Package org.apache.directory.studio.ldifparser

Examples of org.apache.directory.studio.ldifparser.LdifFormatParameters


    private static void logModification( IBrowserConnection browserConnection, Writer logWriter, LdifRecord record,
        StudioProgressMonitor monitor )
    {
        try
        {
            LdifFormatParameters ldifFormatParameters = Utils.getLdifFormatParameters();
            DateFormat df = new SimpleDateFormat( ConnectionCoreConstants.DATEFORMAT );
            logWriter.write( LdifCommentLine.create( "#!RESULT OK" ).toFormattedString( ldifFormatParameters ) ); //$NON-NLS-1$
            logWriter
                .write( LdifCommentLine
                    .create(
View Full Code Here


{

    public void testToFormattedStringSimple()
    {
        LdifDnLine dnLine = LdifDnLine.create( "cn=abc,ou=department,o=org,dc=example,dc=com" ); //$NON-NLS-1$
        LdifFormatParameters formatParameters = new LdifFormatParameters( true, 78, "\n" ); //$NON-NLS-1$
        String formattedString = dnLine.toFormattedString( formatParameters );
        assertEquals( formattedString, "dn: cn=abc,ou=department,o=org,dc=example,dc=com\n" ); //$NON-NLS-1$
    }
View Full Code Here


    public void testToFormattedStringNewline()
    {
        LdifDnLine dnLine = LdifDnLine.create( "cn=abc,ou=department,o=org,dc=example,dc=com" ); //$NON-NLS-1$
        LdifFormatParameters formatParameters = new LdifFormatParameters( true, 78, "\r\n" ); //$NON-NLS-1$
        String formattedString = dnLine.toFormattedString( formatParameters );
        assertEquals( formattedString, "dn: cn=abc,ou=department,o=org,dc=example,dc=com\r\n" ); //$NON-NLS-1$
    }
View Full Code Here

    public void testToFormattedStringLineWrap()
    {
        LdifDnLine dnLine = LdifDnLine
            .create( "cn=abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxy,ou=department,o=org,dc=example,dc=com" ); //$NON-NLS-1$
        LdifFormatParameters formatParameters = new LdifFormatParameters( true, 78, "\n" ); //$NON-NLS-1$
        String formattedString = dnLine.toFormattedString( formatParameters );
        assertEquals( formattedString, "dn: cn=abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxy,ou=department,o=org" //$NON-NLS-1$
            + "\n ,dc=example,dc=com\n" ); //$NON-NLS-1$
    }
View Full Code Here


    public void testToFormattedStringNoSpaceAfterColon()
    {
        LdifDnLine dnLine = LdifDnLine.create( "cn=abc,ou=department,o=org,dc=example,dc=com" ); //$NON-NLS-1$
        LdifFormatParameters formatParameters = new LdifFormatParameters( false, 78, "\n" ); //$NON-NLS-1$
        String formattedString = dnLine.toFormattedString( formatParameters );
        assertEquals( formattedString, "dn:cn=abc,ou=department,o=org,dc=example,dc=com\n" ); //$NON-NLS-1$
    }
View Full Code Here


    public void testToFormattedStringBase64()
    {
        LdifDnLine dnLine = LdifDnLine.create( "cn=\u00e4\u00f6\u00fc,ou=department,o=org,dc=example,dc=com" ); //$NON-NLS-1$
        LdifFormatParameters formatParameters = new LdifFormatParameters( true, 78, "\n" ); //$NON-NLS-1$
        String formattedString = dnLine.toFormattedString( formatParameters );
        assertEquals( formattedString, "dn:: Y249w6TDtsO8LG91PWRlcGFydG1lbnQsbz1vcmcsZGM9ZXhhbXBsZSxkYz1jb20=\n" ); //$NON-NLS-1$
    }
View Full Code Here

{

    public void testToFormattedStringSimple()
    {
        LdifAttrValLine line = LdifAttrValLine.create( "cn", "abc" ); //$NON-NLS-1$ //$NON-NLS-2$
        LdifFormatParameters formatParameters = new LdifFormatParameters( true, 78, "\n" ); //$NON-NLS-1$
        String formattedString = line.toFormattedString( formatParameters );
        assertEquals( formattedString, "cn: abc\n" ); //$NON-NLS-1$
    }
View Full Code Here

    public void testToFormattedStringLineWrap()
    {
        LdifAttrValLine line = LdifAttrValLine.create( "cn", //$NON-NLS-1$
            "abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxy" ); //$NON-NLS-1$
        LdifFormatParameters formatParameters = new LdifFormatParameters( true, 78, "\n" ); //$NON-NLS-1$
        String formattedString = line.toFormattedString( formatParameters );
        assertEquals( formattedString,
            "cn: abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyabcdefghijklmnopqrstuvw\n xyzabcdefghijklmnopqrstuvwxy\n" ); //$NON-NLS-1$
    }
View Full Code Here


    public void testToFormattedStringNoSpaceAfterColon()
    {
        LdifAttrValLine line = LdifAttrValLine.create( "cn", "abc" ); //$NON-NLS-1$ //$NON-NLS-2$
        LdifFormatParameters formatParameters = new LdifFormatParameters( false, 78, "\n" ); //$NON-NLS-1$
        String formattedString = line.toFormattedString( formatParameters );
        assertEquals( formattedString, "cn:abc\n" ); //$NON-NLS-1$
    }
View Full Code Here


    public void testToFormattedStringBase64()
    {
        LdifAttrValLine line = LdifAttrValLine.create( "cn", "\u00e4\u00f6\u00fc" ); //$NON-NLS-1$ //$NON-NLS-2$
        LdifFormatParameters formatParameters = new LdifFormatParameters( true, 78, "\n" ); //$NON-NLS-1$
        String formattedString = line.toFormattedString( formatParameters );
        assertEquals( formattedString, "cn:: w6TDtsO8\n" ); //$NON-NLS-1$
    }
View Full Code Here

TOP

Related Classes of org.apache.directory.studio.ldifparser.LdifFormatParameters

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.