1 52 53 package freemarker.testcase; 54 55 import freemarker.template.SimpleHash; 56 import freemarker.template.SimpleScalar; 57 58 68 public class TestExtendedHash extends AbstractTestCase { 69 70 public TestExtendedHash(String aTestname) { 71 super( aTestname ); 72 } 73 74 77 public void setUp() { 78 setUpFiles( "test-exthash.html" ); 79 root.put("message", new SimpleScalar("Hello, world!")); 80 81 SimpleHash hash = new SimpleHash(); 82 83 hash.put( "aardvark", "one" ); 84 hash.put( "kiwi", "two" ); 85 hash.put( "gecko", "three" ); 86 hash.put( "cat", "four" ); 87 hash.put( "dog", "five" ); 88 hash.put( "elephant", "six" ); 89 hash.put( "squirrel", "seven" ); 90 hash.put( "zebra", "eight" ); 91 92 root.put( "animals", hash ); 93 } 94 95 97 public static void main( String [] argc ) throws Exception { 98 AbstractTestCase cTest = new TestExtendedHash( "test-exthash.html" ); 99 cTest.run(); 100 } 101 } 102 | Popular Tags |