edu.wpi.prc.server.test
Class LocalTransitionerTest

java.lang.Object
  extended by junit.framework.Assert
      extended by junit.framework.TestCase
          extended by edu.wpi.prc.server.test.LocalTransitionerTest
All Implemented Interfaces:
junit.framework.Test

public class LocalTransitionerTest
extends junit.framework.TestCase

Tests the LocalTransitioner.

Author:
James Baldassari

Field Summary
private  Project p
           
private  LocalTransitioner transitioner
           
private  Volunteer user
           
 
Constructor Summary
LocalTransitionerTest(java.lang.String name)
           
 
Method Summary
protected  void setUp()
           
 void testAddIngressResultNormal()
          Tests the addIngressResult method.
 void testAddIngressResultRetiredWorkUnit()
          Tests the addIngressResult method.
 void testAddIngressResultSpotCheck()
          Tests the addIngressResult method.
 void testAddIngressWorkUnit()
          Tests the addIngressWorkUnit method.
 void testEntireTaskLifeCycle()
          Tests the entire life cycle of a work unit and its associated results.
 void testGetAssociatedIngressResults()
          Tests the getAssociatedIngressResults(String hqlQuery) method.
 void testGetAssociatedPendingResults()
          Tests the getAssociatedPendingResults(String hqlQuery) method.
 void testGetIngressResultQueue()
          Tests the getIngressResultQueue method.
 void testGetIngressWorkQueue()
          Tests the getIngressWorkQueue method.
 void testGetPendingResultQueue()
          Tests the getPendingResultQueue method.
 void testGetPendingWorkQueue()
          Tests the getPendingWorkQueue method.
 void testGetRetiredWorkQueue()
          Tests the getRetiredWorkQueue method.
 void testGetValidResultQueue()
          Tests the getValidResultQueue method.
 void testGetWorkUnit()
          Tests the getWorkUnit method.
 void testGetWorkUnitPriority()
          Tests the getWorkUnit method using different work unit priorities.
 void testOptimisticWorkUnitSchedulingPolicy()
          Tests the LocalTransitioner's optimistic work unit schedulilng policy.
 void testRestoreFromDatabase()
          Tests restoring the local transitioner from the database.
 void testWorkUnitExpiration()
           
 
Methods inherited from class junit.framework.TestCase
countTestCases, createResult, getName, run, run, runBare, runTest, setName, 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
 

Field Detail

transitioner

private LocalTransitioner transitioner

user

private Volunteer user

p

private Project p
Constructor Detail

LocalTransitionerTest

public LocalTransitionerTest(java.lang.String name)
Method Detail

setUp

protected void setUp()
              throws java.lang.Exception
Overrides:
setUp in class junit.framework.TestCase
Throws:
java.lang.Exception

testRestoreFromDatabase

public void testRestoreFromDatabase()
Tests restoring the local transitioner from the database.


testGetIngressWorkQueue

public void testGetIngressWorkQueue()
Tests the getIngressWorkQueue method.


testGetPendingWorkQueue

public void testGetPendingWorkQueue()
Tests the getPendingWorkQueue method.


testGetRetiredWorkQueue

public void testGetRetiredWorkQueue()
Tests the getRetiredWorkQueue method.


testGetIngressResultQueue

public void testGetIngressResultQueue()
Tests the getIngressResultQueue method.


testGetPendingResultQueue

public void testGetPendingResultQueue()
Tests the getPendingResultQueue method.


testGetValidResultQueue

public void testGetValidResultQueue()
Tests the getValidResultQueue method.


testAddIngressWorkUnit

public void testAddIngressWorkUnit()
Tests the addIngressWorkUnit method.


testGetAssociatedIngressResults

public void testGetAssociatedIngressResults()
Tests the getAssociatedIngressResults(String hqlQuery) method.


testAddIngressResultNormal

public void testAddIngressResultNormal()
Tests the addIngressResult method. This tests the normal case in which the result's work unit has not been retired and the result is not a spot check result.


testAddIngressResultRetiredWorkUnit

public void testAddIngressResultRetiredWorkUnit()
Tests the addIngressResult method. This tests the exceptional case when the result's work unit has been retired and the result is not a spot check result.


testAddIngressResultSpotCheck

public void testAddIngressResultSpotCheck()
Tests the addIngressResult method. This tests the exceptional case when the result is a spot check result.


testGetAssociatedPendingResults

public void testGetAssociatedPendingResults()
Tests the getAssociatedPendingResults(String hqlQuery) method.


testGetWorkUnit

public void testGetWorkUnit()
Tests the getWorkUnit method.


testGetWorkUnitPriority

public void testGetWorkUnitPriority()
Tests the getWorkUnit method using different work unit priorities.


testOptimisticWorkUnitSchedulingPolicy

public void testOptimisticWorkUnitSchedulingPolicy()
Tests the LocalTransitioner's optimistic work unit schedulilng policy.


testWorkUnitExpiration

public void testWorkUnitExpiration()

testEntireTaskLifeCycle

public void testEntireTaskLifeCycle()
Tests the entire life cycle of a work unit and its associated results. Both begin as ingress tasks, then make state transitions until the work unit is retired, a canonical result is selected, and the other results are deleted.