viewguitest
Class GameTimerTest

java.lang.Object
  extended by junit.framework.Assert
      extended by junit.framework.TestCase
          extended by viewguitest.GameTimerTest
All Implemented Interfaces:
Test

public class GameTimerTest
extends TestCase

Some tests for the GameTimer, hard to do because it is a timer. A lot of tests are done in TimerLabelTest.

Author:
nlharr Methods that need testing: start() thoroughly stop() thoroughly getTime() thoroughly addTimerListener() notifyTimeUpdate() run() setTime

Constructor Summary
GameTimerTest(String name)
           
 
Method Summary
 void initializeTimers()
           
 void testConstructor()
          Tests to see if the constructor is able to create valid GameTimers without throwing errors.
 void testInitialGetTime()
          Tests that retrieving the initial time works Tests getTime() without running the GameTimers
 void testIsRunning()
          Tests isRunning()
 void testSetGetTime()
          Tests setTime() and getTime() while not running
 void testStart()
          Naive start test to see if the start() Works by calling start() and waiting after the timers should be run down to check if the timers have 0 remaining on them.
 void testStop()
          Naive start test to see if the stop() Works by calling start() and waiting a very short time, stop it and then waiting until the timers would run down to zero.
 
Methods inherited from class junit.framework.TestCase
countTestCases, createResult, getName, run, run, runBare, runTest, setName, setUp, tearDown, toString
 
Methods inherited from class junit.framework.Assert
assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, fail, fail
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

GameTimerTest

public GameTimerTest(String name)
Method Detail

initializeTimers

public void initializeTimers()

testConstructor

public void testConstructor()
Tests to see if the constructor is able to create valid GameTimers without throwing errors.


testInitialGetTime

public void testInitialGetTime()
Tests that retrieving the initial time works Tests getTime() without running the GameTimers


testStart

public void testStart()
Naive start test to see if the start() Works by calling start() and waiting after the timers should be run down to check if the timers have 0 remaining on them.


testStop

public void testStop()
Naive start test to see if the stop() Works by calling start() and waiting a very short time, stop it and then waiting until the timers would run down to zero.


testIsRunning

public void testIsRunning()
Tests isRunning()


testSetGetTime

public void testSetGetTime()
Tests setTime() and getTime() while not running