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
20 * * ECOMP is a trademark and service mark of AT&T Intellectual Property.
\r
22 ******************************************************************************/
\r
23 package com.onap.aaf.cadi.aaf;
\r
25 import static org.junit.Assert.*;
\r
27 import org.junit.Before;
\r
28 import org.junit.Test;
\r
29 import org.onap.aaf.cadi.cm.CertException;
\r
31 public class JU_CertExceptionTest {
\r
34 public void setUp() throws Exception {
\r
38 public void test() {
\r
39 CertException ex = new CertException();
\r
42 ex = new CertException("Exception Message");
\r
44 assertEquals(ex.getMessage(),"Exception Message");
\r
46 ex = new CertException(new Throwable());
\r
48 assertNotNull(ex.getCause());
\r
50 ex = new CertException("Exception Message1", new Throwable());
\r
51 assertNotNull(ex.getCause());
\r
52 assertEquals(ex.getMessage(),"Exception Message1");
\r
56 public void test3() {
\r
57 CertException ex = new CertException();
\r
60 ex = new CertException("Exception Message");
\r
62 assertEquals(ex.getMessage(),"Exception Message");
\r
64 ex = new CertException(new Throwable());
\r
66 assertNotNull(ex.getCause());
\r
68 ex = new CertException("Exception Message1", new Throwable());
\r
69 assertNotNull(ex.getCause());
\r
70 assertEquals(ex.getMessage(),"Exception Message1");
\r
75 public void test1() {
\r
76 CertException ex = new CertException();
\r
79 ex = new CertException("Exception Message");
\r
81 assertEquals(ex.getMessage(),"Exception Message");
\r
83 ex = new CertException(new Throwable());
\r
85 assertNotNull(ex.getCause());
\r
87 ex = new CertException("Exception Message1", new Throwable());
\r
88 assertNotNull(ex.getCause());
\r
89 assertEquals(ex.getMessage(),"Exception Message1");
\r
94 public void test2() {
\r
95 CertException ex = new CertException();
\r
98 ex = new CertException("Exception Message");
\r
100 assertEquals(ex.getMessage(),"Exception Message");
\r
102 ex = new CertException(new Throwable());
\r
104 assertNotNull(ex.getCause());
\r
106 ex = new CertException("Exception Message1", new Throwable());
\r
107 assertNotNull(ex.getCause());
\r
108 assertEquals(ex.getMessage(),"Exception Message1");
\r
111 public void test4() {
\r
112 CertException ex = new CertException();
\r
115 ex = new CertException("Exception Message");
\r
117 assertEquals(ex.getMessage(),"Exception Message");
\r
119 ex = new CertException(new Throwable());
\r
121 assertNotNull(ex.getCause());
\r
123 ex = new CertException("Exception Message1", new Throwable());
\r
124 assertNotNull(ex.getCause());
\r
125 assertEquals(ex.getMessage(),"Exception Message1");
\r
129 public void test5() {
\r
130 CertException ex = new CertException();
\r
133 ex = new CertException("Exception Message");
\r
135 assertEquals(ex.getMessage(),"Exception Message");
\r
137 ex = new CertException(new Throwable());
\r
139 assertNotNull(ex.getCause());
\r
141 ex = new CertException("Exception Message1", new Throwable());
\r
142 assertNotNull(ex.getCause());
\r
143 assertEquals(ex.getMessage(),"Exception Message1");
\r
147 public void test6() {
\r
148 CertException ex = new CertException();
\r
151 ex = new CertException("Exception Message");
\r
153 assertEquals(ex.getMessage(),"Exception Message");
\r
155 ex = new CertException(new Throwable());
\r
157 assertNotNull(ex.getCause());
\r
159 ex = new CertException("Exception Message1", new Throwable());
\r
160 assertNotNull(ex.getCause());
\r
161 assertEquals(ex.getMessage(),"Exception Message1");
\r
165 public void test7() {
\r
166 CertException ex = new CertException();
\r
169 ex = new CertException("Exception Message");
\r
171 assertEquals(ex.getMessage(),"Exception Message");
\r
173 ex = new CertException(new Throwable());
\r
175 assertNotNull(ex.getCause());
\r
177 ex = new CertException("Exception Message1", new Throwable());
\r
178 assertNotNull(ex.getCause());
\r
179 assertEquals(ex.getMessage(),"Exception Message1");
\r
184 public void test8() {
\r
185 CertException ex = new CertException();
\r
188 ex = new CertException("Exception Message");
\r
190 assertEquals(ex.getMessage(),"Exception Message");
\r
192 ex = new CertException(new Throwable());
\r
194 assertNotNull(ex.getCause());
\r
196 ex = new CertException("Exception Message1", new Throwable());
\r
197 assertNotNull(ex.getCause());
\r
198 assertEquals(ex.getMessage(),"Exception Message1");
\r
202 public void test9() {
\r
203 CertException ex = new CertException();
\r
206 ex = new CertException("Exception Message");
\r
208 assertEquals(ex.getMessage(),"Exception Message");
\r
210 ex = new CertException(new Throwable());
\r
212 assertNotNull(ex.getCause());
\r
214 ex = new CertException("Exception Message1", new Throwable());
\r
215 assertNotNull(ex.getCause());
\r
216 assertEquals(ex.getMessage(),"Exception Message1");
\r
220 public void test10() {
\r
221 CertException ex = new CertException();
\r
224 ex = new CertException("Exception Message");
\r
226 assertEquals(ex.getMessage(),"Exception Message");
\r
228 ex = new CertException(new Throwable());
\r
230 assertNotNull(ex.getCause());
\r
232 ex = new CertException("Exception Message1", new Throwable());
\r
233 assertNotNull(ex.getCause());
\r
234 assertEquals(ex.getMessage(),"Exception Message1");
\r