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 2008/12/02 21:01:17 UTC
svn commit: r722594 - /james/mpt/trunk/main/src/site/xdoc/index.xml
Author: rdonkin
Date: Tue Dec 2 12:01:16 2008
New Revision: 722594
URL: http://svn.apache.org/viewvc?rev=722594&view=rev
Log:
Adding some explanation of script syntax
Modified:
james/mpt/trunk/main/src/site/xdoc/index.xml
Modified: james/mpt/trunk/main/src/site/xdoc/index.xml
URL: http://svn.apache.org/viewvc/james/mpt/trunk/main/src/site/xdoc/index.xml?rev=722594&r1=722593&r2=722594&view=diff
==============================================================================
--- james/mpt/trunk/main/src/site/xdoc/index.xml (original)
+++ james/mpt/trunk/main/src/site/xdoc/index.xml Tue Dec 2 12:01:16 2008
@@ -68,9 +68,48 @@
</subsection>
</section>
<section name="Script Features">
+<subsection name='Basic Syntax'>
+<p>
+MPT scripts are line based plain text files. The initial letter of each line determines it's type:
+</p>
+<table>
+<tr>
+ <td><strong>Line Prefix</strong></td> <td><strong>Description</strong></td>
+</tr>
+<tr>
+ <td>#</td>
+ <td>A comment: the rest of the line will be ignored</td>
+</tr>
+<tr>
+ <td>C: </td>
+ <td>A client request: the rest of the line will be sent to the server</td>
+</tr>
+<tr>
+ <td>S: </td>
+ <td>A server response: the framework will read one line of response from the server,
+ and compare it to the rest of the line (see
+ <a href='#Regex Matching Of Server Responses'>regex matching</a>)</td>
+</tr>
+</table>
+<p>
+Example:
+</p>
+<source><pre>
+#
+# This script is a basic SMTP HELO.
+#
+S: 220 localhost. SMTP Server \(JAMES SMTP Server .*
+C: HELO example.org
+S: 250 localhost. Hello example.org .*
+C: QUIT
+S: 221 2.0.0 localhost. Service closing transmission channel
+</pre></source>
+</subsection>
<subsection name='Regex Matching Of Server Responses'>
<p>
-The server responses in the script support regex matching.
+The server responses in the script support regex matching.
+<a href='http://java.sun.com/j2se/1.4.2/docs/api/java/util/regex/Pattern.html'>Java Pattern</a>
+is used for the regex comparison and so the syntax is identical.
</p>
</subsection>
<subsection name='Variable Substitution'>
---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org