org.apache.james.mpt
Class AbstractProtocolTestFramework

java.lang.Object
  extended by junit.framework.Assert
      extended by junit.framework.TestCase
          extended by org.apache.james.mpt.AbstractProtocolTestFramework
All Implemented Interfaces:
junit.framework.Test
Direct Known Subclasses:
AbstractSimpleScriptedTestProtocol

public abstract class AbstractProtocolTestFramework
extends junit.framework.TestCase

Abstract Protocol Test is the root of all of the scripted test cases. It provides basic functionality for running a protocol session as a JUnit test, and failing if exceptions are thrown. To create a test which reads the entire protocol session from a single protocol definition file, use the AbstractSimpleScriptedTestProtocol.

Author:
Darrell DeBoer, Andrew C. Oliver

Field Summary
protected  Runner runner
           
 
Constructor Summary
AbstractProtocolTestFramework(HostSystem hostSystem, java.lang.String userName, java.lang.String password)
           
 
Method Summary
protected  void continueAfterFailure()
           
protected  void runSessions()
          Runs the pre,test and post protocol sessions against a local copy of the Server.
protected  void setUp()
           
 
Methods inherited from class junit.framework.TestCase
countTestCases, createResult, getName, run, run, runBare, runTest, setName, tearDown, toString
 
Methods inherited from class junit.framework.Assert
assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, fail, fail
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

runner

protected final Runner runner
Constructor Detail

AbstractProtocolTestFramework

public AbstractProtocolTestFramework(HostSystem hostSystem,
                                     java.lang.String userName,
                                     java.lang.String password)
Method Detail

setUp

protected void setUp()
              throws java.lang.Exception
Overrides:
setUp in class junit.framework.TestCase
Throws:
java.lang.Exception

continueAfterFailure

protected void continueAfterFailure()

runSessions

protected void runSessions()
                    throws java.lang.Exception

Runs the pre,test and post protocol sessions against a local copy of the Server. This is useful for rapid development and debugging.

Instead of sending requests to a socket connected to a running instance of James, this method uses the HostSystem to simplify testing. One mock instance is required per protocol session/connection.

Throws:
java.lang.Exception


Copyright © 2008-2009 The Apache Software Foundation. All Rights Reserved.