From 4a91132226e923cb35411531569b547801c246c2 Mon Sep 17 00:00:00 2001 From: Damian Ujma <92095156+damianujma@users.noreply.github.com> Date: Mon, 25 Nov 2024 09:49:47 +0100 Subject: [PATCH] ACS-5371 Exclude xpp3 dependency to avoid conflict in JDK9+ (#3049) * ACS-5371 Exclude xpp3 dependency * ACS-5371 Set compiler compliance to 17 * ACS-5371 Update xmlpull version * ACS-5371 Update xmlpull version * ACS-5371 Use kxml2 * ACS-5371 Refactor --- data-model/pom.xml | 12 + .../src/main/resources/licenses/notice.txt | 1 + pom.xml | 1 + repository/pom.xml | 6 +- .../repo/site/SiteMembershipTest.java | 273 +++++++++--------- 5 files changed, 154 insertions(+), 139 deletions(-) diff --git a/data-model/pom.xml b/data-model/pom.xml index 0ebfd90a3c..ff50cc3e6e 100644 --- a/data-model/pom.xml +++ b/data-model/pom.xml @@ -118,6 +118,18 @@ org.jibx jibx-run 1.4.2 + + + + xpp3 + xpp3 + + + + + net.sf.kxml + kxml2 + ${dependency.kxml2.version} com.fasterxml.jackson.core diff --git a/packaging/distribution/src/main/resources/licenses/notice.txt b/packaging/distribution/src/main/resources/licenses/notice.txt index 291b511332..3fa5e4c0a6 100644 --- a/packaging/distribution/src/main/resources/licenses/notice.txt +++ b/packaging/distribution/src/main/resources/licenses/notice.txt @@ -146,6 +146,7 @@ libgif http://giflib.sourceforge.net/ libfreetype http://www.freetype.org/ PostgreSQL http://www.postgresql.org/ PostgreSQL JDBC Driver http://www.postgresql.org/ +kXML 2 http://kxml.sourceforge.net/ === CDDL 1.0 === diff --git a/pom.xml b/pom.xml index c52695b177..3fba120021 100644 --- a/pom.xml +++ b/pom.xml @@ -96,6 +96,7 @@ 3.8.6 2.0.6.1 3.1.6 + 2.3.0 4.0.2 4.0.5 diff --git a/repository/pom.xml b/repository/pom.xml index fe27e79cbe..45899ba6ad 100644 --- a/repository/pom.xml +++ b/repository/pom.xml @@ -850,12 +850,12 @@ - 1.8 + 17 false true true - 1.8 - 1.8 + 17 + 17 -parameters diff --git a/repository/src/test/java/org/alfresco/repo/site/SiteMembershipTest.java b/repository/src/test/java/org/alfresco/repo/site/SiteMembershipTest.java index 847b2e300a..72efa0f449 100644 --- a/repository/src/test/java/org/alfresco/repo/site/SiteMembershipTest.java +++ b/repository/src/test/java/org/alfresco/repo/site/SiteMembershipTest.java @@ -1,136 +1,137 @@ -/* - * #%L - * Alfresco Repository - * %% - * Copyright (C) 2005 - 2016 Alfresco Software Limited - * %% - * This file is part of the Alfresco software. - * If the software was purchased under a paid Alfresco license, the terms of - * the paid license agreement will prevail. Otherwise, the software is - * provided under the following open source license terms: - * - * Alfresco is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Alfresco is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Alfresco. If not, see . - * #L% - */ -package org.alfresco.repo.site; - -import static org.junit.Assert.assertEquals; - -import java.util.UUID; - -import org.alfresco.service.cmr.site.SiteInfo; -import org.alfresco.service.cmr.site.SiteVisibility; -import org.junit.Before; -import org.junit.Test; - -/** - * Test Membership constructor logs. Based on REPO-2520 - * - * @author Alexandru Epure - */ -public class SiteMembershipTest -{ - SiteInfo siteInfo; - SiteMembership siteMember; - String personId = UUID.randomUUID().toString(); - String firstName = UUID.randomUUID().toString(); - String lastName = UUID.randomUUID().toString(); - String role = "Consumer"; - - String idErrorMessage = "Id required building site membership"; - String firstNameErrorMessage = "FirstName required building site membership of "; - String lastNameErrorMessage = "LastName required building site membership of "; - String roleErrorMessage = "Role required building site membership"; - - @Before - public void createSite() - { - String sitePreset = "testSiteMembershipPreset"; - String shortName = "testSiteMembershipShortName"; - String title = "testSiteMembershipTile"; - String description = "testSiteMembershipDescription"; - siteInfo = new SiteInfoImpl(sitePreset, shortName, title, description, - SiteVisibility.PUBLIC, null); - } - - @Test - public void testNullpersonInfo() throws Exception - { - try - { - siteMember = new SiteMembership(siteInfo, null, firstName, lastName, role); - } - catch (IllegalArgumentException e) - { - assertEquals(idErrorMessage, e.getMessage()); - } - - try - { - siteMember = new SiteMembership(siteInfo, null, role); - } - catch (IllegalArgumentException e) - { - assertEquals(idErrorMessage, e.getMessage()); - } - } - - @Test - public void testNullRole() throws Exception - { - try - { - siteMember = new SiteMembership(siteInfo, personId, firstName, lastName, null); - } - catch (IllegalArgumentException e) - { - assertEquals(roleErrorMessage, e.getMessage()); - } - - try - { - siteMember = new SiteMembership(siteInfo, personId, null); - } - catch (IllegalArgumentException e) - { - assertEquals(roleErrorMessage, e.getMessage()); - } - } - - @Test - public void testNullFirstName() throws Exception - { - try - { - siteMember = new SiteMembership(siteInfo, personId, null, lastName, role); - } - catch (IllegalArgumentException e) - { - assertEquals(firstNameErrorMessage + siteInfo.getShortName(), e.getMessage()); - } - } - - @Test - public void testNullLastName() throws Exception - { - try - { - siteMember = new SiteMembership(siteInfo, personId, firstName, null, role); - } - catch (IllegalArgumentException e) - { - assertEquals(lastNameErrorMessage + siteInfo.getShortName(), e.getMessage()); - } - } -} +/* + * #%L + * Alfresco Repository + * %% + * Copyright (C) 2005 - 2024 Alfresco Software Limited + * %% + * This file is part of the Alfresco software. + * If the software was purchased under a paid Alfresco license, the terms of + * the paid license agreement will prevail. Otherwise, the software is + * provided under the following open source license terms: + * + * Alfresco is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Alfresco is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with Alfresco. If not, see . + * #L% + */ +package org.alfresco.repo.site; + +import static org.junit.Assert.assertEquals; + +import java.util.UUID; + +import org.junit.Before; +import org.junit.Test; + +import org.alfresco.service.cmr.site.SiteInfo; +import org.alfresco.service.cmr.site.SiteVisibility; + +/** + * Test Membership constructor logs. Based on REPO-2520 + * + * @author Alexandru Epure + */ +public class SiteMembershipTest +{ + SiteInfo siteInfo; + SiteMembership siteMember; + String personId = UUID.randomUUID().toString(); + String firstName = UUID.randomUUID().toString(); + String lastName = UUID.randomUUID().toString(); + String role = "Consumer"; + + String idErrorMessage = "Id required building site membership"; + String firstNameErrorMessage = "FirstName required building site membership of "; + String lastNameErrorMessage = "LastName required building site membership of "; + String roleErrorMessage = "Role required building site membership"; + + @Before + public void createSite() + { + var sitePreset = "testSiteMembershipPreset"; + var shortName = "testSiteMembershipShortName"; + var title = "testSiteMembershipTile"; + var description = "testSiteMembershipDescription"; + siteInfo = new SiteInfoImpl(sitePreset, shortName, title, description, + SiteVisibility.PUBLIC, null); + } + + @Test + public void testNullpersonInfo() throws Exception + { + try + { + siteMember = new SiteMembership(siteInfo, null, firstName, lastName, role); + } + catch (IllegalArgumentException e) + { + assertEquals(idErrorMessage, e.getMessage()); + } + + try + { + siteMember = new SiteMembership(siteInfo, null, role); + } + catch (IllegalArgumentException e) + { + assertEquals(idErrorMessage, e.getMessage()); + } + } + + @Test + public void testNullRole() throws Exception + { + try + { + siteMember = new SiteMembership(siteInfo, personId, firstName, lastName, null); + } + catch (IllegalArgumentException e) + { + assertEquals(roleErrorMessage, e.getMessage()); + } + + try + { + siteMember = new SiteMembership(siteInfo, personId, null); + } + catch (IllegalArgumentException e) + { + assertEquals(roleErrorMessage, e.getMessage()); + } + } + + @Test + public void testNullFirstName() throws Exception + { + try + { + siteMember = new SiteMembership(siteInfo, personId, null, lastName, role); + } + catch (IllegalArgumentException e) + { + assertEquals(firstNameErrorMessage + siteInfo.getShortName(), e.getMessage()); + } + } + + @Test + public void testNullLastName() throws Exception + { + try + { + siteMember = new SiteMembership(siteInfo, personId, firstName, null, role); + } + catch (IllegalArgumentException e) + { + assertEquals(lastNameErrorMessage + siteInfo.getShortName(), e.getMessage()); + } + } +}