Update of /cvsroot/smartfrog/core/components/junit/test/org/smartfrog/services/junit/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16162/components/junit/test/org/smartfrog/services/junit/test Modified Files: DeployedConsoleListenerTest.java DeployedXMLListenerTest.java LocalhostTest.java Added Files: ListFlatteningTest.java Log Message: List flattening is fixed; dynamic code load problems continue Index: LocalhostTest.java =================================================================== RCS file: /cvsroot/smartfrog/core/components/junit/test/org/smartfrog/services/junit/test/LocalhostTest.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** LocalhostTest.java 22 Nov 2004 18:05:38 -0000 1.6 --- LocalhostTest.java 23 Nov 2004 15:45:47 -0000 1.7 *************** *** 22,35 **** package org.smartfrog.services.junit.test; - import org.smartfrog.services.junit.JUnitTestSuiteImpl; import org.smartfrog.services.junit.Statistics; import org.smartfrog.services.junit.TestRunner; import org.smartfrog.services.junit.listeners.BufferingListener; - import org.smartfrog.sfcore.common.SmartFrogInitException; import org.smartfrog.sfcore.prim.Prim; - import java.util.ArrayList; - import java.util.List; - /** * Test deploying against a localhost Date: 06-Jul-2004 Time: 21:54:25 --- 22,30 ---- *************** *** 41,77 **** } - public void testListFlattening() throws Exception { - List l1 = new ArrayList(); - List l2 = new ArrayList(); - List l3 = new ArrayList(); - l2.add("1"); - l2.add("2"); - l3.add("3"); - l3.add("4"); - l2.add(l3); - List flat = new ArrayList(); - flat.add("1"); - flat.add("2"); - flat.add("3"); - flat.add("4"); - List flat2 = JUnitTestSuiteImpl.flattenStringList(l2, "l2"); - assertEquals(flat, flat); - assertEquals(flat, flat2); - l2.add(new ArrayList()); - l1.add(l2); - List flat3 = JUnitTestSuiteImpl.flattenStringList(l3, "l3"); - assertEquals(flat, flat3); - List l4 = new ArrayList(); - l4.add(l1); - l4.add(new Integer("3")); - try { - List flat4 = JUnitTestSuiteImpl.flattenStringList(l4, "l5"); - fail("should have thrown something"); - } catch (SmartFrogInitException e) { - //expected - } - List flat5 = JUnitTestSuiteImpl.flattenStringList(null, "flat5"); - assertEquals(0, flat5.size()); - } public void testSuccess() throws Throwable { --- 36,39 ---- --- NEW FILE: ListFlatteningTest.java --- /** (C) Copyright 1998-2004 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.services.junit.test; import junit.framework.TestCase; import org.smartfrog.services.junit.JUnitTestSuiteImpl; import org.smartfrog.sfcore.common.SmartFrogInitException; import java.util.ArrayList; import java.util.List; /** * created Nov 23, 2004 11:33:33 AM */ public class ListFlatteningTest extends TestCase { public void testListFlattening() throws Exception { List l1 = new ArrayList(); List l2 = new ArrayList(); List l3 = new ArrayList(); l2.add("1"); l2.add("2"); l3.add("3"); l3.add("4"); l2.add(l3); List flat = new ArrayList(); flat.add("1"); flat.add("2"); flat.add("3"); flat.add("4"); List flat2 = JUnitTestSuiteImpl.flattenStringList(l2, "l2"); assertEquals(flat, flat); assertEquals(flat, flat2); l2.add(new ArrayList()); l1.add(l2); List flat3 = JUnitTestSuiteImpl.flattenStringList(l1, "l1"); assertEquals(flat, flat3); List l4 = new ArrayList(); l4.add(l1); l4.add(new Integer("3")); try { List flat4 = JUnitTestSuiteImpl.flattenStringList(l4, "l5"); fail("should have thrown something"); } catch (SmartFrogInitException e) { //expected } List flat5 = JUnitTestSuiteImpl.flattenStringList(null, "flat5"); assertEquals(0, flat5.size()); } } Index: DeployedConsoleListenerTest.java =================================================================== RCS file: /cvsroot/smartfrog/core/components/junit/test/org/smartfrog/services/junit/test/DeployedConsoleListenerTest.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** DeployedConsoleListenerTest.java 22 Nov 2004 18:05:38 -0000 1.1 --- DeployedConsoleListenerTest.java 23 Nov 2004 15:45:47 -0000 1.2 *************** *** 20,25 **** package org.smartfrog.services.junit.test; import org.smartfrog.services.junit.TestRunner; - import org.smartfrog.services.junit.listeners.ConsoleListener; import org.smartfrog.sfcore.prim.Prim; --- 20,25 ---- package org.smartfrog.services.junit.test; + import org.smartfrog.services.junit.TestListenerFactory; import org.smartfrog.services.junit.TestRunner; import org.smartfrog.sfcore.prim.Prim; *************** *** 45,51 **** TestRunner runner = (TestRunner) deploy; assertTrue(runner != null); ! ConsoleListener listener = null; listener = ! (ConsoleListener) deploy.sfResolve( TestRunner.ATTR_LISTENER, listener, --- 45,51 ---- TestRunner runner = (TestRunner) deploy; assertTrue(runner != null); ! TestListenerFactory listener = null; listener = ! (TestListenerFactory) deploy.sfResolve( TestRunner.ATTR_LISTENER, listener, Index: DeployedXMLListenerTest.java =================================================================== RCS file: /cvsroot/smartfrog/core/components/junit/test/org/smartfrog/services/junit/test/DeployedXMLListenerTest.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** DeployedXMLListenerTest.java 22 Nov 2004 18:05:38 -0000 1.1 --- DeployedXMLListenerTest.java 23 Nov 2004 15:45:47 -0000 1.2 *************** *** 22,26 **** import org.smartfrog.services.junit.Statistics; import org.smartfrog.services.junit.TestRunner; ! import org.smartfrog.services.junit.listeners.XmlListener; import org.smartfrog.sfcore.prim.Prim; --- 22,26 ---- import org.smartfrog.services.junit.Statistics; import org.smartfrog.services.junit.TestRunner; ! import org.smartfrog.services.junit.listeners.XmlListenerFactory; import org.smartfrog.sfcore.prim.Prim; *************** *** 46,53 **** TestRunner runner = (TestRunner) deploy; assertTrue(runner != null); ! XmlListener listener = null; ! listener = ! (XmlListener) deploy.sfResolve(TestRunner.ATTR_LISTENER, ! listener, true); boolean finished = spinTillFinished(runner, seconds); --- 46,54 ---- TestRunner runner = (TestRunner) deploy; assertTrue(runner != null); ! XmlListenerFactory listenerFactory = null; ! listenerFactory = ! (XmlListenerFactory) deploy.sfResolve( ! TestRunner.ATTR_LISTENER, ! listenerFactory, true); boolean finished = spinTillFinished(runner, seconds); |