/*
 * $Id: TestCollectionUtil.java,v 1.1 2002-08-31 06:58:16 tal Exp $
 */

/*

Copyright (c) 2002 Board of Trustees of Leland Stanford Jr. University,
all rights reserved.

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
STANFORD UNIVERSITY BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Except as contained in this notice, the name of Stanford University shall not
be used in advertising or otherwise to promote the sale, use or other dealings
in this Software without prior written authorization from Stanford University.

*/

package org.lockss.util;

import java.util.*;
import junit.framework.TestCase;
import org.lockss.test.MockLogTarget;


/**
 * Test class for org.lockss.util.ArrayIterator
 */

public class TestCollectionUtil extends TestCase {
  public static Class testedClasses[] = {
    org.lockss.util.CollectionUtil.class
  };

  public TestCollectionUtil(String msg) {
    super(msg);
  }

  public void testEqualColls() {
    Vector v = new Vector();
    List l = new ArrayList();
    assertTrue(CollectionUtil.equalCollections(v.iterator(), l.iterator()));
    v.add("one");
    assertTrue( ! CollectionUtil.equalCollections(v.iterator(), l.iterator()));
    l.add("one");
    assertTrue(CollectionUtil.equalCollections(v.iterator(), l.iterator()));
    l.add("two");
    assertTrue( ! CollectionUtil.equalCollections(v.iterator(), l.iterator()));
    v.add("two");
    assertTrue(CollectionUtil.equalCollections(v.iterator(), l.iterator()));
    l.add("three");
    v.add("fweet");
    assertTrue( ! CollectionUtil.equalCollections(v.iterator(), l.iterator()));
  }

  static String empty[] = {};
  public void testEmptyIter() {
    Iterator iter = new ArrayIterator(empty);
    assertTrue( ! iter.hasNext());
  }

  static String arr[] = {"one", "two"};
  public void testIter() {
    Iterator iter = new ArrayIterator(arr);
    for (int ix = 0; ix < arr.length; ix++) {
      assertTrue(iter.hasNext());
      assertEquals(arr[ix], (String)iter.next());
    }
    assertTrue( ! iter.hasNext());
  }

}

@@ -36,29 +36,29 @@
 v 1.
-1
+2
  2002-0
-8-31 06:58:16
+9-19 21:02:13
  tal
@@ -1821,18 +1821,15 @@
 test
-EqualColls
+IsoIter
 () %7B
@@ -1918,32 +1918,28 @@
 ionUtil.
-equalCollections
+isIsomorphic
 (v.itera
@@ -2012,32 +2012,28 @@
 ionUtil.
-equalCollections
+isIsomorphic
 (v.itera
@@ -2103,32 +2103,28 @@
 ionUtil.
-equalCollections
+isIsomorphic
 (v.itera
@@ -2197,32 +2197,28 @@
 ionUtil.
-equalCollections
+isIsomorphic
 (v.itera
@@ -2288,32 +2288,28 @@
 ionUtil.
-equalCollections
+isIsomorphic
 (v.itera
@@ -2408,24 +2408,20 @@
 til.
-equalCollections
+isIsomorphic
 (v.i
@@ -2444,32 +2444,183 @@
 rator()));%0A  %7D%0A%0A
+  public void testIsoColls() %7B%0A    Vector v1 = new Vector();%0A    Vector v2 = new Vector();%0A    Object a0%5B%5D = %7B%7D;%0A    Object a1%5B%5D = %7B%2212%22, %2234%22%7D;%0A  %7D%0A%0A%0A
   static String 

Test new overloaded iso fns.