~ubuntu-branches/ubuntu/maverick/geronimo-jms-1.1-spec/maverick

« back to all changes in this revision

Viewing changes to src/test/java/javax/jms/InvalidSelectorExceptionTest.java

  • Committer: Bazaar Package Importer
  • Author(s): Thierry Carrez
  • Date: 2009-02-10 13:51:53 UTC
  • Revision ID: james.westby@ubuntu.com-20090210135153-rwgj7a2njoau9qbx
Tags: upstream-1.1
ImportĀ upstreamĀ versionĀ 1.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
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
 
9
 *
 
10
 *  http://www.apache.org/licenses/LICENSE-2.0
 
11
 *
 
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
 
17
 * under the License.
 
18
 */
 
19
 
 
20
//
 
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!
 
24
//
 
25
 
 
26
package javax.jms;
 
27
 
 
28
import junit.framework.TestCase;
 
29
 
 
30
/**
 
31
 * @version $Rev: 467553 $ $Date: 2006-10-25 04:01:51 +0000 (mer 25 oct 2006) $
 
32
 */
 
33
public class InvalidSelectorExceptionTest extends TestCase {
 
34
    public void testConstructorNull() {
 
35
        InvalidSelectorException ex = new InvalidSelectorException(null);
 
36
        assertNull(ex.getMessage());
 
37
        assertNull(ex.getErrorCode());
 
38
        assertNull(ex.getLinkedException());
 
39
    }
 
40
 
 
41
    public void testConstructorNullNull() {
 
42
        InvalidSelectorException ex = new InvalidSelectorException(null, null);
 
43
        assertNull(ex.getMessage());
 
44
        assertNull(ex.getErrorCode());
 
45
        assertNull(ex.getLinkedException());
 
46
    }
 
47
 
 
48
    public void testConstructorNullString() {
 
49
        String expected = "some code";
 
50
        InvalidSelectorException ex = new InvalidSelectorException(null, expected);
 
51
        assertNull(ex.getMessage());
 
52
        assertEquals(expected, ex.getErrorCode());
 
53
        assertNull(ex.getLinkedException());
 
54
    }
 
55
 
 
56
    public void testConstructorString() {
 
57
        String expected = "some message";
 
58
        InvalidSelectorException ex = new InvalidSelectorException(expected);
 
59
        assertEquals(expected, ex.getMessage());
 
60
        assertNull(ex.getErrorCode());
 
61
        assertNull(ex.getLinkedException());
 
62
    }
 
63
 
 
64
    public void testConstructorStringNull() {
 
65
        String expected = "some message";
 
66
        InvalidSelectorException ex = new InvalidSelectorException(expected, null);
 
67
        assertEquals(expected, ex.getMessage());
 
68
        assertNull(ex.getErrorCode());
 
69
        assertNull(ex.getLinkedException());
 
70
    }
 
71
 
 
72
    public void testConstructorStringString() {
 
73
        String expectedMessage = "some message";
 
74
        String expectedCode = "some code";
 
75
        InvalidSelectorException ex = new InvalidSelectorException(expectedMessage, expectedCode);
 
76
        assertEquals(expectedMessage, ex.getMessage());
 
77
        assertEquals(expectedCode, ex.getErrorCode());
 
78
        assertNull(ex.getLinkedException());
 
79
    }
 
80
}