From: <st...@us...> - 2008-03-25 14:41:53
|
Revision: 6244 http://smartfrog.svn.sourceforge.net/smartfrog/?rev=6244&view=rev Author: steve_l Date: 2008-03-25 07:41:50 -0700 (Tue, 25 Mar 2008) Log Message: ----------- SFOS-361 Prim.sfAttributes() does not work over RMI, fails with a NotSerializableException Added Paths: ----------- trunk/core/testharness/testcases/org/smartfrog/test/system/compound/RemoteCompoundTest.java trunk/core/testharness/testcases/org/smartfrog/test/system/compound/components.sf Added: trunk/core/testharness/testcases/org/smartfrog/test/system/compound/RemoteCompoundTest.java =================================================================== --- trunk/core/testharness/testcases/org/smartfrog/test/system/compound/RemoteCompoundTest.java (rev 0) +++ trunk/core/testharness/testcases/org/smartfrog/test/system/compound/RemoteCompoundTest.java 2008-03-25 14:41:50 UTC (rev 6244) @@ -0,0 +1,85 @@ +/* (C) Copyright 2008 Hewlett-Packard Development Company, LP + +This library is free software; you can redistribute it and/or +modify it under the terms of the GNU Lesser General Public +License as published by the Free Software Foundation; either +version 2.1 of the License, or (at your option) any later version. + +This library is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +Lesser General Public License for more details. + +You should have received a copy of the GNU Lesser General Public +License along with this library; if not, write to the Free Software +Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +For more information: www.smartfrog.org + +*/ +package org.smartfrog.test.system.compound; + +import org.smartfrog.test.DeployingTestBase; +import org.smartfrog.sfcore.compound.Compound; +import org.smartfrog.sfcore.prim.Liveness; + +import java.util.Iterator; +import java.util.Enumeration; + +/** + * + * Created 19-Mar-2008 13:31:17 + * + */ + +public class RemoteCompoundTest extends DeployingTestBase { + + public RemoteCompoundTest(String name) { + super(name); + } + + + /** + * Sets up the fixture,by extracting the hostname and classes dir + */ + protected void setUp() throws Exception { + super.setUp(); + } + + + private Compound deployCompound() throws Throwable { + application = deployExpectingSuccess("/org/smartfrog/test/system/compound/components.sf", "compounds"); + return (Compound) application; + } + + private Compound getCompound() { + return (Compound) application; + } + + public void testAttributes() throws Throwable { + Compound comp=deployCompound(); + Iterator iterator = comp.sfAttributes(); + while (iterator.hasNext()) { + Object o = iterator.next(); + } + } + + public void testValues() throws Throwable { + Compound comp = deployCompound(); + Iterator iterator = comp.sfValues(); + while (iterator.hasNext()) { + Object o = iterator.next(); + } + } + + public void testChildren() throws Throwable { + Compound comp = deployCompound(); + Enumeration<Liveness> children = comp.sfChildren(); + while (children.hasMoreElements()) { + Liveness child = children.nextElement(); + //pretend we are the parent + child.sfPing(comp); + } + } + +} Added: trunk/core/testharness/testcases/org/smartfrog/test/system/compound/components.sf =================================================================== --- trunk/core/testharness/testcases/org/smartfrog/test/system/compound/components.sf (rev 0) +++ trunk/core/testharness/testcases/org/smartfrog/test/system/compound/components.sf 2008-03-25 14:41:50 UTC (rev 6244) @@ -0,0 +1,33 @@ +/* (C) Copyright 2008 Hewlett-Packard Development Company, LP + +This library is free software; you can redistribute it and/or +modify it under the terms of the GNU Lesser General Public +License as published by the Free Software Foundation; either +version 2.1 of the License, or (at your option) any later version. + +This library is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +Lesser General Public License for more details. + +You should have received a copy of the GNU Lesser General Public +License along with this library; if not, write to the Free Software +Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +For more information: www.smartfrog.org + +*/ +#include "/org/smartfrog/services/filesystem/components.sf" +#include "/org/smartfrog/services/assertions/components.sf" + +sfConfig extends Compound { + + child1 extends Compound {} + child2 extends Compound {} + child3 extends Compound {} + + attr1 "attr1"; + attr2 "attr2"; + attr3 "attr3"; + +} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |