2 * ============LICENSE_START=======================================================
4 * ================================================================================
5 * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
6 * ================================================================================
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
18 * ============LICENSE_END=========================================================
21 package org.onap.policy.test;
24 import org.onap.policy.api.PolicyEventException;
26 import static org.junit.Assert.*;
29 * The class <code>PolicyEventExceptionTest</code> contains tests for the class <code>{@link PolicyEventException}</code>.
31 * @generatedBy CodePro at 6/1/16 1:40 PM
32 * @version $Revision: 1.0 $
34 public class PolicyEventExceptionTest {
36 * Run the PolicyEventException() constructor test.
40 * @generatedBy CodePro at 6/1/16 1:40 PM
43 public void testPolicyEventException_1()
46 PolicyEventException result = new PolicyEventException();
48 // add additional test code here
49 assertNotNull(result);
50 assertEquals(null, result.getCause());
51 assertEquals("org.onap.policy.api.PolicyEventException", result.toString());
52 assertEquals(null, result.getLocalizedMessage());
53 assertEquals(null, result.getMessage());
57 * Run the PolicyEventException(String) constructor test.
61 * @generatedBy CodePro at 6/1/16 1:40 PM
64 public void testPolicyEventException_2()
68 PolicyEventException result = new PolicyEventException(message);
70 // add additional test code here
71 assertNotNull(result);
72 assertEquals(null, result.getCause());
73 assertEquals("org.onap.policy.api.PolicyEventException: ", result.toString());
74 assertEquals("", result.getLocalizedMessage());
75 assertEquals("", result.getMessage());
79 * Run the PolicyEventException(Throwable) constructor test.
83 * @generatedBy CodePro at 6/1/16 1:40 PM
86 public void testPolicyEventException_3()
88 Throwable cause = new Throwable();
90 PolicyEventException result = new PolicyEventException(cause);
92 // add additional test code here
93 assertNotNull(result);
94 assertEquals("org.onap.policy.api.PolicyEventException: java.lang.Throwable", result.toString());
95 assertEquals("java.lang.Throwable", result.getLocalizedMessage());
96 assertEquals("java.lang.Throwable", result.getMessage());
100 * Run the PolicyEventException(String,Throwable) constructor test.
104 * @generatedBy CodePro at 6/1/16 1:40 PM
107 public void testPolicyEventException_4()
110 Throwable cause = new Throwable();
112 PolicyEventException result = new PolicyEventException(message, cause);
114 // add additional test code here
115 assertNotNull(result);
116 assertEquals("org.onap.policy.api.PolicyEventException: ", result.toString());
117 assertEquals("", result.getLocalizedMessage());
118 assertEquals("", result.getMessage());
122 * Run the PolicyEventException(String,Throwable,boolean,boolean) constructor test.
126 * @generatedBy CodePro at 6/1/16 1:40 PM
129 public void testPolicyEventException_5()
132 Throwable cause = new Throwable();
133 boolean enableSuppression = true;
134 boolean writableStackTrace = true;
136 PolicyEventException result = new PolicyEventException(message, cause, enableSuppression, writableStackTrace);
138 // add additional test code here
139 assertNotNull(result);
140 assertEquals("org.onap.policy.api.PolicyEventException: ", result.toString());
141 assertEquals("", result.getLocalizedMessage());
142 assertEquals("", result.getMessage());
146 * Perform pre-test initialization.
149 * if the initialization fails for some reason
151 * @generatedBy CodePro at 6/1/16 1:40 PM
156 // add additional set up code here
160 * Perform post-test clean-up.
163 * if the clean-up fails for some reason
165 * @generatedBy CodePro at 6/1/16 1:40 PM
168 public void tearDown()
170 // Add additional tear down code here
176 * @param args the command line arguments
178 * @generatedBy CodePro at 6/1/16 1:40 PM
180 public static void main(String[] args) {
181 new org.junit.runner.JUnitCore().run(PolicyEventExceptionTest.class);