From: <bri...@us...> - 2003-03-27 00:35:35
|
Update of /cvsroot/webmacro/webmacro/test/unit/org/webmacro In directory sc8-pr-cvs1:/tmp/cvs-serv13677/test/unit/org/webmacro Modified Files: TestMultipleInstances.java Log Message: Add WM(Properties), WM(Servlet, Properties), constructors and test case Index: TestMultipleInstances.java =================================================================== RCS file: /cvsroot/webmacro/webmacro/test/unit/org/webmacro/TestMultipleInstances.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** TestMultipleInstances.java 23 Mar 2003 02:00:35 -0000 1.4 --- TestMultipleInstances.java 27 Mar 2003 00:35:31 -0000 1.5 *************** *** 1,4 **** --- 1,6 ---- package org.webmacro; + import java.util.*; + import junit.framework.TestCase; import org.webmacro.engine.StringTemplate; *************** *** 57,60 **** --- 59,94 ---- } + + public void testDefaultConstructor() throws InitException { + WM wm1 = new WM(); + WM wm2 = new WM(); + + assertEquals(wm1.toString(), wm2.toString()); + assertEquals(wm1.getBroker(), wm2.getBroker()); + + Properties p3 = new Properties(); + p3.put("foo", "goo"); + p3.put("moo", "zoo"); + + Properties p4 = new Properties(); + p4.put("foo", "goo"); + p4.put("moo", "zoo"); + + Properties p5 = new Properties(); + p5.put("foo", "goo"); + p5.put("moo", "zoo"); + p5.put("goo", "flu"); + + WM wm3 = new WM(p3); + WM wm4 = new WM(p4); + WM wm5 = new WM(p5); + assertTrue(wm1.getBroker() != wm3.getBroker()); + assertTrue(wm3.getBroker() == wm4.getBroker()); + assertTrue(wm3.getBroker() != wm5.getBroker()); + + p3.put("oops", "loops"); + WM wm6 = new WM(p3); + assertTrue(wm3.getBroker() != wm6.getBroker()); + } /** Execute a string as a template against the current context, |