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

Comparing jsr166/src/test/tck/LinkedBlockingQueueTest.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:10 2009 UTC

# Line 29 | Line 29 | public class LinkedBlockingQueueTest ext
29      private LinkedBlockingQueue populatedQueue(int n) {
30          LinkedBlockingQueue q = new LinkedBlockingQueue(n);
31          assertTrue(q.isEmpty());
32 <        for(int i = 0; i < n; i++)
32 >        for (int i = 0; i < n; i++)
33              assertTrue(q.offer(new Integer(i)));
34          assertFalse(q.isEmpty());
35          assertEquals(0, q.remainingCapacity());
# Line 716 | Line 716 | public class LinkedBlockingQueueTest ext
716          LinkedBlockingQueue q = populatedQueue(SIZE);
717          Object[] o = q.toArray();
718          try {
719 <        for(int i = 0; i < o.length; i++)
719 >        for (int i = 0; i < o.length; i++)
720              assertEquals(o[i], q.take());
721          } catch (InterruptedException e){
722              unexpectedException();
# Line 731 | Line 731 | public class LinkedBlockingQueueTest ext
731          Integer[] ints = new Integer[SIZE];
732          ints = (Integer[])q.toArray(ints);
733          try {
734 <            for(int i = 0; i < ints.length; i++)
734 >            for (int i = 0; i < ints.length; i++)
735                  assertEquals(ints[i], q.take());
736          } catch (InterruptedException e){
737              unexpectedException();
# Line 746 | Line 746 | public class LinkedBlockingQueueTest ext
746              LinkedBlockingQueue q = populatedQueue(SIZE);
747              Object o[] = q.toArray(null);
748              shouldThrow();
749 <        } catch(NullPointerException success){}
749 >        } catch (NullPointerException success){}
750      }
751  
752      /**
# Line 757 | Line 757 | public class LinkedBlockingQueueTest ext
757              LinkedBlockingQueue q = populatedQueue(SIZE);
758              Object o[] = q.toArray(new String[10] );
759              shouldThrow();
760 <        } catch(ArrayStoreException  success){}
760 >        } catch (ArrayStoreException  success){}
761      }
762  
763  
# Line 768 | Line 768 | public class LinkedBlockingQueueTest ext
768          LinkedBlockingQueue q = populatedQueue(SIZE);
769          Iterator it = q.iterator();
770          try {
771 <            while(it.hasNext()){
771 >            while (it.hasNext()){
772                  assertEquals(it.next(), q.take());
773              }
774          } catch (InterruptedException e){
# Line 934 | Line 934 | public class LinkedBlockingQueueTest ext
934              assertEquals(q.size(), r.size());
935              while (!q.isEmpty())
936                  assertEquals(q.remove(), r.remove());
937 <        } catch(Exception e){
937 >        } catch (Exception e){
938              unexpectedException();
939          }
940      }
# Line 947 | Line 947 | public class LinkedBlockingQueueTest ext
947          try {
948              q.drainTo(null);
949              shouldThrow();
950 <        } catch(NullPointerException success) {
950 >        } catch (NullPointerException success) {
951          }
952      }
953  
# Line 959 | Line 959 | public class LinkedBlockingQueueTest ext
959          try {
960              q.drainTo(q);
961              shouldThrow();
962 <        } catch(IllegalArgumentException success) {
962 >        } catch (IllegalArgumentException success) {
963          }
964      }
965  
# Line 1010 | Line 1010 | public class LinkedBlockingQueueTest ext
1010                  assertEquals(l.get(i), new Integer(i));
1011              t.join();
1012              assertTrue(q.size() + l.size() >= SIZE);
1013 <        } catch(Exception e){
1013 >        } catch (Exception e){
1014              unexpectedException();
1015          }
1016      }
# Line 1023 | Line 1023 | public class LinkedBlockingQueueTest ext
1023          try {
1024              q.drainTo(null, 0);
1025              shouldThrow();
1026 <        } catch(NullPointerException success) {
1026 >        } catch (NullPointerException success) {
1027          }
1028      }
1029  
# Line 1035 | Line 1035 | public class LinkedBlockingQueueTest ext
1035          try {
1036              q.drainTo(q, 0);
1037              shouldThrow();
1038 <        } catch(IllegalArgumentException success) {
1038 >        } catch (IllegalArgumentException success) {
1039          }
1040      }
1041  
# Line 1045 | Line 1045 | public class LinkedBlockingQueueTest ext
1045      public void testDrainToN() {
1046          LinkedBlockingQueue q = new LinkedBlockingQueue();
1047          for (int i = 0; i < SIZE + 2; ++i) {
1048 <            for(int j = 0; j < SIZE; j++)
1048 >            for (int j = 0; j < SIZE; j++)
1049                  assertTrue(q.offer(new Integer(j)));
1050              ArrayList l = new ArrayList();
1051              q.drainTo(l, i);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines