jSyncManager Simple Java Server

org.jSyncManager.SJS.Tests
Class SMTPMailTest

java.lang.Object
  extended by java.lang.Thread
      extended by org.jSyncManager.SJS.API.AbstractAdapter
          extended by org.jSyncManager.SJS.API.AbstractRequestResponseAdapter
              extended by org.jSyncManager.SJS.Adapters.SMTPServer.AbstractSMTPServer
                  extended by org.jSyncManager.SJS.Adapters.SMTPServer.TestSMTPServer
                      extended by org.jSyncManager.SJS.Tests.SMTPMailTest
All Implemented Interfaces:
java.lang.Runnable

public class SMTPMailTest
extends TestSMTPServer

JUnit tests for the TestSMTPServer processRequest function.

Author:
York Li <liyy@uvic.ca>

Nested Class Summary
 
Nested classes/interfaces inherited from class org.jSyncManager.SJS.Adapters.SMTPServer.AbstractSMTPServer
AbstractSMTPServer.CommandData, AbstractSMTPServer.CommandEhlo, AbstractSMTPServer.CommandExpn, AbstractSMTPServer.CommandHelo, AbstractSMTPServer.CommandHelp, AbstractSMTPServer.CommandMail, AbstractSMTPServer.CommandNoop, AbstractSMTPServer.CommandQuit, AbstractSMTPServer.CommandRcpt, AbstractSMTPServer.CommandRset, AbstractSMTPServer.CommandVrfy, AbstractSMTPServer.SmtpCommand, AbstractSMTPServer.State
 
Nested classes/interfaces inherited from class java.lang.Thread
java.lang.Thread.UncaughtExceptionHandler
 
Field Summary
static int DATA_ENTER_SUCCESS
          A final integer representing the "354 Start mail input; end with <CRLF>.<CRLF>" reply code.
static int DATA_EXIT_SUCCESS
          A final integer representing the "250 Requested mail action okay, completed" reply code.
static int DATA_FAIL_BAD_PARAMS
          A final integer representing the "501 Syntax error in parameters or arguments" reply code.
static int DATA_FAIL_BAD_SEQ
          A final integer representing the "503 Bad sequence of commands" reply code.
static int FAIL_UNKNOWN_COMMAND
          A final integer representing the "500 Syntax error, command unrecognized" reply code.
static int MAIL_FAIL_BAD_PARAMS
          A final integer representing the "501 Syntax error in parameters or arguments" reply code.
static int MAIL_FAIL_BAD_SEQ
          A final integer representing the "503 Bad sequence of commands" reply code.
static int MAIL_SUCCESS
          A final integer representing the "250 Requested mail action okay, completed" reply code.
static int RCPT_FAIL_BAD_PARAMS
          A final integer representing the "501 Syntax error in parameters or arguments" reply code.
static int RCPT_FAIL_BAD_SEQ
          A final integer representing the "503 Bad sequence of commands" reply code.
static int RCPT_FAIL_TOO_MANY
          A final integer representing the "452 Requested action not taken: insufficient system storage" reply code.
static int RCPT_SUCCESS
          A final integer representing the "250 Requested mail action okay, completed" reply code.
 
Fields inherited from class org.jSyncManager.SJS.Adapters.SMTPServer.TestSMTPServer
domain, server
 
Fields inherited from class org.jSyncManager.SJS.Adapters.SMTPServer.AbstractSMTPServer
atDomainRegex, commands, currentMask, domainRegex, INVALID_ADDR_SYNTAX, INVALID_SEQUENCE, INVALID_SYNTAX, mailAddrExpr, PARAM_NOT_IMPLEMENTED, rcptAddrExpr, relayPattern, state, validEmailChars
 
Fields inherited from class org.jSyncManager.SJS.API.AbstractAdapter
props
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
SMTPMailTest()
           
 
Method Summary
static void beginClass()
          One-time setup method.
 void beginMethod()
          Set up method.
static void endClass()
          One-time teardown method.
 void endMethod()
          Tear down method.
static void main(java.lang.String[] args)
          Main method.
 void testDATA()
          A method that tests the DATA command for correct command syntax and order of commands.
 void testMAIL()
          A method that tests the MAIL command for correct command syntax and order of commands.
 void testRCPT()
          A method that tests the RCPT command for correct command syntax and order of commands.
 
Methods inherited from class org.jSyncManager.SJS.Adapters.SMTPServer.TestSMTPServer
getAddress, processData, processEhlo, processExpn, processHelo, processHelp, processMail, processMessageFinished, processMessagePart, processNoop, processQuit, processRcpt, processRset, processVrfy
 
Methods inherited from class org.jSyncManager.SJS.Adapters.SMTPServer.AbstractSMTPServer
getCommands, getConnectionHeaderString, getCurrentMask, getMailAddrExpr, getRcptAddrExpr, getStateLong, initCommands, processRequest
 
Methods inherited from class org.jSyncManager.SJS.API.AbstractRequestResponseAdapter
disconnect, getTimeoutMessage, processConnection
 
Methods inherited from class org.jSyncManager.SJS.API.AbstractAdapter
connectionPermitted, getConnectionManagerInterface, getInetAddress, getLogManager, getProperty, processConnection, run, setLogManager, setThreadGroup
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

MAIL_FAIL_BAD_SEQ

public static final int MAIL_FAIL_BAD_SEQ
A final integer representing the "503 Bad sequence of commands" reply code.

See Also:
Constant Field Values

MAIL_SUCCESS

public static final int MAIL_SUCCESS
A final integer representing the "250 Requested mail action okay, completed" reply code.

See Also:
Constant Field Values

MAIL_FAIL_BAD_PARAMS

public static final int MAIL_FAIL_BAD_PARAMS
A final integer representing the "501 Syntax error in parameters or arguments" reply code.

See Also:
Constant Field Values

RCPT_SUCCESS

public static final int RCPT_SUCCESS
A final integer representing the "250 Requested mail action okay, completed" reply code.

See Also:
Constant Field Values

RCPT_FAIL_BAD_PARAMS

public static final int RCPT_FAIL_BAD_PARAMS
A final integer representing the "501 Syntax error in parameters or arguments" reply code.

See Also:
Constant Field Values

RCPT_FAIL_TOO_MANY

public static final int RCPT_FAIL_TOO_MANY
A final integer representing the "452 Requested action not taken: insufficient system storage" reply code.

See Also:
Constant Field Values

RCPT_FAIL_BAD_SEQ

public static final int RCPT_FAIL_BAD_SEQ
A final integer representing the "503 Bad sequence of commands" reply code.

See Also:
Constant Field Values

DATA_FAIL_BAD_SEQ

public static final int DATA_FAIL_BAD_SEQ
A final integer representing the "503 Bad sequence of commands" reply code.

See Also:
Constant Field Values

DATA_FAIL_BAD_PARAMS

public static final int DATA_FAIL_BAD_PARAMS
A final integer representing the "501 Syntax error in parameters or arguments" reply code.

See Also:
Constant Field Values

DATA_ENTER_SUCCESS

public static final int DATA_ENTER_SUCCESS
A final integer representing the "354 Start mail input; end with <CRLF>.<CRLF>" reply code.

See Also:
Constant Field Values

DATA_EXIT_SUCCESS

public static final int DATA_EXIT_SUCCESS
A final integer representing the "250 Requested mail action okay, completed" reply code.

See Also:
Constant Field Values

FAIL_UNKNOWN_COMMAND

public static final int FAIL_UNKNOWN_COMMAND
A final integer representing the "500 Syntax error, command unrecognized" reply code.

See Also:
Constant Field Values
Constructor Detail

SMTPMailTest

public SMTPMailTest()
Method Detail

beginClass

public static void beginClass()
One-time setup method. Runs before the first test is run.


beginMethod

public void beginMethod()
Set up method. Runs before each test method.


testMAIL

public void testMAIL()
A method that tests the MAIL command for correct command syntax and order of commands.


testRCPT

public final void testRCPT()
A method that tests the RCPT command for correct command syntax and order of commands.


testDATA

public final void testDATA()
A method that tests the DATA command for correct command syntax and order of commands.


endMethod

public void endMethod()
Tear down method. Runs after each test method.


endClass

public static void endClass()
One-time teardown method. Runs after the last test has been run.


main

public static void main(java.lang.String[] args)
Main method. Sets the JUnitCore to SMTPMailTest.

Parameters:
args - command line parameters are disregarded.

jSyncManager Simple Java Server

Copyright (c) 2004 Brad BARCLAY. All Rights Reserved.