Update of /cvsroot/webmacro/webmacro/test/unit/org/webmacro/template In directory sc8-pr-cvs1:/tmp/cvs-serv5682/test/unit/org/webmacro/template Modified Files: AbstractVariableTestCase.java EncodingTestCase.java TemplateTestCase.java TestAbuse.java TestBlocks.java TestCountDirective.java TestDirectiveParser.java TestGetSet.java TestIf.java TestMacro.java TestParseInclude.java TestShortCircuit.java ecomm.wm Log Message: Updates include: RelaxedDirectiveBuilding Property. Test Cases for above property. assert() --> assertTrue() allowing compilation under java1.4 some additions/improvements to the standard macro library all tests run without error under jdk 1.3, solaris 2.8. some work needs to be done on test cases to remove unix dependencies. Index: AbstractVariableTestCase.java =================================================================== RCS file: /cvsroot/webmacro/webmacro/test/unit/org/webmacro/template/AbstractVariableTestCase.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** AbstractVariableTestCase.java 15 Dec 2002 07:21:24 -0000 1.4 --- AbstractVariableTestCase.java 23 Mar 2003 02:00:37 -0000 1.5 *************** *** 26,116 **** public void testGoodVariable () throws Exception { ! assert(false); } public void testGoodMethod () throws Exception { ! assert(false); } public void testGoodProperty () throws Exception { ! assert(false); } public void testNoSuchVariable () throws Exception { ! assert(false); } public void testNoSuchMethod () throws Exception { ! assert(false); } public void testNoSuchProperty () throws Exception { ! assert(false); } public void testVoidMethod () throws Exception { ! assert(false); } public void testNullMethod () throws Exception { ! assert(false); } public void testThrowsMethod() throws Exception { ! assert(false); } /** A variable in the context who's .toString() method returns null */ public void testNullVariable () throws Exception { ! assert(false); } public void testEvalGoodVariable () throws Exception { ! assert(false); } public void testEvalGoodMethod () throws Exception { ! assert(false); } public void testEvalGoodProperty () throws Exception { ! assert(false); } public void testEvalNoSuchVariable () throws Exception { ! assert(false); } public void testEvalNoSuchMethod () throws Exception { ! assert(false); } public void testNoSuchMethodWithArguments () throws Exception { ! assert(false); } public void testEvalNoSuchMethodWithArguments () throws Exception { ! assert(false); } public void testEvalNoSuchProperty () throws Exception { ! assert(false); } public void testEvalVoidMethod () throws Exception { ! assert(false); } public void testEvalNullMethod () throws Exception { ! assert(false); } public void testEvalThrowsMethod() throws Exception { ! assert(false); } public void testEvalNullVariable () throws Exception { ! assert(false); } --- 26,116 ---- public void testGoodVariable () throws Exception { ! assertTrue(false); } public void testGoodMethod () throws Exception { ! assertTrue(false); } public void testGoodProperty () throws Exception { ! assertTrue(false); } public void testNoSuchVariable () throws Exception { ! assertTrue(false); } public void testNoSuchMethod () throws Exception { ! assertTrue(false); } public void testNoSuchProperty () throws Exception { ! assertTrue(false); } public void testVoidMethod () throws Exception { ! assertTrue(false); } public void testNullMethod () throws Exception { ! assertTrue(false); } public void testThrowsMethod() throws Exception { ! assertTrue(false); } /** A variable in the context who's .toString() method returns null */ public void testNullVariable () throws Exception { ! assertTrue(false); } public void testEvalGoodVariable () throws Exception { ! assertTrue(false); } public void testEvalGoodMethod () throws Exception { ! assertTrue(false); } public void testEvalGoodProperty () throws Exception { ! assertTrue(false); } public void testEvalNoSuchVariable () throws Exception { ! assertTrue(false); } public void testEvalNoSuchMethod () throws Exception { ! assertTrue(false); } public void testNoSuchMethodWithArguments () throws Exception { ! assertTrue(false); } public void testEvalNoSuchMethodWithArguments () throws Exception { ! assertTrue(false); } public void testEvalNoSuchProperty () throws Exception { ! assertTrue(false); } public void testEvalVoidMethod () throws Exception { ! assertTrue(false); } public void testEvalNullMethod () throws Exception { ! assertTrue(false); } public void testEvalThrowsMethod() throws Exception { ! assertTrue(false); } public void testEvalNullVariable () throws Exception { ! assertTrue(false); } *************** *** 120,124 **** */ public void testEvaluationOfNullReturnValue() throws Exception { ! assert(false); } --- 120,124 ---- */ public void testEvaluationOfNullReturnValue() throws Exception { ! assertTrue(false); } Index: EncodingTestCase.java =================================================================== RCS file: /cvsroot/webmacro/webmacro/test/unit/org/webmacro/template/EncodingTestCase.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** EncodingTestCase.java 17 Oct 2001 10:03:24 -0000 1.2 --- EncodingTestCase.java 23 Mar 2003 02:00:37 -0000 1.3 *************** *** 164,173 **** protected void assertByteArrayEquals(byte[] a,byte[] b) throws Exception { if (a == b) return; ! assert("One byte array is null", ((a != null) && (b != null))); ! assert("Size of binary output differs", a.length == b.length); for (int i=0; i < a.length; i++) { ! assert("Binary output differs", a[i] == b[i]); } --- 164,173 ---- protected void assertByteArrayEquals(byte[] a,byte[] b) throws Exception { if (a == b) return; ! assertTrue("One byte array is null", ((a != null) && (b != null))); ! assertTrue("Size of binary output differs", a.length == b.length); for (int i=0; i < a.length; i++) { ! assertTrue("Binary output differs", a[i] == b[i]); } Index: TemplateTestCase.java =================================================================== RCS file: /cvsroot/webmacro/webmacro/test/unit/org/webmacro/template/TemplateTestCase.java,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** TemplateTestCase.java 15 Dec 2002 10:22:37 -0000 1.13 --- TemplateTestCase.java 23 Mar 2003 02:00:38 -0000 1.14 *************** *** 119,125 **** executeStringTemplate(template); if (result == null) ! assert (_context.get("assertEvalutionEquals") == null); else ! assert (result==null ? "null" : result.toString(), result.equals(_context.get("assertEvalutionEquals"))); } --- 119,125 ---- executeStringTemplate(template); if (result == null) ! assertTrue (_context.get("assertEvalutionEquals") == null); else ! assertTrue (result==null ? "null" : result.toString(), result.equals(_context.get("assertEvalutionEquals"))); } *************** *** 142,146 **** + "evaluate to /" + resultText + "/ " + "result=/" + result + "/"); ! assert (false); } } --- 142,146 ---- + "evaluate to /" + resultText + "/ " + "result=/" + result + "/"); ! assertTrue (false); } } *************** *** 163,167 **** + resultText + "/"); e.printStackTrace(); ! assert(false); } if (result == null) --- 163,167 ---- + resultText + "/"); e.printStackTrace(); ! assertTrue(false); } if (result == null) *************** *** 172,176 **** + " yielded /" + result + "/, expecting /" + resultText + "/"); ! assert(false); } } --- 172,176 ---- + " yielded /" + result + "/, expecting /" + resultText + "/"); ! assertTrue(false); } } *************** *** 197,201 **** + " yielded /" + result + "/, expecting throw " + exceptionClass); ! assert(false); } else if (!exceptionClass.isAssignableFrom(caught.getClass())) { --- 197,201 ---- + " yielded /" + result + "/, expecting throw " + exceptionClass); ! assertTrue(false); } else if (!exceptionClass.isAssignableFrom(caught.getClass())) { *************** *** 203,207 **** + " threw " + caught.getClass() + ", expecting " + exceptionClass); ! assert(false); } else if (messageMatchText != null) { --- 203,207 ---- + " threw " + caught.getClass() + ", expecting " + exceptionClass); ! assertTrue(false); } else if (messageMatchText != null) { *************** *** 211,215 **** + " does not match /" + messageMatchText + "/"); ! assert(false); } } --- 211,215 ---- + " does not match /" + messageMatchText + "/"); ! assertTrue(false); } } *************** *** 240,244 **** + resultPattern + "/"); e.printStackTrace(System.err); ! assert(false); } if (result == null) --- 240,244 ---- + resultPattern + "/"); e.printStackTrace(System.err); ! assertTrue(false); } if (result == null) *************** *** 250,254 **** + " yielded /" + result + "/, expecting match /" + resultPattern + "/"); ! assert(false); } } --- 250,254 ---- + " yielded /" + result + "/, expecting match /" + resultPattern + "/"); ! assertTrue(false); } } *************** *** 269,273 **** + " yielded /" + caught.getClass() + "/, expecting throw PropertyException"); ! assert(false); } else { caught = ((PropertyException)e).getCaught(); --- 269,273 ---- + " yielded /" + caught.getClass() + "/, expecting throw PropertyException"); ! assertTrue(false); } else { caught = ((PropertyException)e).getCaught(); *************** *** 279,283 **** + "PropertyException with caught exception " + exceptionClass); ! assert(false); } else if (!exceptionClass.isAssignableFrom(caught.getClass())) { --- 279,283 ---- + "PropertyException with caught exception " + exceptionClass); ! assertTrue(false); } else if (!exceptionClass.isAssignableFrom(caught.getClass())) { *************** *** 286,290 **** + "PropertyException with caught exception " + exceptionClass); ! assert(false); } } --- 286,290 ---- + "PropertyException with caught exception " + exceptionClass); ! assertTrue(false); } } Index: TestAbuse.java =================================================================== RCS file: /cvsroot/webmacro/webmacro/test/unit/org/webmacro/template/TestAbuse.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** TestAbuse.java 15 Dec 2002 07:21:24 -0000 1.7 --- TestAbuse.java 23 Mar 2003 02:00:38 -0000 1.8 *************** *** 66,70 **** public void testMultiLineIf () throws Exception { System.err.println ("NEED TO REVISIT: TestAbuse.testMultiLineIf()"); ! assert (true); // String tmpl = "#if (true\n&& true && true\n) {pass} #else {fail}"; // assertStringTemplateEquals (tmpl, "pass"); --- 66,70 ---- public void testMultiLineIf () throws Exception { System.err.println ("NEED TO REVISIT: TestAbuse.testMultiLineIf()"); ! assertTrue (true); // String tmpl = "#if (true\n&& true && true\n) {pass} #else {fail}"; // assertStringTemplateEquals (tmpl, "pass"); Index: TestBlocks.java =================================================================== RCS file: /cvsroot/webmacro/webmacro/test/unit/org/webmacro/template/TestBlocks.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** TestBlocks.java 26 Nov 2002 06:54:45 -0000 1.7 --- TestBlocks.java 23 Mar 2003 02:00:38 -0000 1.8 *************** *** 89,93 **** String output = executeStringTemplate (tmpl); ! assert (output.indexOf ("should not be here") == -1); } --- 89,93 ---- String output = executeStringTemplate (tmpl); ! assertTrue (output.indexOf ("should not be here") == -1); } Index: TestCountDirective.java =================================================================== RCS file: /cvsroot/webmacro/webmacro/test/unit/org/webmacro/template/TestCountDirective.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** TestCountDirective.java 11 Nov 2002 04:53:13 -0000 1.2 --- TestCountDirective.java 23 Mar 2003 02:00:39 -0000 1.3 *************** *** 40,44 **** Integer i = (Integer) _context.get("i"); Counter c = (Counter) _context.get("Counter"); ! assert (i.intValue() == c.getCount()); } public void testCountBackwards () throws Exception { --- 40,44 ---- Integer i = (Integer) _context.get("i"); Counter c = (Counter) _context.get("Counter"); ! assertTrue (i.intValue() == c.getCount()); } public void testCountBackwards () throws Exception { *************** *** 46,51 **** Integer i = (Integer) _context.get("i"); Counter c = (Counter) _context.get("Counter"); ! assert (c.toString(), c.getCount() == 10); ! assert (i.toString(), i.intValue() == 1); } public void testCountByTwo () throws Exception { --- 46,51 ---- Integer i = (Integer) _context.get("i"); Counter c = (Counter) _context.get("Counter"); ! assertTrue (c.toString(), c.getCount() == 10); ! assertTrue (i.toString(), i.intValue() == 1); } public void testCountByTwo () throws Exception { *************** *** 53,58 **** Integer i = (Integer) _context.get("i"); Counter c = (Counter) _context.get("Counter"); ! assert (c.toString(), c.getCount() == 5); ! assert (i.toString(), i.intValue() == 9); } public void testCountByZero () throws Exception { --- 53,58 ---- Integer i = (Integer) _context.get("i"); Counter c = (Counter) _context.get("Counter"); ! assertTrue (c.toString(), c.getCount() == 5); ! assertTrue (i.toString(), i.intValue() == 9); } public void testCountByZero () throws Exception { *************** *** 60,65 **** Integer i = (Integer) _context.get("i"); Counter c = (Counter) _context.get("Counter"); ! assert (c.toString(), c.getCount() == 0); ! assert (i == null); } public void testCountForwardsWithNegativeStep () throws Exception { --- 60,65 ---- Integer i = (Integer) _context.get("i"); Counter c = (Counter) _context.get("Counter"); ! assertTrue (c.toString(), c.getCount() == 0); ! assertTrue (i == null); } public void testCountForwardsWithNegativeStep () throws Exception { *************** *** 67,72 **** Integer i = (Integer) _context.get("i"); Counter c = (Counter) _context.get("Counter"); ! assert (c.toString(), c.getCount() == 0); ! assert (i == null); } public void testCountBackwardsWithPositiveStep () throws Exception { --- 67,72 ---- Integer i = (Integer) _context.get("i"); Counter c = (Counter) _context.get("Counter"); ! assertTrue (c.toString(), c.getCount() == 0); ! assertTrue (i == null); } public void testCountBackwardsWithPositiveStep () throws Exception { *************** *** 74,79 **** Integer i = (Integer) _context.get("i"); Counter c = (Counter) _context.get("Counter"); ! assert (c.toString(), c.getCount() == 0); ! assert (i == null); } } --- 74,79 ---- Integer i = (Integer) _context.get("i"); Counter c = (Counter) _context.get("Counter"); ! assertTrue (c.toString(), c.getCount() == 0); ! assertTrue (i == null); } } Index: TestDirectiveParser.java =================================================================== RCS file: /cvsroot/webmacro/webmacro/test/unit/org/webmacro/template/TestDirectiveParser.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** TestDirectiveParser.java 2 Mar 2002 14:23:47 -0000 1.4 --- TestDirectiveParser.java 23 Mar 2003 02:00:40 -0000 1.5 *************** *** 44,49 **** public void testBadDir() throws Exception { ! assertStringTemplateThrows("#doh", org.webmacro.engine.BuildException.class); } --- 44,56 ---- public void testBadDir() throws Exception { ! boolean relax = _wm.getBroker().getBooleanSetting("RelaxedDirectiveBuilding"); ! if (!relax) { ! assertStringTemplateThrows("#doh", org.webmacro.engine.BuildException.class); + } + else { + assertStringTemplateMatches("#doh", "#doh"); + } + } Index: TestGetSet.java =================================================================== RCS file: /cvsroot/webmacro/webmacro/test/unit/org/webmacro/template/TestGetSet.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** TestGetSet.java 4 May 2001 00:39:29 -0000 1.2 --- TestGetSet.java 23 Mar 2003 02:00:40 -0000 1.3 *************** *** 69,97 **** assertStringTemplateEquals ("$TestObject.intField", "1"); assertStringTemplateEquals ("#set $TestObject.intField=2", ""); ! assert(to.intField == 2); to.intField = 1; assertStringTemplateEquals ("#set $TestObject.intField=$two", ""); ! assert(to.intField == 2); to.longField = 1; assertStringTemplateEquals ("$TestObject.longField", "1"); assertStringTemplateEquals ("#set $TestObject.longField=2", ""); ! assert(to.longField == 2); to.longField = 1; assertStringTemplateEquals ("$TestObject.longField", "1"); assertStringTemplateEquals ("#set $TestObject.longField=$twoLong", ""); ! assert(to.longField == 2); to.setInt(1); assertStringTemplateEquals ("$TestObject.Int", "1"); assertStringTemplateEquals ("#set $TestObject.Int=2", ""); ! assert(to.getInt() == 2); to.setInt(1); assertStringTemplateEquals ("$TestObject.Int", "1"); assertStringTemplateEquals ("#set $TestObject.Int=$two", ""); ! assert(to.getInt() == 2); } --- 69,97 ---- assertStringTemplateEquals ("$TestObject.intField", "1"); assertStringTemplateEquals ("#set $TestObject.intField=2", ""); ! assertTrue(to.intField == 2); to.intField = 1; assertStringTemplateEquals ("#set $TestObject.intField=$two", ""); ! assertTrue(to.intField == 2); to.longField = 1; assertStringTemplateEquals ("$TestObject.longField", "1"); assertStringTemplateEquals ("#set $TestObject.longField=2", ""); ! assertTrue(to.longField == 2); to.longField = 1; assertStringTemplateEquals ("$TestObject.longField", "1"); assertStringTemplateEquals ("#set $TestObject.longField=$twoLong", ""); ! assertTrue(to.longField == 2); to.setInt(1); assertStringTemplateEquals ("$TestObject.Int", "1"); assertStringTemplateEquals ("#set $TestObject.Int=2", ""); ! assertTrue(to.getInt() == 2); to.setInt(1); assertStringTemplateEquals ("$TestObject.Int", "1"); assertStringTemplateEquals ("#set $TestObject.Int=$two", ""); ! assertTrue(to.getInt() == 2); } *************** *** 116,120 **** to2.obj = new Object(); assertStringTemplateEquals("$TestObject2.setObjectValue($foo)", ""); ! assert(to2.obj == null); } --- 116,120 ---- to2.obj = new Object(); assertStringTemplateEquals("$TestObject2.setObjectValue($foo)", ""); ! assertTrue(to2.obj == null); } Index: TestIf.java =================================================================== RCS file: /cvsroot/webmacro/webmacro/test/unit/org/webmacro/template/TestIf.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** TestIf.java 25 Nov 2002 05:21:33 -0000 1.3 --- TestIf.java 23 Mar 2003 02:00:40 -0000 1.4 *************** *** 15,19 **** public TestIf (String name) { super (name); ! System.setProperty("org.webmacro.LogLevel", "DEBUG"); } --- 15,19 ---- public TestIf (String name) { super (name); ! //System.setProperty("org.webmacro.LogLevel", "DEBUG"); } Index: TestMacro.java =================================================================== RCS file: /cvsroot/webmacro/webmacro/test/unit/org/webmacro/template/TestMacro.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** TestMacro.java 15 Dec 2002 10:22:37 -0000 1.2 --- TestMacro.java 23 Mar 2003 02:00:41 -0000 1.3 *************** *** 5,11 **** import org.webmacro.*; import org.webmacro.engine.StringTemplate; ! import org.webmacro.engine.DefaultEvaluationExceptionHandler; ! import org.webmacro.engine.BuildException; ! import junit.framework.*; --- 5,11 ---- import org.webmacro.*; import org.webmacro.engine.StringTemplate; ! import org.webmacro.engine.DefaultEvaluationExceptionHandler; ! import org.webmacro.engine.BuildException; ! import junit.framework.*; *************** *** 20,28 **** context.put ("string", "Foo!"); } ! ! public void testUndefinedMacro() throws Exception { ! assertStringTemplateThrows ("#foo()", BuildException.class, "#foo: no such [M,m]acro or [D,d]irective at \\w+:\\d+\\.\\d+"); ! assertStringTemplateThrows ("#foo", BuildException.class, "#foo: no such [M,m]acro or [D,d]irective at \\w+:\\d+\\.\\d+"); ! } public void testNoArgs() throws Exception { --- 20,31 ---- context.put ("string", "Foo!"); } ! ! public void testUndefinedMacro() throws Exception { ! boolean relax = _wm.getBroker().getBooleanSetting("RelaxedDirectiveBuilding"); ! if (! relax) { ! assertStringTemplateThrows ("#foo()", BuildException.class, "#foo: no such [M,m]acro or [D,d]irective at \\w+:\\d+\\.\\d+"); ! assertStringTemplateThrows ("#foo", BuildException.class, "#foo: no such [M,m]acro or [D,d]irective at \\w+:\\d+\\.\\d+"); ! } ! } public void testNoArgs() throws Exception { Index: TestParseInclude.java =================================================================== RCS file: /cvsroot/webmacro/webmacro/test/unit/org/webmacro/template/TestParseInclude.java,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** TestParseInclude.java 21 Dec 2002 07:30:20 -0000 1.9 --- TestParseInclude.java 23 Mar 2003 02:00:41 -0000 1.10 *************** *** 65,71 **** ! // include /etc/password ! assertStringTemplateMatches("#include \"/etc/passwd\"", ! ".*root:.*"); // include http://www.yahoo.com/ --- 65,72 ---- ! // include the current directory build file ! String fileName = "\"" + System.getProperty("user.dir") + "/build.xml\""; ! assertStringTemplateMatches("#include " + fileName, ! ".*project.*"); // include http://www.yahoo.com/ *************** *** 95,98 **** --- 96,116 ---- + "#setVar($foo, \"brian\")\n" + "#showVar($foo)", "brian"); + + } + /** Tests that the property "RelaxedDirectiveBuilding" is properly interpreted. */ + public void testRelaxedDirectiveBuild() { + + boolean relax = _wm.getBroker().getBooleanSetting("RelaxedDirectiveBuilding"); + System.out.println("RelaxedDirectiveBuilding=" + relax); + try { + String input = "#ffffff #BeginTemplate # A Comment"; + String output = executeStringTemplate(input); + if (relax) assertEquals(input, output); + else fail("Exception not thrown when evaluating template."); + } + catch (Exception e) { + if (relax) + fail("relax = true but test template did not build"); + } } *************** *** 102,105 **** --- 120,130 ---- String value = executeFileTemplate("org/webmacro/template/ecomm.wm"); store(System.getProperty("user.dir") + "/" + "ecomm.html", value); + } + + /** executes out of the standard macro/ distribution. */ + public void testVerisignMacros() throws Exception { + // execute the pay pal eCommerce test case and store the output + String value = executeFileTemplate("org/webmacro/template/verisign.wm"); + store(System.getProperty("user.dir") + "/" + "verisign.html", value); } Index: TestShortCircuit.java =================================================================== RCS file: /cvsroot/webmacro/webmacro/test/unit/org/webmacro/template/TestShortCircuit.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** TestShortCircuit.java 4 May 2001 00:39:29 -0000 1.2 --- TestShortCircuit.java 23 Mar 2003 02:00:41 -0000 1.3 *************** *** 57,61 **** String tmpl = "#if (true || $BM1.gimmeTrue()) {pass} #else {fail}"; assertStringTemplateEquals (tmpl, "pass"); ! assert (bm1.whichMethod == null); } --- 57,61 ---- String tmpl = "#if (true || $BM1.gimmeTrue()) {pass} #else {fail}"; assertStringTemplateEquals (tmpl, "pass"); ! assertTrue (bm1.whichMethod == null); } *************** *** 64,68 **** String tmpl = "#if ($TRUE || $BM1.gimmeTrue()) {pass} #else {fail}"; assertStringTemplateEquals (tmpl, "pass"); ! assert (bm1.whichMethod == null); } --- 64,68 ---- String tmpl = "#if ($TRUE || $BM1.gimmeTrue()) {pass} #else {fail}"; assertStringTemplateEquals (tmpl, "pass"); ! assertTrue (bm1.whichMethod == null); } *************** *** 72,77 **** String tmpl = "#if ((true && $BM1.gimmeTrue()) || $BM2.gimmeTrue()) {pass} #else {fail}"; assertStringTemplateEquals(tmpl, "pass"); ! assert (bm1.whichMethod.equals ("gimmeTrue")); ! assert (bm2.whichMethod == null); } --- 72,77 ---- String tmpl = "#if ((true && $BM1.gimmeTrue()) || $BM2.gimmeTrue()) {pass} #else {fail}"; assertStringTemplateEquals(tmpl, "pass"); ! assertTrue (bm1.whichMethod.equals ("gimmeTrue")); ! assertTrue (bm2.whichMethod == null); } *************** *** 81,86 **** String tmpl = "#if (($TRUE && $BM1.gimmeTrue()) || $BM2.gimmeTrue()) {pass} #else {fail}"; assertStringTemplateEquals(tmpl, "pass"); ! assert (bm1.whichMethod.equals ("gimmeTrue")); ! assert (bm2.whichMethod == null); } --- 81,86 ---- String tmpl = "#if (($TRUE && $BM1.gimmeTrue()) || $BM2.gimmeTrue()) {pass} #else {fail}"; assertStringTemplateEquals(tmpl, "pass"); ! assertTrue (bm1.whichMethod.equals ("gimmeTrue")); ! assertTrue (bm2.whichMethod == null); } *************** *** 91,101 **** String tmpl = "#if ((true || $BM1.gimmeTrue()) || $BM2.gimmeTrue()) {pass} #else {fail}"; assertStringTemplateEquals (tmpl, "pass"); ! assert (bm1.whichMethod == null); ! assert (bm2.whichMethod == null); tmpl = "#if (true || $BM1.gimmeTrue() || $BM2.gimmeTrue()) {pass} #else {fail}"; assertStringTemplateEquals (tmpl, "pass"); ! assert (bm1.whichMethod == null); ! assert (bm2.whichMethod == null); } --- 91,101 ---- String tmpl = "#if ((true || $BM1.gimmeTrue()) || $BM2.gimmeTrue()) {pass} #else {fail}"; assertStringTemplateEquals (tmpl, "pass"); ! assertTrue (bm1.whichMethod == null); ! assertTrue (bm2.whichMethod == null); tmpl = "#if (true || $BM1.gimmeTrue() || $BM2.gimmeTrue()) {pass} #else {fail}"; assertStringTemplateEquals (tmpl, "pass"); ! assertTrue (bm1.whichMethod == null); ! assertTrue (bm2.whichMethod == null); } *************** *** 106,111 **** String tmpl = "#if (($TRUE || $BM1.gimmeTrue()) || $BM2.gimmeTrue()) {pass} #else {fail}"; assertStringTemplateEquals (tmpl, "pass"); ! assert (bm1.whichMethod == null); ! assert (bm2.whichMethod == null); } } --- 106,111 ---- String tmpl = "#if (($TRUE || $BM1.gimmeTrue()) || $BM2.gimmeTrue()) {pass} #else {fail}"; assertStringTemplateEquals (tmpl, "pass"); ! assertTrue (bm1.whichMethod == null); ! assertTrue (bm2.whichMethod == null); } } Index: ecomm.wm =================================================================== RCS file: /cvsroot/webmacro/webmacro/test/unit/org/webmacro/template/ecomm.wm,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** ecomm.wm 26 Nov 2002 15:20:14 -0000 1.1 --- ecomm.wm 23 Mar 2003 02:00:41 -0000 1.2 *************** *** 8,11 **** --- 8,22 ---- ## see the paypalSetup macro for the property name specs. #bean $System = "java.lang.System" scope=static + + ## verisign data... + #bean $App = "org.webmacro.util.SparseProperties" scope=page onNew { + #set $App.LoginName = "lanesharman" + #set $App.PartnerName = "VeriSign" + } + #bean $Tran = "org.webmacro.util.SparseProperties" scope=page onNew { + #set $Tran.Amount = "100.00" + #set $Tran.TranType = "S" + } + #bean $cust = "org.webmacro.util.SparseProperties" scope=page onNew { #set $cust.firstName = $System.getProperty("user.name") |