From 32a008a60f1fa5031b6b838ea599c28d9819ffb9 Mon Sep 17 00:00:00 2001 From: "r.bogacki" Date: Mon, 25 Feb 2019 13:15:07 +0100 Subject: Removed MsoLogger in 'mso-catalog-db-adapter' Removed MsoLogger from adapters ('mso-catalog-db-adapter') Replaced MsoLogger with plain slf4j. Refactored login output. Fixed imports. Change-Id: Ic61119892e9d4cb41498f2be2a65990f4d51bf0a Issue-ID: LOG-631 Signed-off-by: Robert Bogacki --- .../catalogrest/CvnfcCatalogDbQueryTest.java | 7 +++-- .../NetworkCollectionCatalogDbQueryTest.java | 35 ++++++++++++---------- 2 files changed, 24 insertions(+), 18 deletions(-) (limited to 'adapters/mso-catalog-db-adapter/src/test') diff --git a/adapters/mso-catalog-db-adapter/src/test/java/org/onap/so/adapters/catalogdb/catalogrest/CvnfcCatalogDbQueryTest.java b/adapters/mso-catalog-db-adapter/src/test/java/org/onap/so/adapters/catalogdb/catalogrest/CvnfcCatalogDbQueryTest.java index aeee279002..b08b93eb87 100644 --- a/adapters/mso-catalog-db-adapter/src/test/java/org/onap/so/adapters/catalogdb/catalogrest/CvnfcCatalogDbQueryTest.java +++ b/adapters/mso-catalog-db-adapter/src/test/java/org/onap/so/adapters/catalogdb/catalogrest/CvnfcCatalogDbQueryTest.java @@ -4,6 +4,8 @@ * ================================================================================ * Copyright (C) 2017 - 2018 AT&T Intellectual Property. All rights reserved. * ================================================================================ + * Modifications Copyright (c) 2019 Samsung + * ================================================================================ * 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 @@ -44,7 +46,8 @@ import org.onap.so.db.catalog.beans.VnfVfmoduleCvnfcConfigurationCustomization; import org.onap.so.db.catalog.beans.VnfcCustomization; import org.onap.so.db.catalog.client.CatalogDbClientPortChanger; import org.onap.so.db.catalog.data.repository.CvnfcCustomizationRepository; -import org.onap.so.logger.MsoLogger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.web.server.LocalServerPort; import org.springframework.boot.test.context.SpringBootTest; @@ -61,7 +64,7 @@ public class CvnfcCatalogDbQueryTest { @Autowired private CvnfcCustomizationRepository cvnfcCustomizationRepository; - private static final MsoLogger msoLogger = MsoLogger.getMsoLogger(MsoLogger.Catalog.BPEL, CvnfcCatalogDbQueryTest.class); + private static final Logger logger = LoggerFactory.getLogger(CvnfcCatalogDbQueryTest.class); @LocalServerPort private int port; diff --git a/adapters/mso-catalog-db-adapter/src/test/java/org/onap/so/adapters/catalogdb/catalogrest/NetworkCollectionCatalogDbQueryTest.java b/adapters/mso-catalog-db-adapter/src/test/java/org/onap/so/adapters/catalogdb/catalogrest/NetworkCollectionCatalogDbQueryTest.java index 3154603292..89a7ba3d17 100644 --- a/adapters/mso-catalog-db-adapter/src/test/java/org/onap/so/adapters/catalogdb/catalogrest/NetworkCollectionCatalogDbQueryTest.java +++ b/adapters/mso-catalog-db-adapter/src/test/java/org/onap/so/adapters/catalogdb/catalogrest/NetworkCollectionCatalogDbQueryTest.java @@ -4,6 +4,8 @@ * ================================================================================ * Copyright (C) 2017 - 2018 AT&T Intellectual Property. All rights reserved. * ================================================================================ + * Modifications Copyright (c) 2019 Samsung + * ================================================================================ * 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 @@ -40,7 +42,8 @@ import org.onap.so.db.catalog.beans.CollectionResourceInstanceGroupCustomization import org.onap.so.db.catalog.beans.InstanceGroup; import org.onap.so.db.catalog.beans.NetworkCollectionResourceCustomization; import org.onap.so.db.catalog.client.CatalogDbClientPortChanger; -import org.onap.so.logger.MsoLogger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.web.server.LocalServerPort; import org.springframework.boot.test.context.SpringBootTest; @@ -52,7 +55,7 @@ import org.springframework.test.context.junit4.SpringRunner; @ActiveProfiles("test") public class NetworkCollectionCatalogDbQueryTest { - private static final MsoLogger msoLogger = MsoLogger.getMsoLogger(MsoLogger.Catalog.BPEL, NetworkCollectionCatalogDbQueryTest.class); + private static final Logger logger = LoggerFactory.getLogger(NetworkCollectionCatalogDbQueryTest.class); private static final String NETWORKCOLLECTION = "NetworkCollection"; private final String serviceUUID = "5df8b6de-2083-11e7-93ae-92361f002671"; @@ -72,19 +75,19 @@ public class NetworkCollectionCatalogDbQueryTest { @Test @Transactional public void networkCollectionTest() { - msoLogger.debug("TEST IS STARTING UP..."); + logger.debug("TEST IS STARTING UP..."); String modelUUID = "4694a55f-58b3-4f17-92a5-796d6f5ffd0d"; boolean found = false; - msoLogger.debug(Integer.toString(port)); + logger.debug(Integer.toString(port)); InstanceGroup instanceGroup = null; List collectionInstanceGroupList = null; org.onap.so.db.catalog.beans.Service service = client.getServiceByID(modelUUID); if (service == null) { - msoLogger.debug("null"); + logger.debug("null"); } else { List customizations = service.getCollectionResourceCustomizations(); if (customizations.isEmpty()) { - msoLogger.debug("No Network Collection found. CollectionResourceCustomizations is empty"); + logger.debug("No Network Collection found. CollectionResourceCustomizations is empty"); } for (CollectionResourceCustomization crc : customizations) { if(client.getNetworkCollectionResourceCustomizationByID(crc.getModelCustomizationUUID()) @@ -95,25 +98,25 @@ public class NetworkCollectionCatalogDbQueryTest { String toscaNodeType = crc.getCollectionResource() .getToscaNodeType(); if (toscaNodeType.contains(NETWORKCOLLECTION)) { - msoLogger.debug("Found a network collection"); + logger.debug("Found a network collection"); instanceGroup = crc.getCollectionResource().getInstanceGroup(); collectionInstanceGroupList = instanceGroup.getCollectionInstanceGroupCustomizations(); CollectionNetworkResourceCustomization collectionNetworkCust = instanceGroup.getCollectionNetworkResourceCustomizations().get(0); - msoLogger.debug("Found Collection Network Resource Customization: " + collectionNetworkCust.getModelCustomizationUUID()); + logger.debug("Found Collection Network Resource Customization: " + collectionNetworkCust.getModelCustomizationUUID()); } else { - msoLogger.debug( + logger.debug( "No Network Collection found. toscaNodeType does not contain NetworkCollection"); } } else { - msoLogger.debug("No Network Collection found. toscaNodeType is null"); + logger.debug("No Network Collection found. toscaNodeType is null"); } } else { - msoLogger.debug("No Network Collection found. collectionResource is null"); + logger.debug("No Network Collection found. collectionResource is null"); } found = true; } else { - msoLogger.debug("Not a Network Collection Resource Customization Instance"); + logger.debug("Not a Network Collection Resource Customization Instance"); } } } @@ -124,11 +127,11 @@ public class NetworkCollectionCatalogDbQueryTest { @Test public void buildingBlockDetailTest() { - msoLogger.debug("TEST IS STARTING UP..."); - msoLogger.debug(Integer.toString(port)); + logger.debug("TEST IS STARTING UP..."); + logger.debug(Integer.toString(port)); String buildingBlockFlowName = "CreateNetworkCollectionBB"; BuildingBlockDetail buildingBlockDetail = client.getBuildingBlockDetail(buildingBlockFlowName); - msoLogger.debug("" + buildingBlockDetail.getResourceType()); + logger.debug("" + buildingBlockDetail.getResourceType()); assertNotNull(buildingBlockDetail); } @@ -148,6 +151,6 @@ public class NetworkCollectionCatalogDbQueryTest { String modelCustId = "1a61be4b-3378-4c9a-91c8-c919519b2d01"; CollectionNetworkResourceCustomization collectionNetworkCust = client.getCollectionNetworkResourceCustomizationByID(modelCustId); assertNotNull(collectionNetworkCust); - msoLogger.debug(collectionNetworkCust.getModelCustomizationUUID()); + logger.debug(collectionNetworkCust.getModelCustomizationUUID()); } } -- cgit 1.2.3-korg