58c45b97cdaf47187b60f9195db714dfd21b861b
[policy/engine.git] / PolicyEngineAPI / src / test / java / org / onap / policy / test / PolicyEngineExceptionTest.java
1 /*-
2  * ============LICENSE_START=======================================================
3  * PolicyEngineAPI
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
10  * 
11  *      http://www.apache.org/licenses/LICENSE-2.0
12  * 
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=========================================================
19  */
20
21 package org.onap.policy.test;
22
23 import org.junit.*;
24 import org.onap.policy.api.PolicyEngineException;
25
26 import static org.junit.Assert.*;
27
28 /**
29  * The class <code>PolicyEngineExceptionTest</code> contains tests for the class <code>{@link PolicyEngineException}</code>.
30  *
31  * @generatedBy CodePro at 6/1/16 1:41 PM
32  * @version $Revision: 1.0 $
33  */
34 public class PolicyEngineExceptionTest {
35         /**
36          * Run the PolicyEngineException() constructor test.
37          *
38          * @throws Exception
39          *
40          * @generatedBy CodePro at 6/1/16 1:41 PM
41          */
42         @Test
43         public void testPolicyEngineException_1()
44                 throws Exception {
45
46                 PolicyEngineException result = new PolicyEngineException();
47
48                 // add additional test code here
49                 assertNotNull(result);
50                 assertEquals(null, result.getCause());
51                 assertEquals("org.onap.policy.api.PolicyEngineException", result.toString());
52                 assertEquals(null, result.getLocalizedMessage());
53                 assertEquals(null, result.getMessage());
54         }
55
56         /**
57          * Run the PolicyEngineException(String) constructor test.
58          *
59          * @throws Exception
60          *
61          * @generatedBy CodePro at 6/1/16 1:41 PM
62          */
63         @Test
64         public void testPolicyEngineException_2()
65                 throws Exception {
66                 String message = "";
67
68                 PolicyEngineException result = new PolicyEngineException(message);
69
70                 // add additional test code here
71                 assertNotNull(result);
72                 assertEquals(null, result.getCause());
73                 assertEquals("org.onap.policy.api.PolicyEngineException: ", result.toString());
74                 assertEquals("", result.getLocalizedMessage());
75                 assertEquals("", result.getMessage());
76         }
77
78         /**
79          * Run the PolicyEngineException(Throwable) constructor test.
80          *
81          * @throws Exception
82          *
83          * @generatedBy CodePro at 6/1/16 1:41 PM
84          */
85         @Test
86         public void testPolicyEngineException_3()
87                 throws Exception {
88                 Throwable cause = new Throwable();
89
90                 PolicyEngineException result = new PolicyEngineException(cause);
91
92                 // add additional test code here
93                 assertNotNull(result);
94                 assertEquals("org.onap.policy.api.PolicyEngineException: java.lang.Throwable", result.toString());
95                 assertEquals("java.lang.Throwable", result.getLocalizedMessage());
96                 assertEquals("java.lang.Throwable", result.getMessage());
97         }
98
99         /**
100          * Run the PolicyEngineException(String,Throwable) constructor test.
101          *
102          * @throws Exception
103          *
104          * @generatedBy CodePro at 6/1/16 1:41 PM
105          */
106         @Test
107         public void testPolicyEngineException_4()
108                 throws Exception {
109                 String message = "";
110                 Throwable cause = new Throwable();
111
112                 PolicyEngineException result = new PolicyEngineException(message, cause);
113
114                 // add additional test code here
115                 assertNotNull(result);
116                 assertEquals("org.onap.policy.api.PolicyEngineException: ", result.toString());
117                 assertEquals("", result.getLocalizedMessage());
118                 assertEquals("", result.getMessage());
119         }
120
121         /**
122          * Run the PolicyEngineException(String,Throwable,boolean,boolean) constructor test.
123          *
124          * @throws Exception
125          *
126          * @generatedBy CodePro at 6/1/16 1:41 PM
127          */
128         @Test
129         public void testPolicyEngineException_5()
130                 throws Exception {
131                 String message = "";
132                 Throwable cause = new Throwable();
133                 boolean enableSuppression = true;
134                 boolean writableStackTrace = true;
135
136                 PolicyEngineException result = new PolicyEngineException(message, cause, enableSuppression, writableStackTrace);
137
138                 // add additional test code here
139                 assertNotNull(result);
140                 assertEquals("org.onap.policy.api.PolicyEngineException: ", result.toString());
141                 assertEquals("", result.getLocalizedMessage());
142                 assertEquals("", result.getMessage());
143         }
144
145         /**
146          * Perform pre-test initialization.
147          *
148          * @throws Exception
149          *         if the initialization fails for some reason
150          *
151          * @generatedBy CodePro at 6/1/16 1:41 PM
152          */
153         @Before
154         public void setUp()
155                 throws Exception {
156                 // add additional set up code here
157         }
158
159         /**
160          * Perform post-test clean-up.
161          *
162          * @throws Exception
163          *         if the clean-up fails for some reason
164          *
165          * @generatedBy CodePro at 6/1/16 1:41 PM
166          */
167         @After
168         public void tearDown()
169                 throws Exception {
170                 // Add additional tear down code here
171         }
172
173         /**
174          * Launch the test.
175          *
176          * @param args the command line arguments
177          *
178          * @generatedBy CodePro at 6/1/16 1:41 PM
179          */
180         public static void main(String[] args) {
181                 new org.junit.runner.JUnitCore().run(PolicyEngineExceptionTest.class);
182         }
183 }