Class SelfTester

java.lang.Object
  extended by SelfTester

public class SelfTester
extends java.lang.Object

SelfTester

The code that makes the voting machine test itself. When called upon, this code surfs through the ballot and automatically casts random votes, while remembering the number of votes cast. At the end, it will present its own tally for comparison.

Author:
Dave Price

Constructor Summary
SelfTester(BallotGUI bg)
          build a new testing harness that casts random votes
SelfTester(BallotGUI bg, java.lang.String ballotFileDir)
          Build a new testing harness that casts the same votes as shown in the given ballot directory.
 
Method Summary
 void test(int howMany)
          Perform the test, casting the specified number of randomly decided ballots.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SelfTester

public SelfTester(BallotGUI bg)
build a new testing harness that casts random votes

Parameters:
bg - The GUI to manipulate

SelfTester

public SelfTester(BallotGUI bg,
                  java.lang.String ballotFileDir)
Build a new testing harness that casts the same votes as shown in the given ballot directory. Please note that the input directory should be different from the output directory set.

Parameters:
bg - The GUI to manipulate
ballotFileDir - The directory where to find votes to cast.
Method Detail

test

public void test(int howMany)
Perform the test, casting the specified number of randomly decided ballots.

Parameters:
howMany - the number of ballots to cast.