org.curjent.test.agent
Class DeadlockTest

java.lang.Object
  extended by org.curjent.test.agent.AgentTest
      extended by org.curjent.test.agent.DeadlockTest

public class DeadlockTest
extends AgentTest

Tests for deadlocks.


Nested Class Summary
(package private) static interface DeadlockTest.DeadlockTestAgent
           
(package private)  class DeadlockTest.DeadlockTestTask
           
 
Nested classes/interfaces inherited from class org.curjent.test.agent.AgentTest
AgentTest.Context
 
Field Summary
(package private)  DeadlockTest.DeadlockTestAgent agent
           
 
Fields inherited from class org.curjent.test.agent.AgentTest
config, failed, stats
 
Constructor Summary
DeadlockTest()
           
 
Method Summary
private  DeadlockTest.DeadlockTestAgent newAgent()
           
protected  TestAgent newTestAgent()
           
 void testControllerDeadcheck()
          Tests the scenario outlined in the javadoc comments for the controller's private deadcheck() method.
private  void testControllerDeadcheck(boolean isolated)
           
 void testDeadlocksScenario()
          Tests the scenario described in the javadoc comments for the DeadLocks class.
 void testIndirectDeadlock()
           
private  void testIndirectDeadlock(long timeout)
           
 void testSimpleDeadlock()
           
private  void testSimpleDeadlock(long timeout)
           
 
Methods inherited from class org.curjent.test.agent.AgentTest
flush, log, setUp, setUp, setUp, sleep, stats, tearDown, tearDown
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

agent

DeadlockTest.DeadlockTestAgent agent
Constructor Detail

DeadlockTest

public DeadlockTest()
Method Detail

newTestAgent

protected TestAgent newTestAgent()
Specified by:
newTestAgent in class AgentTest

newAgent

private DeadlockTest.DeadlockTestAgent newAgent()

testSimpleDeadlock

public void testSimpleDeadlock()

testSimpleDeadlock

private void testSimpleDeadlock(long timeout)

testIndirectDeadlock

public void testIndirectDeadlock()

testIndirectDeadlock

private void testIndirectDeadlock(long timeout)

testControllerDeadcheck

public void testControllerDeadcheck()
Tests the scenario outlined in the javadoc comments for the controller's private deadcheck() method.


testControllerDeadcheck

private void testControllerDeadcheck(boolean isolated)

testDeadlocksScenario

public void testDeadlocksScenario()
Tests the scenario described in the javadoc comments for the DeadLocks class. The following diagram depicts the same scenario with the addition of example agents and messages. This scenario includes three agents: X, Y, and Z. Three threads (P, Q, and R) post three asynchronous messages to the X and Y agents: MA, MB, and MC. These three messages are dispatched on thread A for agent X, and threads B and C for agent Y. The task limit for agent X is 1, and the limit for Y is 2. Neither agent can execute another message until one of these messages finishes. The task methods executing on threads A, B, and C call synchronous methods on agents X, Y, and Z, and Z's D thread makes a synchronous call to agent X. The MD, MI, MJ, and MK synchronous messages deadlock the A, B, C, and D threads. In this scenario, thread A, B, or D checks for deadlock.



Copyright 2009-2011 Tom Landon
Apache License 2.0