You are viewing a plain text version of this content. The canonical link for it is here.
Posted to server-dev@james.apache.org by rd...@apache.org on 2009/05/19 20:17:10 UTC
svn commit: r776401 - in
/james/mpt/trunk/main/src/main/java/org/apache/james/mpt:
AbstractProtocolTestFramework.java AbstractSimpleScriptedTestProtocol.java
ProtocolSession.java ProtocolSessionBuilder.java Runner.java
Author: rdonkin
Date: Tue May 19 18:17:09 2009
New Revision: 776401
URL: http://svn.apache.org/viewvc?rev=776401&view=rev
Log:
Fixed javadocs
Modified:
james/mpt/trunk/main/src/main/java/org/apache/james/mpt/AbstractProtocolTestFramework.java
james/mpt/trunk/main/src/main/java/org/apache/james/mpt/AbstractSimpleScriptedTestProtocol.java
james/mpt/trunk/main/src/main/java/org/apache/james/mpt/ProtocolSession.java
james/mpt/trunk/main/src/main/java/org/apache/james/mpt/ProtocolSessionBuilder.java
james/mpt/trunk/main/src/main/java/org/apache/james/mpt/Runner.java
Modified: james/mpt/trunk/main/src/main/java/org/apache/james/mpt/AbstractProtocolTestFramework.java
URL: http://svn.apache.org/viewvc/james/mpt/trunk/main/src/main/java/org/apache/james/mpt/AbstractProtocolTestFramework.java?rev=776401&r1=776400&r2=776401&view=diff
==============================================================================
--- james/mpt/trunk/main/src/main/java/org/apache/james/mpt/AbstractProtocolTestFramework.java (original)
+++ james/mpt/trunk/main/src/main/java/org/apache/james/mpt/AbstractProtocolTestFramework.java Tue May 19 18:17:09 2009
@@ -22,7 +22,7 @@
import junit.framework.TestCase;
/**
- * Abstract Protocol Test is the root of all of the James Imap Server test
+ * 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
@@ -56,22 +56,19 @@
}
/**
- * Runs the pre,test and post protocol sessions against a local copy of the
- * ImapServer. This does not require that James be running, and is useful
- * for rapid development and debugging.
- *
+ * <p>Runs the pre,test and post protocol sessions against a local copy of the
+ * Server. This is useful for rapid development and debugging.
+ * </p>
* Instead of sending requests to a socket connected to a running instance
- * of James, this method uses the {@link MockImapServer} to simplify
+ * of James, this method uses the {@link HostSystem} to simplify
* testing. One mock instance is required per protocol session/connection.
- * These share the same underlying Mailboxes, because of the way
- * {@link MockImapServer#getImapSession()} works.
*/
protected void runSessions() throws Exception {
runner.runSessions(hostSystem);
}
/**
- * Initialises the UsersRepository and ImapHost on first call.
+ * Initialises the host on first call.
*/
private void setUpEnvironment() throws Exception {
hostSystem.reset();
Modified: james/mpt/trunk/main/src/main/java/org/apache/james/mpt/AbstractSimpleScriptedTestProtocol.java
URL: http://svn.apache.org/viewvc/james/mpt/trunk/main/src/main/java/org/apache/james/mpt/AbstractSimpleScriptedTestProtocol.java?rev=776401&r1=776400&r2=776401&view=diff
==============================================================================
--- james/mpt/trunk/main/src/main/java/org/apache/james/mpt/AbstractSimpleScriptedTestProtocol.java (original)
+++ james/mpt/trunk/main/src/main/java/org/apache/james/mpt/AbstractSimpleScriptedTestProtocol.java Tue May 19 18:17:09 2009
@@ -26,8 +26,8 @@
/**
* A Protocol test which reads the test protocol session from a file. The file
* read is taken as "<test-name>.test", where <test-name> is the value passed
- * into the constructor. Subclasses of this test can set up {@link #preElements}
- * and {@link #postElements} for extra elements not defined in the protocol
+ * into the constructor. Subclasses of this test can set up pre-
+ * and post elements for extra elements not defined in the protocol
* session file.
*/
public abstract class AbstractSimpleScriptedTestProtocol extends
@@ -37,12 +37,10 @@
private static final Locale BASE_DEFAULT_LOCALE = Locale.getDefault();
/**
- * Sets up a SimpleFileProtocolTest which reads the protocol session from a
- * file of name "<fileName>.test". This file should be available in the
- * classloader in the same location as this test class.
- *
- * @param fileName
- * The name of the file to read protocol elements from.
+ * Constructs a scripted test.
+ * @param hostSystem not null
+ * @param userName user name
+ * @param password password for user
*/
public AbstractSimpleScriptedTestProtocol(HostSystem hostSystem, String userName, String password) {
super(hostSystem, userName, password);
@@ -55,7 +53,7 @@
/**
* Reads test elements from the protocol session file and adds them to the
- * {@link #testElements} ProtocolSession. Then calls {@link #runSessions}.
+ * ProtocolSession. Then calls {@link #runSessions()}.
*
* @param locale test under this default locale, not null
*/
Modified: james/mpt/trunk/main/src/main/java/org/apache/james/mpt/ProtocolSession.java
URL: http://svn.apache.org/viewvc/james/mpt/trunk/main/src/main/java/org/apache/james/mpt/ProtocolSession.java?rev=776401&r1=776400&r2=776401&view=diff
==============================================================================
--- james/mpt/trunk/main/src/main/java/org/apache/james/mpt/ProtocolSession.java (original)
+++ james/mpt/trunk/main/src/main/java/org/apache/james/mpt/ProtocolSession.java Tue May 19 18:17:09 2009
@@ -77,10 +77,7 @@
* in the array corresponds to the number of the session. If an exception
* occurs, no more test elements are executed.
*
- * @param out
- * The client requests are written to here.
- * @param in
- * The server responses are read from here.
+ * @param sessions not null
*/
public void runSessions(Session[] sessions) throws Exception {
this.sessions = sessions;
@@ -121,21 +118,21 @@
}
/**
- * @see org.apache.james.mpt.ProtocolScript#CL(java.lang.String)
+ * @see org.apache.james.mpt.ProtocolInteractor#CL(java.lang.String)
*/
public void CL(String clientLine) {
testElements.add(new ClientRequest(clientLine));
}
/**
- * @see org.apache.james.mpt.ProtocolScript#SL(java.lang.String, java.lang.String)
+ * @see org.apache.james.mpt.ProtocolInteractor#SL(java.lang.String, java.lang.String)
*/
public void SL(String serverLine, String location) {
testElements.add(new ServerResponse(serverLine, location));
}
/**
- * @see org.apache.james.mpt.ProtocolScript#SUB(java.util.List, java.lang.String)
+ * @see org.apache.james.mpt.ProtocolInteractor#SUB(java.util.List, java.lang.String)
*/
public void SUB(List<String> serverLines, String location) {
testElements
@@ -143,7 +140,7 @@
}
/**
- * @see org.apache.james.mpt.ProtocolScript#CL(int, java.lang.String)
+ * @see org.apache.james.mpt.ProtocolInteractor#CL(int, java.lang.String)
*/
public void CL(int sessionNumber, String clientLine) {
this.maxSessionNumber = Math.max(this.maxSessionNumber, sessionNumber);
@@ -151,7 +148,7 @@
}
/**
- * @see org.apache.james.mpt.ProtocolScript#CONT(int)
+ * @see org.apache.james.mpt.ProtocolInteractor#CONT(int)
*/
public void CONT(int sessionNumber) throws Exception {
this.maxSessionNumber = Math.max(this.maxSessionNumber, sessionNumber);
@@ -159,7 +156,7 @@
}
/**
- * @see org.apache.james.mpt.ProtocolScript#SL(int, java.lang.String, java.lang.String, java.lang.String)
+ * @see org.apache.james.mpt.ProtocolInteractor#SL(int, java.lang.String, java.lang.String, java.lang.String)
*/
public void SL(int sessionNumber, String serverLine, String location,
String lastClientMessage) {
@@ -169,7 +166,7 @@
}
/**
- * @see org.apache.james.mpt.ProtocolScript#SUB(int, java.util.List, java.lang.String, java.lang.String)
+ * @see org.apache.james.mpt.ProtocolInteractor#SUB(int, java.util.List, java.lang.String, java.lang.String)
*/
public void SUB(int sessionNumber, List<String> serverLines, String location,
String lastClientMessage) {
Modified: james/mpt/trunk/main/src/main/java/org/apache/james/mpt/ProtocolSessionBuilder.java
URL: http://svn.apache.org/viewvc/james/mpt/trunk/main/src/main/java/org/apache/james/mpt/ProtocolSessionBuilder.java?rev=776401&r1=776400&r2=776401&view=diff
==============================================================================
--- james/mpt/trunk/main/src/main/java/org/apache/james/mpt/ProtocolSessionBuilder.java (original)
+++ james/mpt/trunk/main/src/main/java/org/apache/james/mpt/ProtocolSessionBuilder.java Tue May 19 18:17:09 2009
@@ -87,8 +87,8 @@
/**
* Builds a ProtocolSession by reading lines from the reader.
*
- * @param fileName
- * The name of the protocol session file.
+ * @param scriptName not null
+ * @param reader not null
* @return The ProtocolSession
*/
public ProtocolInteractor buildProtocolSession(final String scriptName, final Reader reader)
Modified: james/mpt/trunk/main/src/main/java/org/apache/james/mpt/Runner.java
URL: http://svn.apache.org/viewvc/james/mpt/trunk/main/src/main/java/org/apache/james/mpt/Runner.java?rev=776401&r1=776400&r2=776401&view=diff
==============================================================================
--- james/mpt/trunk/main/src/main/java/org/apache/james/mpt/Runner.java (original)
+++ james/mpt/trunk/main/src/main/java/org/apache/james/mpt/Runner.java Tue May 19 18:17:09 2009
@@ -65,15 +65,13 @@
/**
- * Runs the pre,test and post protocol sessions against a local copy of the
- * ImapServer. This does not require that James be running, and is useful
+ * <p>Runs the pre,test and post protocol sessions against a local copy of the
+ * server. This does not require that James be running, and is useful
* for rapid development and debugging.
- *
+ * </p><p>
* Instead of sending requests to a socket connected to a running instance
- * of James, this method uses the {@link MockImapServer} to simplify
+ * of James, this method uses the {@link HostSystem} to simplify
* testing. One mock instance is required per protocol session/connection.
- * These share the same underlying Mailboxes, because of the way
- * {@link MockImapServer#getImapSession()} works.
*/
public void runSessions(final SessionFactory factory) throws Exception {
class SessionContinuation implements HostSystem.Continuation {
---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org