diff options
Diffstat (limited to 'sdnr/wt/devicemanager-adapter-manager')
-rw-r--r-- | sdnr/wt/devicemanager-adapter-manager/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/adaptermanager/test/TestDeviceManagerAdapterManagerImpl.java | 65 |
1 files changed, 6 insertions, 59 deletions
diff --git a/sdnr/wt/devicemanager-adapter-manager/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/adaptermanager/test/TestDeviceManagerAdapterManagerImpl.java b/sdnr/wt/devicemanager-adapter-manager/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/adaptermanager/test/TestDeviceManagerAdapterManagerImpl.java index 5f79d943a..3f53abfa8 100644 --- a/sdnr/wt/devicemanager-adapter-manager/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/adaptermanager/test/TestDeviceManagerAdapterManagerImpl.java +++ b/sdnr/wt/devicemanager-adapter-manager/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/adaptermanager/test/TestDeviceManagerAdapterManagerImpl.java @@ -17,79 +17,26 @@ */ package org.onap.ccsdk.features.sdnr.wt.devicemanager.adaptermanager.test; -import java.io.File; -import java.io.FileNotFoundException; -import java.io.IOException; -import java.nio.file.Files; -import java.nio.file.Path; -import java.nio.file.Paths; +import static org.mockito.Mockito.mock; import org.junit.After; -import org.junit.Before; import org.junit.Test; import org.onap.ccsdk.features.sdnr.wt.devicemanager.adaptermanager.impl.DeviceManagerAdapterManagerImpl; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; +import org.onap.ccsdk.features.sdnr.wt.devicemanager.service.NetconfNetworkElementService; public class TestDeviceManagerAdapterManagerImpl { - private static Path KARAF_ETC = Paths.get("etc"); - private static final Logger LOG = LoggerFactory.getLogger(TestDeviceManagerAdapterManagerImpl.class); DeviceManagerAdapterManagerImpl devMgrAdapterManager; - @Before - public void init() throws InterruptedException, IOException { - /*System.out.println("Logger: " + LOG.getClass().getName() + " " + LOG.getName()); - Path etc = KARAF_ETC; - delete(etc); - - System.out.println("Create empty:" + etc.toString()); - Files.createDirectories(etc);*/ - } - @Test public void test() throws Exception { devMgrAdapterManager = new DeviceManagerAdapterManagerImpl(); - /*DeviceManagerImpl devMgr = new DeviceManagerImpl(); - - try { - devMgr.init(); - devMgrOran.setNetconfNetworkElementService(devMgr); - devMgrOran.init(); - } catch (Exception e) { - // TODO Auto-generated catch block - e.printStackTrace(); - }*/ - /* - * devMgrOran.setNetconfNetworkElementService(null); devMgrOran.init(); - * NetconfNetworkElementService netConfNetworkElementService = - * mock(NetconfNetworkElementService.class); devMgrOran = - * mock(DeviceManagerORanImpl.class); - * when(netConfNetworkElementService.registerNetworkElementFactory(new - * ORanNetworkElementFactory())).thenReturn(null); - */ - + NetconfNetworkElementService netConfNetworkElementService = mock(NetconfNetworkElementService.class); + devMgrAdapterManager.setNetconfNetworkElementService(netConfNetworkElementService); + devMgrAdapterManager.init(); } @After public void cleanUp() throws Exception { devMgrAdapterManager.close(); } - - private static void delete(Path etc) throws IOException { - if (Files.exists(etc)) { - System.out.println("Found, removing:" + etc.toString()); - delete(etc.toFile()); - } - } - - private static void delete(File f) throws IOException { - if (f.isDirectory()) { - for (File c : f.listFiles()) { - delete(c); - } - } - if (!f.delete()) { - throw new FileNotFoundException("Failed to delete file: " + f); - } - } -} + } |