diff options
author | highstreetherbert <herbert.eiselt@highstreet-technologies.com> | 2020-07-10 18:54:26 +0200 |
---|---|---|
committer | highstreetherbert <herbert.eiselt@highstreet-technologies.com> | 2020-07-11 20:33:52 +0200 |
commit | 25f7c518a61c3018452381f082effe5af335f592 (patch) | |
tree | 1d8f5388219f2e418e473689f0351bcc2e69d92b /sdnr/wt/mountpoint-state-provider/provider/src/test | |
parent | 23c27ddcd79913d11eac16eb42c5a43899de97a1 (diff) |
Reformat sdnr mountpoint-state-provider to ONAP code style
Reformat to ONAP code style
Issue-ID: SDNC-1280
Signed-off-by: highstreetherbert <herbert.eiselt@highstreet-technologies.com>
Change-Id: Ibb4685c594de3733e7c682c4cf761fd311ab52a4
Signed-off-by: highstreetherbert <herbert.eiselt@highstreet-technologies.com>
Diffstat (limited to 'sdnr/wt/mountpoint-state-provider/provider/src/test')
16 files changed, 379 insertions, 377 deletions
diff --git a/sdnr/wt/mountpoint-state-provider/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/mountpointstateprovider/test/GeneralConfigTest.java b/sdnr/wt/mountpoint-state-provider/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/mountpointstateprovider/test/GeneralConfigTest.java index 87bd85fa3..c95dbf56c 100644 --- a/sdnr/wt/mountpoint-state-provider/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/mountpointstateprovider/test/GeneralConfigTest.java +++ b/sdnr/wt/mountpoint-state-provider/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/mountpointstateprovider/test/GeneralConfigTest.java @@ -1,4 +1,4 @@ -/******************************************************************************* +/* * ============LICENSE_START======================================================================== * ONAP : ccsdk feature sdnr wt * ================================================================================================= @@ -14,70 +14,70 @@ * 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.mountpointstateprovider.test; import static org.junit.Assert.assertEquals; - +import com.google.common.io.Files; import java.io.File; import java.io.IOException; import java.nio.charset.StandardCharsets; - import org.junit.After; import org.junit.Test; import org.onap.ccsdk.features.sdnr.wt.common.configuration.ConfigurationFileRepresentation; import org.onap.ccsdk.features.sdnr.wt.mountpointstateprovider.impl.GeneralConfig; -import com.google.common.io.Files; - public class GeneralConfigTest { - private static final String TESTCONFIG_CONTENT="[general]\n" + - "dmaapEnabled=false\n" + - "TransportType=HTTPNOAUTH\n" + - "host=onap-dmap:3904\n" + - "topic=unauthenticated.SDNR_MOUNTPOINT_STATE_INFO\n" + - "contenttype=application/json\n" + - "timeout=20000\n" + - "limit=10000\n" + - "maxBatchSize=100\n" + - "maxAgeMs=250\n" + - "MessageSentThreadOccurance=50\n"; + // @formatter:off + private static final String TESTCONFIG_CONTENT = + "[general]\n" + + "dmaapEnabled=false\n" + + "TransportType=HTTPNOAUTH\n" + + "host=onap-dmap:3904\n" + + "topic=unauthenticated.SDNR_MOUNTPOINT_STATE_INFO\n" + + "contenttype=application/json\n" + + "timeout=20000\n" + + "limit=10000\n" + + "maxBatchSize=100\n" + + "maxAgeMs=250\n" + + "MessageSentThreadOccurance=50\n"; + // @formatter:on + + private ConfigurationFileRepresentation globalCfg; + + @Test + public void test() { + try { + Files.asCharSink(new File("test.properties"), StandardCharsets.UTF_8).write(TESTCONFIG_CONTENT); + globalCfg = new ConfigurationFileRepresentation("test.properties"); + GeneralConfig cfg = new GeneralConfig(globalCfg); + assertEquals("onap-dmap:3904", cfg.getHostPort()); + assertEquals(false, cfg.getEnabled()); + assertEquals("unauthenticated.SDNR_MOUNTPOINT_STATE_INFO", cfg.getTopic()); + assertEquals("application/json", cfg.getContenttype()); + assertEquals("20000", cfg.getTimeout()); + assertEquals("10000", cfg.getLimit()); + assertEquals("100", cfg.getMaxBatchSize()); + assertEquals("250", cfg.getMaxAgeMs()); + assertEquals("50", cfg.getMessageSentThreadOccurrence()); + assertEquals("HTTPNOAUTH", cfg.getTransportType()); + assertEquals("general", cfg.getSectionName()); - private ConfigurationFileRepresentation globalCfg; + } catch (IOException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + } - @Test - public void test() { - try { - Files.asCharSink(new File("test.properties"), StandardCharsets.UTF_8).write(TESTCONFIG_CONTENT); - globalCfg = new ConfigurationFileRepresentation("test.properties"); - GeneralConfig cfg = new GeneralConfig(globalCfg); - assertEquals("onap-dmap:3904", cfg.getHostPort()); - assertEquals(false, cfg.getEnabled()); - assertEquals("unauthenticated.SDNR_MOUNTPOINT_STATE_INFO", cfg.getTopic()); - assertEquals("application/json", cfg.getContenttype()); - assertEquals("20000", cfg.getTimeout()); - assertEquals("10000", cfg.getLimit()); - assertEquals("100", cfg.getMaxBatchSize()); - assertEquals("250", cfg.getMaxAgeMs()); - assertEquals("50", cfg.getMessageSentThreadOccurrence()); - assertEquals("HTTPNOAUTH", cfg.getTransportType()); - assertEquals("general", cfg.getSectionName()); + @After + public void cleanUp() { + File file = new File("test.properties"); + if (file.exists()) { + System.out.println("File exists, Deleting it"); + file.delete(); + } - } catch (IOException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - } - - @After - public void cleanUp() { - File file = new File("test.properties"); - if (file.exists()) { - System.out.println("File exists, Deleting it"); - file.delete(); - } - - } + } } diff --git a/sdnr/wt/mountpoint-state-provider/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/mountpointstateprovider/test/TestMountpointNodeConnectListenerImpl.java b/sdnr/wt/mountpoint-state-provider/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/mountpointstateprovider/test/TestMountpointNodeConnectListenerImpl.java index 078109500..8cc7f206f 100644 --- a/sdnr/wt/mountpoint-state-provider/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/mountpointstateprovider/test/TestMountpointNodeConnectListenerImpl.java +++ b/sdnr/wt/mountpoint-state-provider/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/mountpointstateprovider/test/TestMountpointNodeConnectListenerImpl.java @@ -1,4 +1,4 @@ -/******************************************************************************* +/* * ============LICENSE_START======================================================================== * ONAP : ccsdk feature sdnr wt * ================================================================================================= @@ -14,7 +14,7 @@ * 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.mountpointstateprovider.test; diff --git a/sdnr/wt/mountpoint-state-provider/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/mountpointstateprovider/test/TestMountpointNodeStateListenerImpl.java b/sdnr/wt/mountpoint-state-provider/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/mountpointstateprovider/test/TestMountpointNodeStateListenerImpl.java index 2423aa8d4..2ee93b0a3 100644 --- a/sdnr/wt/mountpoint-state-provider/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/mountpointstateprovider/test/TestMountpointNodeStateListenerImpl.java +++ b/sdnr/wt/mountpoint-state-provider/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/mountpointstateprovider/test/TestMountpointNodeStateListenerImpl.java @@ -1,4 +1,4 @@ -/******************************************************************************* +/* * ============LICENSE_START======================================================================== * ONAP : ccsdk feature sdnr wt * ================================================================================================= @@ -14,7 +14,7 @@ * 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.mountpointstateprovider.test; @@ -33,29 +33,29 @@ import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology. public class TestMountpointNodeStateListenerImpl { - MountpointNodeStateListenerImpl nodeStateListener = new MountpointNodeStateListenerImpl(); - NetconfNodeMock netconfNodeMock = new NetconfNodeMock(); - NetconfNode netconfNode = netconfNodeMock.getNetconfNode(); - NodeId nNodeId = new NodeId("nSky"); - DataBroker netconfNodeDataBroker = new DataBrokerMountpointMock(); - - @Test - public void testOnCreated() { - assertNotNull(nNodeId); - assertNotNull(netconfNode); - nodeStateListener.onCreated(nNodeId, netconfNode); - assertNotEquals(MountpointStatePublisher.stateObjects.size(), 0); - } - - @Test - public void testOnStateChange() { - nodeStateListener.onStateChange(nNodeId, netconfNode); - assertNotEquals(MountpointStatePublisher.stateObjects.size(), 0); - } - - @Test - public void testOnRemoved() { - nodeStateListener.onRemoved(nNodeId); - } + MountpointNodeStateListenerImpl nodeStateListener = new MountpointNodeStateListenerImpl(); + NetconfNodeMock netconfNodeMock = new NetconfNodeMock(); + NetconfNode netconfNode = netconfNodeMock.getNetconfNode(); + NodeId nNodeId = new NodeId("nSky"); + DataBroker netconfNodeDataBroker = new DataBrokerMountpointMock(); + + @Test + public void testOnCreated() { + assertNotNull(nNodeId); + assertNotNull(netconfNode); + nodeStateListener.onCreated(nNodeId, netconfNode); + assertNotEquals(MountpointStatePublisher.stateObjects.size(), 0); + } + + @Test + public void testOnStateChange() { + nodeStateListener.onStateChange(nNodeId, netconfNode); + assertNotEquals(MountpointStatePublisher.stateObjects.size(), 0); + } + + @Test + public void testOnRemoved() { + nodeStateListener.onRemoved(nNodeId); + } } diff --git a/sdnr/wt/mountpoint-state-provider/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/mountpointstateprovider/test/TestMountpointStateProviderImpl.java b/sdnr/wt/mountpoint-state-provider/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/mountpointstateprovider/test/TestMountpointStateProviderImpl.java index 40951fab9..19d930866 100644 --- a/sdnr/wt/mountpoint-state-provider/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/mountpointstateprovider/test/TestMountpointStateProviderImpl.java +++ b/sdnr/wt/mountpoint-state-provider/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/mountpointstateprovider/test/TestMountpointStateProviderImpl.java @@ -44,88 +44,88 @@ import org.slf4j.LoggerFactory; public class TestMountpointStateProviderImpl { - private static Path KARAF_ETC = Paths.get("etc"); - private static MountpointStateProviderImpl mountpointStateProvider; - - private static final Logger LOG = LoggerFactory.getLogger(TestMountpointStateProviderImpl.class); - - - - @BeforeClass - public static void before() throws InterruptedException, IOException { - - System.out.println("Logger: " + LOG.getClass().getName() + " " + LOG.getName()); - // Call System property to get the classpath value - Path etc = KARAF_ETC; - delete(etc); - - System.out.println("Create empty:" + etc.toString()); - Files.createDirectories(etc); - - // Create mocks - - // start using blueprint interface - try { - mountpointStateProvider = new MountpointStateProviderImpl(); - - //mountpointStateProvider.init(); // Can't be tested as this invokes a thread. Mockito doesn't help either - } catch (Exception e) { - StringWriter sw = new StringWriter(); - e.printStackTrace(new PrintWriter(sw)); - fail("Not initialized" +sw.toString()); - } - System.out.println("Initialization status: " + mountpointStateProvider.isInitializationOk()); - System.out.println("Initialization done"); - } - - @AfterClass - public static void after() throws InterruptedException, IOException { - - System.out.println("Start shutdown"); - // close using blueprint interface - try { - mountpointStateProvider.close(); - } catch (Exception e) { - System.out.println(e); - } - delete(KARAF_ETC); - - } - - @Test - public void test1() { - System.out.println("Test1: slave mountpoint"); - System.out.println("Initialization status: " + mountpointStateProvider.isInitializationOk()); - System.out.println("Test2: Done"); - } - - // ********************* Private - - private static void delete(Path etc) throws IOException { - if (Files.exists(etc)) { - System.out.println("Found and remove:" + 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); - } - } -/* @Test - public void testInit() { - - } - - @Test - public void testOnConfigChanged() { - //fail("Not yet implemented"); - }*/ + private static Path KARAF_ETC = Paths.get("etc"); + private static MountpointStateProviderImpl mountpointStateProvider; + + private static final Logger LOG = LoggerFactory.getLogger(TestMountpointStateProviderImpl.class); + + + + @BeforeClass + public static void before() throws InterruptedException, IOException { + + System.out.println("Logger: " + LOG.getClass().getName() + " " + LOG.getName()); + // Call System property to get the classpath value + Path etc = KARAF_ETC; + delete(etc); + + System.out.println("Create empty:" + etc.toString()); + Files.createDirectories(etc); + + // Create mocks + + // start using blueprint interface + try { + mountpointStateProvider = new MountpointStateProviderImpl(); + + //mountpointStateProvider.init(); // Can't be tested as this invokes a thread. Mockito doesn't help either + } catch (Exception e) { + StringWriter sw = new StringWriter(); + e.printStackTrace(new PrintWriter(sw)); + fail("Not initialized" + sw.toString()); + } + System.out.println("Initialization status: " + mountpointStateProvider.isInitializationOk()); + System.out.println("Initialization done"); + } + + @AfterClass + public static void after() throws InterruptedException, IOException { + + System.out.println("Start shutdown"); + // close using blueprint interface + try { + mountpointStateProvider.close(); + } catch (Exception e) { + System.out.println(e); + } + delete(KARAF_ETC); + + } + + @Test + public void test1() { + System.out.println("Test1: slave mountpoint"); + System.out.println("Initialization status: " + mountpointStateProvider.isInitializationOk()); + System.out.println("Test2: Done"); + } + + // ********************* Private + + private static void delete(Path etc) throws IOException { + if (Files.exists(etc)) { + System.out.println("Found and remove:" + 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); + } + } + /* @Test + public void testInit() { + + } + + @Test + public void testOnConfigChanged() { + //fail("Not yet implemented"); + }*/ } diff --git a/sdnr/wt/mountpoint-state-provider/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/mountpointstateprovider/test/TestMountpointStatePublisher.java b/sdnr/wt/mountpoint-state-provider/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/mountpointstateprovider/test/TestMountpointStatePublisher.java index 72069d72c..dcb62f253 100644 --- a/sdnr/wt/mountpoint-state-provider/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/mountpointstateprovider/test/TestMountpointStatePublisher.java +++ b/sdnr/wt/mountpoint-state-provider/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/mountpointstateprovider/test/TestMountpointStatePublisher.java @@ -43,108 +43,110 @@ import org.slf4j.Logger; public class TestMountpointStatePublisher { - private static final String CONFIGURATIONTESTFILE = "test.properties"; - public Thread publisher; - - @Before - public void testMountpointStatePublisherData() { - String testJsonData = "{\"NodeId\":\"69322972e178_50001\",\"NetConfNodeState\":\"Connecting\",\"TimeStamp\":\"2019-11-12T12:45:08.604Z\"}"; - JSONObject jsonObj = new JSONObject(testJsonData); - MountpointStatePublisher.stateObjects.add(jsonObj); - } - - @Test - public void testMountpointStatePublisherConfiguration() throws InterruptedException { - ConfigurationFileRepresentation configFileRepresentation = new ConfigurationFileRepresentation(CONFIGURATIONTESTFILE); - GeneralConfig cfg = new GeneralConfig(configFileRepresentation); - - MountpointStatePublisher pub = new MountpointStatePublisherMock(cfg); - pub.createPublisher(null); - pub.publishMessage(pub.createPublisher(null), "Test DMaaP Message"); - - } - - public class MountpointStatePublisherMock extends MountpointStatePublisher { - - public MountpointStatePublisherMock(Configuration config) { - super(config); - } - - @Override - public MRBatchingPublisher createPublisher(Properties publisherProperties) { - - return new MRBatchingPublisher() { - - @Override - public int send(String msg) throws IOException { - // TODO Auto-generated method stub - System.out.println("Message to send - "+msg); - return 0; - } - - @Override - public int send(String partition, String msg) throws IOException { - // TODO Auto-generated method stub - return 0; - } - - @Override - public int send(message msg) throws IOException { - // TODO Auto-generated method stub - return 0; - } - - @Override - public int send(Collection<message> msgs) throws IOException { - // TODO Auto-generated method stub - return 0; - } - - @Override - public void close() { - // TODO Auto-generated method stub - - } - - @Override - public void logTo(Logger log) { - // TODO Auto-generated method stub - - } - - @Override - public void setApiCredentials(String apiKey, String apiSecret) { - // TODO Auto-generated method stub - - } - - @Override - public void clearApiCredentials() { - // TODO Auto-generated method stub - - } - - @Override - public int getPendingMessageCount() { - // TODO Auto-generated method stub - return 0; - } - - @Override - public List<message> close(long timeout, TimeUnit timeoutUnits) - throws IOException, InterruptedException { - // TODO Auto-generated method stub - return null; - } - - @Override - public MRPublisherResponse sendBatchWithResponse() { - // TODO Auto-generated method stub - return null; - } - - }; - } - } + private static final String CONFIGURATIONTESTFILE = "test.properties"; + public Thread publisher; + + @Before + public void testMountpointStatePublisherData() { + String testJsonData = + "{\"NodeId\":\"69322972e178_50001\",\"NetConfNodeState\":\"Connecting\",\"TimeStamp\":\"2019-11-12T12:45:08.604Z\"}"; + JSONObject jsonObj = new JSONObject(testJsonData); + MountpointStatePublisher.stateObjects.add(jsonObj); + } + + @Test + public void testMountpointStatePublisherConfiguration() throws InterruptedException { + ConfigurationFileRepresentation configFileRepresentation = + new ConfigurationFileRepresentation(CONFIGURATIONTESTFILE); + GeneralConfig cfg = new GeneralConfig(configFileRepresentation); + + MountpointStatePublisher pub = new MountpointStatePublisherMock(cfg); + pub.createPublisher(null); + pub.publishMessage(pub.createPublisher(null), "Test DMaaP Message"); + + } + + public class MountpointStatePublisherMock extends MountpointStatePublisher { + + public MountpointStatePublisherMock(Configuration config) { + super(config); + } + + @Override + public MRBatchingPublisher createPublisher(Properties publisherProperties) { + + return new MRBatchingPublisher() { + + @Override + public int send(String msg) throws IOException { + // TODO Auto-generated method stub + System.out.println("Message to send - " + msg); + return 0; + } + + @Override + public int send(String partition, String msg) throws IOException { + // TODO Auto-generated method stub + return 0; + } + + @Override + public int send(message msg) throws IOException { + // TODO Auto-generated method stub + return 0; + } + + @Override + public int send(Collection<message> msgs) throws IOException { + // TODO Auto-generated method stub + return 0; + } + + @Override + public void close() { + // TODO Auto-generated method stub + + } + + @Override + public void logTo(Logger log) { + // TODO Auto-generated method stub + + } + + @Override + public void setApiCredentials(String apiKey, String apiSecret) { + // TODO Auto-generated method stub + + } + + @Override + public void clearApiCredentials() { + // TODO Auto-generated method stub + + } + + @Override + public int getPendingMessageCount() { + // TODO Auto-generated method stub + return 0; + } + + @Override + public List<message> close(long timeout, TimeUnit timeoutUnits) + throws IOException, InterruptedException { + // TODO Auto-generated method stub + return null; + } + + @Override + public MRPublisherResponse sendBatchWithResponse() { + // TODO Auto-generated method stub + return null; + } + + }; + } + } } diff --git a/sdnr/wt/mountpoint-state-provider/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/mountpointstateprovider/test/mock/NetconfAccessorMock.java b/sdnr/wt/mountpoint-state-provider/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/mountpointstateprovider/test/mock/NetconfAccessorMock.java index 8a4f20b29..69c24d834 100644 --- a/sdnr/wt/mountpoint-state-provider/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/mountpointstateprovider/test/mock/NetconfAccessorMock.java +++ b/sdnr/wt/mountpoint-state-provider/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/mountpointstateprovider/test/mock/NetconfAccessorMock.java @@ -1,4 +1,4 @@ -/******************************************************************************* +/* * ============LICENSE_START======================================================================== * ONAP : ccsdk feature sdnr wt * ================================================================================================= @@ -14,7 +14,7 @@ * 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.mountpointstateprovider.test.mock; import com.google.common.util.concurrent.ListenableFuture; diff --git a/sdnr/wt/mountpoint-state-provider/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/mountpointstateprovider/test/mock/NetconfNodeMock.java b/sdnr/wt/mountpoint-state-provider/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/mountpointstateprovider/test/mock/NetconfNodeMock.java index 297674945..e5f6456c9 100644 --- a/sdnr/wt/mountpoint-state-provider/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/mountpointstateprovider/test/mock/NetconfNodeMock.java +++ b/sdnr/wt/mountpoint-state-provider/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/mountpointstateprovider/test/mock/NetconfNodeMock.java @@ -1,4 +1,4 @@ -/******************************************************************************* +/* * ============LICENSE_START======================================================================== * ONAP : ccsdk feature sdnr wt * ================================================================================================= @@ -14,7 +14,7 @@ * 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.mountpointstateprovider.test.mock; @@ -28,16 +28,16 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.netconf.node.topology.rev15 public class NetconfNodeMock { - public NetconfNode getNetconfNode() { + public NetconfNode getNetconfNode() { - NetconfNodeBuilder nNodeBuilder = new NetconfNodeBuilder(); - nNodeBuilder.setAvailableCapabilities(null); - nNodeBuilder.setConnectionStatus(ConnectionStatus.Connected); - nNodeBuilder.setHost(new Host(new IpAddress(new Ipv4Address("1.2.3.4")))); - nNodeBuilder.setPort(new PortNumber(2230)); - // build - NetconfNode nNode = nNodeBuilder.build(); - return nNode; - } + NetconfNodeBuilder nNodeBuilder = new NetconfNodeBuilder(); + nNodeBuilder.setAvailableCapabilities(null); + nNodeBuilder.setConnectionStatus(ConnectionStatus.Connected); + nNodeBuilder.setHost(new Host(new IpAddress(new Ipv4Address("1.2.3.4")))); + nNodeBuilder.setPort(new PortNumber(2230)); + // build + NetconfNode nNode = nNodeBuilder.build(); + return nNode; + } } diff --git a/sdnr/wt/mountpoint-state-provider/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/mountpointstateprovider/test/mock/odlapi/ClusterSingletonServiceProviderMock.java b/sdnr/wt/mountpoint-state-provider/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/mountpointstateprovider/test/mock/odlapi/ClusterSingletonServiceProviderMock.java index b9d55ff27..c69f05da3 100644 --- a/sdnr/wt/mountpoint-state-provider/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/mountpointstateprovider/test/mock/odlapi/ClusterSingletonServiceProviderMock.java +++ b/sdnr/wt/mountpoint-state-provider/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/mountpointstateprovider/test/mock/odlapi/ClusterSingletonServiceProviderMock.java @@ -1,4 +1,4 @@ -/******************************************************************************* +/* * ============LICENSE_START======================================================================== * ONAP : ccsdk feature sdnr wt * ================================================================================================= @@ -14,7 +14,7 @@ * 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.mountpointstateprovider.test.mock.odlapi; @@ -24,14 +24,14 @@ import org.opendaylight.mdsal.singleton.common.api.ClusterSingletonServiceRegist public class ClusterSingletonServiceProviderMock implements ClusterSingletonServiceProvider { - @Override - public void close() throws Exception { + @Override + public void close() throws Exception { - } + } - @Override - public ClusterSingletonServiceRegistration registerClusterSingletonService(ClusterSingletonService service) { - return null; - } + @Override + public ClusterSingletonServiceRegistration registerClusterSingletonService(ClusterSingletonService service) { + return null; + } } diff --git a/sdnr/wt/mountpoint-state-provider/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/mountpointstateprovider/test/mock/odlapi/DataBrokerMountpointMock.java b/sdnr/wt/mountpoint-state-provider/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/mountpointstateprovider/test/mock/odlapi/DataBrokerMountpointMock.java index b85d66809..271701fc2 100644 --- a/sdnr/wt/mountpoint-state-provider/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/mountpointstateprovider/test/mock/odlapi/DataBrokerMountpointMock.java +++ b/sdnr/wt/mountpoint-state-provider/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/mountpointstateprovider/test/mock/odlapi/DataBrokerMountpointMock.java @@ -1,4 +1,4 @@ -/******************************************************************************* +/* * ============LICENSE_START======================================================= * ONAP : ccsdk feature sdnr wt * ================================================================================ @@ -17,7 +17,7 @@ * See the License for the specific language governing permissions and * limitations under the License. * ============LICENSE_END========================================================= - ******************************************************************************/ + */ package org.onap.ccsdk.features.sdnr.wt.mountpointstateprovider.test.mock.odlapi; import org.eclipse.jdt.annotation.NonNull; @@ -61,45 +61,45 @@ public class DataBrokerMountpointMock implements DataBroker, BindingService { return readOnlyTransaction; } - public ReadWriteTransaction newReadWriteTransaction1() { - return null; + public ReadWriteTransaction newReadWriteTransaction1() { + return null; } public org.opendaylight.mdsal.binding.api.@NonNull WriteTransaction newWriteOnlyTransaction1() { return null; } - @Override - public @NonNull ReadTransaction newReadOnlyTransaction() { - // TODO Auto-generated method stub - return null; - } - - @Override - public org.opendaylight.mdsal.binding.api.@NonNull ReadWriteTransaction newReadWriteTransaction() { - // TODO Auto-generated method stub - return null; - } - - @Override - public org.opendaylight.mdsal.binding.api.@NonNull WriteTransaction newWriteOnlyTransaction() { - // TODO Auto-generated method stub - return null; - } - - @Override - public <T extends DataObject, L extends org.opendaylight.mdsal.binding.api.DataTreeChangeListener<T>> @NonNull ListenerRegistration<L> registerDataTreeChangeListener( - org.opendaylight.mdsal.binding.api.@NonNull DataTreeIdentifier<T> treeId, @NonNull L listener) { - // TODO Auto-generated method stub - return null; - } - - @Override - public @NonNull TransactionChain createTransactionChain( - org.opendaylight.mdsal.binding.api.@NonNull TransactionChainListener listener) { - // TODO Auto-generated method stub - return null; - } + @Override + public @NonNull ReadTransaction newReadOnlyTransaction() { + // TODO Auto-generated method stub + return null; + } + + @Override + public org.opendaylight.mdsal.binding.api.@NonNull ReadWriteTransaction newReadWriteTransaction() { + // TODO Auto-generated method stub + return null; + } + + @Override + public org.opendaylight.mdsal.binding.api.@NonNull WriteTransaction newWriteOnlyTransaction() { + // TODO Auto-generated method stub + return null; + } + + @Override + public <T extends DataObject, L extends org.opendaylight.mdsal.binding.api.DataTreeChangeListener<T>> @NonNull ListenerRegistration<L> registerDataTreeChangeListener( + org.opendaylight.mdsal.binding.api.@NonNull DataTreeIdentifier<T> treeId, @NonNull L listener) { + // TODO Auto-generated method stub + return null; + } + + @Override + public @NonNull TransactionChain createTransactionChain( + org.opendaylight.mdsal.binding.api.@NonNull TransactionChainListener listener) { + // TODO Auto-generated method stub + return null; + } diff --git a/sdnr/wt/mountpoint-state-provider/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/mountpointstateprovider/test/mock/odlapi/DataBrokerNetconfMock.java b/sdnr/wt/mountpoint-state-provider/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/mountpointstateprovider/test/mock/odlapi/DataBrokerNetconfMock.java index c8b03e4a0..65ca779a3 100644 --- a/sdnr/wt/mountpoint-state-provider/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/mountpointstateprovider/test/mock/odlapi/DataBrokerNetconfMock.java +++ b/sdnr/wt/mountpoint-state-provider/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/mountpointstateprovider/test/mock/odlapi/DataBrokerNetconfMock.java @@ -1,4 +1,4 @@ -/******************************************************************************* +/* * ============LICENSE_START======================================================= * ONAP : ccsdk feature sdnr wt * ================================================================================ @@ -17,7 +17,7 @@ * See the License for the specific language governing permissions and * limitations under the License. * ============LICENSE_END========================================================= - ******************************************************************************/ + */ package org.onap.ccsdk.features.sdnr.wt.mountpointstateprovider.test.mock.odlapi; import org.eclipse.jdt.annotation.NonNull; @@ -74,37 +74,37 @@ public class DataBrokerNetconfMock implements DataBroker { return null; } - @Override - public @NonNull ReadTransaction newReadOnlyTransaction() { - // TODO Auto-generated method stub - return null; - } - - @Override - public org.opendaylight.mdsal.binding.api.@NonNull ReadWriteTransaction newReadWriteTransaction() { - // TODO Auto-generated method stub - return null; - } - - @Override - public org.opendaylight.mdsal.binding.api.@NonNull WriteTransaction newWriteOnlyTransaction() { - // TODO Auto-generated method stub - return null; - } - - @Override - public <T extends DataObject, L extends org.opendaylight.mdsal.binding.api.DataTreeChangeListener<T>> @NonNull ListenerRegistration<L> registerDataTreeChangeListener( - org.opendaylight.mdsal.binding.api.@NonNull DataTreeIdentifier<T> treeId, @NonNull L listener) { - // TODO Auto-generated method stub - return null; - } - - @Override - public @NonNull TransactionChain createTransactionChain( - org.opendaylight.mdsal.binding.api.@NonNull TransactionChainListener listener) { - // TODO Auto-generated method stub - return null; - } + @Override + public @NonNull ReadTransaction newReadOnlyTransaction() { + // TODO Auto-generated method stub + return null; + } + + @Override + public org.opendaylight.mdsal.binding.api.@NonNull ReadWriteTransaction newReadWriteTransaction() { + // TODO Auto-generated method stub + return null; + } + + @Override + public org.opendaylight.mdsal.binding.api.@NonNull WriteTransaction newWriteOnlyTransaction() { + // TODO Auto-generated method stub + return null; + } + + @Override + public <T extends DataObject, L extends org.opendaylight.mdsal.binding.api.DataTreeChangeListener<T>> @NonNull ListenerRegistration<L> registerDataTreeChangeListener( + org.opendaylight.mdsal.binding.api.@NonNull DataTreeIdentifier<T> treeId, @NonNull L listener) { + // TODO Auto-generated method stub + return null; + } + + @Override + public @NonNull TransactionChain createTransactionChain( + org.opendaylight.mdsal.binding.api.@NonNull TransactionChainListener listener) { + // TODO Auto-generated method stub + return null; + } } diff --git a/sdnr/wt/mountpoint-state-provider/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/mountpointstateprovider/test/mock/odlapi/MountPointMock.java b/sdnr/wt/mountpoint-state-provider/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/mountpointstateprovider/test/mock/odlapi/MountPointMock.java index 3194189d8..cab9747e9 100644 --- a/sdnr/wt/mountpoint-state-provider/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/mountpointstateprovider/test/mock/odlapi/MountPointMock.java +++ b/sdnr/wt/mountpoint-state-provider/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/mountpointstateprovider/test/mock/odlapi/MountPointMock.java @@ -1,4 +1,4 @@ -/******************************************************************************* +/* * ============LICENSE_START======================================================= * ONAP : ccsdk feature sdnr wt sdnr-wt-devicemanager-provider * ================================================================================ @@ -17,7 +17,7 @@ * See the License for the specific language governing permissions and * limitations under the License. * ============LICENSE_END========================================================= - ******************************************************************************/ + */ package org.onap.ccsdk.features.sdnr.wt.mountpointstateprovider.test.mock.odlapi; @@ -58,12 +58,13 @@ public class MountPointMock implements MountPoint { @Override public <T extends BindingService> Optional<T> getService(Class<T> service) { - System.out.println("Requested mountpoint service: "+service.getSimpleName()+" databrokerAbsent state: "+databrokerAbsent); + System.out.println("Requested mountpoint service: " + service.getSimpleName() + " databrokerAbsent state: " + + databrokerAbsent); Optional<?> res; if (service.isInstance(dataBroker)) { System.out.println("Delivering databroker"); - res = databrokerAbsent ? Optional.absent() : Optional.of(dataBroker); + res = databrokerAbsent ? Optional.absent() : Optional.of(dataBroker); } else if (service.isInstance(rpcConsumerRegistry)) { System.out.println("Delivering RpcConsumerRegistryMock"); res = Optional.of(rpcConsumerRegistry); @@ -74,14 +75,14 @@ public class MountPointMock implements MountPoint { System.out.println("Delivering no service"); res = Optional.absent(); } - return (Optional<T>)res; + return (Optional<T>) res; } - public void setDatabrokerAbsent( boolean state) { + public void setDatabrokerAbsent(boolean state) { this.databrokerAbsent = state; } - public <T extends NotificationService&ReadOnlyTransaction>void setReadOnlyTransaction(T readOnlyTransaction) { + public <T extends NotificationService & ReadOnlyTransaction> void setReadOnlyTransaction(T readOnlyTransaction) { this.setReadOnlyTransaction = readOnlyTransaction; dataBroker.setReadOnlyTransaction(readOnlyTransaction); } diff --git a/sdnr/wt/mountpoint-state-provider/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/mountpointstateprovider/test/mock/odlapi/MountPointMockNew.java b/sdnr/wt/mountpoint-state-provider/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/mountpointstateprovider/test/mock/odlapi/MountPointMockNew.java index 03e70b56f..f8035e82e 100644 --- a/sdnr/wt/mountpoint-state-provider/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/mountpointstateprovider/test/mock/odlapi/MountPointMockNew.java +++ b/sdnr/wt/mountpoint-state-provider/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/mountpointstateprovider/test/mock/odlapi/MountPointMockNew.java @@ -1,4 +1,4 @@ -/******************************************************************************* +/* * ============LICENSE_START======================================================================== * ONAP : ccsdk feature sdnr wt * ================================================================================================= @@ -14,7 +14,7 @@ * 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.mountpointstateprovider.test.mock.odlapi; import java.util.Optional; diff --git a/sdnr/wt/mountpoint-state-provider/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/mountpointstateprovider/test/mock/odlapi/MountPointServiceMock.java b/sdnr/wt/mountpoint-state-provider/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/mountpointstateprovider/test/mock/odlapi/MountPointServiceMock.java index 59f742f4a..8802e812b 100644 --- a/sdnr/wt/mountpoint-state-provider/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/mountpointstateprovider/test/mock/odlapi/MountPointServiceMock.java +++ b/sdnr/wt/mountpoint-state-provider/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/mountpointstateprovider/test/mock/odlapi/MountPointServiceMock.java @@ -1,4 +1,4 @@ -/******************************************************************************* +/* * ============LICENSE_START======================================================= * ONAP : ccsdk feature sdnr wt * ================================================================================ @@ -17,7 +17,7 @@ * See the License for the specific language governing permissions and * limitations under the License. * ============LICENSE_END========================================================= - ******************************************************************************/ + */ package org.onap.ccsdk.features.sdnr.wt.mountpointstateprovider.test.mock.odlapi; import com.google.common.base.Optional; diff --git a/sdnr/wt/mountpoint-state-provider/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/mountpointstateprovider/test/mock/odlapi/NotificationPublishServiceMock.java b/sdnr/wt/mountpoint-state-provider/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/mountpointstateprovider/test/mock/odlapi/NotificationPublishServiceMock.java index b9db050c3..79ba90ae2 100644 --- a/sdnr/wt/mountpoint-state-provider/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/mountpointstateprovider/test/mock/odlapi/NotificationPublishServiceMock.java +++ b/sdnr/wt/mountpoint-state-provider/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/mountpointstateprovider/test/mock/odlapi/NotificationPublishServiceMock.java @@ -1,4 +1,4 @@ -/******************************************************************************* +/* * ============LICENSE_START======================================================= * ONAP : ccsdk feature sdnr wt * ================================================================================ @@ -17,7 +17,7 @@ * See the License for the specific language governing permissions and * limitations under the License. * ============LICENSE_END========================================================= - ******************************************************************************/ + */ package org.onap.ccsdk.features.sdnr.wt.mountpointstateprovider.test.mock.odlapi; import com.google.common.util.concurrent.ListenableFuture; @@ -37,14 +37,13 @@ public class NotificationPublishServiceMock implements NotificationPublishServic return null; } - @Override + @Override public ListenableFuture<?> offerNotification(Notification notification, int timeout, TimeUnit unit) throws InterruptedException { return null; } @Override - public void putNotification(Notification notification) throws InterruptedException { - } + public void putNotification(Notification notification) throws InterruptedException {} } diff --git a/sdnr/wt/mountpoint-state-provider/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/mountpointstateprovider/test/mock/odlapi/RpcConsumerRegistryMock.java b/sdnr/wt/mountpoint-state-provider/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/mountpointstateprovider/test/mock/odlapi/RpcConsumerRegistryMock.java index 0f08ec07f..963c9023b 100644 --- a/sdnr/wt/mountpoint-state-provider/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/mountpointstateprovider/test/mock/odlapi/RpcConsumerRegistryMock.java +++ b/sdnr/wt/mountpoint-state-provider/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/mountpointstateprovider/test/mock/odlapi/RpcConsumerRegistryMock.java @@ -1,4 +1,4 @@ -/******************************************************************************* +/* * ============LICENSE_START======================================================= * ONAP : ccsdk feature sdnr wt sdnr-wt-devicemanager-provider * ================================================================================ @@ -17,7 +17,7 @@ * See the License for the specific language governing permissions and * limitations under the License. * ============LICENSE_END========================================================= - ******************************************************************************/ + */ package org.onap.ccsdk.features.sdnr.wt.mountpointstateprovider.test.mock.odlapi; diff --git a/sdnr/wt/mountpoint-state-provider/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/mountpointstateprovider/test/mock/odlapi/RpcProviderRegistryMock.java b/sdnr/wt/mountpoint-state-provider/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/mountpointstateprovider/test/mock/odlapi/RpcProviderRegistryMock.java index 8a72bb630..1a8ed90d6 100644 --- a/sdnr/wt/mountpoint-state-provider/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/mountpointstateprovider/test/mock/odlapi/RpcProviderRegistryMock.java +++ b/sdnr/wt/mountpoint-state-provider/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/mountpointstateprovider/test/mock/odlapi/RpcProviderRegistryMock.java @@ -1,4 +1,4 @@ -/******************************************************************************* +/* * ============LICENSE_START======================================================= * ONAP : ccsdk feature sdnr wt * ================================================================================ @@ -17,7 +17,7 @@ * See the License for the specific language governing permissions and * limitations under the License. * ============LICENSE_END========================================================= - ******************************************************************************/ + */ package org.onap.ccsdk.features.sdnr.wt.mountpointstateprovider.test.mock.odlapi; import org.opendaylight.controller.md.sal.common.api.routing.RouteChangeListener; @@ -37,7 +37,7 @@ public class RpcProviderRegistryMock implements RpcProviderRegistry { return null; } - @Override + @Override public <L extends RouteChangeListener<RpcContextIdentifier, InstanceIdentifier<?>>> ListenerRegistration<L> registerRouteChangeListener( L listener) { return null; @@ -53,7 +53,7 @@ public class RpcProviderRegistryMock implements RpcProviderRegistry { @Override public <T extends RpcService> RpcRegistration<T> addRpcImplementation(Class<T> serviceInterface, T implementation) throws IllegalStateException { - System.out.println("Register class "+serviceInterface); + System.out.println("Register class " + serviceInterface); return null; } |