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

Comparing jsr166/src/test/tck/ExecutorsTest.java (file contents):
Revision 1.46 by jsr166, Sun Oct 4 16:14:48 2015 UTC vs.
Revision 1.49 by jsr166, Mon May 29 22:44:26 2017 UTC

# Line 140 | Line 140 | public class ExecutorsTest extends JSR16
140      }
141  
142      /**
143 <     * A new newFixedThreadPool with null ThreadFactory throws NPE
143 >     * A new newFixedThreadPool with null ThreadFactory throws
144 >     * NullPointerException
145       */
146      public void testNewFixedThreadPool3() {
147          try {
# Line 150 | Line 151 | public class ExecutorsTest extends JSR16
151      }
152  
153      /**
154 <     * A new newFixedThreadPool with 0 threads throws IAE
154 >     * A new newFixedThreadPool with 0 threads throws IllegalArgumentException
155       */
156      public void testNewFixedThreadPool4() {
157          try {
# Line 281 | Line 282 | public class ExecutorsTest extends JSR16
282                  delay(LONG_DELAY_MS);
283              }};
284  
285 <        List<Thread> threads = new ArrayList<Thread>();
285 >        List<Thread> threads = new ArrayList<>();
286          for (final ExecutorService executor : executors) {
287              threads.add(newStartedThread(new CheckedRunnable() {
288                  public void realRun() {
# Line 306 | Line 307 | public class ExecutorsTest extends JSR16
307              public void realRun() {
308                  try {
309                      Thread current = Thread.currentThread();
310 <                    assertTrue(!current.isDaemon());
310 >                    assertFalse(current.isDaemon());
311                      assertTrue(current.getPriority() <= Thread.NORM_PRIORITY);
311                    ThreadGroup g = current.getThreadGroup();
312                      SecurityManager s = System.getSecurityManager();
313 <                    if (s != null)
314 <                        assertTrue(g == s.getThreadGroup());
315 <                    else
316 <                        assertTrue(g == egroup);
317 <                    String name = current.getName();
318 <                    assertTrue(name.endsWith("thread-1"));
313 >                    assertSame(current.getThreadGroup(),
314 >                               (s == null) ? egroup : s.getThreadGroup());
315 >                    assertTrue(current.getName().endsWith("thread-1"));
316                  } catch (SecurityException ok) {
317                      // Also pass if not allowed to change setting
318                  }
# Line 343 | Line 340 | public class ExecutorsTest extends JSR16
340                  Runnable r = new CheckedRunnable() {
341                      public void realRun() {
342                          Thread current = Thread.currentThread();
343 <                        assertTrue(!current.isDaemon());
343 >                        assertFalse(current.isDaemon());
344                          assertTrue(current.getPriority() <= Thread.NORM_PRIORITY);
348                        ThreadGroup g = current.getThreadGroup();
345                          SecurityManager s = System.getSecurityManager();
346 <                        if (s != null)
347 <                            assertTrue(g == s.getThreadGroup());
348 <                        else
353 <                            assertTrue(g == egroup);
354 <                        String name = current.getName();
355 <                        assertTrue(name.endsWith("thread-1"));
346 >                        assertSame(current.getThreadGroup(),
347 >                                   (s == null) ? egroup : s.getThreadGroup());
348 >                        assertTrue(current.getName().endsWith("thread-1"));
349                          assertSame(thisccl, current.getContextClassLoader());
350                          assertEquals(thisacc, AccessController.getContext());
351                          done.countDown();

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines