166 |
|
} |
167 |
|
|
168 |
|
/** |
169 |
< |
* Submitting null tasks throws NullPointerException. |
169 |
> |
* Submitting null tasks throws NullPointerException |
170 |
|
*/ |
171 |
< |
@SuppressWarnings("FutureReturnValueIgnored") |
172 |
< |
public void testNullTaskSubmission() throws Exception { |
171 |
> |
public void testNullTaskSubmission() { |
172 |
|
final ExecutorService e = new DirectExecutorService(); |
173 |
|
try (PoolCleaner cleaner = cleaner(e)) { |
174 |
< |
try { |
176 |
< |
e.execute((Runnable) null); |
177 |
< |
shouldThrow(); |
178 |
< |
} catch (NullPointerException success) {} |
179 |
< |
try { |
180 |
< |
e.submit((Runnable) null); |
181 |
< |
shouldThrow(); |
182 |
< |
} catch (NullPointerException success) {} |
183 |
< |
try { |
184 |
< |
e.submit((Callable) null); |
185 |
< |
shouldThrow(); |
186 |
< |
} catch (NullPointerException success) {} |
174 |
> |
assertNullTaskSubmissionThrowsNullPointerException(e); |
175 |
|
} |
176 |
|
} |
177 |
|
|