2 * ============LICENSE_START====================================================
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
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====================================================
22 package org.onap.aaf.auth.server.test;
24 import java.io.ByteArrayOutputStream;
25 import java.io.PrintStream;
27 import javax.servlet.Filter;
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;
44 public class JU_AbsServiceStarter {
46 ByteArrayOutputStream outStream;
47 AbsServiceStub absServiceStub;
48 AbsServiceStarterStub absServiceStarterStub;
50 private class AbsServiceStarterStub extends AbsServiceStarter {
52 public AbsServiceStarterStub(AbsService service, boolean secure) {
53 super(service,secure);
54 // TODO Auto-generated constructor stub
58 public void _start(RServlet rserv) throws Exception {
59 // TODO Auto-generated method stub
64 public void _propertyAdjustment() {
65 // TODO Auto-generated method stub
70 private class AbsServiceStub extends AbsService {
72 public AbsServiceStub(Access access, BasicEnv env) throws CadiException {
74 // TODO Auto-generated constructor stub
78 public Filter[] _filters(Object ... additionalTafLurs) throws CadiException, LocatorException {
79 // TODO Auto-generated method stub
84 public Registrant[] registrants(int port) throws CadiException, LocatorException {
85 // TODO Auto-generated method stub
93 outStream = new ByteArrayOutputStream();
94 System.setOut(new PrintStream(outStream));
98 public void tearDown() {
99 System.setOut(System.out);
104 public void testStub() throws CadiException {
105 BasicEnv bEnv = new BasicEnv();
106 PropAccess prop = new PropAccess();
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);
113 absServiceStarterStub = new AbsServiceStarterStub(absServiceStub,true);
117 // public void testStart() throws Exception {
118 // absServiceStarterStub.env();
119 // absServiceStarterStub.start();