Reformat sdnr devicemanager-oran to ONAP code style 85/110085/1
authorhighstreetherbert <herbert.eiselt@highstreet-technologies.com>
Fri, 10 Jul 2020 16:38:50 +0000 (18:38 +0200)
committerhighstreetherbert <herbert.eiselt@highstreet-technologies.com>
Fri, 10 Jul 2020 16:38:58 +0000 (18:38 +0200)
Reformat to ONAP code style

Issue-ID: SDNC-1279
Signed-off-by: highstreetherbert <herbert.eiselt@highstreet-technologies.com>
Change-Id: I83c61a94855ce4640651c45ac97157566d805028
Signed-off-by: highstreetherbert <herbert.eiselt@highstreet-technologies.com>
20 files changed:
sdnr/wt/devicemanager-oran/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/oran/impl/DeviceManagerORanImpl.java
sdnr/wt/devicemanager-oran/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/oran/impl/NtsNetworkElement.java
sdnr/wt/devicemanager-oran/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/oran/impl/ORanChangeNotificationListener.java
sdnr/wt/devicemanager-oran/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/oran/impl/ORanNetworkElement.java
sdnr/wt/devicemanager-oran/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/oran/impl/ORanNetworkElementFactory.java
sdnr/wt/devicemanager-oran/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/oran/impl/ORanToInternalDataModel.java
sdnr/wt/devicemanager-oran/provider/src/main/java/org/opendaylight/yang/gen/v1/urn/ietf/params/xml/ns/yang/ietf/alarms/rev190911/OperatorStateBuilder.java
sdnr/wt/devicemanager-oran/provider/src/main/java/org/opendaylight/yang/gen/v1/urn/ietf/params/xml/ns/yang/ietf/alarms/rev190911/ResourceBuilder.java
sdnr/wt/devicemanager-oran/provider/src/main/java/org/opendaylight/yang/gen/v1/urn/ietf/params/xml/ns/yang/ietf/alarms/rev190911/ResourceMatchBuilder.java
sdnr/wt/devicemanager-oran/provider/src/main/java/org/opendaylight/yang/gen/v1/urn/ietf/params/xml/ns/yang/ietf/alarms/rev190911/SeverityWithClearBuilder.java
sdnr/wt/devicemanager-oran/provider/src/main/java/org/opendaylight/yang/gen/v1/urn/ietf/params/xml/ns/yang/ietf/alarms/rev190911/alarms/ControlMaxAlarmStatusChangesBuilder.java
sdnr/wt/devicemanager-oran/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/oran/test/TestDeviceManagerORanImpl.java
sdnr/wt/devicemanager-oran/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/oran/test/TestHardwareClass.java
sdnr/wt/devicemanager-oran/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/oran/test/TestORanChangeNotificationListener.java
sdnr/wt/devicemanager-oran/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/oran/test/TestORanFaultNotificationListener.java
sdnr/wt/devicemanager-oran/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/oran/test/TestORanNetworkElement.java
sdnr/wt/devicemanager-oran/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/oran/test/TestORanNetworkElementFactory.java
sdnr/wt/devicemanager-oran/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/oran/test/TestORanToInternalDataModel.java
sdnr/wt/devicemanager-oran/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/oran/test/mock/NetconfConfigChangeMock.java
sdnr/wt/devicemanager-oran/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/oran/test/mock/TransactionUtilsMock.java

index 50a6a75..8d9a215 100644 (file)
@@ -23,7 +23,7 @@ import org.onap.ccsdk.features.sdnr.wt.devicemanager.service.NetconfNetworkEleme
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-public class DeviceManagerORanImpl implements AutoCloseable  {
+public class DeviceManagerORanImpl implements AutoCloseable {
 
     private static final Logger LOG = LoggerFactory.getLogger(DeviceManagerORanImpl.class);
     private static final String APPLICATION_NAME = "DeviceManagerORan";
index 8f4d090..15f906d 100644 (file)
@@ -44,14 +44,13 @@ public class NtsNetworkElement implements NetworkElement {
     private final DataProvider databaseService;
 
     NtsNetworkElement(NetconfAccessor netconfAccess, DataProvider databaseService) {
-        LOG.info("Create {}",NtsNetworkElement.class.getSimpleName());
+        LOG.info("Create {}", NtsNetworkElement.class.getSimpleName());
         this.netconfAccessor = netconfAccess;
         this.databaseService = databaseService;
     }
 
     @Override
-    public void deregister() {
-    }
+    public void deregister() {}
 
     @Override
     public NodeId getNodeId() {
@@ -64,12 +63,10 @@ public class NtsNetworkElement implements NetworkElement {
     }
 
     @Override
-    public void warmstart() {
-    }
+    public void warmstart() {}
 
     @Override
-    public void register() {
-    }
+    public void register() {}
 
     @Override
     public NetworkElementDeviceType getDeviceType() {
index e0c133e..43bfeed 100644 (file)
@@ -36,7 +36,7 @@ import org.slf4j.LoggerFactory;
 /**
  * Listener for change notifications
  */
-public class ORanChangeNotificationListener  implements IetfNetconfNotificationsListener {
+public class ORanChangeNotificationListener implements IetfNetconfNotificationsListener {
 
     private static final Logger log = LoggerFactory.getLogger(ORanChangeNotificationListener.class);
 
index 83e8401..8b8a9bd 100644 (file)
@@ -53,7 +53,7 @@ public class ORanNetworkElement implements NetworkElement {
     private @NonNull final ORanFaultNotificationListener oRanFaultListener;
 
     ORanNetworkElement(NetconfAccessor netconfAccess, DataProvider databaseService) {
-        log.info("Create {}",ORanNetworkElement.class.getSimpleName());
+        log.info("Create {}", ORanNetworkElement.class.getSimpleName());
         this.netconfAccessor = netconfAccess;
         this.databaseService = databaseService;
 
@@ -73,7 +73,8 @@ public class ORanNetworkElement implements NetworkElement {
             List<Component> componentList = hardware.getComponent();
             if (componentList != null) {
                 for (Component component : componentList) {
-                    databaseService.writeInventory( oRanMapper.getInternalEquipment(netconfAccessor.getNodeId(), component));
+                    databaseService
+                            .writeInventory(oRanMapper.getInternalEquipment(netconfAccessor.getNodeId(), component));
                 }
             }
         }
@@ -91,11 +92,10 @@ public class ORanNetworkElement implements NetworkElement {
         log.info("DBRead Get equipment for class {} from mountpoint {} for uuid {}", clazzPac.getSimpleName(),
                 accessData.getNodeId().getValue());
 
-        InstanceIdentifier<Hardware> hardwareIID =
-                InstanceIdentifier.builder(clazzPac).build();
+        InstanceIdentifier<Hardware> hardwareIID = InstanceIdentifier.builder(clazzPac).build();
 
-        Hardware res = accessData.getTransactionUtils().readData(accessData.getDataBroker(), LogicalDatastoreType.OPERATIONAL,
-                hardwareIID);
+        Hardware res = accessData.getTransactionUtils().readData(accessData.getDataBroker(),
+                LogicalDatastoreType.OPERATIONAL, hardwareIID);
 
         return res;
     }
@@ -114,7 +114,7 @@ public class ORanNetworkElement implements NetworkElement {
         }
         if (oRanFaultListenerRegistrationResult != null) {
             this.oRanFaultListenerRegistrationResult.close();
-        };
+        } ;
     }
 
 
@@ -129,8 +129,7 @@ public class ORanNetworkElement implements NetworkElement {
     }
 
     @Override
-    public void warmstart() {
-    }
+    public void warmstart() {}
 
     @Override
     public Optional<NetconfAccessor> getAcessor() {
index cf93ba7..3a557cc 100644 (file)
@@ -35,10 +35,10 @@ public class ORanNetworkElementFactory implements NetworkElementFactory {
     @Override
     public Optional<NetworkElement> create(NetconfAccessor acessor, DeviceManagerServiceProvider serviceProvider) {
         if (acessor.getCapabilites().isSupportingNamespace(ORANHWCOMPONENT.QNAME)) {
-            log.info("Create device {} ",ORanNetworkElement.class.getName());
+            log.info("Create device {} ", ORanNetworkElement.class.getName());
             return Optional.of(new ORanNetworkElement(acessor, serviceProvider.getDataProvider()));
         } else if (acessor.getCapabilites().isSupportingNamespace(SimulatorStatus.QNAME)) {
-            log.info("Create device {} ",NtsNetworkElement.class.getName());
+            log.info("Create device {} ", NtsNetworkElement.class.getName());
             return Optional.of(new NtsNetworkElement(acessor, serviceProvider.getDataProvider()));
         } else {
             return Optional.empty();
index 7e8327a..48d8e80 100644 (file)
@@ -1,14 +1,15 @@
 package org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.alarms.rev190911;
+
 import java.lang.String;
 import java.lang.UnsupportedOperationException;
 
 /**
- * The purpose of generated class in src/main/java for Union types is to create new instances of unions from a string representation.
- * In some cases it is very difficult to automate it since there can be unions such as (uint32 - uint16), or (string - uint32).
+ * The purpose of generated class in src/main/java for Union types is to create new instances of unions from a string
+ * representation. In some cases it is very difficult to automate it since there can be unions such as (uint32 -
+ * uint16), or (string - uint32).
  *
- * The reason behind putting it under src/main/java is:
- * This class is generated in form of a stub and needs to be finished by the user. This class is generated only once to prevent
- * loss of user code.
+ * The reason behind putting it under src/main/java is: This class is generated in form of a stub and needs to be
+ * finished by the user. This class is generated only once to prevent loss of user code.
  *
  */
 public class OperatorStateBuilder {
index 7c4a63d..fb2e5d5 100644 (file)
@@ -1,14 +1,15 @@
 package org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.alarms.rev190911;
+
 import java.lang.String;
 import java.lang.UnsupportedOperationException;
 
 /**
- * The purpose of generated class in src/main/java for Union types is to create new instances of unions from a string representation.
- * In some cases it is very difficult to automate it since there can be unions such as (uint32 - uint16), or (string - uint32).
+ * The purpose of generated class in src/main/java for Union types is to create new instances of unions from a string
+ * representation. In some cases it is very difficult to automate it since there can be unions such as (uint32 -
+ * uint16), or (string - uint32).
  *
- * The reason behind putting it under src/main/java is:
- * This class is generated in form of a stub and needs to be finished by the user. This class is generated only once to prevent
- * loss of user code.
+ * The reason behind putting it under src/main/java is: This class is generated in form of a stub and needs to be
+ * finished by the user. This class is generated only once to prevent loss of user code.
  *
  */
 public class ResourceBuilder {
index 282a6a2..2f4b593 100644 (file)
@@ -1,14 +1,15 @@
 package org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.alarms.rev190911;
+
 import java.lang.String;
 import java.lang.UnsupportedOperationException;
 
 /**
- * The purpose of generated class in src/main/java for Union types is to create new instances of unions from a string representation.
- * In some cases it is very difficult to automate it since there can be unions such as (uint32 - uint16), or (string - uint32).
+ * The purpose of generated class in src/main/java for Union types is to create new instances of unions from a string
+ * representation. In some cases it is very difficult to automate it since there can be unions such as (uint32 -
+ * uint16), or (string - uint32).
  *
- * The reason behind putting it under src/main/java is:
- * This class is generated in form of a stub and needs to be finished by the user. This class is generated only once to prevent
- * loss of user code.
+ * The reason behind putting it under src/main/java is: This class is generated in form of a stub and needs to be
+ * finished by the user. This class is generated only once to prevent loss of user code.
  *
  */
 public class ResourceMatchBuilder {
index 8139192..49e50e0 100644 (file)
@@ -1,14 +1,15 @@
 package org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.alarms.rev190911;
+
 import java.lang.String;
 import java.lang.UnsupportedOperationException;
 
 /**
- * The purpose of generated class in src/main/java for Union types is to create new instances of unions from a string representation.
- * In some cases it is very difficult to automate it since there can be unions such as (uint32 - uint16), or (string - uint32).
+ * The purpose of generated class in src/main/java for Union types is to create new instances of unions from a string
+ * representation. In some cases it is very difficult to automate it since there can be unions such as (uint32 -
+ * uint16), or (string - uint32).
  *
- * The reason behind putting it under src/main/java is:
- * This class is generated in form of a stub and needs to be finished by the user. This class is generated only once to prevent
- * loss of user code.
+ * The reason behind putting it under src/main/java is: This class is generated in form of a stub and needs to be
+ * finished by the user. This class is generated only once to prevent loss of user code.
  *
  */
 public class SeverityWithClearBuilder {
index 9f10ae8..c2a5009 100644 (file)
@@ -1,14 +1,15 @@
 package org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.alarms.rev190911.alarms;
+
 import java.lang.String;
 import java.lang.UnsupportedOperationException;
 
 /**
- * The purpose of generated class in src/main/java for Union types is to create new instances of unions from a string representation.
- * In some cases it is very difficult to automate it since there can be unions such as (uint32 - uint16), or (string - uint32).
+ * The purpose of generated class in src/main/java for Union types is to create new instances of unions from a string
+ * representation. In some cases it is very difficult to automate it since there can be unions such as (uint32 -
+ * uint16), or (string - uint32).
  *
- * The reason behind putting it under src/main/java is:
- * This class is generated in form of a stub and needs to be finished by the user. This class is generated only once to prevent
- * loss of user code.
+ * The reason behind putting it under src/main/java is: This class is generated in form of a stub and needs to be
+ * finished by the user. This class is generated only once to prevent loss of user code.
  *
  */
 public class ControlMaxAlarmStatusChangesBuilder {
index 1b5ed9b..7d7eef5 100644 (file)
@@ -1,3 +1,20 @@
+/*
+ * ============LICENSE_START========================================================================
+ * ONAP : ccsdk feature sdnr wt
+ * =================================================================================================
+ * Copyright (C) 2020 highstreet technologies GmbH Intellectual Property. All rights reserved.
+ * =================================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
+ * in compliance with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software distributed under the License
+ * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
+ * or implied. See the License for the specific language governing permissions and limitations under
+ * the License.
+ * ============LICENSE_END==========================================================================
+ */
 package org.onap.ccsdk.features.sdnr.wt.devicemanager.oran.test;
 
 import java.io.File;
@@ -6,65 +23,59 @@ import java.io.IOException;
 import java.nio.file.Files;
 import java.nio.file.Path;
 import java.nio.file.Paths;
-
 import org.junit.After;
 import org.junit.Before;
 import org.junit.Test;
 import org.onap.ccsdk.features.sdnr.wt.devicemanager.oran.impl.DeviceManagerORanImpl;
-import org.onap.ccsdk.features.sdnr.wt.devicemanager.oran.impl.ORanNetworkElementFactory;
-import org.onap.ccsdk.features.sdnr.wt.devicemanager.service.NetconfNetworkElementService;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.when;
-
 public class TestDeviceManagerORanImpl {
-       private static Path KARAF_ETC = Paths.get("etc");
-        private static final Logger LOG = LoggerFactory.getLogger(TestDeviceManagerORanImpl.class);
-       DeviceManagerORanImpl devMgrOran; 
-       
-       @Before
-       public void init() throws InterruptedException, IOException {
-               /*System.out.println("Logger: " + LOG.getClass().getName() + " " + LOG.getName());
+    private static Path KARAF_ETC = Paths.get("etc");
+    private static final Logger LOG = LoggerFactory.getLogger(TestDeviceManagerORanImpl.class);
+    DeviceManagerORanImpl devMgrOran;
+
+    @Before
+    public void init() throws InterruptedException, IOException {
+        /*System.out.println("Logger: " + LOG.getClass().getName() + " " + LOG.getName());
         Path etc = KARAF_ETC;
-               delete(etc);
-               
+        delete(etc);
+
         System.out.println("Create empty:" + etc.toString());
         Files.createDirectories(etc);*/
-       }
-       
-       @Test
-       public void test() throws Exception {
-               devMgrOran = new DeviceManagerORanImpl();
-               /*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);
-                */
-               
-               
-       }
-       
-       @After
-       public void cleanUp() throws Exception {
-                       devMgrOran.close();
-       }
-       
-       private static void delete(Path etc) throws IOException {
+    }
+
+    @Test
+    public void test() throws Exception {
+        devMgrOran = new DeviceManagerORanImpl();
+        /*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);
+         */
+
+
+    }
+
+    @After
+    public void cleanUp() throws Exception {
+        devMgrOran.close();
+    }
+
+    private static void delete(Path etc) throws IOException {
         if (Files.exists(etc)) {
             System.out.println("Found, removing:" + etc.toString());
             delete(etc.toFile());
index caa4e64..c8a000b 100644 (file)
@@ -1,3 +1,20 @@
+/*
+ * ============LICENSE_START========================================================================
+ * ONAP : ccsdk feature sdnr wt
+ * =================================================================================================
+ * Copyright (C) 2020 highstreet technologies GmbH Intellectual Property. All rights reserved.
+ * =================================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
+ * in compliance with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software distributed under the License
+ * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
+ * or implied. See the License for the specific language governing permissions and limitations under
+ * the License.
+ * ============LICENSE_END==========================================================================
+ */
 package org.onap.ccsdk.features.sdnr.wt.devicemanager.oran.test;
 
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.iana.hardware.rev180313.HardwareClass;
index a7cd28d..7709298 100644 (file)
@@ -41,47 +41,47 @@ import org.opendaylight.yangtools.yang.binding.InstanceIdentifier.PathArgument;
 
 public class TestORanChangeNotificationListener {
 
-       private static final String NODEID = "node1";
+    private static final String NODEID = "node1";
 
-       @Test
-       public void test() {
+    @Test
+    public void test() {
 
-               NetconfAccessor netconfAccessor = mock(NetconfAccessor.class);
-               DataProvider databaseService = mock(DataProvider.class);
-               ORanChangeNotificationListener notifListener = new ORanChangeNotificationListener(netconfAccessor,
-                               databaseService);
-               when(netconfAccessor.getNodeId()).thenReturn(new NodeId(NODEID));
-               Iterable<? extends PathArgument> pathArguments = Arrays.asList(new PathArgument() {
+        NetconfAccessor netconfAccessor = mock(NetconfAccessor.class);
+        DataProvider databaseService = mock(DataProvider.class);
+        ORanChangeNotificationListener notifListener =
+                new ORanChangeNotificationListener(netconfAccessor, databaseService);
+        when(netconfAccessor.getNodeId()).thenReturn(new NodeId(NODEID));
+        Iterable<? extends PathArgument> pathArguments = Arrays.asList(new PathArgument() {
 
-                       @Override
-                       public int compareTo(PathArgument arg0) {
-                               return 0;
-                       }
+            @Override
+            public int compareTo(PathArgument arg0) {
+                return 0;
+            }
 
-                       @Override
-                       public Class<? extends DataObject> getType() {
-                               return DataObject.class;
-                       }
-               });
-               InstanceIdentifier<?> target = InstanceIdentifier.create(pathArguments);
+            @Override
+            public Class<? extends DataObject> getType() {
+                return DataObject.class;
+            }
+        });
+        InstanceIdentifier<?> target = InstanceIdentifier.create(pathArguments);
 
-               notifListener.onNetconfConfigChange(createNotification(EditOperationType.Create,target));
-               EventlogEntity event = new EventlogBuilder().setNodeId(NODEID)
-                               .setNewValue(String.valueOf(EditOperationType.Create)).setObjectId(target.toString()).build();
-               verify(databaseService).writeEventLog(event);
+        notifListener.onNetconfConfigChange(createNotification(EditOperationType.Create, target));
+        EventlogEntity event = new EventlogBuilder().setNodeId(NODEID)
+                .setNewValue(String.valueOf(EditOperationType.Create)).setObjectId(target.toString()).build();
+        verify(databaseService).writeEventLog(event);
 
-       }
+    }
 
-       /**
-        * @param type 
-        * @return
-        */
-       private static NetconfConfigChange createNotification(EditOperationType type,InstanceIdentifier<?> target) {
-               NetconfConfigChange change = mock(NetconfConfigChange.class);
-               
-               @SuppressWarnings("null")
-               final @NonNull List<Edit> edits = Arrays.asList(new EditBuilder().setOperation(type).setTarget(target).build());
-               when(change.nonnullEdit()).thenReturn(edits);
-               return change;
-       }
+    /**
+     * @param type
+     * @return
+     */
+    private static NetconfConfigChange createNotification(EditOperationType type, InstanceIdentifier<?> target) {
+        NetconfConfigChange change = mock(NetconfConfigChange.class);
+
+        @SuppressWarnings("null")
+        final @NonNull List<Edit> edits = Arrays.asList(new EditBuilder().setOperation(type).setTarget(target).build());
+        when(change.nonnullEdit()).thenReturn(edits);
+        return change;
+    }
 }
index e67ec54..d486f67 100644 (file)
@@ -22,9 +22,9 @@ import org.onap.ccsdk.features.sdnr.wt.devicemanager.oran.impl.ORanFaultNotifica
 
 public class TestORanFaultNotificationListener {
 
-       @Test
-       public void test() {
-               ORanFaultNotificationListener faultListener = new ORanFaultNotificationListener();
-               faultListener.onAlarmNotif(null);
-       }
+    @Test
+    public void test() {
+        ORanFaultNotificationListener faultListener = new ORanFaultNotificationListener();
+        faultListener.onAlarmNotif(null);
+    }
 }
index 9858915..675499a 100644 (file)
@@ -56,8 +56,8 @@ public class TestORanNetworkElement {
 
         NodeId nNodeId = new NodeId("nSky");
         when(accessor.getCapabilites()).thenReturn(capabilities);
-        when (accessor.getNodeId()).thenReturn(nNodeId);
-        when (accessor.getTransactionUtils()).thenReturn(new TransactionUtilsMock());
+        when(accessor.getNodeId()).thenReturn(nNodeId);
+        when(accessor.getTransactionUtils()).thenReturn(new TransactionUtilsMock());
 
         DataProvider dataProvider = mock(DataProvider.class);
         when(serviceProvider.getDataProvider()).thenReturn(dataProvider);
index f972f8e..2614e4d 100644 (file)
@@ -36,50 +36,50 @@ import org.opendaylight.yangtools.yang.common.QName;
 
 public class TestORanNetworkElementFactory {
 
-       static NetconfAccessor accessor;
-       static DeviceManagerServiceProvider serviceProvider;
-       static Capabilities capabilities;
-       QName qCapability;
+    static NetconfAccessor accessor;
+    static DeviceManagerServiceProvider serviceProvider;
+    static Capabilities capabilities;
+    QName qCapability;
 
-       @BeforeClass
-       public static void init() throws InterruptedException, IOException {
-               capabilities = mock(Capabilities.class);
-               accessor = mock(NetconfAccessorMock.class);
-               serviceProvider = mock(DeviceManagerServiceProvider.class);
-                               
-               when(accessor.getCapabilites()).thenReturn(capabilities);
-               when(serviceProvider.getDataProvider()).thenReturn(null);
+    @BeforeClass
+    public static void init() throws InterruptedException, IOException {
+        capabilities = mock(Capabilities.class);
+        accessor = mock(NetconfAccessorMock.class);
+        serviceProvider = mock(DeviceManagerServiceProvider.class);
 
-       
-       }
+        when(accessor.getCapabilites()).thenReturn(capabilities);
+        when(serviceProvider.getDataProvider()).thenReturn(null);
 
-       @Test
-       public void testCreateORANHWComponent() throws Exception {
-               when(accessor.getCapabilites().isSupportingNamespace(ORANHWCOMPONENT.QNAME)).thenReturn(true);
-               when(accessor.getCapabilites().isSupportingNamespace(SimulatorStatus.QNAME)).thenReturn(false);
-               ORanNetworkElementFactory factory = new ORanNetworkElementFactory();
-               assertTrue((factory.create(accessor, serviceProvider)).isPresent());
-       }
 
-       @Test
-       public void testCreateSimulator() throws Exception {
-               when(accessor.getCapabilites().isSupportingNamespace(ORANHWCOMPONENT.QNAME)).thenReturn(false);
-               when(accessor.getCapabilites().isSupportingNamespace(SimulatorStatus.QNAME)).thenReturn(true);
-               ORanNetworkElementFactory factory = new ORanNetworkElementFactory();
-               assertTrue(factory.create(accessor, serviceProvider).isPresent());
-       }
-       
-       @Test
-       public void testCreateNone() throws Exception {
-               when(accessor.getCapabilites().isSupportingNamespace(ORANHWCOMPONENT.QNAME)).thenReturn(false);
-               when(accessor.getCapabilites().isSupportingNamespace(SimulatorStatus.QNAME)).thenReturn(false);
-               ORanNetworkElementFactory factory = new ORanNetworkElementFactory();
-               assertTrue(!(factory.create(accessor, serviceProvider).isPresent()));
-       }
-       
-       @After
-       public void cleanUp() throws Exception {
+    }
 
-       }
+    @Test
+    public void testCreateORANHWComponent() throws Exception {
+        when(accessor.getCapabilites().isSupportingNamespace(ORANHWCOMPONENT.QNAME)).thenReturn(true);
+        when(accessor.getCapabilites().isSupportingNamespace(SimulatorStatus.QNAME)).thenReturn(false);
+        ORanNetworkElementFactory factory = new ORanNetworkElementFactory();
+        assertTrue((factory.create(accessor, serviceProvider)).isPresent());
+    }
+
+    @Test
+    public void testCreateSimulator() throws Exception {
+        when(accessor.getCapabilites().isSupportingNamespace(ORANHWCOMPONENT.QNAME)).thenReturn(false);
+        when(accessor.getCapabilites().isSupportingNamespace(SimulatorStatus.QNAME)).thenReturn(true);
+        ORanNetworkElementFactory factory = new ORanNetworkElementFactory();
+        assertTrue(factory.create(accessor, serviceProvider).isPresent());
+    }
+
+    @Test
+    public void testCreateNone() throws Exception {
+        when(accessor.getCapabilites().isSupportingNamespace(ORANHWCOMPONENT.QNAME)).thenReturn(false);
+        when(accessor.getCapabilites().isSupportingNamespace(SimulatorStatus.QNAME)).thenReturn(false);
+        ORanNetworkElementFactory factory = new ORanNetworkElementFactory();
+        assertTrue(!(factory.create(accessor, serviceProvider).isPresent()));
+    }
+
+    @After
+    public void cleanUp() throws Exception {
+
+    }
 }
 
index c641152..e5efb1b 100644 (file)
@@ -41,46 +41,46 @@ import org.onap.ccsdk.features.sdnr.wt.devicemanager.oran.test.TestHardwareClass
 
 public class TestORanToInternalDataModel {
 
-       NodeId nodeId;
-       Component component;
+    NodeId nodeId;
+    Component component;
 
-       @SuppressWarnings("unchecked")
-       @Before
-       public void init() throws InterruptedException, IOException {
-               nodeId = mock(NodeId.class);
-               component = mock(Component.class);
+    @SuppressWarnings("unchecked")
+    @Before
+    public void init() throws InterruptedException, IOException {
+        nodeId = mock(NodeId.class);
+        component = mock(Component.class);
 
-               when(nodeId.getValue()).thenReturn("ORan-1000");
-               when(component.getParent()).thenReturn("Shelf");
-               when(component.getParentRelPos()).thenReturn(0);
-               when(component.getUuid()).thenReturn(new Uuid("0Aabcdef-0abc-0cfD-0abC-0123456789AB"));
+        when(nodeId.getValue()).thenReturn("ORan-1000");
+        when(component.getParent()).thenReturn("Shelf");
+        when(component.getParentRelPos()).thenReturn(0);
+        when(component.getUuid()).thenReturn(new Uuid("0Aabcdef-0abc-0cfD-0abC-0123456789AB"));
 
-               List<String> list = new ArrayList<String>();
-               list.add("Card-01A");
-               list.add("Card-01B");
+        List<String> list = new ArrayList<String>();
+        list.add("Card-01A");
+        list.add("Card-01B");
 
-               when (component.getContainsChild()).thenReturn(list);
-               when (component.getName()).thenReturn("Nokia");
-               when (component.getDescription()).thenReturn("ORAN Network Element NO-456");
-               Class<? extends HardwareClass> hwClass = TestHardwareClass.class;
-               Mockito.<Class<? extends HardwareClass>>when(component.getXmlClass()).thenReturn(hwClass);
-               
-               DateAndTime dt = new DateAndTime("2020-02-05T12:30:45.283Z");
-               when (component.getMfgDate()).thenReturn(dt);
-               
-       }
+        when(component.getContainsChild()).thenReturn(list);
+        when(component.getName()).thenReturn("Nokia");
+        when(component.getDescription()).thenReturn("ORAN Network Element NO-456");
+        Class<? extends HardwareClass> hwClass = TestHardwareClass.class;
+        Mockito.<Class<? extends HardwareClass>>when(component.getXmlClass()).thenReturn(hwClass);
 
-       @Test
-       public void test() throws Exception {
-               ORanToInternalDataModel model = new ORanToInternalDataModel();
-               model.getInternalEquipment(nodeId, component);
-               assertEquals(component.getUuid().getValue(), "0Aabcdef-0abc-0cfD-0abC-0123456789AB");
-               assertEquals(component.getMfgDate().getValue(), "2020-02-05T12:30:45.283Z");
+        DateAndTime dt = new DateAndTime("2020-02-05T12:30:45.283Z");
+        when(component.getMfgDate()).thenReturn(dt);
 
-       }
+    }
 
-       @After
-       public void cleanUp() throws Exception {
+    @Test
+    public void test() throws Exception {
+        ORanToInternalDataModel model = new ORanToInternalDataModel();
+        model.getInternalEquipment(nodeId, component);
+        assertEquals(component.getUuid().getValue(), "0Aabcdef-0abc-0cfD-0abC-0123456789AB");
+        assertEquals(component.getMfgDate().getValue(), "2020-02-05T12:30:45.283Z");
 
-       }
+    }
+
+    @After
+    public void cleanUp() throws Exception {
+
+    }
 }
index c1991dc..e31aac8 100644 (file)
@@ -29,34 +29,34 @@ import org.opendaylight.yangtools.yang.binding.DataContainer;
 
 public class NetconfConfigChangeMock implements NetconfConfigChange {
 
-       @Override
-       public Class<? extends DataContainer> getImplementedInterface() {
-               // TODO Auto-generated method stub
-               return null;
-       }
-
-       @Override
-       public <E$$ extends Augmentation<NetconfConfigChange>> @Nullable E$$ augmentation(Class<E$$> augmentationType) {
-               // TODO Auto-generated method stub
-               return null;
-       }
-
-       @Override
-       public @Nullable ChangedBy getChangedBy() {
-               // TODO Auto-generated method stub
-               return null;
-       }
-
-       @Override
-       public @Nullable Datastore getDatastore() {
-               // TODO Auto-generated method stub
-               return null;
-       }
-
-       @Override
-       public @Nullable List<Edit> getEdit() {
-               List<Edit> list = new ArrayList<Edit>();
-               return list;
-       }
+    @Override
+    public Class<? extends DataContainer> getImplementedInterface() {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+    @Override
+    public <E$$ extends Augmentation<NetconfConfigChange>> @Nullable E$$ augmentation(Class<E$$> augmentationType) {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+    @Override
+    public @Nullable ChangedBy getChangedBy() {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+    @Override
+    public @Nullable Datastore getDatastore() {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+    @Override
+    public @Nullable List<Edit> getEdit() {
+        List<Edit> list = new ArrayList<Edit>();
+        return list;
+    }
 
 }
index 0ae9b4a..d23227d 100644 (file)
@@ -29,19 +29,19 @@ import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
 
 public class TransactionUtilsMock implements TransactionUtils {
 
-       @Override
-       public <T extends DataObject> @Nullable T readData(DataBroker dataBroker, LogicalDatastoreType dataStoreType,
-                       InstanceIdentifier<T> iid) {
-               // TODO Auto-generated method stub
-               return null;
-       }
+    @Override
+    public <T extends DataObject> @Nullable T readData(DataBroker dataBroker, LogicalDatastoreType dataStoreType,
+            InstanceIdentifier<T> iid) {
+        // TODO Auto-generated method stub
+        return null;
+    }
 
-       @Override
-       public <T extends DataObject> @Nullable T readDataOptionalWithStatus(DataBroker dataBroker,
-                       LogicalDatastoreType dataStoreType, InstanceIdentifier<T> iid, AtomicBoolean noErrorIndication,
-                       AtomicReference<String> statusIndicator) {
-               // TODO Auto-generated method stub
-               return null;
-       }
+    @Override
+    public <T extends DataObject> @Nullable T readDataOptionalWithStatus(DataBroker dataBroker,
+            LogicalDatastoreType dataStoreType, InstanceIdentifier<T> iid, AtomicBoolean noErrorIndication,
+            AtomicReference<String> statusIndicator) {
+        // TODO Auto-generated method stub
+        return null;
+    }
 
 }