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

Comparing jsr166/src/test/tck/ScheduledExecutorTest.java (file contents):
Revision 1.82 by jsr166, Thu Sep 15 17:31:16 2016 UTC vs.
Revision 1.83 by jsr166, Wed Jan 4 06:09:58 2017 UTC

# Line 888 | Line 888 | public class ScheduledExecutorTest exten
888          CountDownLatch latch = new CountDownLatch(1);
889          final ExecutorService e = new ScheduledThreadPoolExecutor(2);
890          try (PoolCleaner cleaner = cleaner(e)) {
891 <            List<Callable<String>> l = new ArrayList<Callable<String>>();
891 >            List<Callable<String>> l = new ArrayList<>();
892              l.add(latchAwaitingStringTask(latch));
893              l.add(null);
894              try {
# Line 905 | Line 905 | public class ScheduledExecutorTest exten
905      public void testInvokeAny4() throws Exception {
906          final ExecutorService e = new ScheduledThreadPoolExecutor(2);
907          try (PoolCleaner cleaner = cleaner(e)) {
908 <            List<Callable<String>> l = new ArrayList<Callable<String>>();
908 >            List<Callable<String>> l = new ArrayList<>();
909              l.add(new NPETask());
910              try {
911                  e.invokeAny(l);
# Line 922 | Line 922 | public class ScheduledExecutorTest exten
922      public void testInvokeAny5() throws Exception {
923          final ExecutorService e = new ScheduledThreadPoolExecutor(2);
924          try (PoolCleaner cleaner = cleaner(e)) {
925 <            List<Callable<String>> l = new ArrayList<Callable<String>>();
925 >            List<Callable<String>> l = new ArrayList<>();
926              l.add(new StringTask());
927              l.add(new StringTask());
928              String result = e.invokeAny(l);
# Line 960 | Line 960 | public class ScheduledExecutorTest exten
960      public void testInvokeAll3() throws Exception {
961          final ExecutorService e = new ScheduledThreadPoolExecutor(2);
962          try (PoolCleaner cleaner = cleaner(e)) {
963 <            List<Callable<String>> l = new ArrayList<Callable<String>>();
963 >            List<Callable<String>> l = new ArrayList<>();
964              l.add(new StringTask());
965              l.add(null);
966              try {
# Line 976 | Line 976 | public class ScheduledExecutorTest exten
976      public void testInvokeAll4() throws Exception {
977          final ExecutorService e = new ScheduledThreadPoolExecutor(2);
978          try (PoolCleaner cleaner = cleaner(e)) {
979 <            List<Callable<String>> l = new ArrayList<Callable<String>>();
979 >            List<Callable<String>> l = new ArrayList<>();
980              l.add(new NPETask());
981              List<Future<String>> futures = e.invokeAll(l);
982              assertEquals(1, futures.size());
# Line 995 | Line 995 | public class ScheduledExecutorTest exten
995      public void testInvokeAll5() throws Exception {
996          final ExecutorService e = new ScheduledThreadPoolExecutor(2);
997          try (PoolCleaner cleaner = cleaner(e)) {
998 <            List<Callable<String>> l = new ArrayList<Callable<String>>();
998 >            List<Callable<String>> l = new ArrayList<>();
999              l.add(new StringTask());
1000              l.add(new StringTask());
1001              List<Future<String>> futures = e.invokeAll(l);
# Line 1024 | Line 1024 | public class ScheduledExecutorTest exten
1024      public void testTimedInvokeAnyNullTimeUnit() throws Exception {
1025          final ExecutorService e = new ScheduledThreadPoolExecutor(2);
1026          try (PoolCleaner cleaner = cleaner(e)) {
1027 <            List<Callable<String>> l = new ArrayList<Callable<String>>();
1027 >            List<Callable<String>> l = new ArrayList<>();
1028              l.add(new StringTask());
1029              try {
1030                  e.invokeAny(l, MEDIUM_DELAY_MS, null);
# Line 1053 | Line 1053 | public class ScheduledExecutorTest exten
1053          CountDownLatch latch = new CountDownLatch(1);
1054          final ExecutorService e = new ScheduledThreadPoolExecutor(2);
1055          try (PoolCleaner cleaner = cleaner(e)) {
1056 <            List<Callable<String>> l = new ArrayList<Callable<String>>();
1056 >            List<Callable<String>> l = new ArrayList<>();
1057              l.add(latchAwaitingStringTask(latch));
1058              l.add(null);
1059              try {
# Line 1071 | Line 1071 | public class ScheduledExecutorTest exten
1071          final ExecutorService e = new ScheduledThreadPoolExecutor(2);
1072          try (PoolCleaner cleaner = cleaner(e)) {
1073              long startTime = System.nanoTime();
1074 <            List<Callable<String>> l = new ArrayList<Callable<String>>();
1074 >            List<Callable<String>> l = new ArrayList<>();
1075              l.add(new NPETask());
1076              try {
1077                  e.invokeAny(l, LONG_DELAY_MS, MILLISECONDS);
# Line 1090 | Line 1090 | public class ScheduledExecutorTest exten
1090          final ExecutorService e = new ScheduledThreadPoolExecutor(2);
1091          try (PoolCleaner cleaner = cleaner(e)) {
1092              long startTime = System.nanoTime();
1093 <            List<Callable<String>> l = new ArrayList<Callable<String>>();
1093 >            List<Callable<String>> l = new ArrayList<>();
1094              l.add(new StringTask());
1095              l.add(new StringTask());
1096              String result = e.invokeAny(l, LONG_DELAY_MS, MILLISECONDS);
# Line 1118 | Line 1118 | public class ScheduledExecutorTest exten
1118      public void testTimedInvokeAllNullTimeUnit() throws Exception {
1119          final ExecutorService e = new ScheduledThreadPoolExecutor(2);
1120          try (PoolCleaner cleaner = cleaner(e)) {
1121 <            List<Callable<String>> l = new ArrayList<Callable<String>>();
1121 >            List<Callable<String>> l = new ArrayList<>();
1122              l.add(new StringTask());
1123              try {
1124                  e.invokeAll(l, MEDIUM_DELAY_MS, null);
# Line 1145 | Line 1145 | public class ScheduledExecutorTest exten
1145      public void testTimedInvokeAll3() throws Exception {
1146          final ExecutorService e = new ScheduledThreadPoolExecutor(2);
1147          try (PoolCleaner cleaner = cleaner(e)) {
1148 <            List<Callable<String>> l = new ArrayList<Callable<String>>();
1148 >            List<Callable<String>> l = new ArrayList<>();
1149              l.add(new StringTask());
1150              l.add(null);
1151              try {
# Line 1161 | Line 1161 | public class ScheduledExecutorTest exten
1161      public void testTimedInvokeAll4() throws Exception {
1162          final ExecutorService e = new ScheduledThreadPoolExecutor(2);
1163          try (PoolCleaner cleaner = cleaner(e)) {
1164 <            List<Callable<String>> l = new ArrayList<Callable<String>>();
1164 >            List<Callable<String>> l = new ArrayList<>();
1165              l.add(new NPETask());
1166              List<Future<String>> futures =
1167                  e.invokeAll(l, LONG_DELAY_MS, MILLISECONDS);
# Line 1181 | Line 1181 | public class ScheduledExecutorTest exten
1181      public void testTimedInvokeAll5() throws Exception {
1182          final ExecutorService e = new ScheduledThreadPoolExecutor(2);
1183          try (PoolCleaner cleaner = cleaner(e)) {
1184 <            List<Callable<String>> l = new ArrayList<Callable<String>>();
1184 >            List<Callable<String>> l = new ArrayList<>();
1185              l.add(new StringTask());
1186              l.add(new StringTask());
1187              List<Future<String>> futures =

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines