ACS-3841 Use AlphabeticalPriorityInterceptor from alfresco-tas-utility (#1671)

This commit is contained in:
Damian Ujma
2023-01-12 12:51:52 +01:00
committed by GitHub
parent 9239817226
commit b773307a0b
3 changed files with 2 additions and 54 deletions

View File

@@ -1,52 +0,0 @@
/*
* #%L
* Alfresco Records Management Module
* %%
* Copyright (C) 2005 - 2023 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 <http://www.gnu.org/licenses/>.
* #L%
*/
package org.alfresco.rest.rm.community.utils;
import java.util.Comparator;
import java.util.List;
import java.util.stream.Collectors;
import org.testng.IMethodInstance;
import org.testng.IMethodInterceptor;
import org.testng.ITestContext;
/**
* A method interceptor that sorts test classes alphabetically.
*
* @author Damian Ujma
*/
public class AlphabeticalPriorityInterceptor implements IMethodInterceptor
{
@Override
public List<IMethodInstance> intercept(List<IMethodInstance> methods,
ITestContext context)
{
return methods.stream()
.sorted(Comparator.comparing(methodInstance -> methodInstance.getMethod().getTestClass().getName()))
.collect(Collectors.toList());
}
}

View File

@@ -2,7 +2,7 @@
<suite name="TestNG AllTestSuite" configfailurepolicy="continue" verbose="1" time-out="300000">
<listeners>
<listener class-name="org.alfresco.rest.rm.community.utils.AlphabeticalPriorityInterceptor" />
<listener class-name="org.alfresco.utility.testng.AlphabeticalPriorityInterceptor" />
</listeners>
<test name="restapi" preserve-order="false">
<packages>

View File

@@ -120,7 +120,7 @@
<dependency.mysql.version>8.0.30</dependency.mysql.version>
<dependency.mysql-image.version>8</dependency.mysql-image.version>
<dependency.mariadb.version>2.7.4</dependency.mariadb.version>
<dependency.tas-utility.version>3.0.57</dependency.tas-utility.version>
<dependency.tas-utility.version>3.0.58</dependency.tas-utility.version>
<dependency.rest-assured.version>5.2.0</dependency.rest-assured.version>
<dependency.tas-email.version>1.11</dependency.tas-email.version>
<dependency.tas-webdav.version>1.7</dependency.tas-webdav.version>