org.ourgrid.test.threadServices
Class ShutdownableThreadTest

java.lang.Object
  extended by junit.framework.Assert
      extended by junit.framework.TestCase
          extended by org.ourgrid.test.threadServices.ShutdownableThreadTest
All Implemented Interfaces:
junit.framework.Test, SelectiveTest, StressTest

public class ShutdownableThreadTest
extends junit.framework.TestCase
implements StressTest

Tests for the ShutdownnableThread class.


Constructor Summary
ShutdownableThreadTest(java.lang.String name)
          Constructor.
 
Method Summary
static void main(java.lang.String[] args)
          Some ad-hoc tests.
protected  void setUp()
          Initializes the ShutdownableRunnable to be used in the tests.
protected  void tearDown()
          Shutdowns the ShutdownableRunnable.
 void testRun()
          Tests the run method.
 void testRun2()
          Another test for the run method.
 void testShutdown()
          Tests the shutdown method and the thread state after calling it.
 void testStart()
          Tests the start method and the ThreadServices.
 void testStartNotWaiting()
          Tests the thread state after calling the start method.
 
Methods inherited from class junit.framework.TestCase
countTestCases, createResult, getName, run, run, runBare, runTest, setName, 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
 
Methods inherited from interface junit.framework.Test
countTestCases, run
 

Constructor Detail

ShutdownableThreadTest

public ShutdownableThreadTest(java.lang.String name)
Constructor.

Parameters:
name - The Test name.
Method Detail

setUp

protected void setUp()
              throws java.lang.Exception
Initializes the ShutdownableRunnable to be used in the tests.

Overrides:
setUp in class junit.framework.TestCase
Throws:
java.lang.Exception

tearDown

protected void tearDown()
                 throws java.lang.Exception
Shutdowns the ShutdownableRunnable.

Overrides:
tearDown in class junit.framework.TestCase
Throws:
java.lang.Exception

main

public static void main(java.lang.String[] args)
Some ad-hoc tests.

Parameters:
args - The arguments that can be used inside this method.

testRun

public void testRun()
Tests the run method.


testRun2

public void testRun2()
Another test for the run method.


testStart

public void testStart()
Tests the start method and the ThreadServices.


testStartNotWaiting

public void testStartNotWaiting()
Tests the thread state after calling the start method.


testShutdown

public void testShutdown()
Tests the shutdown method and the thread state after calling it.