org.curjent.test.agent
Class FutureTest

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

public class FutureTest
extends AgentTest

Test cases for agent methods returning Future references.


Nested Class Summary
(package private) static interface FutureTest.FutureTestAgent
           
(package private)  class FutureTest.FutureTestTask
           
 
Nested classes/interfaces inherited from class org.curjent.test.agent.AgentTest
AgentTest.Context
 
Field Summary
(package private)  FutureTest.FutureTestAgent agent
           
 
Fields inherited from class org.curjent.test.agent.AgentTest
config, failed, stats
 
Constructor Summary
FutureTest()
           
 
Method Summary
private  Object getValue(Future<?> future)
           
protected  TestAgent newTestAgent()
           
 void testBoxedFutures()
           
 void testCancelBeforeStart()
           
 void testCancelWithInterrupt()
           
 void testFutureCancellation()
           
 void testFutureException()
           
 void testFutureGet()
           
 void testFutureInterrupt()
           
private  void testFutureTimeout(long timeout, TimeUnit unit)
           
 void testFutureTimeout0()
           
 void testFutureTimeout100()
           
 void testSoftCancel()
           
 void testSynchronousFuture()
           
 void testVoidCall()
           
 
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

FutureTest.FutureTestAgent agent
Constructor Detail

FutureTest

public FutureTest()
Method Detail

newTestAgent

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

testFutureGet

public void testFutureGet()
                   throws InterruptedException,
                          ExecutionException
Throws:
InterruptedException
ExecutionException

testBoxedFutures

public void testBoxedFutures()
                      throws InterruptedException,
                             ExecutionException
Throws:
InterruptedException
ExecutionException

getValue

private Object getValue(Future<?> future)
                 throws InterruptedException,
                        ExecutionException
Throws:
InterruptedException
ExecutionException

testFutureTimeout0

public void testFutureTimeout0()
                        throws InterruptedException,
                               ExecutionException
Throws:
InterruptedException
ExecutionException

testFutureTimeout100

public void testFutureTimeout100()
                          throws InterruptedException,
                                 ExecutionException
Throws:
InterruptedException
ExecutionException

testFutureTimeout

private void testFutureTimeout(long timeout,
                               TimeUnit unit)
                        throws InterruptedException,
                               ExecutionException
Throws:
InterruptedException
ExecutionException

testSynchronousFuture

public void testSynchronousFuture()

testFutureInterrupt

public void testFutureInterrupt()
                         throws ExecutionException,
                                InterruptedException
Throws:
ExecutionException
InterruptedException

testFutureException

public void testFutureException()
                         throws InterruptedException
Throws:
InterruptedException

testFutureCancellation

public void testFutureCancellation()
                            throws InterruptedException,
                                   ExecutionException
Throws:
InterruptedException
ExecutionException

testCancelWithInterrupt

public void testCancelWithInterrupt()
                             throws InterruptedException,
                                    ExecutionException
Throws:
InterruptedException
ExecutionException

testSoftCancel

public void testSoftCancel()
                    throws InterruptedException,
                           ExecutionException
Throws:
InterruptedException
ExecutionException

testCancelBeforeStart

public void testCancelBeforeStart()
                           throws InterruptedException,
                                  ExecutionException
Throws:
InterruptedException
ExecutionException

testVoidCall

public void testVoidCall()
                  throws InterruptedException,
                         ExecutionException
Throws:
InterruptedException
ExecutionException


Copyright 2009-2011 Tom Landon
Apache License 2.0