2  * ============LICENSE_START========================================================================
 
   3  * ONAP : ccsdk feature sdnr wt
 
   4  * =================================================================================================
 
   5  * Copyright (C) 2020 highstreet technologies GmbH Intellectual Property. All rights reserved.
 
   6  * =================================================================================================
 
   7  * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
 
   8  * in compliance with the License. You may obtain a copy of the License at
 
  10  * http://www.apache.org/licenses/LICENSE-2.0
 
  12  * Unless required by applicable law or agreed to in writing, software distributed under the License
 
  13  * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
 
  14  * or implied. See the License for the specific language governing permissions and limitations under
 
  16  * ============LICENSE_END==========================================================================
 
  18 package org.onap.ccsdk.features.sdnr.wt.devicemanager.adaptermanager.test;
 
  21 import java.io.FileNotFoundException;
 
  22 import java.io.IOException;
 
  23 import java.nio.file.Files;
 
  24 import java.nio.file.Path;
 
  25 import java.nio.file.Paths;
 
  26 import org.junit.After;
 
  27 import org.junit.Before;
 
  28 import org.junit.Test;
 
  29 import org.onap.ccsdk.features.sdnr.wt.devicemanager.adaptermanager.impl.DeviceManagerAdapterManagerImpl;
 
  30 import org.slf4j.Logger;
 
  31 import org.slf4j.LoggerFactory;
 
  33 public class TestDeviceManagerAdapterManagerImpl {
 
  34     private static Path KARAF_ETC = Paths.get("etc");
 
  35     private static final Logger LOG = LoggerFactory.getLogger(TestDeviceManagerAdapterManagerImpl.class);
 
  36     DeviceManagerAdapterManagerImpl devMgrAdapterManager;
 
  39     public void init() throws InterruptedException, IOException {
 
  40         /*System.out.println("Logger: " + LOG.getClass().getName() + " " + LOG.getName());
 
  44         System.out.println("Create empty:" + etc.toString());
 
  45         Files.createDirectories(etc);*/
 
  49     public void test() throws Exception {
 
  50         devMgrAdapterManager = new DeviceManagerAdapterManagerImpl();
 
  51         /*DeviceManagerImpl devMgr = new DeviceManagerImpl();
 
  55                 devMgrOran.setNetconfNetworkElementService(devMgr);
 
  57         } catch (Exception e) {
 
  58                 // TODO Auto-generated catch block
 
  62          * devMgrOran.setNetconfNetworkElementService(null); devMgrOran.init();
 
  63          * NetconfNetworkElementService netConfNetworkElementService =
 
  64          * mock(NetconfNetworkElementService.class); devMgrOran =
 
  65          * mock(DeviceManagerORanImpl.class);
 
  66          * when(netConfNetworkElementService.registerNetworkElementFactory(new
 
  67          * ORanNetworkElementFactory())).thenReturn(null);
 
  74     public void cleanUp() throws Exception {
 
  75         devMgrAdapterManager.close();
 
  78     private static void delete(Path etc) throws IOException {
 
  79         if (Files.exists(etc)) {
 
  80             System.out.println("Found, removing:" + etc.toString());
 
  85     private static void delete(File f) throws IOException {
 
  86         if (f.isDirectory()) {
 
  87             for (File c : f.listFiles()) {
 
  92             throw new FileNotFoundException("Failed to delete file: " + f);