hivemind-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hls...@apache.org
Subject cvs commit: jakarta-hivemind/framework/src/test/hivemind/test TestMessagesImpl.java
Date Tue, 20 Jul 2004 17:25:27 GMT
hlship      2004/07/20 10:25:27

  Modified:    framework/src/test/hivemind/test TestMessagesImpl.java
  Log:
  Improve how Messages outputs exceptions (to match MessageFormatter).
  
  Revision  Changes    Path
  1.6       +18 -0     jakarta-hivemind/framework/src/test/hivemind/test/TestMessagesImpl.java
  
  Index: TestMessagesImpl.java
  ===================================================================
  RCS file: /home/cvs/jakarta-hivemind/framework/src/test/hivemind/test/TestMessagesImpl.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- TestMessagesImpl.java	25 Jun 2004 20:20:04 -0000	1.5
  +++ TestMessagesImpl.java	20 Jul 2004 17:25:27 -0000	1.6
  @@ -16,6 +16,7 @@
   
   import java.util.Locale;
   
  +import org.apache.hivemind.ApplicationRuntimeException;
   import org.apache.hivemind.Messages;
   import org.apache.hivemind.Resource;
   import org.apache.hivemind.impl.MessagesImpl;
  @@ -97,6 +98,23 @@
           assertEquals(
               "[alpha, bravo, delta, gamma]",
               m.format("four-arg", new String[] { "alpha", "bravo", "delta", "gamma" }));
  +    }
  +
  +    public void testException() throws Exception
  +    {
  +        Messages m = read("config/Localized.xml", Locale.ENGLISH);
   
  +        assertEquals(
  +            "exception: Exception Message",
  +            m.format("exception", new ApplicationRuntimeException("Exception Message")));
  +    }
  +
  +    public void testExceptionNoMessage() throws Exception
  +    {
  +        Messages m = read("config/Localized.xml", Locale.ENGLISH);
  +
  +        assertEquals(
  +            "exception: java.lang.NullPointerException",
  +            m.format("exception", new NullPointerException()));
       }
   }
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: hivemind-cvs-unsubscribe@jakarta.apache.org
For additional commands, e-mail: hivemind-cvs-help@jakarta.apache.org


Mime
View raw message