1   /* $Id: MessengerExceptionTest.java,v 1.1 2004/03/17 21:20:12 johndavidtaylor Exp $
2    * Created on Mar 14, 2004 by jdt
3    * The alipes project
4    * (c) 2004 
5    *
6    */
7   package org.abraracourcix.alipes.common.messaging;
8   
9   import junit.framework.TestCase;
10  
11  /***
12   * Trivial tests of exception. 
13   * 
14   * @author jdt
15   */
16  public final class MessengerExceptionTest extends TestCase {
17      /***
18       * Run the text ui
19       * @param args ingored
20       */
21      public static void main(final String[] args) {
22          junit.textui.TestRunner.run(MessengerExceptionTest.class);
23      }
24      /***
25       * Class to test for void MessengerException()
26       */
27      public void testMessengerException() {
28          new MessengerException();
29      }
30      /***
31       * Class to test for void MessengerException(String)
32       */
33      public void testMessengerExceptionString() {
34          final Exception ex = new MessengerException("fred");
35          assertEquals(ex.getMessage(), "fred");
36      }
37      /***
38       * Class to test for void MessengerException(Throwable)
39       */
40      public void testMessengerExceptionThrowable() {
41          final Exception ex2 = new Exception();
42          final Exception ex = new MessengerException(ex2);
43          assertEquals(ex.getCause(), ex2);
44      }
45      /***
46       * Class to test for void MessengerException(String, Throwable)
47       */
48      public void testMessengerExceptionStringThrowable() {
49          final Exception ex2 = new Exception();
50          final Exception ex = new MessengerException("fred",ex2);
51          assertEquals(ex.getCause(), ex2);
52          assertEquals(ex.getMessage(), "fred");
53      }
54  }
55  
56  
57  /*
58   *  $Log: MessengerExceptionTest.java,v $
59   *  Revision 1.1  2004/03/17 21:20:12  johndavidtaylor
60   *  Copied across from incubation in beanpeeler
61   *
62   *  Revision 1.1  2004/03/14 18:49:14  johndavidtaylor
63   *  corrected comments
64   *
65   */