If I don't pass a port number I get an exception, no matter if the Ant script 
is run in Eclipse or from a DOS box:

Exception in thread "WorkbenchTestable" java.lang.IllegalArgumentException: 
Error: parameter '-port' not specified

I used your example in library.xml for org.rcpmail.test in an analogous way:

<project name="org.rcpmail.test" basedir=".">
    
    <target name="test_rcpmail">
        <property name="application" 
value="net.sf.swtbot.eclipse.ui.swtbottestapplication"/>
        <property name="data-dir" 
value="D:\workspace\eclipse_3.3.2/../junit-workspace"/>
        <property name="plugin-name" value="org.rcpmail.test"/>
        <property name="classname" value="org.rcpmail.AllTests"/>
        <property name="vmargs" value=""/>
        <property name="os" value="win32"/>
        <property name="ws" value="win32"/>
        <property name="arch" value="x86"/>
        <antcall target="eclipse-test"></antcall>
    </target>
    
    <property name="test.eclipse.dir" 
value="D:\workspace\eclipse_3.3.2\eclipse-SDK-3.3.2-win32\eclipse"/>
    
    <path id="equinox.launcher.class.path">
        <fileset dir="${test.eclipse.dir}/plugins">
            <include name="org.eclipse.equinox.launcher_*.jar"/>
        </fileset>
    </path>
    
      <target name="eclipse-test">
        <!-- 
        Parameters to this target:
        data-dir        - the directory for Eclipse to write its data
        plugin-name        - the name of the plugin to test
        classname        - the name of the test class
        vmargs            - a string containing arguments to pass to the VM - 
defaults to ""
        -->
          <tstamp>
            <format property="TIMENOW" pattern="HHmmssSSSS"/>
        </tstamp>
        <!--set default heap sizes when running performance tests-->
        <condition property="vmargs" value=" -Xms256M -Xmx256M">
        <equals arg1="${test.target}" arg2="performance" />
        </condition>
        <property name="vmargs" value=" -Xms40m -Xmx256m"/>
        <property name="formatter" 
value="org.apache.tools.ant.taskdefs.optional.junit.XMLJUnitResultFormatter"/>
        <property name="extraVMargs" value=""/>
        <property name="plugin-path" value="" />
        <property name="timeout" value="7200000" />
          <property name="test-output" value="${classname}.xml" />
          
          <!--set default jvm to use for testing-->
           <property name="jvm" value="${java.home}/bin/java" />

          <!--Load value for eclipse.buildId from the config.ini file-->
         <property file="${eclipse-home}/configuration/config.ini" />
              
        <echo message="Running ${classname}"/>

        <!-- Produces the file '${default-filename}' -->
          <!--
        <java jar="${eclipse-home}/startup.jar" fork="true" dir="." 
timeout="${timeout}" jvm="${jvm}">
        -->
        <java dir="." classname="org.eclipse.equinox.launcher.Main" fork="yes" 
classpathref="equinox.launcher.class.path">
            <arg line="-application ${application}"/>
            <arg line="-dev bin -data ${data-dir}"/>
            <arg line="formatter=${formatter},${test-output}"/>
            <arg line="-testPluginName ${plugin-name}"/>
            <arg line="-className ${classname}"/>
            <arg line="-os ${os}"/>
            <arg line="-ws ${ws}"/>
            <arg line="-arch ${arch}"/>
            <arg line="-consolelog"/>
            <arg line="-port 1298"/> <!-- Is dynamic! -->
            <arg line="-product org.rcpmail.product"/>
            <jvmarg line="${vmargs} ${extraVMargs}"/>
            <sysproperty key="PLUGIN_PATH" value="${plugin-path}"/> 
        </java>
      </target>
</project>


--- On Wed, 7/9/08, Ketan Padegaonkar <[EMAIL PROTECTED]> wrote:
From: Ketan Padegaonkar <[EMAIL PROTECTED]>
Subject: Re: [SWTBot-users] Running SWTBot Plugin Test from Ant
To: [email protected]
Date: Wednesday, July 9, 2008, 6:43 AM

On 09-Jul-08, at 3:59 PM, Hans Schwaebli wrote:

> Thank you, but I already got it working. The only problem is the  
> port number which is dynamic. In the other example there is a class  
> to determine that port number. So it seems it is not working without  
> such a class like PDETestPortLocator to automate it. So these  
> classes need to be in the class path for everyone who wants to  
> automate it. They could be included in SWTBot. Are you aware of  
> that? Then the patch would include at least one source class.


As I've already mentioned the port number is only useful if you're  
running from within eclipse, not ant.

-- Ketan


-------------------------------------------------------------------------
Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
Studies have shown that voting for your favorite open source project,
along with a healthy diet, reduces your potential for chronic lameness
and boredom. Vote Now at http://www.sourceforge.net/community/cca08
_______________________________________________
SWTBot-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/swtbot-users
http://swtbot.org/ - a functional testing tool for SWT/Eclipse


      
-------------------------------------------------------------------------
Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
Studies have shown that voting for your favorite open source project,
along with a healthy diet, reduces your potential for chronic lameness
and boredom. Vote Now at http://www.sourceforge.net/community/cca08
_______________________________________________
SWTBot-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/swtbot-users
http://swtbot.org/ - a functional testing tool for SWT/Eclipse

Reply via email to