Save This Page
Home » displaytag-1.1.1-src » org » displaytag » decorator » [javadoc | source]
    1   package org.displaytag.decorator;
    2   
    3   import java.util.Date;
    4   import java.util.Locale;
    5   
    6   import junit.framework.TestCase;
    7   
    8   
    9   /**
   10    * Test case for MessageFormatColumnDecoratorTest.
   11    * @author Fabrizio Giustina
   12    * @version $Id$
   13    */
   14   public class MessageFormatColumnDecoratorTest extends TestCase
   15   {
   16   
   17       /**
   18        * @see junit.framework.TestCase#getName()
   19        */
   20       public String getName()
   21       {
   22           return getClass().getName() + "." + super.getName();
   23       }
   24   
   25       /**
   26        * Test with <code>day is {0, date, EEEE}</code>.
   27        */
   28       public void testDate()
   29       {
   30           Object result = new MessageFormatColumnDecorator("day is {0,date,EEEE}", Locale.ENGLISH).decorate(
   31               new Date(0),
   32               null,
   33               null);
   34           assertEquals("day is Thursday", result);
   35       }
   36   
   37       /**
   38        * Test with <code>day is {0, date, EEEE}</code>.
   39        */
   40       public void testWrongDate()
   41       {
   42           Object result = new MessageFormatColumnDecorator("day is {0,date,EEEE}", Locale.ENGLISH).decorate(
   43               "abc",
   44               null,
   45               null);
   46           assertEquals("abc", result);
   47       }
   48   
   49   }

Save This Page
Home » displaytag-1.1.1-src » org » displaytag » decorator » [javadoc | source]