The test case you create will simply read in your script file to determine what tests should be run.
package test; import java.io.File; import junit.framework.Test; import com.flexiblewebsolutions.xdriveunit.ScriptRunner;
public class ScriptTest extends ScriptRunner { public File getTestDirectory() { return( new File("test") ); } public static Test suite() { return( ( new ScriptTest() ).initScript( "script1.xml" ) ); } }
Your script will be stored in the 'test directory' as defined by your test script class.
<?xml version="1.0" encoding="ISO-8859-1"?> <testscript xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../schemas/XDriveTestScript.xsd"> <test> <test> <step> <classname>com.flexiblewebsolutions.xdriveunit.extensions.test.TestTest</classname> <configuration>testConfig/config1.xml</configuration> </step> </test> <test> <step> <classname>com.flexiblewebsolutions.xdriveunit.extensions.test.TestTest</classname> <configuration>testConfig/config2.xml</configuration> </step> </test> </testscript>