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

Comparing jsr166/src/test/tck/LinkedBlockingDequeTest.java (file contents):
Revision 1.4 by jsr166, Mon Nov 2 20:28:31 2009 UTC vs.
Revision 1.5 by jsr166, Mon Nov 16 04:57:10 2009 UTC

# Line 25 | Line 25 | public class LinkedBlockingDequeTest ext
25      private LinkedBlockingDeque populatedDeque(int n) {
26          LinkedBlockingDeque q = new LinkedBlockingDeque(n);
27          assertTrue(q.isEmpty());
28 <        for(int i = 0; i < n; i++)
28 >        for (int i = 0; i < n; i++)
29              assertTrue(q.offer(new Integer(i)));
30          assertFalse(q.isEmpty());
31          assertEquals(0, q.remainingCapacity());
# Line 1509 | Line 1509 | public class LinkedBlockingDequeTest ext
1509          LinkedBlockingDeque q = populatedDeque(SIZE);
1510          Object[] o = q.toArray();
1511          try {
1512 <        for(int i = 0; i < o.length; i++)
1512 >        for (int i = 0; i < o.length; i++)
1513              assertEquals(o[i], q.take());
1514          } catch (InterruptedException e){
1515              unexpectedException();
# Line 1524 | Line 1524 | public class LinkedBlockingDequeTest ext
1524          Integer[] ints = new Integer[SIZE];
1525          ints = (Integer[])q.toArray(ints);
1526          try {
1527 <            for(int i = 0; i < ints.length; i++)
1527 >            for (int i = 0; i < ints.length; i++)
1528                  assertEquals(ints[i], q.take());
1529          } catch (InterruptedException e){
1530              unexpectedException();
# Line 1539 | Line 1539 | public class LinkedBlockingDequeTest ext
1539              LinkedBlockingDeque q = populatedDeque(SIZE);
1540              Object o[] = q.toArray(null);
1541              shouldThrow();
1542 <        } catch(NullPointerException success){}
1542 >        } catch (NullPointerException success){}
1543      }
1544  
1545      /**
# Line 1550 | Line 1550 | public class LinkedBlockingDequeTest ext
1550              LinkedBlockingDeque q = populatedDeque(SIZE);
1551              Object o[] = q.toArray(new String[10] );
1552              shouldThrow();
1553 <        } catch(ArrayStoreException  success){}
1553 >        } catch (ArrayStoreException  success){}
1554      }
1555  
1556  
# Line 1561 | Line 1561 | public class LinkedBlockingDequeTest ext
1561          LinkedBlockingDeque q = populatedDeque(SIZE);
1562          Iterator it = q.iterator();
1563          try {
1564 <            while(it.hasNext()){
1564 >            while (it.hasNext()){
1565                  assertEquals(it.next(), q.take());
1566              }
1567          } catch (InterruptedException e){
# Line 1634 | Line 1634 | public class LinkedBlockingDequeTest ext
1634          LinkedBlockingDeque q = populatedDeque(SIZE);
1635          int i = 0;
1636          Iterator it = q.descendingIterator();
1637 <        while(it.hasNext()) {
1637 >        while (it.hasNext()) {
1638              assertTrue(q.contains(it.next()));
1639              ++i;
1640          }
# Line 1642 | Line 1642 | public class LinkedBlockingDequeTest ext
1642          assertFalse(it.hasNext());
1643          try {
1644              it.next();
1645 <        } catch(NoSuchElementException success) {
1645 >        } catch (NoSuchElementException success) {
1646          }
1647      }
1648  
# Line 1791 | Line 1791 | public class LinkedBlockingDequeTest ext
1791              assertEquals(q.size(), r.size());
1792              while (!q.isEmpty())
1793                  assertEquals(q.remove(), r.remove());
1794 <        } catch(Exception e){
1794 >        } catch (Exception e){
1795              unexpectedException();
1796          }
1797      }
# Line 1804 | Line 1804 | public class LinkedBlockingDequeTest ext
1804          try {
1805              q.drainTo(null);
1806              shouldThrow();
1807 <        } catch(NullPointerException success) {
1807 >        } catch (NullPointerException success) {
1808          }
1809      }
1810  
# Line 1816 | Line 1816 | public class LinkedBlockingDequeTest ext
1816          try {
1817              q.drainTo(q);
1818              shouldThrow();
1819 <        } catch(IllegalArgumentException success) {
1819 >        } catch (IllegalArgumentException success) {
1820          }
1821      }
1822  
# Line 1867 | Line 1867 | public class LinkedBlockingDequeTest ext
1867                  assertEquals(l.get(i), new Integer(i));
1868              t.join();
1869              assertTrue(q.size() + l.size() >= SIZE);
1870 <        } catch(Exception e){
1870 >        } catch (Exception e){
1871              unexpectedException();
1872          }
1873      }
# Line 1880 | Line 1880 | public class LinkedBlockingDequeTest ext
1880          try {
1881              q.drainTo(null, 0);
1882              shouldThrow();
1883 <        } catch(NullPointerException success) {
1883 >        } catch (NullPointerException success) {
1884          }
1885      }
1886  
# Line 1892 | Line 1892 | public class LinkedBlockingDequeTest ext
1892          try {
1893              q.drainTo(q, 0);
1894              shouldThrow();
1895 <        } catch(IllegalArgumentException success) {
1895 >        } catch (IllegalArgumentException success) {
1896          }
1897      }
1898  
# Line 1902 | Line 1902 | public class LinkedBlockingDequeTest ext
1902      public void testDrainToN() {
1903          LinkedBlockingDeque q = new LinkedBlockingDeque();
1904          for (int i = 0; i < SIZE + 2; ++i) {
1905 <            for(int j = 0; j < SIZE; j++)
1905 >            for (int j = 0; j < SIZE; j++)
1906                  assertTrue(q.offer(new Integer(j)));
1907              ArrayList l = new ArrayList();
1908              q.drainTo(l, i);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines