1 52 53 package freemarker.testcase; 54 55 import freemarker.template.SimpleHash; 56 import freemarker.template.SimpleScalar; 57 import freemarker.template.SimpleSequence; 58 59 63 public class TestListIterators extends AbstractTestCase { 64 65 66 public TestListIterators(String aTestname) { 67 super( aTestname ); 68 } 69 70 73 public void setUp() { 74 setUpFiles( "test-listiterators.html" ); 75 76 root.put("message", new SimpleScalar("Hello, world!")); 77 78 SimpleSequence cModel1 = new SimpleSequence(); 79 SimpleHash cModel2 = new SimpleHash(); 80 SimpleHash cModel3 = new SimpleHash(); 81 82 cModel1.add( "one" ); 83 cModel1.add( "two" ); 84 cModel1.add( "three" ); 85 cModel1.add( "four" ); 86 cModel1.add( "five" ); 87 88 cModel2.put( "key", cModel1 ); 89 cModel3.put( "value", cModel2 ); 90 91 root.put( "list", cModel1 ); 92 root.put( "hash", cModel2 ); 93 root.put( "hash2", cModel3 ); 94 } 95 96 98 public static void main( String [] argc ) throws Exception { 99 AbstractTestCase cTest = new TestListIterators( "test-listiterators.html" ); 100 cTest.run(); 101 } 102 } 103 | Popular Tags |