jSyncManager Simple Java Server

org.jSyncManager.SJS.Tests
Class SMTPServerTest

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.SMTPServerTest
All Implemented Interfaces:
java.lang.Runnable

public class SMTPServerTest
extends TestSMTPServer

JUnit tests for the TestSMTPServer processRequest function.

Author:
Cecelia Redding <cecelia@uvic.ca>, Crystal Gold <cgold@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 EHLO_FAIL_NO_PARAMS
          A final integer representing the "501 Syntax error in parameters or arguments" reply code.
static int EHLO_FAIL_PARAMS
          A final integer representing the "501 Syntax error in parameters or arguments" reply code.
static int EHLO_SUCCESS
          A final integer representing the "250 Requested mail action okay, completed" reply code.
static int EXPN_FAIL_PARAMS
          A final integer representing the "501 Syntax error in parameters or arguments" reply code.
static int EXPN_SUCCESS_SYNTAX
          A final integer representing the "502 Command not implemented" reply code.
static int FAIL_UNKNOWN_COMMAND
          A final integer representing the "500 Syntax error, command unrecognized" reply code.
static int HELO_FAIL_NO_PARAMS
          A final integer representing the "501 Syntax error in parameters or arguments" reply code.
static int HELO_FAIL_PARAMS
          A final integer representing the "501 Syntax error in parameters or arguments" reply code.
static int HELO_SUCCESS
          A final integer representing the "250 Requested mail action okay, completed" reply code.
static int HELP_FAIL_PARAMS
          A final integer representing the "501 Syntax error in parameters or arguments" reply code.
static int HELP_SUCCESS
          A final integer representing the "214 Help message" reply code.
static int NOOP_SUCCESS
          A final integer representing the "250 Requested mail action okay, completed" reply code.
static int QUIT_FAIL_PARAMS
          A final integer representing the "501 Syntax error in parameters or arguments" reply code.
static int QUIT_SUCCESS
          A final integer representing the "221 <domain> Service closing transmission channel" reply code.
static int RSET_FAIL_PARAMS
          A final integer representing the "501 Syntax error in parameters or arguments" reply code.
static int RSET_SUCCESS
          A final integer representing the "250 Requested mail action okay, completed" reply code.
static int VRFY_FAIL_PARAMS
          A final integer representing the "501 Syntax error in parameters or arguments" reply code.
static int VRFY_SUCCESS_SYNTAX
          A final integer representing the "502 Command not implemented" 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
SMTPServerTest()
           
 
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.
 void general()
          A method that tests general syntax errors.
static void main(java.lang.String[] args)
          Main method.
 void testEHLO()
          A method that tests the EHLO command for correct command syntax and order of commands.
 void testEXPN()
          A method that tests the EXPN command for correct command syntax and order of commands.
 void testHELO()
          A method that tests the HELO command for correct command syntax and order of commands.
 void testHELP()
          A method that tests the HELP command for correct command syntax and order of commands.
 void testNOOP()
          A method that tests the NOOP command for correct command syntax and order of commands.
 void testQUIT()
          A method that tests the QUIT command for correct command syntax and order of commands.
 void testRSET()
          A method that tests the RSET command for correct command syntax and order of commands.
 void testVRFY()
          A method that tests the VRFY 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

HELO_SUCCESS

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

See Also:
Constant Field Values

HELO_FAIL_NO_PARAMS

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

See Also:
Constant Field Values

HELO_FAIL_PARAMS

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

See Also:
Constant Field Values

EHLO_SUCCESS

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

See Also:
Constant Field Values

EHLO_FAIL_NO_PARAMS

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

See Also:
Constant Field Values

EHLO_FAIL_PARAMS

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

See Also:
Constant Field Values

QUIT_SUCCESS

public static final int QUIT_SUCCESS
A final integer representing the "221 <domain> Service closing transmission channel" reply code.

See Also:
Constant Field Values

QUIT_FAIL_PARAMS

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

See Also:
Constant Field Values

NOOP_SUCCESS

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

See Also:
Constant Field Values

HELP_SUCCESS

public static final int HELP_SUCCESS
A final integer representing the "214 Help message" reply code.

See Also:
Constant Field Values

HELP_FAIL_PARAMS

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

See Also:
Constant Field Values

EXPN_FAIL_PARAMS

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

See Also:
Constant Field Values

EXPN_SUCCESS_SYNTAX

public static final int EXPN_SUCCESS_SYNTAX
A final integer representing the "502 Command not implemented" 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

RSET_FAIL_PARAMS

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

See Also:
Constant Field Values

RSET_SUCCESS

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

See Also:
Constant Field Values

VRFY_FAIL_PARAMS

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

See Also:
Constant Field Values

VRFY_SUCCESS_SYNTAX

public static final int VRFY_SUCCESS_SYNTAX
A final integer representing the "502 Command not implemented" reply code.

See Also:
Constant Field Values
Constructor Detail

SMTPServerTest

public SMTPServerTest()
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.


general

public void general()
A method that tests general syntax errors.


testHELO

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


testEHLO

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


testQUIT

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


testNOOP

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


testHELP

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


testEXPN

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


testRSET

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


testVRFY

public void testVRFY()
A method that tests the VRFY 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 SMTPServerTest.

Parameters:
args - command line parameters are disregarded.

jSyncManager Simple Java Server

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