org.curjent.test.agent
Class DeadlockTest
java.lang.Object
org.curjent.test.agent.AgentTest
org.curjent.test.agent.DeadlockTest
public class DeadlockTest
- extends AgentTest
Tests for deadlocks.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
agent
DeadlockTest.DeadlockTestAgent agent
DeadlockTest
public DeadlockTest()
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