Resolved Fortify System Information Leak issues
[policy/engine.git] / ONAP-XACML / src / test / java / org / onap / policy / xacml / test / std / pap / StdEngineTest.java
1 /*-
2  * ============LICENSE_START=======================================================
3  * ONAP-XACML
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 package org.onap.policy.xacml.test.std.pap;
21
22 import static org.junit.Assert.assertTrue;
23
24 import java.io.IOException;
25 import java.nio.file.Path;
26 import java.nio.file.Paths;
27 import java.util.Properties;
28
29 import org.junit.Before;
30 import org.junit.Test;
31 import org.onap.policy.common.logging.flexlogger.FlexLogger;
32 import org.onap.policy.common.logging.flexlogger.Logger;
33 import org.onap.policy.xacml.std.pap.StdEngine;
34
35 import com.att.research.xacml.api.pap.PAPException;
36
37 public class StdEngineTest {
38         
39         private static Logger logger = FlexLogger.getLogger(StdEngineTest.class);
40         private Path repository;
41         Properties properties = new Properties();
42         StdEngine stdEngine = null;
43         
44         @Before
45         public void setUp(){
46         
47                 repository = Paths.get("src/test/resources/pdps");
48                 try {
49                         stdEngine = new StdEngine(repository);
50                 } catch (PAPException e) {
51                         logger.info(e);
52                 } catch (IOException e) {
53                         logger.info(e);
54                 }
55         }
56
57         @Test
58         public void testGetDefaultGroup(){
59                 try {
60                         assertTrue(stdEngine.getDefaultGroup() != null);
61                 } catch (PAPException e) {
62                         logger.info(e);
63                 }
64         }       
65         @Test
66         public void testGetGroup(){
67                 try {
68                         assertTrue(stdEngine.getGroup("1") == null);
69                 } catch (PAPException e) {
70                         logger.info(e);
71                 }
72                 
73         }       
74         
75         @Test
76         public void testGetOnapPDPGroups(){
77                 try {
78                         assertTrue(stdEngine.getOnapPDPGroups() != null);
79                 } catch (PAPException e) {
80                         logger.info(e);
81                 }       
82         }       
83         @Test
84         public void testGetPDP(){
85                 try {
86                         assertTrue(stdEngine.getPDP("1") == null);
87                 } catch (PAPException e) {
88                         logger.info(e);
89                 }
90         }       
91         @Test
92         public void testGetPDPGroup(){
93                 try {
94                         assertTrue(stdEngine.getPDPGroup(null) == null);
95                 } catch (PAPException e) {
96                         logger.info(e);
97                 }
98         }
99 }