1 17 18 24 package javax.jms; 25 26 import junit.framework.TestCase; 27 28 29 32 public class MessageNotReadableExceptionTest extends TestCase { 33 public void testConstructorNull() { 34 MessageNotReadableException ex = new MessageNotReadableException(null); 35 assertNull(ex.getMessage()); 36 assertNull(ex.getErrorCode()); 37 assertNull(ex.getLinkedException()); 38 } 39 40 public void testConstructorNullNull() { 41 MessageNotReadableException ex = new MessageNotReadableException(null, null); 42 assertNull(ex.getMessage()); 43 assertNull(ex.getErrorCode()); 44 assertNull(ex.getLinkedException()); 45 } 46 47 public void testConstructorNullString() { 48 String expected = "some code"; 49 MessageNotReadableException ex = new MessageNotReadableException(null, expected); 50 assertNull(ex.getMessage()); 51 assertEquals(expected, ex.getErrorCode()); 52 assertNull(ex.getLinkedException()); 53 } 54 55 public void testConstructorString() { 56 String expected = "some message"; 57 MessageNotReadableException ex = new MessageNotReadableException(expected); 58 assertEquals(expected, ex.getMessage()); 59 assertNull(ex.getErrorCode()); 60 assertNull(ex.getLinkedException()); 61 } 62 63 public void testConstructorStringNull() { 64 String expected = "some message"; 65 MessageNotReadableException ex = new MessageNotReadableException(expected, null); 66 assertEquals(expected, ex.getMessage()); 67 assertNull(ex.getErrorCode()); 68 assertNull(ex.getLinkedException()); 69 } 70 71 public void testConstructorStringString() { 72 String expectedMessage = "some message"; 73 String expectedCode = "some code"; 74 MessageNotReadableException ex = new MessageNotReadableException(expectedMessage, expectedCode); 75 assertEquals(expectedMessage, ex.getMessage()); 76 assertEquals(expectedCode, ex.getErrorCode()); 77 assertNull(ex.getLinkedException()); 78 } 79 } 80 | Popular Tags |