1 52 53 package freemarker.testcase; 54 55 import junit.framework.Test; 56 import junit.framework.TestResult; 57 import junit.framework.TestSuite; 58 import freemarker.template.SimpleScalar; 59 import freemarker.testcase.models.ExceptionModel; 60 61 67 public class TestException extends AbstractTestCase { 68 69 public TestException ( String aTestname ) { 70 super( aTestname ); 71 } 72 73 76 public void setUp() { 77 setUpFiles( "test-exception.html" ); 78 root.put( "message", new SimpleScalar( "Hello, world!" ) ); 79 root.put( "test", new ExceptionModel() ); 80 } 81 82 85 public static Test suite() { 86 TestSuite suite = new TestSuite(); 87 suite.addTest(new TestException("testException")); 88 return suite; 89 } 90 91 94 public static void main (String args[]) throws Exception { 95 AbstractTestCase cTester = new TestException( "test-exception.html" ); 96 TestResult cResult = new TestResult(); 97 cTester.run( cResult ); 98 } 99 100 } 101 | Popular Tags |