/** * Tests if the two created DistHashTables have #n objects as content using getWait() when one is * created later. */ public void testDistHashTable6() { l1 = new DistHashTable(host); assertTrue("l1==empty", l1.isEmpty()); int i = 0, loops = 10; while (i < loops) { Integer x = new Integer(++i); l1.putWait(x, x); assertTrue("#l1==i", l1.size() == i); } assertTrue("#l1==" + loops, l1.size() == loops); l2 = new DistHashTable(host); Iterator it = null; it = l1.iterator(); i = 0; while (it.hasNext()) { Object k = it.next(); Object v = l2.getWait(k); Integer x = new Integer(++i); // System.out.println("o = " + o + " x = "+ x); assertEquals("l1(i)==k(i)", x, k); assertEquals("l2(i)==v(i)", x, v); } assertTrue("#l2==" + loops, l2.size() == loops); }