Author: rdonkin
Date: Sun Nov 30 11:23:15 2008
New Revision: 721874
URL: http://svn.apache.org/viewvc?rev=721874&view=rev
Log:
When using a body text script can all Ant to substitute variables. So, user and
passwd should be optional on AddUser
Modified:
james/mpt/trunk/antlib/src/main/java/org/apache/james/mpt/ant/MailProtocolTestTask.java
james/mpt/trunk/antlib/src/site/xdoc/index.xml
james/mpt/trunk/antlib/src/test/resources/build.xml
Modified:
james/mpt/trunk/antlib/src/main/java/org/apache/james/mpt/ant/MailProtocolTestTask.java
URL:
http://svn.apache.org/viewvc/james/mpt/trunk/antlib/src/main/java/org/apache/james/mpt/ant/MailProtocolTestTask.java?rev=721874&r1=721873&r2=721874&view=diff
==============================================================================
---
james/mpt/trunk/antlib/src/main/java/org/apache/james/mpt/ant/MailProtocolTestTask.java
(original)
+++
james/mpt/trunk/antlib/src/main/java/org/apache/james/mpt/ant/MailProtocolTestTask.java
Sun Nov 30 11:23:15 2008
@@ -320,14 +320,6 @@
throw new BuildException("Choose either script text or script
attribute but not both.");
}
- if (user == null) {
- throw new BuildException("'user' attribute must be set on
AddUser to the name of the user to be created.");
- }
-
- if (passwd == null) {
- throw new BuildException("'passwd' attribute must be set on
AddUser to the password to be set for the user created");
- }
-
if (port <= 0) {
throw new BuildException("'port' attribute must be set on
AddUser to the port against which the script should run.");
}
Modified: james/mpt/trunk/antlib/src/site/xdoc/index.xml
URL:
http://svn.apache.org/viewvc/james/mpt/trunk/antlib/src/site/xdoc/index.xml?rev=721874&r1=721873&r2=721874&view=diff
==============================================================================
--- james/mpt/trunk/antlib/src/site/xdoc/index.xml (original)
+++ james/mpt/trunk/antlib/src/site/xdoc/index.xml Sun Nov 30 11:23:15 2008
@@ -113,13 +113,13 @@
<tr>
<td>passwd</td>
<td>Password to be set for user created. Will be passed to the
script.</td>
- <td>Yes</td>
+ <td>No</td>
</tr>
<tr>
<td>user</td>
<td>Name of the user to be created. Will be passed to the script.</td>
- <td>Yes</td>
+ <td>No</td>
</tr>
<tr>
Modified: james/mpt/trunk/antlib/src/test/resources/build.xml
URL:
http://svn.apache.org/viewvc/james/mpt/trunk/antlib/src/test/resources/build.xml?rev=721874&r1=721873&r2=721874&view=diff
==============================================================================
--- james/mpt/trunk/antlib/src/test/resources/build.xml (original)
+++ james/mpt/trunk/antlib/src/test/resources/build.xml Sun Nov 30 11:23:15 2008
@@ -79,30 +79,28 @@
</mpt:mpt>
</target>
+ <target name='testAddUserMaySetNamePassword'>
+ <mpt:mpt port='10000' skip='true' host='example.org'>
+ <fileset dir='${basedir}' />
+ <addUser port='10001' user='user' passwd='passwd'
script='pom.xml'/>
+ </mpt:mpt>
+ <mpt:mpt port='10000' skip='true' host='example.org'>
+ <fileset dir='${basedir}' />
+ <addUser port='10001' script='pom.xml'/>
+ </mpt:mpt>
+ </target>
- <target name='testAddUserMustSetPortNamePasswordScript'>
- <au:expectfailure>
- <mpt:mpt port='10000' skip='true' host='example.org'>
- <fileset dir='${basedir}' />
- <addUser user='user' passwd='passwd' script='pom.xml' />
- </mpt:mpt>
- </au:expectfailure>
- <au:expectfailure>
- <mpt:mpt port='10000' skip='true' host='example.org'>
- <fileset dir='${basedir}' />
- <addUser port='10001' passwd='passwd' script='pom.xml' />
- </mpt:mpt>
- </au:expectfailure>
+ <target name='testAddUserMustSetPortScript'>
<au:expectfailure>
<mpt:mpt port='10000' skip='true' host='example.org'>
<fileset dir='${basedir}' />
- <addUser port='10001' user='user' script='pom.xml' />
+ <addUser script='pom.xml' />
</mpt:mpt>
</au:expectfailure>
<au:expectfailure>
<mpt:mpt port='10000' skip='true' host='example.org'>
<fileset dir='${basedir}' />
- <addUser port='10001' user='user' passwd='passwd' />
+ <addUser port='10001'/>
</mpt:mpt>
</au:expectfailure>
</target>
@@ -124,7 +122,7 @@
</target>
<target name='testMptAttributes' depends='testMustSetPort,
testMaySetHost,testMustSetScriptsOrScript, testMustNotAllowScriptsAndScript,
testMaySetShabang'/>
- <target name='testAddUser' depends='testShouldAllowAddUserToBeSet,
testAddUserMustSetPortNamePasswordScript, testAddUserMayIncludeScriptText,
testAddUserBothScriptTextAndScriptAttributeMayNotBeSet'/>
+ <target name='testAddUser' depends='testShouldAllowAddUserToBeSet,
testAddUserMustSetPortScript, testAddUserMayIncludeScriptText,
testAddUserBothScriptTextAndScriptAttributeMayNotBeSet,
testAddUserMaySetNamePassword'/>
<target name='all' depends='testMptAttributes, testAddUser'/>
</project>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]