2 * ============LICENSE_START=======================================================
4 * ================================================================================
5 * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
6 * ================================================================================
7 * Modifications Copyright (C) 2019 Samsung
8 * ================================================================================
9 * Licensed under the Apache License, Version 2.0 (the "License");
10 * you may not use this file except in compliance with the License.
11 * You may obtain a copy of the License at
13 * http://www.apache.org/licenses/LICENSE-2.0
15 * Unless required by applicable law or agreed to in writing, software
16 * distributed under the License is distributed on an "AS IS" BASIS,
17 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18 * See the License for the specific language governing permissions and
19 * limitations under the License.
20 * ============LICENSE_END=========================================================
23 package org.onap.policy.test;
26 import org.onap.policy.api.PolicyConfigException;
27 import static org.junit.Assert.*;
30 * The class <code>PolicyConfigExceptionTest</code> contains tests for the class
31 * <code>{@link PolicyConfigException}</code>.
33 * @generatedBy CodePro at 6/1/16 1:40 PM
34 * @version $Revision: 1.0 $
36 public class PolicyConfigExceptionTest {
38 * Run the PolicyConfigException() constructor test.
42 * @generatedBy CodePro at 6/1/16 1:40 PM
45 public void testPolicyConfigException_1() throws Exception {
47 PolicyConfigException result = new PolicyConfigException();
49 // add additional test code here
50 assertNotNull(result);
51 assertEquals(null, result.getCause());
52 assertEquals("org.onap.policy.api.PolicyConfigException", result.toString());
53 assertEquals(null, result.getLocalizedMessage());
54 assertEquals(null, result.getMessage());
58 * Run the PolicyConfigException(String) constructor test.
62 * @generatedBy CodePro at 6/1/16 1:40 PM
65 public void testPolicyConfigException_2() throws Exception {
68 PolicyConfigException result = new PolicyConfigException(message);
70 // add additional test code here
71 assertNotNull(result);
72 assertEquals(null, result.getCause());
73 assertEquals("org.onap.policy.api.PolicyConfigException: ", result.toString());
74 assertEquals("", result.getLocalizedMessage());
75 assertEquals("", result.getMessage());
79 * Run the PolicyConfigException(Throwable) constructor test.
83 * @generatedBy CodePro at 6/1/16 1:40 PM
86 public void testPolicyConfigException_3() throws Exception {
87 Throwable cause = new Throwable();
89 PolicyConfigException result = new PolicyConfigException(cause);
91 // add additional test code here
92 assertNotNull(result);
93 assertEquals("org.onap.policy.api.PolicyConfigException: java.lang.Throwable",
95 assertEquals("java.lang.Throwable", result.getLocalizedMessage());
96 assertEquals("java.lang.Throwable", result.getMessage());
100 * Run the PolicyConfigException(String,Throwable) constructor test.
104 * @generatedBy CodePro at 6/1/16 1:40 PM
107 public void testPolicyConfigException_4() throws Exception {
109 Throwable cause = new Throwable();
111 PolicyConfigException result = new PolicyConfigException(message, cause);
113 // add additional test code here
114 assertNotNull(result);
115 assertEquals("org.onap.policy.api.PolicyConfigException: ", result.toString());
116 assertEquals("", result.getLocalizedMessage());
117 assertEquals("", result.getMessage());
121 * Run the PolicyConfigException(String,Throwable,boolean,boolean) constructor test.
125 * @generatedBy CodePro at 6/1/16 1:40 PM
128 public void testPolicyConfigException_5() throws Exception {
130 Throwable cause = new Throwable();
131 boolean enableSuppression = true;
132 boolean writableStackTrace = true;
134 PolicyConfigException result =
135 new PolicyConfigException(message, cause, enableSuppression, writableStackTrace);
137 // add additional test code here
138 assertNotNull(result);
139 assertEquals("org.onap.policy.api.PolicyConfigException: ", result.toString());
140 assertEquals("", result.getLocalizedMessage());
141 assertEquals("", result.getMessage());
145 * Perform pre-test initialization.
147 * @throws Exception if the initialization fails for some reason
149 * @generatedBy CodePro at 6/1/16 1:40 PM
152 public void setUp() throws Exception {
153 // add additional set up code here
157 * Perform post-test clean-up.
159 * @throws Exception if the clean-up fails for some reason
161 * @generatedBy CodePro at 6/1/16 1:40 PM
164 public void tearDown() throws Exception {
165 // Add additional tear down code here
171 * @param args the command line arguments
173 * @generatedBy CodePro at 6/1/16 1:40 PM
175 public static void main(String[] args) {
176 new org.junit.runner.JUnitCore().run(PolicyConfigExceptionTest.class);