/** * TestGameAnalsyer * - Tests the GameAnalyser * @author Akbar Sherwani * @date 1st Feb * @version 0.1 */ public class TestGameAnalyser extends Thread { private CommentaryProducer cp; private Output out; public Stats stats; public Ball ball; /** * Run method for testing * @param args */ public static void main(String[] args) { new TestGameAnalyser(); } /** * Starts of all the tests */ public TestGameAnalyser() { ball = new Ball(); out = new Output(2); // change to 2 for voice stats = new Stats(ball); // Call Stats cp = new CommentaryProducer(out, stats); System.out.println("Testing GameAnalyser:"); try { if(TestCP()) { System.out.println("GameAnalyser Class Passed :)"); System.out.println("-------------------------------"); } else { System.out.println("GameAnalyser Class Failed"); System.out.println("-------------------------------"); } } catch (InterruptedException e) { // TODO Auto-generated catch block e.printStackTrace(); } } public boolean TestCP() throws InterruptedException { cp.counterAttack("Liverpool"); sleep(2500); cp.speakOffside(); sleep(2500); cp.speakOneTwo(3, 4); sleep(2500); cp.speakGoal(false, 13); return true; } }