From bc23c135fbddf419560c6c5c70bf888fd8fdc964 Mon Sep 17 00:00:00 2001 From: highstreetherbert Date: Fri, 10 Jul 2020 18:36:49 +0200 Subject: Reformat sdnr devicemanager-gran to ONAP code style Reformat to ONAP code style Issue-ID: SDNC-1278 Signed-off-by: highstreetherbert Change-Id: Ie4b3f182a0d30570e2eea3d7e4e9eafe699d90ca Signed-off-by: highstreetherbert --- .../wt/devicemanager/gran/GRanNetworkElement.java | 6 +-- .../gran/GRanNetworkElementFactory.java | 8 +-- .../gran/test/TestDeviceManagerGRanImpl.java | 34 ++++++------ .../gran/test/TestGRanNetworkElement.java | 42 +++++++-------- .../gran/test/TestGRanNetworkElementFactory.java | 60 +++++++++++----------- 5 files changed, 75 insertions(+), 75 deletions(-) diff --git a/sdnr/wt/devicemanager-gran/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/gran/GRanNetworkElement.java b/sdnr/wt/devicemanager-gran/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/gran/GRanNetworkElement.java index 239711f0a..7698a4a8e 100644 --- a/sdnr/wt/devicemanager-gran/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/gran/GRanNetworkElement.java +++ b/sdnr/wt/devicemanager-gran/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/gran/GRanNetworkElement.java @@ -40,7 +40,7 @@ public class GRanNetworkElement implements NetworkElement { private final DataProvider databaseService; public GRanNetworkElement(NetconfAccessor netconfAccess, DataProvider databaseService) { - log.info("Create {}",GRanNetworkElement.class.getSimpleName()); + log.info("Create {}", GRanNetworkElement.class.getSimpleName()); this.netconfAccessor = netconfAccess; this.databaseService = databaseService; } @@ -52,12 +52,12 @@ public class GRanNetworkElement implements NetworkElement { @Override public void deregister() { - log.info("deRegister actions should be here"); + log.info("deRegister actions should be here"); } @Override public void warmstart() { - log.info("Warmstart actions should be here"); + log.info("Warmstart actions should be here"); } @Override diff --git a/sdnr/wt/devicemanager-gran/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/gran/GRanNetworkElementFactory.java b/sdnr/wt/devicemanager-gran/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/gran/GRanNetworkElementFactory.java index 6c54e4213..81cdf7536 100644 --- a/sdnr/wt/devicemanager-gran/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/gran/GRanNetworkElementFactory.java +++ b/sdnr/wt/devicemanager-gran/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/gran/GRanNetworkElementFactory.java @@ -31,13 +31,13 @@ public class GRanNetworkElementFactory implements NetworkElementFactory { private static final Logger log = LoggerFactory.getLogger(GRanNetworkElementFactory.class); - @Override - public Optional create(NetconfAccessor acessor, DeviceManagerServiceProvider serviceProvider) { + @Override + public Optional create(NetconfAccessor acessor, DeviceManagerServiceProvider serviceProvider) { if (acessor.getCapabilites().isSupportingNamespace(TopGrp.QNAME)) { - log.info("Create device {} ",GRanNetworkElement.class.getName()); + log.info("Create device {} ", GRanNetworkElement.class.getName()); return Optional.of(new GRanNetworkElement(acessor, serviceProvider.getDataProvider())); } else { return Optional.empty(); } - } + } } diff --git a/sdnr/wt/devicemanager-gran/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/gran/test/TestDeviceManagerGRanImpl.java b/sdnr/wt/devicemanager-gran/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/gran/test/TestDeviceManagerGRanImpl.java index aeb50e83f..86865277f 100644 --- a/sdnr/wt/devicemanager-gran/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/gran/test/TestDeviceManagerGRanImpl.java +++ b/sdnr/wt/devicemanager-gran/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/gran/test/TestDeviceManagerGRanImpl.java @@ -27,22 +27,22 @@ import org.onap.ccsdk.features.sdnr.wt.devicemanager.service.DeviceManagerServic import org.onap.ccsdk.features.sdnr.wt.devicemanager.service.NetconfNetworkElementService; public class TestDeviceManagerGRanImpl { - GRanNetworkElementFactory factory = new GRanNetworkElementFactory(); - DeviceManagerServiceProvider serviceProvider; - - @Test - public void test() throws Exception { - serviceProvider = mock(DeviceManagerServiceProvider.class); - NetconfNetworkElementService netconfNetworkElementService = mock(NetconfNetworkElementService.class); - when(netconfNetworkElementService.registerNetworkElementFactory(factory)).thenReturn(null); - when(netconfNetworkElementService.getServiceProvider()).thenReturn(serviceProvider); - - DeviceManagerGRanImpl devMgrGRan = new DeviceManagerGRanImpl(); - - devMgrGRan.setNetconfNetworkElementService(netconfNetworkElementService); - devMgrGRan.init(); - devMgrGRan.close(); - - } + GRanNetworkElementFactory factory = new GRanNetworkElementFactory(); + DeviceManagerServiceProvider serviceProvider; + + @Test + public void test() throws Exception { + serviceProvider = mock(DeviceManagerServiceProvider.class); + NetconfNetworkElementService netconfNetworkElementService = mock(NetconfNetworkElementService.class); + when(netconfNetworkElementService.registerNetworkElementFactory(factory)).thenReturn(null); + when(netconfNetworkElementService.getServiceProvider()).thenReturn(serviceProvider); + + DeviceManagerGRanImpl devMgrGRan = new DeviceManagerGRanImpl(); + + devMgrGRan.setNetconfNetworkElementService(netconfNetworkElementService); + devMgrGRan.init(); + devMgrGRan.close(); + + } } diff --git a/sdnr/wt/devicemanager-gran/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/gran/test/TestGRanNetworkElement.java b/sdnr/wt/devicemanager-gran/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/gran/test/TestGRanNetworkElement.java index b13965933..a9393cd0e 100644 --- a/sdnr/wt/devicemanager-gran/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/gran/test/TestGRanNetworkElement.java +++ b/sdnr/wt/devicemanager-gran/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/gran/test/TestGRanNetworkElement.java @@ -29,27 +29,27 @@ import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology. public class TestGRanNetworkElement { - private static final String NODEID = "node1"; - - @Test - public void test() { - NetconfAccessor netconfAccessor = mock(NetconfAccessor.class); - DataProvider databaseService = mock(DataProvider.class); - - when(netconfAccessor.getNodeId()).thenReturn(new NodeId(NODEID)); - - GRanNetworkElement gRanNe = new GRanNetworkElement(netconfAccessor, databaseService); - assertEquals(3, gRanNe.getDeviceType().getIntValue()); - assertEquals("RAN3GPP", gRanNe.getDeviceType().getName()); - assertEquals(NODEID, gRanNe.getNodeId().getValue()); - - gRanNe.register(); - gRanNe.deregister(); - gRanNe.warmstart(); - gRanNe.getAcessor(); - gRanNe.getService(null); - - } + private static final String NODEID = "node1"; + + @Test + public void test() { + NetconfAccessor netconfAccessor = mock(NetconfAccessor.class); + DataProvider databaseService = mock(DataProvider.class); + + when(netconfAccessor.getNodeId()).thenReturn(new NodeId(NODEID)); + + GRanNetworkElement gRanNe = new GRanNetworkElement(netconfAccessor, databaseService); + assertEquals(3, gRanNe.getDeviceType().getIntValue()); + assertEquals("RAN3GPP", gRanNe.getDeviceType().getName()); + assertEquals(NODEID, gRanNe.getNodeId().getValue()); + + gRanNe.register(); + gRanNe.deregister(); + gRanNe.warmstart(); + gRanNe.getAcessor(); + gRanNe.getService(null); + + } } diff --git a/sdnr/wt/devicemanager-gran/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/gran/test/TestGRanNetworkElementFactory.java b/sdnr/wt/devicemanager-gran/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/gran/test/TestGRanNetworkElementFactory.java index 4d0417bf7..b307d8877 100644 --- a/sdnr/wt/devicemanager-gran/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/gran/test/TestGRanNetworkElementFactory.java +++ b/sdnr/wt/devicemanager-gran/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/gran/test/TestGRanNetworkElementFactory.java @@ -33,36 +33,36 @@ import org.opendaylight.yang.gen.v1.urn._3gpp.tsg.sa5.nrm.top.rev180731.TopGrp; public class TestGRanNetworkElementFactory { - Capabilities capabilities; - NetconfAccessor netconfAccessor; - DeviceManagerServiceProvider devMgrService; - - @SuppressWarnings("unused") - @Before - public void init() { - capabilities = mock(Capabilities.class); - netconfAccessor = mock(NetconfAccessor.class); - devMgrService = mock(DeviceManagerServiceProvider.class); - - when(netconfAccessor.getCapabilites()).thenReturn(capabilities); - when(devMgrService.getDataProvider()).thenReturn(null); - - } - - @Test - public void testCreate() throws Exception { - when(netconfAccessor.getCapabilites().isSupportingNamespace(TopGrp.QNAME)).thenReturn(true); - - GRanNetworkElementFactory gRanNeFactory = new GRanNetworkElementFactory(); - assertTrue((gRanNeFactory.create(netconfAccessor, devMgrService)).isPresent()); - } + Capabilities capabilities; + NetconfAccessor netconfAccessor; + DeviceManagerServiceProvider devMgrService; - @Test - public void testCreateNone() throws Exception { - when(netconfAccessor.getCapabilites().isSupportingNamespace(TopGrp.QNAME)).thenReturn(false); - - GRanNetworkElementFactory gRanNeFactory = new GRanNetworkElementFactory(); - assertTrue(!(gRanNeFactory.create(netconfAccessor, devMgrService).isPresent())); - } + @SuppressWarnings("unused") + @Before + public void init() { + capabilities = mock(Capabilities.class); + netconfAccessor = mock(NetconfAccessor.class); + devMgrService = mock(DeviceManagerServiceProvider.class); + + when(netconfAccessor.getCapabilites()).thenReturn(capabilities); + when(devMgrService.getDataProvider()).thenReturn(null); + + } + + @Test + public void testCreate() throws Exception { + when(netconfAccessor.getCapabilites().isSupportingNamespace(TopGrp.QNAME)).thenReturn(true); + + GRanNetworkElementFactory gRanNeFactory = new GRanNetworkElementFactory(); + assertTrue((gRanNeFactory.create(netconfAccessor, devMgrService)).isPresent()); + } + + @Test + public void testCreateNone() throws Exception { + when(netconfAccessor.getCapabilites().isSupportingNamespace(TopGrp.QNAME)).thenReturn(false); + + GRanNetworkElementFactory gRanNeFactory = new GRanNetworkElementFactory(); + assertTrue(!(gRanNeFactory.create(netconfAccessor, devMgrService).isPresent())); + } } -- cgit 1.2.3-korg