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.fs.test;
24 import static org.junit.Assert.*;
26 import org.onap.aaf.auth.env.AuthzEnv;
27 import org.onap.aaf.auth.fs.AAF_FS;
28 import org.onap.aaf.auth.rserv.CachingFileAccess;
29 import org.onap.aaf.cadi.Access;
30 import org.onap.aaf.cadi.CadiException;
31 import org.onap.aaf.cadi.config.Config;
32 import org.onap.aaf.misc.env.APIException;
33 import org.onap.aaf.misc.env.Slot;
34 import org.onap.aaf.misc.env.StaticSlot;
35 import org.junit.After;
36 import org.junit.Before;
37 import org.junit.Test;
38 import org.mockito.Mock;
39 import org.mockito.Mockito;
40 import static org.mockito.Mockito.*;
43 import java.io.IOException;
45 import org.junit.Test;
47 public class JU_AAF_FS {
54 private static final String testDir = "src/test/resources/logs";
57 public void setUp() throws APIException, IOException, CadiException {
58 value = System.setProperty(Config.CADI_LOGDIR, testDir);
59 System.setProperty(Config.CADI_ETCDIR, testDir);
60 System.out.println(ClassLoader.getSystemResource("org.osaaf.log4j.props"));
61 d = new File(testDir);
63 fService = new File(d +"/fs-serviceTEST.log");
64 fService.createNewFile();
65 fEtc = new File(d + "/org.osaaf.log4j.props");
68 aEnv = new AuthzEnv();
69 aEnv.staticSlot("test");
70 aEnv.access().setProperty("aaf_public_dir", "test");
71 aEnv.access().setProperty(Config.AAF_COMPONENT, "aaf_com:po.nent");
72 aafFs = new AAF_FS(aEnv);
77 public void testMain() {
78 String[] strArr = {"AAF_LOG4J_PREFIX"};
84 public void cleanUp() {
85 for(File f : d.listFiles()) {