you can for instance put following before your <webtest ...>:

<groovyScript>
import org.apache.tools.ant.BuildException;
import com.canoo.webtest.engine.StepFailedException as SFE

class CustomNot extends com.canoo.webtest.steps.AbstractStepContainer
{
  void doExecute()
  {
    try
    {
      executeContainedSteps()
    }
    catch (BuildException e)
    {
      return // just ignore, this is what we want
    }
    throw new SFE("none of the contained tasks failed")
  }
}
project.addTaskDefinition("myNotStep", CustomNot)
</<groovyScript>

and use it as 
<myNotStep>
  <ftp .../>
</myNotStep>

the semantic is a bit different than the one of WebTest's <not..> step as
this only awaits that one of the nested tasks fails, not all.

Cheers,
Marc.

PS: where should I send the invoice? ;-)


Willi Kuhnis wrote:
> 
> Hi Marc,
> 
> I still didnt find a solution to use Ant's <FTP> with something like
> <NOT>.
> I would like to successfully test, when its not allowed to connect to
> a ftp server.
> 
> you wrote:
> 
> ***********************************************
> to perform what you want to do, you need to write a custom task that
> does for BuildFailure what WebTest's <not> does for StepFailedException.
> 
> Cheers,
> Marc.
> ****************************************
> 
> But I didnt find out, where and how to do this.
> Can somebody help me please ?
> 
> 
> -- 
> Willi Kuhnis
> [EMAIL PROTECTED]
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> _______________________________________________
> WebTest mailing list
> [email protected]
> http://lists.canoo.com/mailman/listinfo/webtest
> 
> 

-- 
View this message in context: 
http://www.nabble.com/%3Cnot%3E-seams-not-to-work-with-ANT%27s-%3Cftp%3E-tp15019551p15019883.html
Sent from the WebTest mailing list archive at Nabble.com.

_______________________________________________
WebTest mailing list
[email protected]
http://lists.canoo.com/mailman/listinfo/webtest

Reply via email to