1 17 18 24 package javax.jms; 25 26 import junit.framework.TestCase; 27 28 29 32 public class MessageEOFExceptionTest extends TestCase { 33 public void testConstructorNull() { 34 MessageEOFException ex = new MessageEOFException(null); 35 assertNull(ex.getMessage()); 36 assertNull(ex.getErrorCode()); 37 assertNull(ex.getLinkedException()); 38 } 39 40 public void testConstructorNullNull() { 41 MessageEOFException ex = new MessageEOFException(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 MessageEOFException ex = new MessageEOFException(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 MessageEOFException ex = new MessageEOFException(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 MessageEOFException ex = new MessageEOFException(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 MessageEOFException ex = new MessageEOFException(expectedMessage, expectedCode); 75 assertEquals(expectedMessage, ex.getMessage()); 76 assertEquals(expectedCode, ex.getErrorCode()); 77 assertNull(ex.getLinkedException()); 78 } 79 } 80 | Popular Tags |