401 |
|
try { |
402 |
|
new ThreadPoolExecutor(-1,1,LONG_DELAY_MS, MILLISECONDS, new ArrayBlockingQueue<Runnable>(10)); |
403 |
|
shouldThrow(); |
404 |
< |
} |
405 |
< |
catch (IllegalArgumentException success) {} |
404 |
> |
} catch (IllegalArgumentException success) {} |
405 |
|
} |
406 |
|
|
407 |
|
/** |
411 |
|
try { |
412 |
|
new ThreadPoolExecutor(1,-1,LONG_DELAY_MS, MILLISECONDS, new ArrayBlockingQueue<Runnable>(10)); |
413 |
|
shouldThrow(); |
414 |
< |
} |
416 |
< |
catch (IllegalArgumentException success) {} |
414 |
> |
} catch (IllegalArgumentException success) {} |
415 |
|
} |
416 |
|
|
417 |
|
/** |
421 |
|
try { |
422 |
|
new ThreadPoolExecutor(1,0,LONG_DELAY_MS, MILLISECONDS, new ArrayBlockingQueue<Runnable>(10)); |
423 |
|
shouldThrow(); |
424 |
< |
} |
427 |
< |
catch (IllegalArgumentException success) {} |
424 |
> |
} catch (IllegalArgumentException success) {} |
425 |
|
} |
426 |
|
|
427 |
|
/** |
431 |
|
try { |
432 |
|
new ThreadPoolExecutor(1,2,-1L,MILLISECONDS, new ArrayBlockingQueue<Runnable>(10)); |
433 |
|
shouldThrow(); |
434 |
< |
} |
438 |
< |
catch (IllegalArgumentException success) {} |
434 |
> |
} catch (IllegalArgumentException success) {} |
435 |
|
} |
436 |
|
|
437 |
|
/** |
441 |
|
try { |
442 |
|
new ThreadPoolExecutor(2,1,LONG_DELAY_MS, MILLISECONDS, new ArrayBlockingQueue<Runnable>(10)); |
443 |
|
shouldThrow(); |
444 |
< |
} |
449 |
< |
catch (IllegalArgumentException success) {} |
444 |
> |
} catch (IllegalArgumentException success) {} |
445 |
|
} |
446 |
|
|
447 |
|
/** |
451 |
|
try { |
452 |
|
new ThreadPoolExecutor(1,2,LONG_DELAY_MS, MILLISECONDS,null); |
453 |
|
shouldThrow(); |
454 |
< |
} |
460 |
< |
catch (NullPointerException success) {} |
454 |
> |
} catch (NullPointerException success) {} |
455 |
|
} |
456 |
|
|
457 |
|
|
463 |
|
try { |
464 |
|
new ThreadPoolExecutor(-1,1,LONG_DELAY_MS, MILLISECONDS, new ArrayBlockingQueue<Runnable>(10),new SimpleThreadFactory()); |
465 |
|
shouldThrow(); |
466 |
< |
} |
473 |
< |
catch (IllegalArgumentException success) {} |
466 |
> |
} catch (IllegalArgumentException success) {} |
467 |
|
} |
468 |
|
|
469 |
|
/** |
473 |
|
try { |
474 |
|
new ThreadPoolExecutor(1,-1,LONG_DELAY_MS, MILLISECONDS, new ArrayBlockingQueue<Runnable>(10),new SimpleThreadFactory()); |
475 |
|
shouldThrow(); |
476 |
< |
} |
484 |
< |
catch (IllegalArgumentException success) {} |
476 |
> |
} catch (IllegalArgumentException success) {} |
477 |
|
} |
478 |
|
|
479 |
|
/** |
483 |
|
try { |
484 |
|
new ThreadPoolExecutor(1,0,LONG_DELAY_MS, MILLISECONDS, new ArrayBlockingQueue<Runnable>(10),new SimpleThreadFactory()); |
485 |
|
shouldThrow(); |
486 |
< |
} |
495 |
< |
catch (IllegalArgumentException success) {} |
486 |
> |
} catch (IllegalArgumentException success) {} |
487 |
|
} |
488 |
|
|
489 |
|
/** |
493 |
|
try { |
494 |
|
new ThreadPoolExecutor(1,2,-1L,MILLISECONDS, new ArrayBlockingQueue<Runnable>(10),new SimpleThreadFactory()); |
495 |
|
shouldThrow(); |
496 |
< |
} |
506 |
< |
catch (IllegalArgumentException success) {} |
496 |
> |
} catch (IllegalArgumentException success) {} |
497 |
|
} |
498 |
|
|
499 |
|
/** |
503 |
|
try { |
504 |
|
new ThreadPoolExecutor(2,1,LONG_DELAY_MS, MILLISECONDS, new ArrayBlockingQueue<Runnable>(10),new SimpleThreadFactory()); |
505 |
|
shouldThrow(); |
506 |
< |
} |
517 |
< |
catch (IllegalArgumentException success) {} |
506 |
> |
} catch (IllegalArgumentException success) {} |
507 |
|
} |
508 |
|
|
509 |
|
/** |
513 |
|
try { |
514 |
|
new ThreadPoolExecutor(1,2,LONG_DELAY_MS, MILLISECONDS,null,new SimpleThreadFactory()); |
515 |
|
shouldThrow(); |
516 |
< |
} |
528 |
< |
catch (NullPointerException success) {} |
516 |
> |
} catch (NullPointerException success) {} |
517 |
|
} |
518 |
|
|
519 |
|
/** |
524 |
|
ThreadFactory f = null; |
525 |
|
new ThreadPoolExecutor(1,2,LONG_DELAY_MS, MILLISECONDS,new ArrayBlockingQueue<Runnable>(10),f); |
526 |
|
shouldThrow(); |
527 |
< |
} |
540 |
< |
catch (NullPointerException success) {} |
527 |
> |
} catch (NullPointerException success) {} |
528 |
|
} |
529 |
|
|
530 |
|
|
535 |
|
try { |
536 |
|
new ThreadPoolExecutor(-1,1,LONG_DELAY_MS, MILLISECONDS, new ArrayBlockingQueue<Runnable>(10),new NoOpREHandler()); |
537 |
|
shouldThrow(); |
538 |
< |
} |
552 |
< |
catch (IllegalArgumentException success) {} |
538 |
> |
} catch (IllegalArgumentException success) {} |
539 |
|
} |
540 |
|
|
541 |
|
/** |
545 |
|
try { |
546 |
|
new ThreadPoolExecutor(1,-1,LONG_DELAY_MS, MILLISECONDS, new ArrayBlockingQueue<Runnable>(10),new NoOpREHandler()); |
547 |
|
shouldThrow(); |
548 |
< |
} |
563 |
< |
catch (IllegalArgumentException success) {} |
548 |
> |
} catch (IllegalArgumentException success) {} |
549 |
|
} |
550 |
|
|
551 |
|
/** |
555 |
|
try { |
556 |
|
new ThreadPoolExecutor(1,0,LONG_DELAY_MS, MILLISECONDS, new ArrayBlockingQueue<Runnable>(10),new NoOpREHandler()); |
557 |
|
shouldThrow(); |
558 |
< |
} |
574 |
< |
catch (IllegalArgumentException success) {} |
558 |
> |
} catch (IllegalArgumentException success) {} |
559 |
|
} |
560 |
|
|
561 |
|
/** |
565 |
|
try { |
566 |
|
new ThreadPoolExecutor(1,2,-1L,MILLISECONDS, new ArrayBlockingQueue<Runnable>(10),new NoOpREHandler()); |
567 |
|
shouldThrow(); |
568 |
< |
} |
585 |
< |
catch (IllegalArgumentException success) {} |
568 |
> |
} catch (IllegalArgumentException success) {} |
569 |
|
} |
570 |
|
|
571 |
|
/** |
575 |
|
try { |
576 |
|
new ThreadPoolExecutor(2,1,LONG_DELAY_MS, MILLISECONDS, new ArrayBlockingQueue<Runnable>(10),new NoOpREHandler()); |
577 |
|
shouldThrow(); |
578 |
< |
} |
596 |
< |
catch (IllegalArgumentException success) {} |
578 |
> |
} catch (IllegalArgumentException success) {} |
579 |
|
} |
580 |
|
|
581 |
|
/** |
585 |
|
try { |
586 |
|
new ThreadPoolExecutor(1,2,LONG_DELAY_MS, MILLISECONDS,null,new NoOpREHandler()); |
587 |
|
shouldThrow(); |
588 |
< |
} |
607 |
< |
catch (NullPointerException success) {} |
588 |
> |
} catch (NullPointerException success) {} |
589 |
|
} |
590 |
|
|
591 |
|
/** |
596 |
|
RejectedExecutionHandler r = null; |
597 |
|
new ThreadPoolExecutor(1,2,LONG_DELAY_MS, MILLISECONDS,new ArrayBlockingQueue<Runnable>(10),r); |
598 |
|
shouldThrow(); |
599 |
< |
} |
619 |
< |
catch (NullPointerException success) {} |
599 |
> |
} catch (NullPointerException success) {} |
600 |
|
} |
601 |
|
|
602 |
|
|
607 |
|
try { |
608 |
|
new ThreadPoolExecutor(-1,1,LONG_DELAY_MS, MILLISECONDS, new ArrayBlockingQueue<Runnable>(10),new SimpleThreadFactory(),new NoOpREHandler()); |
609 |
|
shouldThrow(); |
610 |
< |
} |
631 |
< |
catch (IllegalArgumentException success) {} |
610 |
> |
} catch (IllegalArgumentException success) {} |
611 |
|
} |
612 |
|
|
613 |
|
/** |
617 |
|
try { |
618 |
|
new ThreadPoolExecutor(1,-1,LONG_DELAY_MS, MILLISECONDS, new ArrayBlockingQueue<Runnable>(10),new SimpleThreadFactory(),new NoOpREHandler()); |
619 |
|
shouldThrow(); |
620 |
< |
} |
642 |
< |
catch (IllegalArgumentException success) {} |
620 |
> |
} catch (IllegalArgumentException success) {} |
621 |
|
} |
622 |
|
|
623 |
|
/** |
627 |
|
try { |
628 |
|
new ThreadPoolExecutor(1,0,LONG_DELAY_MS, MILLISECONDS, new ArrayBlockingQueue<Runnable>(10),new SimpleThreadFactory(),new NoOpREHandler()); |
629 |
|
shouldThrow(); |
630 |
< |
} |
653 |
< |
catch (IllegalArgumentException success) {} |
630 |
> |
} catch (IllegalArgumentException success) {} |
631 |
|
} |
632 |
|
|
633 |
|
/** |
637 |
|
try { |
638 |
|
new ThreadPoolExecutor(1,2,-1L,MILLISECONDS, new ArrayBlockingQueue<Runnable>(10),new SimpleThreadFactory(),new NoOpREHandler()); |
639 |
|
shouldThrow(); |
640 |
< |
} |
664 |
< |
catch (IllegalArgumentException success) {} |
640 |
> |
} catch (IllegalArgumentException success) {} |
641 |
|
} |
642 |
|
|
643 |
|
/** |
647 |
|
try { |
648 |
|
new ThreadPoolExecutor(2,1,LONG_DELAY_MS, MILLISECONDS, new ArrayBlockingQueue<Runnable>(10),new SimpleThreadFactory(),new NoOpREHandler()); |
649 |
|
shouldThrow(); |
650 |
< |
} |
675 |
< |
catch (IllegalArgumentException success) {} |
650 |
> |
} catch (IllegalArgumentException success) {} |
651 |
|
} |
652 |
|
|
653 |
|
/** |
657 |
|
try { |
658 |
|
new ThreadPoolExecutor(1,2,LONG_DELAY_MS, MILLISECONDS,null,new SimpleThreadFactory(),new NoOpREHandler()); |
659 |
|
shouldThrow(); |
660 |
< |
} |
686 |
< |
catch (NullPointerException success) {} |
660 |
> |
} catch (NullPointerException success) {} |
661 |
|
} |
662 |
|
|
663 |
|
/** |
668 |
|
RejectedExecutionHandler r = null; |
669 |
|
new ThreadPoolExecutor(1,2,LONG_DELAY_MS, MILLISECONDS,new ArrayBlockingQueue<Runnable>(10),new SimpleThreadFactory(),r); |
670 |
|
shouldThrow(); |
671 |
< |
} |
698 |
< |
catch (NullPointerException success) {} |
671 |
> |
} catch (NullPointerException success) {} |
672 |
|
} |
673 |
|
|
674 |
|
/** |
679 |
|
ThreadFactory f = null; |
680 |
|
new ThreadPoolExecutor(1,2,LONG_DELAY_MS, MILLISECONDS,new ArrayBlockingQueue<Runnable>(10),f,new NoOpREHandler()); |
681 |
|
shouldThrow(); |
682 |
< |
} |
710 |
< |
catch (NullPointerException success) {} |
682 |
> |
} catch (NullPointerException success) {} |
683 |
|
} |
684 |
|
|
685 |
|
|
850 |
|
* execute (null) throws NPE |
851 |
|
*/ |
852 |
|
public void testExecuteNull() { |
853 |
< |
ThreadPoolExecutor tpe = null; |
853 |
> |
ThreadPoolExecutor tpe = new ThreadPoolExecutor(1,2,LONG_DELAY_MS, MILLISECONDS,new ArrayBlockingQueue<Runnable>(10)); |
854 |
|
try { |
883 |
– |
tpe = new ThreadPoolExecutor(1,2,LONG_DELAY_MS, MILLISECONDS,new ArrayBlockingQueue<Runnable>(10)); |
855 |
|
tpe.execute(null); |
856 |
|
shouldThrow(); |
857 |
|
} catch (NullPointerException success) {} |