1 /*******************************************************************************
\r
2 * ============LICENSE_START====================================================
\r
4 * * ===========================================================================
\r
5 * * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
\r
6 * * ===========================================================================
\r
7 * * Licensed under the Apache License, Version 2.0 (the "License");
\r
8 * * you may not use this file except in compliance with the License.
\r
9 * * You may obtain a copy of the License at
\r
11 * * http://www.apache.org/licenses/LICENSE-2.0
\r
13 * * Unless required by applicable law or agreed to in writing, software
\r
14 * * distributed under the License is distributed on an "AS IS" BASIS,
\r
15 * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
\r
16 * * See the License for the specific language governing permissions and
\r
17 * * limitations under the License.
\r
18 * * ============LICENSE_END====================================================
\r
21 ******************************************************************************/
\r
22 package org.onap.aaf.cadi.test;
\r
24 import static org.junit.Assert.*;
\r
26 import org.junit.Test;
\r
27 import org.onap.aaf.cadi.CadiException;
\r
29 import static org.hamcrest.CoreMatchers.is;
\r
31 public class JU_CadiException {
\r
33 public void testCadiException() {
\r
34 CadiException exception = new CadiException();
\r
36 assertNotNull(exception);
\r
40 public void testCadiExceptionString() {
\r
41 CadiException exception = new CadiException("New Exception");
\r
42 assertNotNull(exception);
\r
43 assertThat(exception.getMessage(), is("New Exception"));
\r
47 public void testCadiExceptionThrowable() {
\r
48 CadiException exception = new CadiException(new Throwable("New Exception"));
\r
49 assertNotNull(exception);
\r
50 assertThat(exception.getMessage(), is("java.lang.Throwable: New Exception"));
\r
54 public void testCadiExceptionStringThrowable() {
\r
55 CadiException exception = new CadiException("New Exception",new Throwable("New Exception"));
\r
56 assertNotNull(exception);
\r
57 assertThat(exception.getMessage(), is("New Exception"));
\r
62 public void testCadiException1() {
\r
63 CadiException exception = new CadiException();
\r
65 assertNotNull(exception);
\r
69 public void testCadiExceptionString1() {
\r
70 CadiException exception = new CadiException("New Exception");
\r
71 assertNotNull(exception);
\r
72 assertThat(exception.getMessage(), is("New Exception"));
\r
76 public void testCadiExceptionThrowable1() {
\r
77 CadiException exception = new CadiException(new Throwable("New Exception"));
\r
78 assertNotNull(exception);
\r
79 assertThat(exception.getMessage(), is("java.lang.Throwable: New Exception"));
\r
83 public void testCadiExceptionStringThrowable1() {
\r
84 CadiException exception = new CadiException("New Exception",new Throwable("New Exception"));
\r
85 assertNotNull(exception);
\r
86 assertThat(exception.getMessage(), is("New Exception"));
\r
91 public void testCadiException2() {
\r
92 CadiException exception = new CadiException();
\r
94 assertNotNull(exception);
\r
98 public void testCadiExceptionString2() {
\r
99 CadiException exception = new CadiException("New Exception");
\r
100 assertNotNull(exception);
\r
101 assertThat(exception.getMessage(), is("New Exception"));
\r
105 public void testCadiExceptionThrowable2() {
\r
106 CadiException exception = new CadiException(new Throwable("New Exception"));
\r
107 assertNotNull(exception);
\r
108 assertThat(exception.getMessage(), is("java.lang.Throwable: New Exception"));
\r
112 public void testCadiExceptionStringThrowable2() {
\r
113 CadiException exception = new CadiException("New Exception",new Throwable("New Exception"));
\r
114 assertNotNull(exception);
\r
115 assertThat(exception.getMessage(), is("New Exception"));
\r