From: <st...@us...> - 2008-03-28 11:11:10
|
Revision: 6264 http://smartfrog.svn.sourceforge.net/smartfrog/?rev=6264&view=rev Author: steve_l Date: 2008-03-28 04:11:08 -0700 (Fri, 28 Mar 2008) Log Message: ----------- SFOS-750 www test regression. These components check that the iterators have the expected size and that you find the right number of liveness components underneath. Modified Paths: -------------- trunk/core/testharness/testcases/org/smartfrog/test/system/compound/RemoteCompoundTest.java Modified: trunk/core/testharness/testcases/org/smartfrog/test/system/compound/RemoteCompoundTest.java =================================================================== --- trunk/core/testharness/testcases/org/smartfrog/test/system/compound/RemoteCompoundTest.java 2008-03-28 11:01:08 UTC (rev 6263) +++ trunk/core/testharness/testcases/org/smartfrog/test/system/compound/RemoteCompoundTest.java 2008-03-28 11:11:08 UTC (rev 6264) @@ -33,6 +33,8 @@ */ public class RemoteCompoundTest extends DeployingTestBase { + private static final int CHILDCOUNT = 3; + private static final int ATTRCOUNT = 20; public RemoteCompoundTest(String name) { super(name); @@ -59,27 +61,49 @@ public void testAttributes() throws Throwable { Compound comp=deployCompound(); Iterator iterator = comp.sfAttributes(); + int counter = 0; + int childcount = 0; while (iterator.hasNext()) { - Object o = iterator.next(); + Object key = iterator.next(); + Object value = comp.sfResolveHere(key, true); + getLog().info(key.toString()+"="+ value); + counter++; + if (value instanceof Liveness) { + childcount++; + } } + assertEquals(ATTRCOUNT, counter); + assertEquals(CHILDCOUNT, childcount); } public void testValues() throws Throwable { Compound comp = deployCompound(); Iterator iterator = comp.sfValues(); + int counter = 0; + int childcount =0; while (iterator.hasNext()) { - Object o = iterator.next(); + Object value = iterator.next(); + getLog().info(value.toString()); + counter++; + if(value instanceof Liveness) { + childcount++; + } } + assertEquals(ATTRCOUNT, counter); + assertEquals(CHILDCOUNT, childcount); } public void testChildren() throws Throwable { Compound comp = deployCompound(); Enumeration<Liveness> children = comp.sfChildren(); + int childcount = 0; while (children.hasMoreElements()) { + childcount++; Liveness child = children.nextElement(); //pretend we are the parent child.sfPing(comp); } + assertEquals(CHILDCOUNT, childcount); } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |