[cvs] / jsr166 / src / test / tck / AbstractExecutorServiceTest.java Repository:
ViewVC logotype

Diff of /jsr166/src/test/tck/AbstractExecutorServiceTest.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.46, Mon May 29 22:44:26 2017 UTC revision 1.47, Sun Jul 16 18:05:47 2017 UTC
# Line 166  Line 166 
166      }      }
167    
168      /**      /**
169       * execute(null runnable) throws NPE       * Submitting null tasks throws NullPointerException.
170       */       */
171      public void testExecuteNullRunnable() {      @SuppressWarnings("FutureReturnValueIgnored")
172          ExecutorService e = new DirectExecutorService();      public void testNullTaskSubmission() throws Exception {
173            final ExecutorService e = new DirectExecutorService();
174            try (PoolCleaner cleaner = cleaner(e)) {
175                try {
176                    e.execute((Runnable) null);
177                    shouldThrow();
178                } catch (NullPointerException success) {}
179          try {          try {
180              e.submit((Runnable) null);              e.submit((Runnable) null);
181              shouldThrow();              shouldThrow();
182          } catch (NullPointerException success) {}          } catch (NullPointerException success) {}
     }  
   
     /**  
      * submit(null callable) throws NPE  
      */  
     public void testSubmitNullCallable() {  
         ExecutorService e = new DirectExecutorService();  
183          try {          try {
184              e.submit((Callable) null);              e.submit((Callable) null);
185              shouldThrow();              shouldThrow();
186          } catch (NullPointerException success) {}          } catch (NullPointerException success) {}
187      }      }
188        }
189    
190      /**      /**
191       * submit(callable).get() throws InterruptedException if interrupted       * submit(callable).get() throws InterruptedException if interrupted

Legend:
Removed from v.1.46  
changed lines
  Added in v.1.47

Doug Lea
ViewVC Help
Powered by ViewVC 1.0.8