1 package org.apache.turbine.util; 2 3 18 19 import org.apache.turbine.test.BaseTestCase; 20 21 public class FormMessageTest 22 extends BaseTestCase 23 { 24 public FormMessageTest(String name) 25 throws Exception 26 { 27 super(name); 28 } 29 30 public void testCreateFormMessage() 31 { 32 FormMessage fm = new FormMessage("mainForm","someField","A message!"); 33 String fmString = fm.toString(); 34 assertTrue("Make sure toString works",fmString.indexOf("someField")>-1); 35 assertTrue("Make sure toString works",fmString.indexOf("A message")>-1); 36 assertTrue("Make sure toString works",fmString.indexOf("mainForm")>-1); 37 } 38 39 public void testCreateFormMessageMultipleFields() 40 { 41 FormMessage fm = new FormMessage("mainForm","someField","A message!"); 42 fm.setFieldName("someOtherField"); 43 String fmString = fm.toString(); 44 assertTrue("Make sure toString works",fmString.indexOf("someField")>-1); 45 assertTrue("Make sure toString works",fmString.indexOf("someOtherField")>-1); 46 assertTrue("Make sure toString works",fmString.indexOf("A message")>-1); 47 assertTrue("Make sure toString works",fmString.indexOf("mainForm")>-1); 48 } 49 } 50 | Popular Tags |