From: Tim P <ti...@us...> - 2010-02-18 22:57:07
|
Update of /cvsroot/webmacro/webmacro/test/unit/org/webmacro/template In directory sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv30732/test/unit/org/webmacro/template Modified Files: TestSetpropsDirective.java Log Message: Add test which should fail Index: TestSetpropsDirective.java =================================================================== RCS file: /cvsroot/webmacro/webmacro/test/unit/org/webmacro/template/TestSetpropsDirective.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** TestSetpropsDirective.java 12 Nov 2008 23:41:31 -0000 1.2 --- TestSetpropsDirective.java 18 Feb 2010 22:56:51 -0000 1.3 *************** *** 19,31 **** protected void setUp () throws Exception { ! super.setUp(); ! } ! public void init () throws Exception ! { System.getProperties().setProperty("org.webmacro.ImpliedPackages", ! "java.util"); ! System.getProperties().setProperty("org.webmacro.AllowedPackages", ! "java.util"); ! super.init(); } --- 19,28 ---- protected void setUp () throws Exception { ! //System.getProperties().setProperty("org.webmacro.LogLevel", "DEBUG"); System.getProperties().setProperty("org.webmacro.ImpliedPackages", ! "java.util"); ! System.getProperties().setProperty("org.webmacro.AllowedPackages", ! "java.util"); ! super.setUp(); } *************** *** 36,40 **** } ! /* * Test the basic functionality of the directive: create a new hashtable and * sets a simple property. --- 33,37 ---- } ! /** * Test the basic functionality of the directive: create a new hashtable and * sets a simple property. *************** *** 46,50 **** } ! /* * Test the creation of an empty map. */ --- 43,47 ---- } ! /** * Test the creation of an empty map. */ *************** *** 55,59 **** } ! /* * This version set properties on a POJO instead of the default hashtable. */ --- 52,56 ---- } ! /** * This version set properties on a POJO instead of the default hashtable. */ *************** *** 69,73 **** } ! /* * This version uses the line continuation character. Notice that it needs to * be double escaped here (\\\\). In a template file it should be be escaped --- 66,70 ---- } ! /** * This version uses the line continuation character. Notice that it needs to * be double escaped here (\\\\). In a template file it should be be escaped *************** *** 85,89 **** } ! /* * This tests the "class" option which lets you construct any class with a * no-arg constructor. --- 82,86 ---- } ! /** * This tests the "class" option which lets you construct any class with a * no-arg constructor. *************** *** 101,106 **** } ! /* ! * This tests the "class" option with the ImpliedPackages configuration * option which lets you omit the package from the class name. */ --- 98,103 ---- } ! /** ! * Tests the "class" option with the ImpliedPackages configuration * option which lets you omit the package from the class name. */ *************** *** 117,122 **** } ! /* ! * This tests the "class" option with the AllowedPackages configuration * option which restricts the classes that can be loaded. */ --- 114,132 ---- } ! /** ! * Tests the "class" option with the ImpliedPackages configuration ! * option which lets you omit the package from the class name. ! */ ! public void testSetpropsThrows() throws Exception ! { ! String tmpl = "#setprops $e class=\"java.lang.Exception\""; ! tmpl += "\n{\n"; ! tmpl += "}\n"; ! tmpl += "$e"; ! assertStringTemplateThrows(tmpl, WebMacroException.class); ! } ! ! /** ! * Tests the "class" option with the AllowedPackages configuration * option which restricts the classes that can be loaded. */ *************** *** 127,130 **** --- 137,141 ---- tmpl += "}\n"; tmpl += "$WM"; + System.err.println(_wm.getBroker()); assertStringTemplateThrows(tmpl, WebMacroException.class); } |