diff options
Diffstat (limited to 'openecomp-be')
24 files changed, 171 insertions, 97 deletions
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/action-library-rest/action-library-rest-services/pom.xml b/openecomp-be/api/openecomp-sdc-rest-webapp/action-library-rest/action-library-rest-services/pom.xml index 1727ba654e..b275c1a3d0 100644 --- a/openecomp-be/api/openecomp-sdc-rest-webapp/action-library-rest/action-library-rest-services/pom.xml +++ b/openecomp-be/api/openecomp-sdc-rest-webapp/action-library-rest/action-library-rest-services/pom.xml @@ -125,7 +125,6 @@ <includes> <include>test/core/unittest/offline/**</include> </includes> - <skipTests>true</skipTests> </configuration> </plugin> <!-- Error codes generator plugin --> diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/onboarding-rest-war/pom.xml b/openecomp-be/api/openecomp-sdc-rest-webapp/onboarding-rest-war/pom.xml index 72d397c90c..eda197c18b 100644 --- a/openecomp-be/api/openecomp-sdc-rest-webapp/onboarding-rest-war/pom.xml +++ b/openecomp-be/api/openecomp-sdc-rest-webapp/onboarding-rest-war/pom.xml @@ -163,7 +163,6 @@ <includes> <include>test/core/unittest/offline/**</include> </includes> - <skipTests>true</skipTests> <systemProperties> <property> <name>buildNumber</name> diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/validation-rest/validation-rest-services/pom.xml b/openecomp-be/api/openecomp-sdc-rest-webapp/validation-rest/validation-rest-services/pom.xml index cc924966a5..5da8179240 100644 --- a/openecomp-be/api/openecomp-sdc-rest-webapp/validation-rest/validation-rest-services/pom.xml +++ b/openecomp-be/api/openecomp-sdc-rest-webapp/validation-rest/validation-rest-services/pom.xml @@ -131,7 +131,6 @@ <includes> <include>test/core/unittest/offline/**</include> </includes> - <skipTests>true</skipTests> </configuration> </plugin> <!-- Error codes generator plugin --> diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/pom.xml b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/pom.xml index 58b4ace44f..643addc0aa 100644 --- a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/pom.xml +++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/pom.xml @@ -118,7 +118,6 @@ <includes> <include>test/core/unittest/offline/**</include> </includes> - <skipTests>true</skipTests> </configuration> </plugin> <!-- Error codes generator plugin --> diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/pom.xml b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/pom.xml index b779200bc2..0d67b1b1ec 100644 --- a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/pom.xml +++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/pom.xml @@ -139,7 +139,6 @@ <includes> <include>test/core/unittest/offline/**</include> </includes> - <skipTests>true</skipTests> </configuration> </plugin> <!-- Error codes generator plugin --> diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/VendorSoftwareProducts.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/VendorSoftwareProducts.java index c51fcc452b..20fe64b88f 100644 --- a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/VendorSoftwareProducts.java +++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/VendorSoftwareProducts.java @@ -209,17 +209,10 @@ public interface VendorSoftwareProducts extends VspEntities { @PUT @Path("/reSubmitAll") - @ApiOperation(value = "Performs check out, check in and submit for ALL submitted VSPs", notes + @ApiOperation(value = "Performs healing ,check out, check in and submit for Network Package " + + "Based VSPs", + notes = "Please note - only submitted VSPs will be processed") Response reSubmitAll(@NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM) String user) throws IOException; - - @PUT - @Path("/{vspId}/reSubmit") - @ApiOperation(value = "Performs check out, check in and submit for a specific Vendor Software " + - "Product") - Response reSubmit(@PathParam("vspId") String vspId, - @NotNull(message = USER_MISSING_ERROR_MSG) - @HeaderParam(USER_ID_HEADER_PARAM) String user) - throws IOException; } diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/services/VendorSoftwareProductsImpl.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/services/VendorSoftwareProductsImpl.java index 27d4405fc7..4167785c02 100644 --- a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/services/VendorSoftwareProductsImpl.java +++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/services/VendorSoftwareProductsImpl.java @@ -48,7 +48,15 @@ import org.openecomp.sdc.versioning.dao.types.Version; import org.openecomp.sdc.versioning.dao.types.VersionStatus; import org.openecomp.sdc.versioning.types.VersionInfo; import org.openecomp.sdc.versioning.types.VersionableEntityAction; -import org.openecomp.sdcrests.vendorsoftwareproducts.types.*; +import org.openecomp.sdcrests.vendorsoftwareproducts.types.OnboardingMethod; +import org.openecomp.sdcrests.vendorsoftwareproducts.types.PackageInfoDto; +import org.openecomp.sdcrests.vendorsoftwareproducts.types.QuestionnaireResponseDto; +import org.openecomp.sdcrests.vendorsoftwareproducts.types.ValidationResponseDto; +import org.openecomp.sdcrests.vendorsoftwareproducts.types.VersionSoftwareProductActionRequestDto; +import org.openecomp.sdcrests.vendorsoftwareproducts.types.VspComputeDto; +import org.openecomp.sdcrests.vendorsoftwareproducts.types.VspCreationDto; +import org.openecomp.sdcrests.vendorsoftwareproducts.types.VspDescriptionDto; +import org.openecomp.sdcrests.vendorsoftwareproducts.types.VspDetailsDto; import org.openecomp.sdcrests.vsp.rest.VendorSoftwareProducts; import org.openecomp.sdcrests.vsp.rest.mapping.MapComputeEntityToVspComputeDto; import org.openecomp.sdcrests.vsp.rest.mapping.MapPackageInfoToPackageInfoDto; @@ -69,6 +77,7 @@ import java.io.File; import java.io.IOException; import java.util.Collection; import java.util.List; +import java.util.Objects; import static org.openecomp.sdc.logging.messages.AuditMessages.SUBMIT_VSP_ERROR; @@ -94,8 +103,9 @@ public class VendorSoftwareProductsImpl implements VendorSoftwareProducts { + vspDescriptionDto.getName()); VspCreationDto vspCreationDto = null; - OnboardingMethod onboardingMethod = OnboardingMethod.valueOf(vspDescriptionDto.getOnboardingMethod()); - if (onboardingMethod == null){ + OnboardingMethod onboardingMethod = + OnboardingMethod.valueOf(vspDescriptionDto.getOnboardingMethod()); + if (onboardingMethod == null) { return handleUnkownOnboardingMethod(); } switch (onboardingMethod) { @@ -155,7 +165,7 @@ public class VendorSoftwareProductsImpl implements VendorSoftwareProducts { VersionInfo versionInfo = getVersionInfo(vspId, VersionableEntityAction.Read, user); - // + if (vspDetails.getOldVersion() != null && !"".equals(vspDetails.getOldVersion())) { if (Version.valueOf(versionId).equals(versionInfo.getActiveVersion())) { try { @@ -389,67 +399,68 @@ public class VendorSoftwareProductsImpl implements VendorSoftwareProducts { @Override public Response reSubmitAll(String user) throws IOException { + MDC.put(LoggerConstants.SERVICE_NAME, LoggerServiceName.Re_Submit_ALL_Final_VSPs.toString()); logger.audit(AuditMessages.AUDIT_MSG + AuditMessages.RESUBMIT_ALL_FINAL_VSPS); + List<VersionedVendorSoftwareProductInfo> vspList = Objects.requireNonNull( + vendorSoftwareProductManager.listVsps(VersionStatus.Final.name(), user)); - List<VersionedVendorSoftwareProductInfo> vspList = - vendorSoftwareProductManager.listVsps(null, user); + int healingCounter = 0; + int failedCounter = 0; + + try { + + logger.info("Total number of VSPs: {}. Performing healing and " + + "resubmit for all non-Manual VSPs in submitted status.\n No need to pre-set oldVersion " + + "field", vspList.size()); - for (VersionedVendorSoftwareProductInfo versionVspInfo : vspList) { - String vspId = versionVspInfo.getVspDetails().getId(); - if (versionVspInfo.getVersionInfo().getStatus().equals(VersionStatus.Final)) { + for (VersionedVendorSoftwareProductInfo versionVspInfo : vspList) { + + final VspDetails vspDetails = versionVspInfo.getVspDetails(); + final String vspId = vspDetails.getId(); final Version latestFinalVersion = getVersionInfo(vspId, VersionableEntityAction.Read, user).getLatestFinalVersion(); - if (latestFinalVersion != null) { - reSubmit(vspId, user); + + if (Objects.nonNull(latestFinalVersion) && + (!OnboardingMethod.Manual.name().equals(vspDetails.getOnboardingMethod()))) { + reSubmit(vspDetails, user); + healingCounter++; } } + + } catch (Exception e) { + logger.error("Failed during resubmitAll", e); + failedCounter++; + } finally { + logger.info("Finished attempted healing and resubmit for {} VSPs out " + + "of total # of {} submitted VSPs. Failure count during resubmitAll: {}", + healingCounter, vspList.size(), failedCounter); } + return Response.ok().build(); } - @Override - public Response reSubmit(String vspId, String user) - throws IOException { - MDC.put(LoggerConstants.SERVICE_NAME, LoggerServiceName.Checkout_VSP.toString()); - vendorSoftwareProductManager.checkout(vspId, user); - logger.audit(AuditMessages.AUDIT_MSG + AuditMessages.CHECK_OUT_VSP + vspId); - - MDC.put(LoggerConstants.SERVICE_NAME, LoggerServiceName.Checkin_VSP.toString()); - vendorSoftwareProductManager.checkin(vspId, user); - logger.audit(AuditMessages.AUDIT_MSG + AuditMessages.CHECK_IN_VSP + vspId); - - MDC.put(LoggerConstants.SERVICE_NAME, LoggerServiceName.Submit_VSP.toString()); - ValidationResponse validationResponse = vendorSoftwareProductManager.submit(vspId, user); - if (!validationResponse.isValid()) { - logger.audit(AuditMessages.AUDIT_MSG + AuditMessages.SUBMIT_VSP_FAIL + vspId); - logAuditErrors(vspId, validationResponse); - return Response.status(Response.Status.EXPECTATION_FAILED).entity( - new MapValidationResponseToDto() - .applyMapping(validationResponse, ValidationResponseDto.class)).build(); - } - logger.audit(AuditMessages.AUDIT_MSG + AuditMessages.SUBMIT_VSP + vspId); + private void reSubmit(VspDetails vspDetails, String user) throws IOException { + final String vspId = vspDetails.getId(); + long startTime = System.currentTimeMillis(); + logger.info("Starting on healing and resubmit for VSP id[{}]", vspId); + vspDetails.setOldVersion("true"); - return Response.ok().build(); - } + vendorSoftwareProductManager.healAndAdvanceFinalVersion(vspId, vspDetails, user); - private void logAuditErrors(String vspId, ValidationResponse validationResponse) { - if (validationResponse.getVspErrors() != null) { - validationResponse.getVspErrors().forEach(errorCode -> logger.audit(AuditMessages - .AUDIT_MSG + String.format(SUBMIT_VSP_ERROR, errorCode.message(), vspId))); - } - if (validationResponse.getUploadDataErrors() != null) { - validationResponse.getUploadDataErrors().values().forEach(errorMessages - -> VendorSoftwareProductsImpl.printAuditForErrors(errorMessages, vspId, - SUBMIT_VSP_ERROR)); - } + long endTime = System.currentTimeMillis(); + long seconds = (endTime - startTime) / 1000; + + logger.info("Completed healing and resubmit for VSP id [{}], duration: {} seconds", + vspId, seconds); } - private static void printAuditForErrors(List<ErrorMessage> errorList, String vspId, String auditType) { + private static void printAuditForErrors(List<ErrorMessage> errorList, String vspId, + String auditType) { errorList.forEach(errorMessage -> { if (errorMessage.getLevel().equals(ErrorLevel.ERROR)) { logger.audit(AuditMessages.AUDIT_MSG + String.format(auditType, errorMessage.getMessage(), diff --git a/openecomp-be/backend/openecomp-sdc-action-manager/pom.xml b/openecomp-be/backend/openecomp-sdc-action-manager/pom.xml index a72fa3edd2..9339a93108 100644 --- a/openecomp-be/backend/openecomp-sdc-action-manager/pom.xml +++ b/openecomp-be/backend/openecomp-sdc-action-manager/pom.xml @@ -20,7 +20,6 @@ <artifactId>maven-surefire-plugin</artifactId> <version>2.12.4</version> <configuration> - <skipTests>true</skipTests> </configuration> </plugin> </plugins> diff --git a/openecomp-be/backend/openecomp-sdc-application-config-manager/pom.xml b/openecomp-be/backend/openecomp-sdc-application-config-manager/pom.xml index 67a3f7dacc..85b931a833 100644 --- a/openecomp-be/backend/openecomp-sdc-application-config-manager/pom.xml +++ b/openecomp-be/backend/openecomp-sdc-application-config-manager/pom.xml @@ -21,7 +21,6 @@ <artifactId>maven-surefire-plugin</artifactId> <version>2.12.4</version> <configuration> - <skipTests>true</skipTests> </configuration> </plugin> </plugins> diff --git a/openecomp-be/backend/openecomp-sdc-vendor-license-manager/pom.xml b/openecomp-be/backend/openecomp-sdc-vendor-license-manager/pom.xml index 4d70a8bd95..127907f029 100644 --- a/openecomp-be/backend/openecomp-sdc-vendor-license-manager/pom.xml +++ b/openecomp-be/backend/openecomp-sdc-vendor-license-manager/pom.xml @@ -18,7 +18,6 @@ <artifactId>maven-surefire-plugin</artifactId> <version>2.12.4</version> <configuration> - <skipTests>true</skipTests> </configuration> </plugin> </plugins> diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/VendorSoftwareProductManager.java b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/VendorSoftwareProductManager.java index 738e267ca0..0adca1c695 100644 --- a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/VendorSoftwareProductManager.java +++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/VendorSoftwareProductManager.java @@ -34,7 +34,7 @@ import java.io.IOException; import java.util.Collection; import java.util.List; -public interface VendorSoftwareProductManager { +public interface VendorSoftwareProductManager { Version checkout(String vendorSoftwareProductId, String user); @@ -78,4 +78,7 @@ public interface VendorSoftwareProductManager { String fetchValidationVsp(String user); Collection<ComputeEntity> getComputeByVsp(String vspId, Version version, String user); + + Version healAndAdvanceFinalVersion(String vspId, VspDetails vendorSoftwareProductInfo, + String user) throws IOException; } diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/impl/VendorSoftwareProductManagerImpl.java b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/impl/VendorSoftwareProductManagerImpl.java index f4015ab848..0a3428579d 100644 --- a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/impl/VendorSoftwareProductManagerImpl.java +++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/impl/VendorSoftwareProductManagerImpl.java @@ -634,7 +634,7 @@ public class VendorSoftwareProductManagerImpl implements VendorSoftwareProductMa try { validateUniqueName(VALIDATION_VSP_NAME); } catch (Exception ignored) { - logger.debug("",ignored); + logger.debug("", ignored); return VALIDATION_VSP_ID; } VspDetails validationVsp = new VspDetails(); @@ -708,7 +708,7 @@ public class VendorSoftwareProductManagerImpl implements VendorSoftwareProductMa vsps.add(new VersionedVendorSoftwareProductInfo(vsp, versionInfo)); } } catch (RuntimeException rte) { - logger.debug("",rte); + logger.debug("", rte); logger.error( "Error trying to retrieve vsp[" + entry.getKey() + "] version[" + version.toString () + "] " + @@ -789,8 +789,7 @@ public class VendorSoftwareProductManagerImpl implements VendorSoftwareProductMa throw new CoreException(new VendorSoftwareProductNotFoundErrorBuilder(vspId).build()); } vsp.setValidationData(orchestrationTemplateDao.getValidationData(vspId, version)); - - if (Objects.isNull(vsp.getOnboardingOrigin())) { + if (Objects.isNull(vsp.getOnboardingOrigin())) { //todo should this only be done for non-Manual? vsp.setOnboardingOrigin(OnboardingTypesEnum.ZIP.toString()); } @@ -818,22 +817,7 @@ public class VendorSoftwareProductManagerImpl implements VendorSoftwareProductMa autoHeal(vspId, checkoutVersion, vendorSoftwareProductInfo, user); return checkin(vspId, user); case Final: - Version checkoutFinalVersion = checkout(vspId, user); - autoHeal(vspId, checkoutFinalVersion, vendorSoftwareProductInfo, user); - Version checkinFinalVersion = checkin(vspId, user); - ValidationResponse response = submit(vspId, user); - if (!response.isValid()) { - return checkout(vspId, user); - } - - try { - Version finalVersion = checkinFinalVersion.calculateNextFinal(); - createPackage(vspId, finalVersion, user); - return finalVersion; - } catch (IOException ex) { - logger.debug("",ex); - throw new Exception(ex.getMessage()); - } + return healAndAdvanceFinalVersion(vspId, vendorSoftwareProductInfo, user); default: //do nothing break; @@ -841,8 +825,27 @@ public class VendorSoftwareProductManagerImpl implements VendorSoftwareProductMa return versionInfo.getActiveVersion(); } - @Override + public Version healAndAdvanceFinalVersion(String vspId, VspDetails vendorSoftwareProductInfo, + String user) throws IOException { + + Version checkoutFinalVersion = checkout(vspId, user); + autoHeal(vspId, checkoutFinalVersion, vendorSoftwareProductInfo, user); + Version checkinFinalVersion = checkin(vspId, user); + + ValidationResponse response = Objects.requireNonNull(submit(vspId, user), + "Null response not expected"); + if (!response.isValid()) { + return checkout(vspId, user); + } + + Version finalVersion = checkinFinalVersion.calculateNextFinal(); + createPackage(vspId, finalVersion, user); + return finalVersion; + + } + + @Override public void deleteVsp(String vspId, String user) { mdcDataDebugMessage.debugEntryMessage("VSP id", vspId); diff --git a/openecomp-be/lib/openecomp-core-lib/openecomp-config-lib/pom.xml b/openecomp-be/lib/openecomp-core-lib/openecomp-config-lib/pom.xml index 520b5cf481..4f9364dabb 100644 --- a/openecomp-be/lib/openecomp-core-lib/openecomp-config-lib/pom.xml +++ b/openecomp-be/lib/openecomp-core-lib/openecomp-config-lib/pom.xml @@ -18,7 +18,6 @@ <artifactId>maven-surefire-plugin</artifactId> <version>2.12.4</version> <configuration> - <skipTests>true</skipTests> </configuration> </plugin> </plugins> diff --git a/openecomp-be/lib/openecomp-core-lib/openecomp-nosqldb-lib/openecomp-nosqldb-core/pom.xml b/openecomp-be/lib/openecomp-core-lib/openecomp-nosqldb-lib/openecomp-nosqldb-core/pom.xml index 584befcfc5..8ec98379c6 100644 --- a/openecomp-be/lib/openecomp-core-lib/openecomp-nosqldb-lib/openecomp-nosqldb-core/pom.xml +++ b/openecomp-be/lib/openecomp-core-lib/openecomp-nosqldb-lib/openecomp-nosqldb-core/pom.xml @@ -20,7 +20,6 @@ <artifactId>maven-surefire-plugin</artifactId> <version>2.12.4</version> <configuration> - <skipTests>true</skipTests> </configuration> </plugin> </plugins> diff --git a/openecomp-be/lib/openecomp-heat-lib/pom.xml b/openecomp-be/lib/openecomp-heat-lib/pom.xml index 486c23522b..4ba08e925b 100644 --- a/openecomp-be/lib/openecomp-heat-lib/pom.xml +++ b/openecomp-be/lib/openecomp-heat-lib/pom.xml @@ -71,7 +71,6 @@ <artifactId>maven-surefire-plugin</artifactId> <version>${mvn.surefire.version}</version> <configuration> - <skipTests>true</skipTests> <useSystemClassLoader>false</useSystemClassLoader> <redirectTestOutputToFile>true</redirectTestOutputToFile> </configuration> diff --git a/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-impl/pom.xml b/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-impl/pom.xml index 32078aa27d..ae308a0241 100644 --- a/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-impl/pom.xml +++ b/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-impl/pom.xml @@ -114,7 +114,6 @@ <artifactId>maven-surefire-plugin</artifactId> <version>${mvn.surefire.version}</version> <configuration> - <skipTests>true</skipTests> <useSystemClassLoader>false</useSystemClassLoader> <redirectTestOutputToFile>true</redirectTestOutputToFile> </configuration> diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/att-sdc-translator-impl/pom.xml b/openecomp-be/lib/openecomp-sdc-translator-lib/att-sdc-translator-impl/pom.xml index a324ee0b06..12fd1179c5 100644 --- a/openecomp-be/lib/openecomp-sdc-translator-lib/att-sdc-translator-impl/pom.xml +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/att-sdc-translator-impl/pom.xml @@ -20,6 +20,11 @@ <artifactId>logback-classic</artifactId> <version>${logback.version}</version> </dependency> +<!-- <dependency> + <groupId>log4j</groupId> + <artifactId>log4j</artifactId> + <version>1.2.17</version> + </dependency >--> <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> @@ -63,7 +68,6 @@ <version>${mvn.surefire.version}</version> <configuration> <useSystemClassLoader>false</useSystemClassLoader> - <skipTests>true</skipTests> </configuration> </plugin> </plugins> diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/att-sdc-translator-impl/src/test/java/com/att/sdc/translator/services/heattotosca/impl/resourcetranslation/BaseResourceTranslationTest.java b/openecomp-be/lib/openecomp-sdc-translator-lib/att-sdc-translator-impl/src/test/java/com/att/sdc/translator/services/heattotosca/impl/resourcetranslation/BaseResourceTranslationTest.java index 05bc7cb5f1..0009388ad3 100644 --- a/openecomp-be/lib/openecomp-sdc-translator-lib/att-sdc-translator-impl/src/test/java/com/att/sdc/translator/services/heattotosca/impl/resourcetranslation/BaseResourceTranslationTest.java +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/att-sdc-translator-impl/src/test/java/com/att/sdc/translator/services/heattotosca/impl/resourcetranslation/BaseResourceTranslationTest.java @@ -88,7 +88,7 @@ public class BaseResourceTranslationTest { private final String MANIFEST_NAME = SdcCommon.MANIFEST_NAME; private String validationFilename = "validationOutput.json"; - private final Logger log = (Logger) LoggerFactory.getLogger(this.getClass().getName()); + //private final Logger log = (Logger) LoggerFactory.getLogger(this.getClass().getName()); @Before public void setUp() throws IOException { @@ -290,7 +290,7 @@ public class BaseResourceTranslationTest { } } catch (Exception e) { - log.debug("",e); + //log.debug("",e); Assert.fail(e.getMessage()); } return serviceTemplateMap; diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/att-sdc-translator-impl/src/test/java/com/att/sdc/translator/services/heattotosca/impl/resourcetranslation/ResourceTranslationValetGroupAssignmentImplTest.java b/openecomp-be/lib/openecomp-sdc-translator-lib/att-sdc-translator-impl/src/test/java/com/att/sdc/translator/services/heattotosca/impl/resourcetranslation/ResourceTranslationValetGroupAssignmentImplTest.java index 758e262b98..9c9998fbea 100644 --- a/openecomp-be/lib/openecomp-sdc-translator-lib/att-sdc-translator-impl/src/test/java/com/att/sdc/translator/services/heattotosca/impl/resourcetranslation/ResourceTranslationValetGroupAssignmentImplTest.java +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/att-sdc-translator-impl/src/test/java/com/att/sdc/translator/services/heattotosca/impl/resourcetranslation/ResourceTranslationValetGroupAssignmentImplTest.java @@ -24,6 +24,7 @@ import org.junit.Before; import org.junit.Test; import java.io.IOException; +//import org.apache.log4j.Logger; public class ResourceTranslationValetGroupAssignmentImplTest extends BaseResourceTranslationTest { @@ -73,6 +74,13 @@ public class ResourceTranslationValetGroupAssignmentImplTest "/mock/services/heattotosca/attValetGroupAssignment/complexOnlyGroup/inputfiles"; outputFilesPath = "/mock/services/heattotosca/attValetGroupAssignment/complexOnlyGroup/expectedoutputfiles"; + +/* String[] loggers = { "org.apache.commons.dbcp2"}; + for (String logger : loggers) { + org.apache.log4j.Logger logSuppress = org.apache.log4j.Logger.getLogger(logger); + logSuppress.setLevel(org.apache.log4j.Level.OFF); + }*/ + initTranslatorAndTranslate(); testTranslation(); validateComputeTemplateConsolidationData(); diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/pom.xml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/pom.xml index a53699e6cd..f5c8fb0e9e 100644 --- a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/pom.xml +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/pom.xml @@ -78,7 +78,6 @@ <configuration> <useSystemClassLoader>false</useSystemClassLoader> <redirectTestOutputToFile>true</redirectTestOutputToFile> - <skipTests>true</skipTests> </configuration> </plugin> </plugins> diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-impl/pom.xml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-impl/pom.xml index a2e05b2056..e89c04c6b0 100644 --- a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-impl/pom.xml +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-impl/pom.xml @@ -59,7 +59,6 @@ <systemPropertyVariables> <config.location>${project.basedir}/configuration</config.location> </systemPropertyVariables> - <skipTests>true</skipTests> </configuration> </plugin> </plugins> diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/att-sdc-validation-impl/pom.xml b/openecomp-be/lib/openecomp-sdc-validation-lib/att-sdc-validation-impl/pom.xml index 849df4dfea..8208d8bfca 100644 --- a/openecomp-be/lib/openecomp-sdc-validation-lib/att-sdc-validation-impl/pom.xml +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/att-sdc-validation-impl/pom.xml @@ -84,7 +84,6 @@ <configuration> <useSystemClassLoader>false</useSystemClassLoader> <redirectTestOutputToFile>true</redirectTestOutputToFile> - <skipTests>true</skipTests> </configuration> </plugin> </plugins> diff --git a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/pom.xml b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/pom.xml index c1c10d7bb3..8df2c9dfb2 100644 --- a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/pom.xml +++ b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/pom.xml @@ -128,7 +128,6 @@ <artifactId>maven-surefire-plugin</artifactId> <version>${mvn.surefire.version}</version> <configuration> - <skipTests>true</skipTests> <useSystemClassLoader>false</useSystemClassLoader> <redirectTestOutputToFile>true</redirectTestOutputToFile> </configuration> diff --git a/openecomp-be/pom.xml b/openecomp-be/pom.xml index f00bce1c25..e09fe8cbed 100644 --- a/openecomp-be/pom.xml +++ b/openecomp-be/pom.xml @@ -128,9 +128,77 @@ <goal>report</goal> </goals> </execution> + <execution> + <id>post-unit-test</id> + <phase>test</phase> + <goals> + <goal>report</goal> + </goals> + <configuration> + <!-- Sets the path to the file which contains the execution data. --> + + <dataFile>target/jacoco.exec</dataFile> + <!-- Sets the output directory for the code coverage report. --> + <outputDirectory>target/jacoco-ut</outputDirectory> + </configuration> + </execution> </executions> </plugin> - + <!-- Jacoco consolidation Report --> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-antrun-plugin</artifactId> + <version>1.6</version> + <executions> + <execution> + <phase>post-integration-test</phase> + <goals> + <goal>run</goal> + </goals> + <configuration> + <target> + <!-- Execute an ant task within maven --> + <echo message="Generating JaCoCo Reports" /> + <taskdef name="report" classname="org.jacoco.ant.ReportTask"> + <classpath path="${basedir}/target/jacoco-jars/org.jacoco.ant.jar" /> + </taskdef> + <mkdir dir="${basedir}/target/coverage-report" /> + <report> + <executiondata> + <fileset dir="${basedir}"> + <include name="**/*jacoco.exec" /> + </fileset> + </executiondata> + <structure name="jacoco-multi Coverage Project"> + <group name="jacoco-multi"> + <classfiles> + <fileset dir="${basedir}"> + <include name="**/target/classes/**" /> + </fileset> + </classfiles> + <sourcefiles encoding="UTF-8"> + <fileset dir="${basedir}"> + <include name="**/target/generated-sources/**" /> + </fileset> + </sourcefiles> + </group> + </structure> + <html destdir="${basedir}/target/coverage-report/html" /> + <xml destfile="${basedir}/target/coverage-report/coverage-report.xml" /> + <csv destfile="${basedir}/target/coverage-report/coverage-report.csv" /> + </report> + </target> + </configuration> + </execution> + </executions> + <dependencies> + <dependency> + <groupId>org.jacoco</groupId> + <artifactId>org.jacoco.ant</artifactId> + <version>${jacoco.version}</version> + </dependency> + </dependencies> + </plugin> </plugins> </build> |