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

Comparing jsr166/src/test/tck/ConcurrentLinkedQueueTest.java (file contents):
Revision 1.8 by jsr166, Mon Nov 2 20:28:31 2009 UTC vs.
Revision 1.11 by jsr166, Tue Nov 17 12:16:30 2009 UTC

# Line 28 | Line 28 | public class ConcurrentLinkedQueueTest e
28      private ConcurrentLinkedQueue populatedQueue(int n) {
29          ConcurrentLinkedQueue q = new ConcurrentLinkedQueue();
30          assertTrue(q.isEmpty());
31 <        for(int i = 0; i < n; ++i)
31 >        for (int i = 0; i < n; ++i)
32              assertTrue(q.offer(new Integer(i)));
33          assertFalse(q.isEmpty());
34          assertEquals(n, q.size());
# Line 288 | Line 288 | public class ConcurrentLinkedQueueTest e
288          try {
289              q.remove();
290              shouldThrow();
291 <        } catch (NoSuchElementException success){
291 >        } catch (NoSuchElementException success) {
292          }
293      }
294  
# Line 389 | Line 389 | public class ConcurrentLinkedQueueTest e
389          ConcurrentLinkedQueue q = populatedQueue(SIZE);
390          Object[] o = q.toArray();
391          Arrays.sort(o);
392 <        for(int i = 0; i < o.length; i++)
392 >        for (int i = 0; i < o.length; i++)
393              assertEquals(o[i], q.poll());
394      }
395  
# Line 401 | Line 401 | public class ConcurrentLinkedQueueTest e
401          Integer[] ints = new Integer[SIZE];
402          ints = (Integer[])q.toArray(ints);
403          Arrays.sort(ints);
404 <        for(int i = 0; i < ints.length; i++)
404 >        for (int i = 0; i < ints.length; i++)
405              assertEquals(ints[i], q.poll());
406      }
407  
# Line 413 | Line 413 | public class ConcurrentLinkedQueueTest e
413              ConcurrentLinkedQueue q = populatedQueue(SIZE);
414              Object o[] = q.toArray(null);
415              shouldThrow();
416 <        } catch(NullPointerException success){}
416 >        } catch (NullPointerException success) {}
417      }
418  
419      /**
420 <     * toArray with incompatible array type throws CCE
420 >     * toArray with incompatible array type throws ArrayStoreException
421       */
422      public void testToArray1_BadArg() {
423          try {
424              ConcurrentLinkedQueue q = populatedQueue(SIZE);
425              Object o[] = q.toArray(new String[10] );
426              shouldThrow();
427 <        } catch(ArrayStoreException  success){}
427 >        } catch (ArrayStoreException success) {}
428      }
429  
430      /**
# Line 434 | Line 434 | public class ConcurrentLinkedQueueTest e
434          ConcurrentLinkedQueue q = populatedQueue(SIZE);
435          int i = 0;
436          Iterator it = q.iterator();
437 <        while(it.hasNext()) {
437 >        while (it.hasNext()) {
438              assertTrue(q.contains(it.next()));
439              ++i;
440          }
# Line 527 | Line 527 | public class ConcurrentLinkedQueueTest e
527              assertEquals(q.size(), r.size());
528              while (!q.isEmpty())
529                  assertEquals(q.remove(), r.remove());
530 <        } catch(Exception e){
530 >        } catch (Exception e) {
531              unexpectedException();
532          }
533      }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines