CVS update: JGroups/tests/junit-functional/org/jgroups/tests UtilTest.java

"Bela Ban" <[email protected]>
Newsgroups gmane.comp.java.javagroups.cvs
Message-ID <[email protected]>
  User: belaban 
  Date: 10/08/12 15:57:23

  Modified:    tests/junit-functional/org/jgroups/tests UtilTest.java
  Log:
  added pickNext()
  
  Revision  Changes    Path
  1.23      +21 -1     JGroups/tests/junit-functional/org/jgroups/tests/UtilTest.java
  
  Index: UtilTest.java
  ===================================================================
  RCS file: /cvsroot/javagroups/JGroups/tests/junit-functional/org/jgroups/tests/UtilTest.java,v
  retrieving revision 1.22
  retrieving revision 1.23
  diff -u -r1.22 -r1.23
  --- UtilTest.java	1 Mar 2010 09:56:43 -0000	1.22
  +++ UtilTest.java	12 Aug 2010 15:57:23 -0000	1.23
  @@ -1,4 +1,4 @@
  -// $Id: UtilTest.java,v 1.22 2010/03/01 09:56:43 belaban Exp $
  +// $Id: UtilTest.java,v 1.23 2010/08/12 15:57:23 belaban Exp $
   
   package org.jgroups.tests;
   
  @@ -621,6 +621,26 @@
           }
       }
   
  +
  +    public static void testPickNext() {
  +        List<Integer> list=new ArrayList<Integer>(10);
  +        for(int i=0; i < 10; i++)
  +            list.add(i);
  +        Integer num=Util.pickNext(list, 5);
  +        System.out.println("number next to 5: " + num);
  +        assert num != null;
  +        assert num.equals(6);
  +
  +        num=Util.pickNext(list, 9);
  +        System.out.println("number next to 9: " + num);
  +        assert num != null;
  +        assert num.equals(0);
  +
  +        num=Util.pickNext(list, 11);
  +        assert num == null;
  +    }
  +
  +
       public static void testAll() {
           List<String> l=new ArrayList<String>();
           l.add("one"); l.add("two"); l.add("one");
  
  
  

------------------------------------------------------------------------------
This SF.net email is sponsored by 

Make an app they can't live without
Enter the BlackBerry Developer Challenge
http://p.sf.net/sfu/RIM-dev2dev
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.