· Home

 · Download

 · Internals

 · Howto

 · People

 · Javadoc

 · Mailing List

Fast Test Playback

So you have your tests written, but you'd like to speed things up a bit. We'll do that by writing a Player factory. Here is the source for the one used in Pounder's tests:

import com.mtp.pounder.Player;

public class PlayerFactory {

  public static Player buildDefault(String script) throws Exception {
    return new Player(script);
  }

  public static Player buildSpeedy(String script) throws Exception {
    Player p = new Player(script);
    p.setItemDelayEnabled(false);
    p.setPlaybackAttempts(100);
    p.setFailedPlaybackDelay(50);
    return p;
  }

}

As you can see, I currently have two types of Player's. One for standard playback, and another that goes very quickly.

The method setItemDelayedEnabled() determines whether the delay on each item in the script will be used. If this is false, the script will be played as fast as possible.

Because we're playing as fast as possible, there will be tons of errors! These errors will occur because the system will not be able to update the components and display new windows fast enough to keep up. So I bump the playback attempts up to 100. This means an item will be played 100 times before the script fails.

Finally, I set the delay between failed playbacks to a low value. This is in milliseconds. See the Player class documentation for more information.





Many thanks to SourceForge for hosting this project.
SourceForge



Copyright 2002 Matthew Pekar  All rights reserved.