1 52 53 package freemarker.testcase; 54 55 import freemarker.template.SimpleScalar; 56 import freemarker.template.TemplateBooleanModel; 57 import freemarker.testcase.models.BooleanHash1; 58 import freemarker.testcase.models.BooleanHash2; 59 import freemarker.testcase.models.BooleanList1; 60 import freemarker.testcase.models.BooleanList2; 61 62 66 public class TestBoolean extends AbstractTestCase { 67 68 public TestBoolean(String aTestname) { 69 super( aTestname ); 70 } 71 72 75 public void setUp() { 76 setUpFiles( "test-boolean.html" ); 77 78 root.put("message", new SimpleScalar("Hello, world!")); 80 81 root.put( "boolean1", TemplateBooleanModel.FALSE); 82 root.put( "boolean2", TemplateBooleanModel.TRUE); 83 root.put( "boolean3", TemplateBooleanModel.TRUE); 84 root.put( "boolean4", TemplateBooleanModel.TRUE); 85 root.put( "boolean5", TemplateBooleanModel.FALSE); 86 87 root.put( "list1", new BooleanList1() ); 88 root.put( "list2", new BooleanList2() ); 89 90 root.put( "hash1", new BooleanHash1() ); 91 root.put( "hash2", new BooleanHash2() ); 92 } 93 94 95 97 public static void main( String [] argc ) throws Exception { 98 AbstractTestCase cTest = new TestBoolean( "test-boolean.html" ); 99 100 cTest.run(); 101 } 102 } 103 | Popular Tags |