Package org.apache.ftpserver.ftplet

Examples of org.apache.ftpserver.ftplet.DefaultFtpReply


*
*/
public class DefaultFtpReplyTest extends TestCase {

    public void testSingleLineToString() {
        DefaultFtpReply response = new DefaultFtpReply(123, "foo bar");

        assertEquals("123 foo bar\r\n", response.toString());
    }
View Full Code Here


        assertEquals("123 foo bar\r\n", response.toString());
    }

    public void testSingleLineWithTrailingLineFeedToString() {
        DefaultFtpReply response = new DefaultFtpReply(123, "foo bar\n");

        assertEquals("123 foo bar\r\n", response.toString());
    }
View Full Code Here

        assertEquals("123 foo bar\r\n", response.toString());
    }

    public void testCarriageReturnToString() {
        DefaultFtpReply response = new DefaultFtpReply(123, "foo \rbar\r\n");

        assertEquals("123 foo bar\r\n", response.toString());
    }
View Full Code Here

        assertEquals("123 foo bar\r\n", response.toString());
    }
   
    public void testNullToString() {
        DefaultFtpReply response = new DefaultFtpReply(123, (String) null);

        assertEquals("123 \r\n", response.toString());
    }
View Full Code Here

        assertEquals("123 \r\n", response.toString());
    }

    public void testMultipleLinesToString() {
        DefaultFtpReply response = new DefaultFtpReply(123, "foo\nbar\nbaz");

        assertEquals("123-foo\r\nbar\r\n123 baz\r\n", response.toString());
    }
View Full Code Here

        assertEquals("123-foo\r\nbar\r\n123 baz\r\n", response.toString());
    }

    public void testMultipleLinesEndWithNewlineToString() {
        DefaultFtpReply response = new DefaultFtpReply(123, "foo\nbar\nbaz\n");

        assertEquals("123-foo\r\nbar\r\n123 baz\r\n", response.toString());
    }
View Full Code Here

        assertEquals("123-foo\r\nbar\r\n123 baz\r\n", response.toString());
    }

    public void testArrayLinesToString() {
        DefaultFtpReply response = new DefaultFtpReply(123, new String[] {
                "foo", "bar", "baz" });

        assertEquals("123-foo\r\nbar\r\n123 baz\r\n", response.toString());
    }
View Full Code Here

        assertEquals("123-foo\r\nbar\r\n123 baz\r\n", response.toString());
    }

    public void testMultipleLinesToString1() {
        DefaultFtpReply response = new DefaultFtpReply(123, "\nfoo\nbar\nbaz");

        assertEquals("123-\r\nfoo\r\nbar\r\n123 baz\r\n", response.toString());
    }
View Full Code Here

        assertEquals("123-\r\nfoo\r\nbar\r\n123 baz\r\n", response.toString());
    }

    public void testMultipleLinesToStringSpaceFirst() {
        DefaultFtpReply response = new DefaultFtpReply(123, "foo\n bar\nbaz");

        assertEquals("123-foo\r\n bar\r\n123 baz\r\n", response.toString());
    }
View Full Code Here

        assertEquals("123-foo\r\n bar\r\n123 baz\r\n", response.toString());
    }

    public void testMultipleLinesToStringThreeNumbers() {
        DefaultFtpReply response = new DefaultFtpReply(123, "foo\n234bar\nbaz");

        assertEquals("123-foo\r\n  234bar\r\n123 baz\r\n", response.toString());
    }
View Full Code Here

TOP

Related Classes of org.apache.ftpserver.ftplet.DefaultFtpReply

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.