All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.subethamail.smtp.test.command.ReceiptTest Maven / Gradle / Ivy

There is a newer version: 3.1.7
Show newest version
package org.subethamail.smtp.test.command;

import org.subethamail.smtp.test.util.ServerTestCase;

/**
 * @author Jon Stevens
 */
public class ReceiptTest extends ServerTestCase
{
	/** */
	public ReceiptTest(String name)
	{
		super(name);
	}

	/** */
	public void testReceiptBeforeMail() throws Exception
	{
		this.expect("220");

		this.send("HELO foo.com");
		this.expect("250");

		this.send("RCPT TO: [email protected]");
		this.expect("503 Error: need MAIL command");
	}

	/** */
	public void testReceiptErrorInParams() 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("RCPT");
		this.expect("501 Syntax: RCPT TO: 
Error in parameters:"); } /** */ public void testReceiptAccept() 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("RCPT TO: [email protected]"); this.expect("553 address unknown."); this.send("RCPT TO: [email protected]"); this.expect("250 Ok"); } /** */ public void testReceiptNoWhiteSpace() 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("RCPT TO:[email protected]"); this.expect("250 Ok"); } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy