org.apache.james.test.functional
Class AbstractSimpleScriptedTestProtocol
java.lang.Object
junit.framework.Assert
junit.framework.TestCase
org.apache.james.test.functional.AbstractProtocolTestFramework
org.apache.james.test.functional.AbstractSimpleScriptedTestProtocol
- All Implemented Interfaces:
- junit.framework.Test
public abstract class AbstractSimpleScriptedTestProtocol
- extends AbstractProtocolTestFramework
A Protocol test which reads the test protocol session from a file. The file
read is taken as ".test", where is the value passed
into the constructor. Subclasses of this test can set up AbstractProtocolTestFramework.preElements
and AbstractProtocolTestFramework.postElements
for extra elements not defined in the protocol
session file.
Constructor Summary |
AbstractSimpleScriptedTestProtocol(HostSystem hostSystem,
java.lang.String userName,
java.lang.String password)
Sets up a SimpleFileProtocolTest which reads the protocol session from a
file of name ".test". |
Methods inherited from class junit.framework.TestCase |
countTestCases, createResult, getName, run, run, runBare, runTest, setName, 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 |
AbstractSimpleScriptedTestProtocol
public AbstractSimpleScriptedTestProtocol(HostSystem hostSystem,
java.lang.String userName,
java.lang.String password)
- Sets up a SimpleFileProtocolTest which reads the protocol session from a
file of name ".test". This file should be available in the
classloader in the same location as this test class.
- Parameters:
fileName
- The name of the file to read protocol elements from.
tearDown
protected void tearDown()
throws java.lang.Exception
- Overrides:
tearDown
in class junit.framework.TestCase
- Throws:
java.lang.Exception
scriptTest
protected void scriptTest(java.lang.String fileName,
java.util.Locale locale)
throws java.lang.Exception
- Reads test elements from the protocol session file and adds them to the
AbstractProtocolTestFramework.testElements
ProtocolSession. Then calls AbstractProtocolTestFramework.runSessions()
.
- Parameters:
locale
- TODO
- Throws:
java.lang.Exception
addTestFile
protected void addTestFile(java.lang.String fileName,
ProtocolSession session)
throws java.lang.Exception
- Finds the protocol session file identified by the test name, and builds
protocol elements from it. All elements from the definition file are
added to the supplied ProtocolSession.
- Parameters:
fileName
- The name of the file to readsession
- The ProtocolSession to add elements to.
- Throws:
java.lang.Exception
Copyright © 2002-2008 The Apache Software Foundation. All Rights Reserved.