From e37f5a70bcf3fd8073418c13416cc79c0ef47d59 Mon Sep 17 00:00:00 2001 From: HOCKLA Date: Fri, 17 Jan 2020 16:20:01 -0600 Subject: policy/engine jdk11 upgrades Issue-ID: POLICY-1590 Change-Id: I4da8324a065ac9babe16368e69b76a4cbe9504ef Signed-off-by: HOCKLA --- .../onap/policy/pdp/rest/PapUrlResolverTest.java | 26 +++++++++++----------- .../onap/policy/pdp/rest/XACMLPdpServletTest.java | 4 +++- 2 files changed, 16 insertions(+), 14 deletions(-) (limited to 'ONAP-PDP-REST') diff --git a/ONAP-PDP-REST/src/test/java/org/onap/policy/pdp/rest/PapUrlResolverTest.java b/ONAP-PDP-REST/src/test/java/org/onap/policy/pdp/rest/PapUrlResolverTest.java index fb768f7d7..841fad641 100644 --- a/ONAP-PDP-REST/src/test/java/org/onap/policy/pdp/rest/PapUrlResolverTest.java +++ b/ONAP-PDP-REST/src/test/java/org/onap/policy/pdp/rest/PapUrlResolverTest.java @@ -2,7 +2,7 @@ * ============LICENSE_START======================================================= * ONAP-PDP-REST * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * Copyright (C) 2017, 2020 AT&T Intellectual Property. All rights reserved. * ================================================================================ * Modifications Copyright (C) 2019 Samsung * ================================================================================ @@ -59,6 +59,9 @@ public class PapUrlResolverTest { succeeded = prop.getProperty(XacmlRestProperties.PROP_PAP_SUCCEEDED_URLS); rs = PapUrlResolver.getInstance(urls, failed, succeeded); Assert.assertTrue(rs.hasMoreUrls()); + Assert.assertEquals("http://one.localhost.com", rs.getUrl()); + rs.getNext(); + Assert.assertTrue(rs.hasMoreUrls()); Assert.assertEquals("http://two.localhost.com", rs.getUrl()); rs.getNext(); Assert.assertTrue(rs.hasMoreUrls()); @@ -66,9 +69,6 @@ public class PapUrlResolverTest { rs.getNext(); Assert.assertTrue(rs.hasMoreUrls()); Assert.assertEquals("http://four.localhost.com", rs.getUrl()); - rs.getNext(); - Assert.assertTrue(rs.hasMoreUrls()); - Assert.assertEquals("http://one.localhost.com", rs.getUrl()); rs.succeeded(); rs.getNext(); Assert.assertFalse(rs.hasMoreUrls()); @@ -128,13 +128,13 @@ public class PapUrlResolverTest { String succeeded = "-1,8/13/15 5:41 PM,8/13/15 4:41 PM,-1"; PapUrlResolver rs = PapUrlResolver.getInstance(urls, failed, succeeded); Assert.assertTrue(rs.hasMoreUrls()); - Assert.assertEquals("http://two.localhost.com", rs.getUrl()); + Assert.assertEquals("http://one.localhost.com", rs.getUrl()); rs.getNext(); Assert.assertTrue(rs.hasMoreUrls()); - Assert.assertEquals("http://three.localhost.com", rs.getUrl()); + Assert.assertEquals("http://two.localhost.com", rs.getUrl()); rs.getNext(); Assert.assertTrue(rs.hasMoreUrls()); - Assert.assertEquals("http://one.localhost.com", rs.getUrl()); + Assert.assertEquals("http://three.localhost.com", rs.getUrl()); rs.getNext(); Assert.assertTrue(rs.hasMoreUrls()); Assert.assertEquals("http://four.localhost.com", rs.getUrl()); @@ -186,13 +186,13 @@ public class PapUrlResolverTest { succeeded = "-1,-1,-1,-1"; rs = PapUrlResolver.getInstance(urls, failed, succeeded); Assert.assertTrue(rs.hasMoreUrls()); - Assert.assertEquals("http://two.localhost.com", rs.getUrl()); + Assert.assertEquals("http://one.localhost.com", rs.getUrl()); rs.getNext(); Assert.assertTrue(rs.hasMoreUrls()); - Assert.assertEquals("http://three.localhost.com", rs.getUrl()); + Assert.assertEquals("http://two.localhost.com", rs.getUrl()); rs.getNext(); Assert.assertTrue(rs.hasMoreUrls()); - Assert.assertEquals("http://one.localhost.com", rs.getUrl()); + Assert.assertEquals("http://three.localhost.com", rs.getUrl()); rs.getNext(); Assert.assertTrue(rs.hasMoreUrls()); Assert.assertEquals("http://four.localhost.com", rs.getUrl()); @@ -204,6 +204,9 @@ public class PapUrlResolverTest { succeeded = "-1,-1,-1,-1"; rs = PapUrlResolver.getInstance(urls, failed, succeeded); Assert.assertTrue(rs.hasMoreUrls()); + Assert.assertEquals("http://one.localhost.com", rs.getUrl()); + rs.getNext(); + Assert.assertTrue(rs.hasMoreUrls()); Assert.assertEquals("http://two.localhost.com", rs.getUrl()); rs.getNext(); Assert.assertTrue(rs.hasMoreUrls()); @@ -212,9 +215,6 @@ public class PapUrlResolverTest { Assert.assertTrue(rs.hasMoreUrls()); Assert.assertEquals("http://four.localhost.com", rs.getUrl()); rs.getNext(); - Assert.assertTrue(rs.hasMoreUrls()); - Assert.assertEquals("http://one.localhost.com", rs.getUrl()); - rs.getNext(); Assert.assertFalse(rs.hasMoreUrls()); urls = "http://one.localhost.com,http://two.localhost.com,http://three.localhost.com,http://four.localhost.com"; diff --git a/ONAP-PDP-REST/src/test/java/org/onap/policy/pdp/rest/XACMLPdpServletTest.java b/ONAP-PDP-REST/src/test/java/org/onap/policy/pdp/rest/XACMLPdpServletTest.java index 17601a280..eb6910ca7 100644 --- a/ONAP-PDP-REST/src/test/java/org/onap/policy/pdp/rest/XACMLPdpServletTest.java +++ b/ONAP-PDP-REST/src/test/java/org/onap/policy/pdp/rest/XACMLPdpServletTest.java @@ -2,7 +2,7 @@ * ============LICENSE_START======================================================= * ONAP-PDP-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 Samsung * ================================================================================ @@ -47,6 +47,7 @@ import org.onap.policy.common.logging.flexlogger.Logger; import org.onap.policy.xacml.std.pap.StdPDPPolicy; import org.onap.policy.xacml.std.pap.StdPDPStatus; import org.powermock.api.mockito.PowerMockito; +import org.powermock.core.classloader.annotations.PowerMockIgnore; import org.powermock.core.classloader.annotations.PrepareForTest; import org.powermock.modules.junit4.PowerMockRunner; import org.springframework.mock.web.MockHttpServletResponse; @@ -56,6 +57,7 @@ import com.mockrunner.mock.web.MockServletInputStream; import junit.framework.TestCase; @RunWith(PowerMockRunner.class) +@PowerMockIgnore({"com.sun.org.apache.xerces.*", "javax.xml.*", "org.xml.*", "javax.management.*", "org.w3c.dom.*"}) @PrepareForTest({IntegrityMonitor.class}) public class XACMLPdpServletTest extends TestCase { private static Logger LOGGER = FlexLogger.getLogger(XACMLPdpServletTest.class); -- cgit 1.2.3-korg