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

Comparing jsr166/src/test/tck/ArrayBlockingQueueTest.java (file contents):
Revision 1.12 by jsr166, Mon Nov 2 20:28:31 2009 UTC vs.
Revision 1.13 by jsr166, Mon Nov 16 04:57:09 2009 UTC

# Line 27 | Line 27 | public class ArrayBlockingQueueTest exte
27      private ArrayBlockingQueue populatedQueue(int n) {
28          ArrayBlockingQueue q = new ArrayBlockingQueue(n);
29          assertTrue(q.isEmpty());
30 <        for(int i = 0; i < n; i++)
30 >        for (int i = 0; i < n; i++)
31              assertTrue(q.offer(new Integer(i)));
32          assertFalse(q.isEmpty());
33          assertEquals(0, q.remainingCapacity());
# Line 711 | Line 711 | public class ArrayBlockingQueueTest exte
711          ArrayBlockingQueue q = populatedQueue(SIZE);
712          Object[] o = q.toArray();
713          try {
714 <        for(int i = 0; i < o.length; i++)
714 >        for (int i = 0; i < o.length; i++)
715              assertEquals(o[i], q.take());
716          } catch (InterruptedException e){
717              unexpectedException();
# Line 726 | Line 726 | public class ArrayBlockingQueueTest exte
726          Integer[] ints = new Integer[SIZE];
727          ints = (Integer[])q.toArray(ints);
728          try {
729 <            for(int i = 0; i < ints.length; i++)
729 >            for (int i = 0; i < ints.length; i++)
730                  assertEquals(ints[i], q.take());
731          } catch (InterruptedException e){
732              unexpectedException();
# Line 741 | Line 741 | public class ArrayBlockingQueueTest exte
741              ArrayBlockingQueue q = populatedQueue(SIZE);
742              Object o[] = q.toArray(null);
743              shouldThrow();
744 <        } catch(NullPointerException success){}
744 >        } catch (NullPointerException success){}
745      }
746  
747      /**
# Line 752 | Line 752 | public class ArrayBlockingQueueTest exte
752              ArrayBlockingQueue q = populatedQueue(SIZE);
753              Object o[] = q.toArray(new String[10] );
754              shouldThrow();
755 <        } catch(ArrayStoreException  success){}
755 >        } catch (ArrayStoreException  success){}
756      }
757  
758  
# Line 763 | Line 763 | public class ArrayBlockingQueueTest exte
763          ArrayBlockingQueue q = populatedQueue(SIZE);
764          Iterator it = q.iterator();
765          try {
766 <            while(it.hasNext()){
766 >            while (it.hasNext()){
767                  assertEquals(it.next(), q.take());
768              }
769          } catch (InterruptedException e){
# Line 931 | Line 931 | public class ArrayBlockingQueueTest exte
931              assertEquals(q.size(), r.size());
932              while (!q.isEmpty())
933                  assertEquals(q.remove(), r.remove());
934 <        } catch(Exception e){
934 >        } catch (Exception e){
935              unexpectedException();
936          }
937      }
# Line 944 | Line 944 | public class ArrayBlockingQueueTest exte
944          try {
945              q.drainTo(null);
946              shouldThrow();
947 <        } catch(NullPointerException success) {
947 >        } catch (NullPointerException success) {
948          }
949      }
950  
# Line 956 | Line 956 | public class ArrayBlockingQueueTest exte
956          try {
957              q.drainTo(q);
958              shouldThrow();
959 <        } catch(IllegalArgumentException success) {
959 >        } catch (IllegalArgumentException success) {
960          }
961      }
962  
# Line 1007 | Line 1007 | public class ArrayBlockingQueueTest exte
1007                  assertEquals(l.get(i), new Integer(i));
1008              t.join();
1009              assertTrue(q.size() + l.size() >= SIZE);
1010 <        } catch(Exception e){
1010 >        } catch (Exception e){
1011              unexpectedException();
1012          }
1013      }
# Line 1020 | Line 1020 | public class ArrayBlockingQueueTest exte
1020          try {
1021              q.drainTo(null, 0);
1022              shouldThrow();
1023 <        } catch(NullPointerException success) {
1023 >        } catch (NullPointerException success) {
1024          }
1025      }
1026  
# Line 1032 | Line 1032 | public class ArrayBlockingQueueTest exte
1032          try {
1033              q.drainTo(q, 0);
1034              shouldThrow();
1035 <        } catch(IllegalArgumentException success) {
1035 >        } catch (IllegalArgumentException success) {
1036          }
1037      }
1038  
# Line 1042 | Line 1042 | public class ArrayBlockingQueueTest exte
1042      public void testDrainToN() {
1043          ArrayBlockingQueue q = new ArrayBlockingQueue(SIZE*2);
1044          for (int i = 0; i < SIZE + 2; ++i) {
1045 <            for(int j = 0; j < SIZE; j++)
1045 >            for (int j = 0; j < SIZE; j++)
1046                  assertTrue(q.offer(new Integer(j)));
1047              ArrayList l = new ArrayList();
1048              q.drainTo(l, i);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines