org.subethamail.smtp.test.command.HelloTest Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of subethasmtp Show documentation
Show all versions of subethasmtp Show documentation
SubEtha SMTP is an easy-to-use server-side SMTP library for Java.
package org.subethamail.smtp.test.command;
import org.subethamail.smtp.test.util.ServerTestCase;
/**
* @author Jeff Schnitzer
*/
public class HelloTest extends ServerTestCase
{
/** */
public HelloTest(String name)
{
super(name);
}
/** */
public void testHelloCommand() throws Exception
{
this.expect("220");
this.send("HELO");
this.expect("501 Syntax: HELO ");
this.send("HELO");
this.expect("501 Syntax: HELO ");
// Correct!
this.send("HELO foo.com");
this.expect("250");
// Correct!
this.send("HELO foo.com");
this.expect("250");
}
/** */
public void testHelloReset() throws Exception
{
this.expect("220");
this.send("HELO foo.com");
this.expect("250");
this.send("MAIL FROM: [email protected]");
this.expect("250 Ok");
this.send("RSET");
this.expect("250 Ok");
this.send("MAIL FROM: [email protected]");
this.expect("250 Ok");
}
/** */
public void testEhloSize() throws Exception
{
this.wiser.getServer().setMaxMessageSize(1000);
this.expect("220");
this.send("EHLO foo.com");
this.expectContains("250-SIZE 1000");
}
}