1 52 53 package freemarker.testcase; 54 55 import junit.framework.TestResult; 56 import freemarker.template.SimpleScalar; 57 import freemarker.template.utility.HtmlEscape; 58 import freemarker.template.utility.JythonRuntime; 59 import freemarker.testcase.models.TransformHashWrapper; 60 61 66 public class TestTransform extends AbstractTestCase { 67 68 static JythonRuntime jython = new JythonRuntime(); 69 70 71 public TestTransform( String aTestname ) { 72 super( aTestname ); 73 } 74 75 78 public void setUp() { 79 setUpFiles( "test-transformation.html" ); 80 root.put("message", new SimpleScalar("Hello, world!")); 81 root.put("htmlEscape", new HtmlEscape()); 82 root.put("utility", new TransformHashWrapper()); 83 root.put("jython", jython); 84 } 85 86 89 public static void main (String args[]) throws Exception { 90 AbstractTestCase cTest = new TestTransform( "test-transformation.html" ); 91 TestResult cResult = new TestResult(); 92 93 cTest.run( cResult ); 94 } 95 96 } 97 | Popular Tags |