Sonar Fixes, Formatting
[aaf/authz.git] / auth / auth-core / src / test / java / org / onap / aaf / auth / server / test / JU_AbsServiceStarter.java
1 /**
2  * ============LICENSE_START====================================================
3  * org.onap.aaf
4  * ===========================================================================
5  * Copyright (c) 2018 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
22 package org.onap.aaf.auth.server.test;
23
24 import java.io.ByteArrayOutputStream;
25 import java.io.PrintStream;
26
27 import javax.servlet.Filter;
28
29 import org.junit.After;
30 import org.junit.Before;
31 import org.junit.Test;
32 import org.onap.aaf.auth.rserv.RServlet;
33 import org.onap.aaf.auth.server.AbsService;
34 import org.onap.aaf.auth.server.AbsServiceStarter;
35 import org.onap.aaf.cadi.Access;
36 import org.onap.aaf.cadi.Access.Level;
37 import org.onap.aaf.cadi.CadiException;
38 import org.onap.aaf.cadi.LocatorException;
39 import org.onap.aaf.cadi.PropAccess;
40 import org.onap.aaf.cadi.config.Config;
41 import org.onap.aaf.cadi.register.Registrant;
42 import org.onap.aaf.misc.env.impl.BasicEnv;
43
44 public class JU_AbsServiceStarter {
45
46     ByteArrayOutputStream outStream;
47     AbsServiceStub absServiceStub;
48     AbsServiceStarterStub absServiceStarterStub;
49
50     private class AbsServiceStarterStub extends AbsServiceStarter {
51
52         public AbsServiceStarterStub(AbsService service, boolean secure) {
53             super(service,secure);
54             // TODO Auto-generated constructor stub
55         }
56
57         @Override
58         public void _start(RServlet rserv) throws Exception {
59             // TODO Auto-generated method stub
60
61         }
62
63         @Override
64         public void _propertyAdjustment() {
65             // TODO Auto-generated method stub
66
67         }
68     }
69
70     private class AbsServiceStub extends AbsService {
71
72         public AbsServiceStub(Access access, BasicEnv env) throws CadiException {
73             super(access, env);
74             // TODO Auto-generated constructor stub
75         }
76
77         @Override
78         public Filter[] _filters(Object ... additionalTafLurs) throws CadiException, LocatorException {
79             // TODO Auto-generated method stub
80             return null;
81         }
82
83         @Override
84         public Registrant[] registrants(int port) throws CadiException, LocatorException {
85             // TODO Auto-generated method stub
86             return null;
87         }
88
89     }
90
91     @Before
92     public void setUp() {
93         outStream = new ByteArrayOutputStream();
94         System.setOut(new PrintStream(outStream));
95     }
96
97     @After
98     public void tearDown() {
99         System.setOut(System.out);
100     }
101
102
103     @Test
104     public void testStub() throws CadiException {
105         BasicEnv bEnv = new BasicEnv();
106         PropAccess prop = new PropAccess();
107
108         prop.setProperty(Config.AAF_LOCATOR_ENTRIES, "te.st");
109         prop.setProperty(Config.AAF_LOCATOR_VERSION, "te.st");
110         prop.setLogLevel(Level.DEBUG);
111         absServiceStub = new AbsServiceStub(prop, bEnv);
112
113         absServiceStarterStub = new AbsServiceStarterStub(absServiceStub,true);
114     }
115
116 //    @Test
117 //    public void testStart() throws Exception {
118 //        absServiceStarterStub.env();
119 //        absServiceStarterStub.start();
120 //    }
121
122 }
123
124
125