ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/jsr166/jsr166/src/test/tck/ThreadPoolExecutorTest.java
(Generate patch)

Comparing jsr166/src/test/tck/ThreadPoolExecutorTest.java (file contents):
Revision 1.51 by jsr166, Sat Apr 25 04:55:31 2015 UTC vs.
Revision 1.52 by jsr166, Fri May 15 17:07:27 2015 UTC

# Line 8 | Line 8
8  
9   import static java.util.concurrent.TimeUnit.MILLISECONDS;
10   import static java.util.concurrent.TimeUnit.NANOSECONDS;
11 + import static java.util.concurrent.TimeUnit.SECONDS;
12  
13   import java.util.ArrayList;
14   import java.util.List;
# Line 650 | Line 651 | public class ThreadPoolExecutorTest exte
651       */
652      public void testConstructor1() {
653          try {
654 <            new ThreadPoolExecutor(-1, 1,
654 <                                   LONG_DELAY_MS, MILLISECONDS,
654 >            new ThreadPoolExecutor(-1, 1, 1L, SECONDS,
655                                     new ArrayBlockingQueue<Runnable>(10));
656              shouldThrow();
657          } catch (IllegalArgumentException success) {}
# Line 662 | Line 662 | public class ThreadPoolExecutorTest exte
662       */
663      public void testConstructor2() {
664          try {
665 <            new ThreadPoolExecutor(1, -1,
666 <                                   LONG_DELAY_MS, MILLISECONDS,
665 >            new ThreadPoolExecutor(1, -1, 1L, SECONDS,
666                                     new ArrayBlockingQueue<Runnable>(10));
667              shouldThrow();
668          } catch (IllegalArgumentException success) {}
# Line 674 | Line 673 | public class ThreadPoolExecutorTest exte
673       */
674      public void testConstructor3() {
675          try {
676 <            new ThreadPoolExecutor(1, 0,
678 <                                   LONG_DELAY_MS, MILLISECONDS,
676 >            new ThreadPoolExecutor(1, 0, 1L, SECONDS,
677                                     new ArrayBlockingQueue<Runnable>(10));
678              shouldThrow();
679          } catch (IllegalArgumentException success) {}
# Line 686 | Line 684 | public class ThreadPoolExecutorTest exte
684       */
685      public void testConstructor4() {
686          try {
687 <            new ThreadPoolExecutor(1, 2,
690 <                                   -1L, MILLISECONDS,
687 >            new ThreadPoolExecutor(1, 2, -1L, SECONDS,
688                                     new ArrayBlockingQueue<Runnable>(10));
689              shouldThrow();
690          } catch (IllegalArgumentException success) {}
# Line 698 | Line 695 | public class ThreadPoolExecutorTest exte
695       */
696      public void testConstructor5() {
697          try {
698 <            new ThreadPoolExecutor(2, 1,
702 <                                   LONG_DELAY_MS, MILLISECONDS,
698 >            new ThreadPoolExecutor(2, 1, 1L, SECONDS,
699                                     new ArrayBlockingQueue<Runnable>(10));
700              shouldThrow();
701          } catch (IllegalArgumentException success) {}
# Line 710 | Line 706 | public class ThreadPoolExecutorTest exte
706       */
707      public void testConstructorNullPointerException() {
708          try {
709 <            new ThreadPoolExecutor(1, 2,
714 <                                   LONG_DELAY_MS, MILLISECONDS,
709 >            new ThreadPoolExecutor(1, 2, 1L, SECONDS,
710                                     (BlockingQueue) null);
711              shouldThrow();
712          } catch (NullPointerException success) {}
# Line 722 | Line 717 | public class ThreadPoolExecutorTest exte
717       */
718      public void testConstructor6() {
719          try {
720 <            new ThreadPoolExecutor(-1, 1,
726 <                                   LONG_DELAY_MS, MILLISECONDS,
720 >            new ThreadPoolExecutor(-1, 1, 1L, SECONDS,
721                                     new ArrayBlockingQueue<Runnable>(10),
722                                     new SimpleThreadFactory());
723              shouldThrow();
# Line 735 | Line 729 | public class ThreadPoolExecutorTest exte
729       */
730      public void testConstructor7() {
731          try {
732 <            new ThreadPoolExecutor(1, -1,
739 <                                   LONG_DELAY_MS, MILLISECONDS,
732 >            new ThreadPoolExecutor(1, -1, 1L, SECONDS,
733                                     new ArrayBlockingQueue<Runnable>(10),
734                                     new SimpleThreadFactory());
735              shouldThrow();
# Line 748 | Line 741 | public class ThreadPoolExecutorTest exte
741       */
742      public void testConstructor8() {
743          try {
744 <            new ThreadPoolExecutor(1, 0,
752 <                                   LONG_DELAY_MS, MILLISECONDS,
744 >            new ThreadPoolExecutor(1, 0, 1L, SECONDS,
745                                     new ArrayBlockingQueue<Runnable>(10),
746                                     new SimpleThreadFactory());
747              shouldThrow();
# Line 761 | Line 753 | public class ThreadPoolExecutorTest exte
753       */
754      public void testConstructor9() {
755          try {
756 <            new ThreadPoolExecutor(1, 2,
765 <                                   -1L, MILLISECONDS,
756 >            new ThreadPoolExecutor(1, 2, -1L, SECONDS,
757                                     new ArrayBlockingQueue<Runnable>(10),
758                                     new SimpleThreadFactory());
759              shouldThrow();
# Line 774 | Line 765 | public class ThreadPoolExecutorTest exte
765       */
766      public void testConstructor10() {
767          try {
768 <            new ThreadPoolExecutor(2, 1,
778 <                                   LONG_DELAY_MS, MILLISECONDS,
768 >            new ThreadPoolExecutor(2, 1, 1L, SECONDS,
769                                     new ArrayBlockingQueue<Runnable>(10),
770                                     new SimpleThreadFactory());
771              shouldThrow();
# Line 787 | Line 777 | public class ThreadPoolExecutorTest exte
777       */
778      public void testConstructorNullPointerException2() {
779          try {
780 <            new ThreadPoolExecutor(1, 2,
791 <                                   LONG_DELAY_MS, MILLISECONDS,
780 >            new ThreadPoolExecutor(1, 2, 1L, SECONDS,
781                                     (BlockingQueue) null,
782                                     new SimpleThreadFactory());
783              shouldThrow();
# Line 800 | Line 789 | public class ThreadPoolExecutorTest exte
789       */
790      public void testConstructorNullPointerException3() {
791          try {
792 <            new ThreadPoolExecutor(1, 2,
804 <                                   LONG_DELAY_MS, MILLISECONDS,
792 >            new ThreadPoolExecutor(1, 2, 1L, SECONDS,
793                                     new ArrayBlockingQueue<Runnable>(10),
794                                     (ThreadFactory) null);
795              shouldThrow();
# Line 813 | Line 801 | public class ThreadPoolExecutorTest exte
801       */
802      public void testConstructor11() {
803          try {
804 <            new ThreadPoolExecutor(-1, 1,
817 <                                   LONG_DELAY_MS, MILLISECONDS,
804 >            new ThreadPoolExecutor(-1, 1, 1L, SECONDS,
805                                     new ArrayBlockingQueue<Runnable>(10),
806                                     new NoOpREHandler());
807              shouldThrow();
# Line 826 | Line 813 | public class ThreadPoolExecutorTest exte
813       */
814      public void testConstructor12() {
815          try {
816 <            new ThreadPoolExecutor(1, -1,
830 <                                   LONG_DELAY_MS, MILLISECONDS,
816 >            new ThreadPoolExecutor(1, -1, 1L, SECONDS,
817                                     new ArrayBlockingQueue<Runnable>(10),
818                                     new NoOpREHandler());
819              shouldThrow();
# Line 839 | Line 825 | public class ThreadPoolExecutorTest exte
825       */
826      public void testConstructor13() {
827          try {
828 <            new ThreadPoolExecutor(1, 0,
843 <                                   LONG_DELAY_MS, MILLISECONDS,
828 >            new ThreadPoolExecutor(1, 0, 1L, SECONDS,
829                                     new ArrayBlockingQueue<Runnable>(10),
830                                     new NoOpREHandler());
831              shouldThrow();
# Line 852 | Line 837 | public class ThreadPoolExecutorTest exte
837       */
838      public void testConstructor14() {
839          try {
840 <            new ThreadPoolExecutor(1, 2,
856 <                                   -1L, MILLISECONDS,
840 >            new ThreadPoolExecutor(1, 2, -1L, SECONDS,
841                                     new ArrayBlockingQueue<Runnable>(10),
842                                     new NoOpREHandler());
843              shouldThrow();
# Line 865 | Line 849 | public class ThreadPoolExecutorTest exte
849       */
850      public void testConstructor15() {
851          try {
852 <            new ThreadPoolExecutor(2, 1,
869 <                                   LONG_DELAY_MS, MILLISECONDS,
852 >            new ThreadPoolExecutor(2, 1, 1L, SECONDS,
853                                     new ArrayBlockingQueue<Runnable>(10),
854                                     new NoOpREHandler());
855              shouldThrow();
# Line 878 | Line 861 | public class ThreadPoolExecutorTest exte
861       */
862      public void testConstructorNullPointerException4() {
863          try {
864 <            new ThreadPoolExecutor(1, 2,
882 <                                   LONG_DELAY_MS, MILLISECONDS,
864 >            new ThreadPoolExecutor(1, 2, 1L, SECONDS,
865                                     (BlockingQueue) null,
866                                     new NoOpREHandler());
867              shouldThrow();
# Line 891 | Line 873 | public class ThreadPoolExecutorTest exte
873       */
874      public void testConstructorNullPointerException5() {
875          try {
876 <            new ThreadPoolExecutor(1, 2,
895 <                                   LONG_DELAY_MS, MILLISECONDS,
876 >            new ThreadPoolExecutor(1, 2, 1L, SECONDS,
877                                     new ArrayBlockingQueue<Runnable>(10),
878                                     (RejectedExecutionHandler) null);
879              shouldThrow();
# Line 904 | Line 885 | public class ThreadPoolExecutorTest exte
885       */
886      public void testConstructor16() {
887          try {
888 <            new ThreadPoolExecutor(-1, 1,
908 <                                   LONG_DELAY_MS, MILLISECONDS,
888 >            new ThreadPoolExecutor(-1, 1, 1L, SECONDS,
889                                     new ArrayBlockingQueue<Runnable>(10),
890                                     new SimpleThreadFactory(),
891                                     new NoOpREHandler());
# Line 918 | Line 898 | public class ThreadPoolExecutorTest exte
898       */
899      public void testConstructor17() {
900          try {
901 <            new ThreadPoolExecutor(1, -1,
922 <                                   LONG_DELAY_MS, MILLISECONDS,
901 >            new ThreadPoolExecutor(1, -1, 1L, SECONDS,
902                                     new ArrayBlockingQueue<Runnable>(10),
903                                     new SimpleThreadFactory(),
904                                     new NoOpREHandler());
# Line 932 | Line 911 | public class ThreadPoolExecutorTest exte
911       */
912      public void testConstructor18() {
913          try {
914 <            new ThreadPoolExecutor(1, 0,
936 <                                   LONG_DELAY_MS, MILLISECONDS,
914 >            new ThreadPoolExecutor(1, 0, 1L, SECONDS,
915                                     new ArrayBlockingQueue<Runnable>(10),
916                                     new SimpleThreadFactory(),
917                                     new NoOpREHandler());
# Line 946 | Line 924 | public class ThreadPoolExecutorTest exte
924       */
925      public void testConstructor19() {
926          try {
927 <            new ThreadPoolExecutor(1, 2,
950 <                                   -1L, MILLISECONDS,
927 >            new ThreadPoolExecutor(1, 2, -1L, SECONDS,
928                                     new ArrayBlockingQueue<Runnable>(10),
929                                     new SimpleThreadFactory(),
930                                     new NoOpREHandler());
# Line 960 | Line 937 | public class ThreadPoolExecutorTest exte
937       */
938      public void testConstructor20() {
939          try {
940 <            new ThreadPoolExecutor(2, 1,
964 <                                   LONG_DELAY_MS, MILLISECONDS,
940 >            new ThreadPoolExecutor(2, 1, 1L, SECONDS,
941                                     new ArrayBlockingQueue<Runnable>(10),
942                                     new SimpleThreadFactory(),
943                                     new NoOpREHandler());
# Line 974 | Line 950 | public class ThreadPoolExecutorTest exte
950       */
951      public void testConstructorNullPointerException6() {
952          try {
953 <            new ThreadPoolExecutor(1, 2,
978 <                                   LONG_DELAY_MS, MILLISECONDS,
953 >            new ThreadPoolExecutor(1, 2, 1L, SECONDS,
954                                     (BlockingQueue) null,
955                                     new SimpleThreadFactory(),
956                                     new NoOpREHandler());
# Line 988 | Line 963 | public class ThreadPoolExecutorTest exte
963       */
964      public void testConstructorNullPointerException7() {
965          try {
966 <            new ThreadPoolExecutor(1, 2,
992 <                                   LONG_DELAY_MS, MILLISECONDS,
966 >            new ThreadPoolExecutor(1, 2, 1L, SECONDS,
967                                     new ArrayBlockingQueue<Runnable>(10),
968                                     new SimpleThreadFactory(),
969                                     (RejectedExecutionHandler) null);
# Line 1002 | Line 976 | public class ThreadPoolExecutorTest exte
976       */
977      public void testConstructorNullPointerException8() {
978          try {
979 <            new ThreadPoolExecutor(1, 2,
1006 <                                   LONG_DELAY_MS, MILLISECONDS,
979 >            new ThreadPoolExecutor(1, 2, 1L, SECONDS,
980                                     new ArrayBlockingQueue<Runnable>(10),
981                                     (ThreadFactory) null,
982                                     new NoOpREHandler());

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines