2
* Licensed to the Apache Software Foundation (ASF) under one
3
* or more contributor license agreements. See the NOTICE file
4
* distributed with this work for additional information
5
* regarding copyright ownership. The ASF licenses this file
6
* to you under the Apache License, Version 2.0 (the
7
* "License"); you may not use this file except in compliance
8
* with the License. You may obtain a copy of the License at
10
* http://www.apache.org/licenses/LICENSE-2.0
12
* Unless required by applicable law or agreed to in writing,
13
* software distributed under the License is distributed on an
14
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15
* KIND, either express or implied. See the License for the
16
* specific language governing permissions and limitations
21
// This source code implements specifications defined by the Java
22
// Community Process. In order to remain compliant with the specification
23
// DO NOT add / change / or delete method signatures!
28
import junit.framework.TestCase;
31
* @version $Rev: 467553 $ $Date: 2006-10-25 04:01:51 +0000 (mer 25 oct 2006) $
33
public class MessageNotWriteableExceptionTest extends TestCase {
34
public void testConstructorNull() {
35
MessageNotWriteableException ex = new MessageNotWriteableException(null);
36
assertNull(ex.getMessage());
37
assertNull(ex.getErrorCode());
38
assertNull(ex.getLinkedException());
41
public void testConstructorNullNull() {
42
MessageNotWriteableException ex = new MessageNotWriteableException(null, null);
43
assertNull(ex.getMessage());
44
assertNull(ex.getErrorCode());
45
assertNull(ex.getLinkedException());
48
public void testConstructorNullString() {
49
String expected = "some code";
50
MessageNotWriteableException ex = new MessageNotWriteableException(null, expected);
51
assertNull(ex.getMessage());
52
assertEquals(expected, ex.getErrorCode());
53
assertNull(ex.getLinkedException());
56
public void testConstructorString() {
57
String expected = "some message";
58
MessageNotWriteableException ex = new MessageNotWriteableException(expected);
59
assertEquals(expected, ex.getMessage());
60
assertNull(ex.getErrorCode());
61
assertNull(ex.getLinkedException());
64
public void testConstructorStringNull() {
65
String expected = "some message";
66
MessageNotWriteableException ex = new MessageNotWriteableException(expected, null);
67
assertEquals(expected, ex.getMessage());
68
assertNull(ex.getErrorCode());
69
assertNull(ex.getLinkedException());
72
public void testConstructorStringString() {
73
String expectedMessage = "some message";
74
String expectedCode = "some code";
75
MessageNotWriteableException ex = new MessageNotWriteableException(expectedMessage, expectedCode);
76
assertEquals(expectedMessage, ex.getMessage());
77
assertEquals(expectedCode, ex.getErrorCode());
78
assertNull(ex.getLinkedException());