From: HOCKLA Date: Thu, 23 Jan 2020 21:28:35 +0000 (-0600) Subject: policy/engine jdk11 junit and compilation error fixes X-Git-Tag: 1.6.0~13^2 X-Git-Url: https://gerrit.onap.org/r/gitweb?p=policy%2Fengine.git;a=commitdiff_plain;h=ce75201a88f6787c7f5aed265c32134e1a116761 policy/engine jdk11 junit and compilation error fixes Issue-ID: POLICY-1590 Change-Id: I0bbc6f7310705c20924812efc5be2b0f91cf71a2 Signed-off-by: HOCKLA --- diff --git a/BRMSGateway/pom.xml b/BRMSGateway/pom.xml index 8f6a79df1..43ac9bd43 100644 --- a/BRMSGateway/pom.xml +++ b/BRMSGateway/pom.xml @@ -91,6 +91,11 @@ org.apache.httpcomponents httpclient + + org.apache.commons + commons-lang3 + 3.9 + diff --git a/BRMSGateway/src/main/java/org/onap/policy/brms/api/BrmsPush.java b/BRMSGateway/src/main/java/org/onap/policy/brms/api/BrmsPush.java index 0c43aeef7..45f65851e 100644 --- a/BRMSGateway/src/main/java/org/onap/policy/brms/api/BrmsPush.java +++ b/BRMSGateway/src/main/java/org/onap/policy/brms/api/BrmsPush.java @@ -60,7 +60,7 @@ import javax.persistence.Persistence; import javax.persistence.TypedQuery; import javax.ws.rs.ProcessingException; import org.apache.commons.io.FileUtils; -import org.apache.commons.lang.StringEscapeUtils; +import org.apache.commons.lang3.StringEscapeUtils; import org.apache.maven.model.Dependency; import org.apache.maven.model.DeploymentRepository; import org.apache.maven.model.DistributionManagement; diff --git a/ONAP-PAP-REST/pom.xml b/ONAP-PAP-REST/pom.xml index 111c24201..377674abb 100644 --- a/ONAP-PAP-REST/pom.xml +++ b/ONAP-PAP-REST/pom.xml @@ -102,6 +102,10 @@ org.json json + + xml-apis + xml-apis + @@ -129,11 +133,6 @@ javax.activation-api 1.2.0 - - javax.xml - jaxp-api - 1.4.2 - commons-logging commons-logging @@ -246,6 +245,12 @@ org.hibernate hibernate-core ${hibernate.version} + + + xml-apis + xml-apis + + org.hibernate diff --git a/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/XACMLPapServlet.java b/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/XACMLPapServlet.java index e8df2bbdf..60450efd7 100644 --- a/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/XACMLPapServlet.java +++ b/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/XACMLPapServlet.java @@ -2,7 +2,7 @@ * ============LICENSE_START======================================================= * ONAP-PAP-REST * ================================================================================ - * Copyright (C) 2017-2019 AT&T Intellectual Property. All rights reserved. + * Copyright (C) 2017-2020 AT&T Intellectual Property. All rights reserved. * Modifications Copyright (C) 2019 Nordix Foundation. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); @@ -516,6 +516,8 @@ public class XACMLPapServlet extends HttpServlet implements StdItemSetChangeList PolicyLogger.error(MessageCodes.ERROR_SYSTEM_ERROR, e, "XACMLPapServlet", " Error stopping thread"); } } + // reset pap url + setPapUrl(null); } private ConsoleAndApiService getAcServiceInstance() { diff --git a/ONAP-PAP-REST/src/test/java/org/onap/policy/pap/xacml/rest/ConsoleAndApiServiceTest.java b/ONAP-PAP-REST/src/test/java/org/onap/policy/pap/xacml/rest/ConsoleAndApiServiceTest.java index e78151fcb..36e67a718 100644 --- a/ONAP-PAP-REST/src/test/java/org/onap/policy/pap/xacml/rest/ConsoleAndApiServiceTest.java +++ b/ONAP-PAP-REST/src/test/java/org/onap/policy/pap/xacml/rest/ConsoleAndApiServiceTest.java @@ -2,7 +2,7 @@ * ============LICENSE_START======================================================= * ONAP-PAP-REST * ================================================================================ - * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved. + * Copyright (C) 2019-2020 AT&T Intellectual Property. All rights reserved. * Modifications Copyright (C) 2019 Nordix Foundation. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); @@ -45,6 +45,7 @@ import oasis.names.tc.xacml._3_0.core.schema.wd_17.TargetType; import org.apache.commons.io.IOUtils; import org.hibernate.SessionFactory; +import org.junit.AfterClass; import org.junit.Before; import org.junit.BeforeClass; import org.junit.Rule; @@ -124,6 +125,11 @@ public class ConsoleAndApiServiceTest { pap.init(servletConfig); } + @AfterClass + public static void after() { + pap.destroy(); + } + /** * Sets the up. * diff --git a/ONAP-PAP-REST/src/test/java/org/onap/policy/pap/xacml/rest/policycontroller/PolicyCreationTest.java b/ONAP-PAP-REST/src/test/java/org/onap/policy/pap/xacml/rest/policycontroller/PolicyCreationTest.java index 08c1659f9..0c029b433 100644 --- a/ONAP-PAP-REST/src/test/java/org/onap/policy/pap/xacml/rest/policycontroller/PolicyCreationTest.java +++ b/ONAP-PAP-REST/src/test/java/org/onap/policy/pap/xacml/rest/policycontroller/PolicyCreationTest.java @@ -2,7 +2,7 @@ * ============LICENSE_START======================================================= * ONAP-PAP-REST * ================================================================================ - * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved. + * Copyright (C) 2019-2020 AT&T Intellectual Property. All rights reserved. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -23,11 +23,12 @@ package org.onap.policy.pap.xacml.rest.policycontroller; import static org.assertj.core.api.Assertions.assertThatCode; import static org.assertj.core.api.Assertions.assertThatThrownBy; import static org.junit.Assert.assertEquals; -import static org.mockito.Matchers.anyString; -import static org.mockito.Matchers.eq; +import static org.mockito.ArgumentMatchers.anyString; +import static org.mockito.ArgumentMatchers.eq; import com.mockrunner.mock.web.MockHttpServletRequest; import java.util.ArrayList; +import java.util.LinkedHashMap; import java.util.List; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; @@ -90,6 +91,7 @@ public class PolicyCreationTest { assertThatThrownBy(() -> creation.savePolicy(policyData, response)) .isInstanceOf(IllegalArgumentException.class); policyData.setConfigPolicyType("Base"); + Mockito.when(policyData.getRuleData()).thenReturn(new LinkedHashMap<>()); assertThatCode(() -> creation.savePolicy(policyData, response)).doesNotThrowAnyException(); policyData.setConfigPolicyType("ClosedLoop_PM"); assertThatThrownBy(() -> creation.savePolicy(policyData, response)) diff --git a/ONAP-PDP-REST/pom.xml b/ONAP-PDP-REST/pom.xml index 9cdd37227..0b02a7906 100644 --- a/ONAP-PDP-REST/pom.xml +++ b/ONAP-PDP-REST/pom.xml @@ -48,6 +48,12 @@ org.onap.policy.engine ONAP-PDP ${project.version} + + + xml-apis + xml-apis + + commons-logging diff --git a/ONAP-REST/pom.xml b/ONAP-REST/pom.xml index 028b70c1e..e44d28703 100644 --- a/ONAP-REST/pom.xml +++ b/ONAP-REST/pom.xml @@ -3,7 +3,7 @@ ============LICENSE_START======================================================= ONAP Policy Engine ================================================================================ - Copyright (C) 2017-2018 AT&T Intellectual Property. All rights reserved. + Copyright (C) 2017-2018, 2020 AT&T Intellectual Property. All rights reserved. ================================================================================ Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -78,6 +78,11 @@ javax.servlet javax.servlet-api + + org.apache.commons + commons-lang3 + 3.9 + commons-logging commons-logging @@ -158,6 +163,12 @@ org.hibernate hibernate-core ${hibernate.version} + + + xml-apis + xml-apis + + org.hibernate diff --git a/ONAP-REST/src/main/java/org/onap/policy/rest/util/MsModelUtils.java b/ONAP-REST/src/main/java/org/onap/policy/rest/util/MsModelUtils.java index b18572574..fad26daa4 100644 --- a/ONAP-REST/src/main/java/org/onap/policy/rest/util/MsModelUtils.java +++ b/ONAP-REST/src/main/java/org/onap/policy/rest/util/MsModelUtils.java @@ -45,7 +45,7 @@ import java.util.Set; import lombok.Getter; import lombok.Setter; -import org.apache.commons.lang.StringUtils; +import org.apache.commons.lang3.StringUtils; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.eclipse.emf.common.util.EList; diff --git a/ONAP-REST/src/test/java/org/onap/policy/rest/util/MsModelUtilsTest.java b/ONAP-REST/src/test/java/org/onap/policy/rest/util/MsModelUtilsTest.java index 59115b959..6d12d57a3 100644 --- a/ONAP-REST/src/test/java/org/onap/policy/rest/util/MsModelUtilsTest.java +++ b/ONAP-REST/src/test/java/org/onap/policy/rest/util/MsModelUtilsTest.java @@ -35,7 +35,7 @@ import java.util.HashMap; import java.util.List; import java.util.Map; -import org.apache.commons.lang.StringUtils; +import org.apache.commons.lang3.StringUtils; import org.junit.Before; import org.junit.Test; import org.onap.policy.common.logging.flexlogger.FlexLogger; diff --git a/ONAP-SDK-APP/pom.xml b/ONAP-SDK-APP/pom.xml index fa41d92fe..c3c595c53 100644 --- a/ONAP-SDK-APP/pom.xml +++ b/ONAP-SDK-APP/pom.xml @@ -61,14 +61,6 @@ - - org.apache.maven.plugins - maven-compiler-plugin - - 1.8 - 1.8 - - org.apache.maven.plugins maven-surefire-plugin @@ -201,6 +193,14 @@ org.onap.portal.sdk epsdk-core + + org.apache.xmlbeans + xmlbeans + + + dom4j + dom4j + @@ -253,6 +253,22 @@ org.springframework spring-webmvc + + xerces + xercesImpl + + + xalan + xalan + + + xml-apis + xml-apis-ext + + + xom + xom + @@ -296,6 +312,10 @@ org.springframework spring-webmvc + + xalan + xalan + diff --git a/ONAP-XACML/pom.xml b/ONAP-XACML/pom.xml index 8bb78f6c0..664798a07 100644 --- a/ONAP-XACML/pom.xml +++ b/ONAP-XACML/pom.xml @@ -63,20 +63,10 @@ javax.activation-api 1.2.0 - - javax.xml - jaxp-api - 1.4.2 - - - javax.xml.parsers - jaxp-api - 1.4.5 - com.att.research.xacml xacml - 1.0.2 + 2.0.1 org.springframework spring-core - ${springframework.version} commons-logging @@ -136,12 +144,10 @@ org.springframework spring-web - ${springframework.version} org.springframework spring-webmvc - ${springframework.version} org.springframework @@ -158,6 +164,12 @@ org.hibernate hibernate-core ${hibernate.version} + + + xml-apis + xml-apis + + org.hibernate @@ -243,6 +255,10 @@ com.att.aft dme2 + + xml-apis + xml-apis + @@ -264,6 +280,12 @@ org.apache.poi poi-ooxml 3.17 + + + org.apache.xmlbeans + xmlbeans + + diff --git a/PolicyEngineAPI/pom.xml b/PolicyEngineAPI/pom.xml index 94c06b79e..6fc135706 100644 --- a/PolicyEngineAPI/pom.xml +++ b/PolicyEngineAPI/pom.xml @@ -49,22 +49,6 @@ javax.activation-api 1.2.0 - - javax.xml.ws - jaxws-api - 2.3.1 - test - - - javax.xml - jaxp-api - 1.4.2 - - - javax.xml.parsers - jaxp-api - 1.4.5 - org.apache.httpcomponents httpclient @@ -114,6 +98,20 @@ org.onap.policy.engine ONAP-XACML ${project.version} + + + javax.xml.parsers + jaxp-api + + + xml-apis + xml-apis + + + javax.xml + jaxp-api + + diff --git a/pom.xml b/pom.xml index 442471a9f..92844e9f4 100644 --- a/pom.xml +++ b/pom.xml @@ -103,12 +103,6 @@ javax.servlet javax.servlet-api - - - xml-apis - xml-apis - 1.4.01 - com.fasterxml.jackson.core