Class AbstractExecutorServiceTest

java.lang.Object
  extended by junit.framework.Assert
      extended by junit.framework.TestCase
          extended by JSR166TestCase
              extended by AbstractExecutorServiceTest
All Implemented Interfaces:
junit.framework.Test

public class AbstractExecutorServiceTest
extends JSR166TestCase


Nested Class Summary
 
Nested classes/interfaces inherited from class JSR166TestCase
JSR166TestCase.AdjustablePolicy, JSR166TestCase.CallableOne, JSR166TestCase.CheckedBarrier, JSR166TestCase.CheckedCallable<T>, JSR166TestCase.CheckedInterruptedCallable<T>, JSR166TestCase.CheckedInterruptedRunnable, JSR166TestCase.CheckedRecursiveAction, JSR166TestCase.CheckedRecursiveTask<T>, JSR166TestCase.CheckedRunnable, JSR166TestCase.LongPossiblyInterruptedRunnable, JSR166TestCase.MediumInterruptedRunnable, JSR166TestCase.MediumPossiblyInterruptedRunnable, JSR166TestCase.MediumRunnable, JSR166TestCase.NoOpCallable, JSR166TestCase.NoOpREHandler, JSR166TestCase.NoOpRunnable, JSR166TestCase.NPETask, JSR166TestCase.RunnableShouldThrow, JSR166TestCase.ShortInterruptedRunnable, JSR166TestCase.ShortRunnable, JSR166TestCase.SimpleThreadFactory, JSR166TestCase.SmallCallable, JSR166TestCase.SmallPossiblyInterruptedRunnable, JSR166TestCase.SmallRunnable, JSR166TestCase.StringTask, JSR166TestCase.ThreadShouldThrow, JSR166TestCase.TrackedCallable, JSR166TestCase.TrackedLongRunnable, JSR166TestCase.TrackedMediumRunnable, JSR166TestCase.TrackedNoOpRunnable, JSR166TestCase.TrackedRunnable, JSR166TestCase.TrackedShortRunnable, JSR166TestCase.TrackedSmallRunnable
 
Field Summary
 
Fields inherited from class JSR166TestCase
eight, expensiveTests, five, four, LONG_DELAY_MS, m1, m10, m2, m3, m4, m5, m6, MEDIUM_DELAY_MS, nine, one, seven, SHORT_DELAY_MS, six, SIZE, SMALL_DELAY_MS, TEST_STRING, three, two, zero
 
Constructor Summary
AbstractExecutorServiceTest()
           
 
Method Summary
static void main(java.lang.String[] args)
           
static junit.framework.Test suite()
           
 void testExecuteNullRunnable()
          execute(null runnable) throws NPE
 void testExecuteRunnable()
          execute(runnable) runs it to completion
 void testInterruptedSubmit()
          submit(callable).get() throws InterruptedException if interrupted
 void testInvokeAll1()
          invokeAll(null) throws NPE
 void testInvokeAll2()
          invokeAll(empty collection) returns empty collection
 void testInvokeAll3()
          invokeAll(c) throws NPE if c has null elements
 void testInvokeAll4()
          get of returned element of invokeAll(c) throws exception on failed task
 void testInvokeAll5()
          invokeAll(c) returns results of all completed tasks in c
 void testInvokeAny1()
          invokeAny(null) throws NPE
 void testInvokeAny2()
          invokeAny(empty collection) throws IAE
 void testInvokeAny3()
          invokeAny(c) throws NPE if c has null elements
 void testInvokeAny4()
          invokeAny(c) throws ExecutionException if no task in c completes
 void testInvokeAny5()
          invokeAny(c) returns result of some task in c if at least one completes
 void testSubmitCallable()
          Completed submit(callable) returns result
 void testSubmitEE()
          get of submit(callable) throws ExecutionException if callable throws exception
 void testSubmitFailedPrivilegedExceptionAction()
          A submitted failed privileged exception action reports exception
 void testSubmitNullCallable()
          submit(null callable) throws NPE
 void testSubmitPrivilegedAction()
          A submitted privileged action runs to completion
 void testSubmitPrivilegedExceptionAction()
          A submitted privileged exception action runs to completion
 void testSubmitRunnable()
          Completed submit(runnable) returns successfully
 void testSubmitRunnable2()
          Completed submit(runnable, result) returns result
 void testTimedInvokeAll1()
          timed invokeAll(null) throws NPE
 void testTimedInvokeAll2()
          timed invokeAll(empty collection) returns empty collection
 void testTimedInvokeAll3()
          timed invokeAll(c) throws NPE if c has null elements
 void testTimedInvokeAll4()
          get of returned element of invokeAll(c) throws exception on failed task
 void testTimedInvokeAll5()
          timed invokeAll(c) returns results of all completed tasks in c
 void testTimedInvokeAll6()
          timed invokeAll cancels tasks not completed by timeout
 void testTimedInvokeAllNullTimeUnit()
          timed invokeAll(null time unit) throws NPE
 void testTimedInvokeAny1()
          timed invokeAny(null) throws NPE
 void testTimedInvokeAny2()
          timed invokeAny(empty collection) throws IAE
 void testTimedInvokeAny3()
          timed invokeAny(c) throws NPE if c has null elements
 void testTimedInvokeAny4()
          timed invokeAny(c) throws ExecutionException if no task completes
 void testTimedInvokeAny5()
          timed invokeAny(c) returns result of some task in c
 void testTimedInvokeAnyNullTimeUnit()
          timed invokeAny(null time unit) throws NPE
 
Methods inherited from class JSR166TestCase
assertThreadJoinTimesOut, awaiter, checkEmpty, delay, getShortDelay, joinPool, latchAwaitingStringTask, newTestSuite, permissivePolicy, possiblyInterruptedRunnable, runTest, runTestProfiled, runWithoutPermissions, runWithPermissions, setDelays, setUp, shouldThrow, shouldThrow, tearDown, threadAssertEquals, threadAssertEquals, threadAssertFalse, threadAssertNull, threadAssertSame, threadAssertTrue, threadFail, threadRecordFailure, threadShouldThrow, threadShouldThrow, threadUnexpectedException, trackedRunnable
 
Methods inherited from class junit.framework.TestCase
countTestCases, createResult, getName, run, run, runBare, 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, failNotEquals, failNotSame, failSame, format
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AbstractExecutorServiceTest

public AbstractExecutorServiceTest()
Method Detail

main

public static void main(java.lang.String[] args)

suite

public static junit.framework.Test suite()

testExecuteRunnable

public void testExecuteRunnable()
                         throws java.lang.Exception
execute(runnable) runs it to completion

Throws:
java.lang.Exception

testSubmitCallable

public void testSubmitCallable()
                        throws java.lang.Exception
Completed submit(callable) returns result

Throws:
java.lang.Exception

testSubmitRunnable

public void testSubmitRunnable()
                        throws java.lang.Exception
Completed submit(runnable) returns successfully

Throws:
java.lang.Exception

testSubmitRunnable2

public void testSubmitRunnable2()
                         throws java.lang.Exception
Completed submit(runnable, result) returns result

Throws:
java.lang.Exception

testSubmitPrivilegedAction

public void testSubmitPrivilegedAction()
                                throws java.lang.Exception
A submitted privileged action runs to completion

Throws:
java.lang.Exception

testSubmitPrivilegedExceptionAction

public void testSubmitPrivilegedExceptionAction()
                                         throws java.lang.Exception
A submitted privileged exception action runs to completion

Throws:
java.lang.Exception

testSubmitFailedPrivilegedExceptionAction

public void testSubmitFailedPrivilegedExceptionAction()
                                               throws java.lang.Exception
A submitted failed privileged exception action reports exception

Throws:
java.lang.Exception

testExecuteNullRunnable

public void testExecuteNullRunnable()
execute(null runnable) throws NPE


testSubmitNullCallable

public void testSubmitNullCallable()
submit(null callable) throws NPE


testInterruptedSubmit

public void testInterruptedSubmit()
                           throws java.lang.InterruptedException
submit(callable).get() throws InterruptedException if interrupted

Throws:
java.lang.InterruptedException

testSubmitEE

public void testSubmitEE()
                  throws java.lang.InterruptedException
get of submit(callable) throws ExecutionException if callable throws exception

Throws:
java.lang.InterruptedException

testInvokeAny1

public void testInvokeAny1()
                    throws java.lang.Exception
invokeAny(null) throws NPE

Throws:
java.lang.Exception

testInvokeAny2

public void testInvokeAny2()
                    throws java.lang.Exception
invokeAny(empty collection) throws IAE

Throws:
java.lang.Exception

testInvokeAny3

public void testInvokeAny3()
                    throws java.lang.Exception
invokeAny(c) throws NPE if c has null elements

Throws:
java.lang.Exception

testInvokeAny4

public void testInvokeAny4()
                    throws java.lang.InterruptedException
invokeAny(c) throws ExecutionException if no task in c completes

Throws:
java.lang.InterruptedException

testInvokeAny5

public void testInvokeAny5()
                    throws java.lang.Exception
invokeAny(c) returns result of some task in c if at least one completes

Throws:
java.lang.Exception

testInvokeAll1

public void testInvokeAll1()
                    throws java.lang.InterruptedException
invokeAll(null) throws NPE

Throws:
java.lang.InterruptedException

testInvokeAll2

public void testInvokeAll2()
                    throws java.lang.InterruptedException
invokeAll(empty collection) returns empty collection

Throws:
java.lang.InterruptedException

testInvokeAll3

public void testInvokeAll3()
                    throws java.lang.InterruptedException
invokeAll(c) throws NPE if c has null elements

Throws:
java.lang.InterruptedException

testInvokeAll4

public void testInvokeAll4()
                    throws java.lang.Exception
get of returned element of invokeAll(c) throws exception on failed task

Throws:
java.lang.Exception

testInvokeAll5

public void testInvokeAll5()
                    throws java.lang.Exception
invokeAll(c) returns results of all completed tasks in c

Throws:
java.lang.Exception

testTimedInvokeAny1

public void testTimedInvokeAny1()
                         throws java.lang.Exception
timed invokeAny(null) throws NPE

Throws:
java.lang.Exception

testTimedInvokeAnyNullTimeUnit

public void testTimedInvokeAnyNullTimeUnit()
                                    throws java.lang.Exception
timed invokeAny(null time unit) throws NPE

Throws:
java.lang.Exception

testTimedInvokeAny2

public void testTimedInvokeAny2()
                         throws java.lang.Exception
timed invokeAny(empty collection) throws IAE

Throws:
java.lang.Exception

testTimedInvokeAny3

public void testTimedInvokeAny3()
                         throws java.lang.Exception
timed invokeAny(c) throws NPE if c has null elements

Throws:
java.lang.Exception

testTimedInvokeAny4

public void testTimedInvokeAny4()
                         throws java.lang.Exception
timed invokeAny(c) throws ExecutionException if no task completes

Throws:
java.lang.Exception

testTimedInvokeAny5

public void testTimedInvokeAny5()
                         throws java.lang.Exception
timed invokeAny(c) returns result of some task in c

Throws:
java.lang.Exception

testTimedInvokeAll1

public void testTimedInvokeAll1()
                         throws java.lang.InterruptedException
timed invokeAll(null) throws NPE

Throws:
java.lang.InterruptedException

testTimedInvokeAllNullTimeUnit

public void testTimedInvokeAllNullTimeUnit()
                                    throws java.lang.InterruptedException
timed invokeAll(null time unit) throws NPE

Throws:
java.lang.InterruptedException

testTimedInvokeAll2

public void testTimedInvokeAll2()
                         throws java.lang.InterruptedException
timed invokeAll(empty collection) returns empty collection

Throws:
java.lang.InterruptedException

testTimedInvokeAll3

public void testTimedInvokeAll3()
                         throws java.lang.InterruptedException
timed invokeAll(c) throws NPE if c has null elements

Throws:
java.lang.InterruptedException

testTimedInvokeAll4

public void testTimedInvokeAll4()
                         throws java.lang.Exception
get of returned element of invokeAll(c) throws exception on failed task

Throws:
java.lang.Exception

testTimedInvokeAll5

public void testTimedInvokeAll5()
                         throws java.lang.Exception
timed invokeAll(c) returns results of all completed tasks in c

Throws:
java.lang.Exception

testTimedInvokeAll6

public void testTimedInvokeAll6()
                         throws java.lang.InterruptedException
timed invokeAll cancels tasks not completed by timeout

Throws:
java.lang.InterruptedException