Merge "Technical debt reduction"
[policy/engine.git] / ONAP-XACML / src / test / java / org / onap / policy / xacml / test / std / pap / StdPDPTest.java
1 package org.onap.policy.xacml.test.std.pap;
2 /*-
3  * ============LICENSE_START=======================================================
4  * ONAP-XACML
5  * ================================================================================
6  * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
7  * ================================================================================
8  * Licensed under the Apache License, Version 2.0 (the "License");
9  * you may not use this file except in compliance with the License.
10  * You may obtain a copy of the License at
11  * 
12  *      http://www.apache.org/licenses/LICENSE-2.0
13  * 
14  * Unless required by applicable law or agreed to in writing, software
15  * distributed under the License is distributed on an "AS IS" BASIS,
16  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17  * See the License for the specific language governing permissions and
18  * limitations under the License.
19  * ============LICENSE_END=========================================================
20  */
21 import static org.junit.Assert.assertTrue;
22
23 import org.junit.Before;
24 import org.junit.Test;
25 import org.onap.policy.common.logging.flexlogger.FlexLogger;
26 import org.onap.policy.common.logging.flexlogger.Logger;
27 import org.onap.policy.xacml.std.pap.StdPDP;
28 import org.onap.policy.xacml.std.pap.StdPDPStatus;
29
30 public class StdPDPTest {
31
32         private static Logger logger = FlexLogger.getLogger(StdPDPTest.class);
33         
34         private StdPDP stdPDP;
35         
36         @Before
37         public void setUp(){
38         
39                 try {
40                         stdPDP = new StdPDP();
41                 } catch (Exception e) {
42                         logger.error(e);
43                 } 
44         }
45
46         @Test
47         public void testGetId() {
48                 try {
49                         stdPDP.setId("testId");
50                         assertTrue(stdPDP.getId() != null);
51                 } catch (Exception e) {
52                         logger.error(e);
53                 }
54         }
55
56         @Test
57         public void testGetName() {
58                 try {
59                         stdPDP.setName("abc");
60                         assertTrue(stdPDP.getName() != null);
61                 } catch (Exception e) {
62                         logger.error(e);
63                 }
64         }
65
66         @Test
67         public void testGetDescription() {
68                 try {
69                         stdPDP.setDescription("somee here");
70                         assertTrue(stdPDP.getDescription() != null);
71                 } catch (Exception e) {
72                         logger.error(e);
73                 }
74         }
75
76         @Test
77         public void testGetStatus() {
78                 try {
79                         stdPDP.setStatus(new StdPDPStatus());
80                         assertTrue(stdPDP.getStatus() != null);
81                 } catch (Exception e) {
82                         logger.error(e);
83                 }
84         }
85
86         @Test
87         public void testGetPipConfigs() {
88                 try {
89                         assertTrue(stdPDP.getPipConfigs() != null);
90                 } catch (Exception e) {
91                         logger.error(e);
92                 }
93         }
94
95         @Test
96         public void testGetJmxPort() {
97                 try {
98                         stdPDP.setJmxPort(123);
99                         assertTrue(stdPDP.getJmxPort() != null);
100                 } catch (Exception e) {
101                         logger.error(e);
102                 }
103         }
104
105 }