Compare commits

...

22 Commits

Author SHA1 Message Date
Travis CI User
4cb4f6f023 [maven-release-plugin][skip ci] prepare release 14.98 2022-02-03 18:25:38 +00:00
dependabot[bot]
98aebf77ad Bump xercesImpl from 2.12.1 to 2.12.2 (#913)
Bumps xercesImpl from 2.12.1 to 2.12.2.

---
updated-dependencies:
- dependency-name: xerces:xercesImpl
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-02-03 17:34:11 +00:00
Travis CI User
25b7d8c480 [maven-release-plugin][skip ci] prepare for next development iteration 2022-02-03 14:38:05 +00:00
Travis CI User
641ea57895 [maven-release-plugin][skip ci] prepare release 14.97 2022-02-03 14:38:01 +00:00
dependabot[bot]
c0d2d444ca Bump dependency.jackson.version from 2.13.0 to 2.13.1 (#854) 2022-02-03 13:41:02 +00:00
dependabot[bot]
212c2cefec Bump dependency.slf4j.version from 1.7.33 to 1.7.35 (#911) 2022-02-03 13:40:37 +00:00
dependabot[bot]
6bacd51841 Bump junrar from 7.4.0 to 7.4.1 (#914) 2022-02-03 13:40:27 +00:00
Travis CI User
2db4bf0a90 [maven-release-plugin][skip ci] prepare for next development iteration 2022-02-03 12:11:24 +00:00
Travis CI User
7381e578a8 [maven-release-plugin][skip ci] prepare release 14.96 2022-02-03 12:11:21 +00:00
dependabot[bot]
44a8acddd0 Bump reflections from 0.9.12 to 0.10.2 (#776) 2022-02-03 10:51:48 +00:00
Travis CI User
9bcf7eed9a [maven-release-plugin][skip ci] prepare for next development iteration 2022-02-01 09:10:17 +00:00
Travis CI User
d540a25a88 [maven-release-plugin][skip ci] prepare release 14.95 2022-02-01 09:10:14 +00:00
Domenico Sibilio
f113724f9a ACS-2245 Mitigate intermittent failure of FixedAclUpdaterTest (#916)
* ACS-2245 - Trigger CI build

* ACS-2245 - Add RepeatAtMostRule for flaky tests

* ACS-2245 - Add RepeatAtMostRuleTest to the AllUnitTestsSuite

* ACS-2245 - Rename RepeatAtMostRule to RetryAtMostRule
2022-02-01 09:14:53 +01:00
Travis CI User
ad04e79141 [maven-release-plugin][skip ci] prepare for next development iteration 2022-01-31 19:00:40 +00:00
Travis CI User
51ed184126 [maven-release-plugin][skip ci] prepare release 14.94 2022-01-31 19:00:37 +00:00
montgolfiere
5d740eba37 ACS-2104: Remove Camel exclusion from DependABot - to enable future suggestions (#917)
- ie. should prompt with 3.7.7 to 3.14.0 (or maybe 3.14.1)
- also logged ACS-2476 (in case of compile-time/run-time incompatibilities and aligning with Netty)
2022-01-31 18:06:40 +00:00
Travis CI User
5c9cc4dd04 [maven-release-plugin][skip ci] prepare for next development iteration 2022-01-28 19:01:14 +00:00
Travis CI User
430e92dbce [maven-release-plugin][skip ci] prepare release 14.93 2022-01-28 19:01:11 +00:00
dependabot[bot]
f0aa9b6004 Bump dependency.alfresco-transform-model.version from 1.4.7 to 1.4.8 (#915)
Bumps `dependency.alfresco-transform-model.version` from 1.4.7 to 1.4.8.

Updates `alfresco-transform-model` from 1.4.7 to 1.4.8
- [Release notes](https://github.com/Alfresco/alfresco-transform-model/releases)
- [Commits](https://github.com/Alfresco/alfresco-transform-model/commits)

Updates `alfresco-transform-model` from 1.4.7 to 1.4.8
- [Release notes](https://github.com/Alfresco/alfresco-transform-model/releases)
- [Commits](https://github.com/Alfresco/alfresco-transform-model/commits)

---
updated-dependencies:
- dependency-name: org.alfresco:alfresco-transform-model
  dependency-type: direct:production
  update-type: version-update:semver-patch
- dependency-name: org.alfresco:alfresco-transform-model:tests
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-01-28 18:08:59 +00:00
Travis CI User
4471654e40 [maven-release-plugin][skip ci] prepare for next development iteration 2022-01-27 23:34:29 +00:00
Travis CI User
e1fa082b6e [maven-release-plugin][skip ci] prepare release 14.92 2022-01-27 23:34:26 +00:00
alandavis
903672b82b ACS-2479 Pick up T-Core 2.5.6 2022-01-27 21:50:43 +00:00
63 changed files with 639 additions and 349 deletions

View File

@@ -38,27 +38,6 @@ updates:
- dependency-name: org.activiti:activiti-spring
versions:
- ">= 7.1.a, < 7.2"
- dependency-name: org.apache.camel:camel-activemq
versions:
- "> 3.7.1"
- dependency-name: org.apache.camel:camel-amqp
versions:
- "> 3.7.1"
- dependency-name: org.apache.camel:camel-direct
versions:
- "> 3.7.1"
- dependency-name: org.apache.camel:camel-directvm
versions:
- "> 3.7.1"
- dependency-name: org.apache.camel:camel-jackson
versions:
- "> 3.7.1"
- dependency-name: org.apache.camel:camel-mock
versions:
- "> 3.7.1"
- dependency-name: org.apache.camel:camel-spring
versions:
- "> 3.7.1"
- dependency-name: org.apache.chemistry.opencmis:chemistry-opencmis-client-impl
versions:
- "> 1.0.0"

View File

@@ -53,14 +53,14 @@ jobs:
if: commit_message !~ /\[skip repo\]/
script:
- travis_retry mvn -B test -pl core,data-model
- travis_retry mvn -B test -pl repository -Dtest=AllUnitTestsSuite
- travis_retry mvn -B test -pl "repository,mmt" "-Dtest=AllUnitTestsSuite,AllMmtUnitTestSuite"
- name: "Repository - AppContext01TestSuite"
if: commit_message !~ /\[skip repo\]/
before_script:
- docker run -d -p 5433:5432 -e POSTGRES_PASSWORD=alfresco -e POSTGRES_USER=alfresco -e POSTGRES_DB=alfresco postgres:13.3 postgres -c 'max_connections=300'
- docker run -d -p 61616:61616 -p 5672:5672 alfresco/alfresco-activemq:5.16.1
- docker run -d -p 8090:8090 -e JAVA_OPTS=" -Xms256m -Xmx256m" alfresco/alfresco-transform-core-aio:2.5.5
- docker run -d -p 8090:8090 -e JAVA_OPTS=" -Xms256m -Xmx256m" alfresco/alfresco-transform-core-aio:2.5.6
script: travis_wait 20 mvn -B test -pl repository -Dtest=AppContext01TestSuite -Ddb.driver=org.postgresql.Driver -Ddb.name=alfresco -Ddb.url=jdbc:postgresql://localhost:5433/alfresco -Ddb.username=alfresco -Ddb.password=alfresco
- name: "Repository - AppContext02TestSuite"
@@ -75,7 +75,7 @@ jobs:
before_script:
- docker run -d -p 5433:5432 -e POSTGRES_PASSWORD=alfresco -e POSTGRES_USER=alfresco -e POSTGRES_DB=alfresco postgres:13.3 postgres -c 'max_connections=300'
- docker run -d -p 61616:61616 -p 5672:5672 alfresco/alfresco-activemq:5.16.1
- docker run -d -p 8090:8090 -e JAVA_OPTS=" -Xms256m -Xmx256m" alfresco/alfresco-transform-core-aio:2.5.5
- docker run -d -p 8090:8090 -e JAVA_OPTS=" -Xms256m -Xmx256m" alfresco/alfresco-transform-core-aio:2.5.6
script: travis_wait 20 mvn -B test -pl repository -Dtest=AppContext03TestSuite -Ddb.driver=org.postgresql.Driver -Ddb.name=alfresco -Ddb.url=jdbc:postgresql://localhost:5433/alfresco -Ddb.username=alfresco -Ddb.password=alfresco
- name: "Repository - AppContext04TestSuite"
@@ -83,7 +83,7 @@ jobs:
before_script:
- docker run -d -p 5433:5432 -e POSTGRES_PASSWORD=alfresco -e POSTGRES_USER=alfresco -e POSTGRES_DB=alfresco postgres:13.3 postgres -c 'max_connections=300'
- docker run -d -p 61616:61616 -p 5672:5672 alfresco/alfresco-activemq:5.16.1
- docker run -d -p 8090:8090 -e JAVA_OPTS=" -Xms256m -Xmx256m" alfresco/alfresco-transform-core-aio:2.5.5
- docker run -d -p 8090:8090 -e JAVA_OPTS=" -Xms256m -Xmx256m" alfresco/alfresco-transform-core-aio:2.5.6
script: travis_wait 20 mvn -B test -pl repository -Dtest=AppContext04TestSuite -Ddb.driver=org.postgresql.Driver -Ddb.name=alfresco -Ddb.url=jdbc:postgresql://localhost:5433/alfresco -Ddb.username=alfresco -Ddb.password=alfresco
- name: "Repository - AppContext05TestSuite"
@@ -102,7 +102,7 @@ jobs:
before_script:
- docker run -d -p 5433:5432 -e POSTGRES_PASSWORD=alfresco -e POSTGRES_USER=alfresco -e POSTGRES_DB=alfresco postgres:13.3 postgres -c 'max_connections=300'
- docker run -d -p 61616:61616 -p 5672:5672 alfresco/alfresco-activemq:5.16.1
- docker run -d -p 8090:8090 -e JAVA_OPTS=" -Xms256m -Xmx256m" alfresco/alfresco-transform-core-aio:2.5.5
- docker run -d -p 8090:8090 -e JAVA_OPTS=" -Xms256m -Xmx256m" alfresco/alfresco-transform-core-aio:2.5.6
script: travis_wait 20 mvn -B test -pl repository -Dtest=AppContext06TestSuite -Ddb.driver=org.postgresql.Driver -Ddb.name=alfresco -Ddb.url=jdbc:postgresql://localhost:5433/alfresco -Ddb.username=alfresco -Ddb.password=alfresco
- name: "Repository - AppContextExtraTestSuite"
@@ -110,7 +110,7 @@ jobs:
before_script:
- docker run -d -p 5433:5432 -e POSTGRES_PASSWORD=alfresco -e POSTGRES_USER=alfresco -e POSTGRES_DB=alfresco postgres:13.3 postgres -c 'max_connections=300'
- docker run -d -p 61616:61616 -p 5672:5672 alfresco/alfresco-activemq:5.16.1
- docker run -d -p 8090:8090 -e JAVA_OPTS=" -Xms256m -Xmx256m" alfresco/alfresco-transform-core-aio:2.5.5
- docker run -d -p 8090:8090 -e JAVA_OPTS=" -Xms256m -Xmx256m" alfresco/alfresco-transform-core-aio:2.5.6
script: travis_wait 20 mvn -B test -pl repository -Dtest=AppContextExtraTestSuite -Ddb.driver=org.postgresql.Driver -Ddb.name=alfresco -Ddb.url=jdbc:postgresql://localhost:5433/alfresco -Ddb.username=alfresco -Ddb.password=alfresco
- name: "Repository - MiscContextTestSuite"
@@ -118,7 +118,7 @@ jobs:
before_script:
- docker run -d -p 5433:5432 -e POSTGRES_PASSWORD=alfresco -e POSTGRES_USER=alfresco -e POSTGRES_DB=alfresco postgres:13.3 postgres -c 'max_connections=300'
- docker run -d -p 61616:61616 -p 5672:5672 alfresco/alfresco-activemq:5.16.1
- docker run -d -p 8090:8090 -e JAVA_OPTS=" -Xms256m -Xmx256m" alfresco/alfresco-transform-core-aio:2.5.5
- docker run -d -p 8090:8090 -e JAVA_OPTS=" -Xms256m -Xmx256m" alfresco/alfresco-transform-core-aio:2.5.6
script: travis_wait 20 mvn -B test -pl repository -Dtest=MiscContextTestSuite -Ddb.driver=org.postgresql.Driver -Ddb.name=alfresco -Ddb.url=jdbc:postgresql://localhost:5433/alfresco -Ddb.username=alfresco -Ddb.password=alfresco
- name: "Repository - SearchTestSuite"
@@ -241,7 +241,7 @@ jobs:
before_script:
- docker run -d -p 5433:5432 -e POSTGRES_PASSWORD=alfresco -e POSTGRES_USER=alfresco -e POSTGRES_DB=alfresco postgres:13.3 postgres -c 'max_connections=300'
- docker run -d -p 61616:61616 -p 5672:5672 alfresco/alfresco-activemq:5.16.1
- docker run -d -p 8090:8090 -e JAVA_OPTS=" -Xms256m -Xmx256m" alfresco/alfresco-transform-core-aio:2.5.5
- docker run -d -p 8090:8090 -e JAVA_OPTS=" -Xms256m -Xmx256m" alfresco/alfresco-transform-core-aio:2.5.6
script: travis_wait 20 mvn -B test -pl remote-api -Dtest=AppContext02TestSuite -Ddb.driver=org.postgresql.Driver -Ddb.name=alfresco -Ddb.url=jdbc:postgresql://localhost:5433/alfresco -Ddb.username=alfresco -Ddb.password=alfresco
- name: "Remote-api - AppContext03TestSuite"
@@ -249,7 +249,7 @@ jobs:
before_script:
- docker run -d -p 5433:5432 -e POSTGRES_PASSWORD=alfresco -e POSTGRES_USER=alfresco -e POSTGRES_DB=alfresco postgres:13.3 postgres -c 'max_connections=300'
- docker run -d -p 61616:61616 -p 5672:5672 alfresco/alfresco-activemq:5.16.1
- docker run -d -p 8090:8090 -e JAVA_OPTS=" -Xms256m -Xmx256m" alfresco/alfresco-transform-core-aio:2.5.5
- docker run -d -p 8090:8090 -e JAVA_OPTS=" -Xms256m -Xmx256m" alfresco/alfresco-transform-core-aio:2.5.6
script: travis_wait 20 mvn -B test -pl remote-api -Dtest=AppContext03TestSuite -Ddb.driver=org.postgresql.Driver -Ddb.name=alfresco -Ddb.url=jdbc:postgresql://localhost:5433/alfresco -Ddb.username=alfresco -Ddb.password=alfresco
- name: "Remote-api - AppContext04TestSuite"
@@ -257,7 +257,7 @@ jobs:
before_script:
- docker run -d -p 5433:5432 -e POSTGRES_PASSWORD=alfresco -e POSTGRES_USER=alfresco -e POSTGRES_DB=alfresco postgres:13.3 postgres -c 'max_connections=300'
- docker run -d -p 61616:61616 -p 5672:5672 alfresco/alfresco-activemq:5.16.1
- docker run -d -p 8090:8090 -e JAVA_OPTS=" -Xms256m -Xmx256m" alfresco/alfresco-transform-core-aio:2.5.5
- docker run -d -p 8090:8090 -e JAVA_OPTS=" -Xms256m -Xmx256m" alfresco/alfresco-transform-core-aio:2.5.6
script: travis_wait 20 mvn -B test -pl remote-api -Dtest=AppContext04TestSuite -Ddb.driver=org.postgresql.Driver -Ddb.name=alfresco -Ddb.url=jdbc:postgresql://localhost:5433/alfresco -Ddb.username=alfresco -Ddb.password=alfresco
- name: "Remote-api - AppContextExtraTestSuite"

View File

@@ -7,7 +7,7 @@
<parent>
<groupId>org.alfresco</groupId>
<artifactId>alfresco-community-repo-amps</artifactId>
<version>14.92-SNAPSHOT</version>
<version>14.98</version>
</parent>
<modules>

View File

@@ -7,7 +7,7 @@
<parent>
<groupId>org.alfresco</groupId>
<artifactId>alfresco-governance-services-community-parent</artifactId>
<version>14.92-SNAPSHOT</version>
<version>14.98</version>
</parent>
<modules>

View File

@@ -7,7 +7,7 @@
<parent>
<groupId>org.alfresco</groupId>
<artifactId>alfresco-governance-services-automation-community-repo</artifactId>
<version>14.92-SNAPSHOT</version>
<version>14.98</version>
</parent>
<build>
@@ -45,7 +45,7 @@
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
<version>1.7.33</version>
<version>1.7.35</version>
<scope>test</scope>
</dependency>
<dependency>

View File

@@ -7,7 +7,7 @@
<parent>
<groupId>org.alfresco</groupId>
<artifactId>alfresco-governance-services-community-parent</artifactId>
<version>14.92-SNAPSHOT</version>
<version>14.98</version>
</parent>
<modules>

View File

@@ -1,4 +1,4 @@
TRANSFORMERS_TAG=2.5.5
TRANSFORMERS_TAG=2.5.6
SOLR6_TAG=2.0.2
POSTGRES_TAG=13.3
ACTIVEMQ_TAG=5.16.1

View File

@@ -8,7 +8,7 @@
<parent>
<groupId>org.alfresco</groupId>
<artifactId>alfresco-governance-services-community-repo-parent</artifactId>
<version>14.92-SNAPSHOT</version>
<version>14.98</version>
</parent>
<properties>

View File

@@ -29,6 +29,7 @@ package org.alfresco.module.org_alfresco_module_rm.api;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
import static org.reflections.scanners.Scanners.TypesAnnotated;
import java.lang.reflect.Constructor;
import java.lang.reflect.Executable;
@@ -77,7 +78,7 @@ public class PublicAPITestUtil
*/
public static void testPublicAPIConsistency(String basePackageName, SetMultimap<Class<?>, Class<?>> knownBadReferences)
{
Reflections reflections = new Reflections(basePackageName);
Reflections reflections = new Reflections(basePackageName, TypesAnnotated);
Set<Class<?>> publicAPIClasses = reflections.getTypesAnnotatedWith(AlfrescoPublicApi.class, true);
SetMultimap<Class<?>, Class<?>> referencedFrom = HashMultimap.create();

View File

@@ -7,7 +7,7 @@
<parent>
<groupId>org.alfresco</groupId>
<artifactId>alfresco-governance-services-community-repo-parent</artifactId>
<version>14.92-SNAPSHOT</version>
<version>14.98</version>
</parent>
<build>

View File

@@ -7,7 +7,7 @@
<parent>
<groupId>org.alfresco</groupId>
<artifactId>alfresco-community-repo</artifactId>
<version>14.92-SNAPSHOT</version>
<version>14.98</version>
</parent>
<modules>

View File

@@ -8,7 +8,7 @@
<parent>
<groupId>org.alfresco</groupId>
<artifactId>alfresco-community-repo-amps</artifactId>
<version>14.92-SNAPSHOT</version>
<version>14.98</version>
</parent>
<properties>

View File

@@ -7,7 +7,7 @@
<parent>
<groupId>org.alfresco</groupId>
<artifactId>alfresco-community-repo</artifactId>
<version>14.92-SNAPSHOT</version>
<version>14.98</version>
</parent>
<dependencies>

View File

@@ -7,7 +7,7 @@
<parent>
<groupId>org.alfresco</groupId>
<artifactId>alfresco-community-repo</artifactId>
<version>14.92-SNAPSHOT</version>
<version>14.98</version>
</parent>
<properties>

View File

@@ -7,7 +7,7 @@
<parent>
<groupId>org.alfresco</groupId>
<artifactId>alfresco-community-repo</artifactId>
<version>14.92-SNAPSHOT</version>
<version>14.98</version>
</parent>
<dependencies>
@@ -31,6 +31,11 @@
<artifactId>maven-artifact</artifactId>
<version>${dependency.maven-artifact.version}</version>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<build>

View File

@@ -1,28 +1,28 @@
/*
* #%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 <http://www.gnu.org/licenses/>.
* #L%
*/
/*
* #%L
* Alfresco Repository
* %%
* Copyright (C) 2005 - 2022 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.repo.module.tool;
import java.io.BufferedReader;

View File

@@ -1,28 +1,28 @@
/*
* #%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 <http://www.gnu.org/licenses/>.
* #L%
*/
/*
* #%L
* Alfresco Repository
* %%
* Copyright (C) 2005 - 2022 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.repo.module.tool;
import java.io.FileNotFoundException;
@@ -178,13 +178,13 @@ public class ModuleDetailsHelper
}
/**
* Saves the module details to the war in the correct location based on the module id
*
* @param warLocation the war location
* @param moduleDetails the module id
*/
public static void saveModuleDetails(String warLocation, ModuleDetails moduleDetails)
{
* Saves the module details to the war in the correct location based on the module id
*
* @param warLocation the war location
* @param moduleDetails the module id
*/
public static void saveModuleDetails(String warLocation, ModuleDetails moduleDetails)
{
// Ensure that it is a valid set of properties
String moduleId = moduleDetails.getId();
try

View File

@@ -1,28 +1,28 @@
/*
* #%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 <http://www.gnu.org/licenses/>.
* #L%
*/
/*
* #%L
* Alfresco Repository
* %%
* Copyright (C) 2005 - 2022 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.repo.module.tool;
import de.schlichtherle.truezip.file.*;

View File

@@ -1,28 +1,28 @@
/*
* #%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 <http://www.gnu.org/licenses/>.
* #L%
*/
/*
* #%L
* Alfresco Repository
* %%
* Copyright (C) 2005 - 2022 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.repo.module.tool;
import org.alfresco.service.cmr.module.ModuleDetails;

View File

@@ -1,28 +1,28 @@
/*
* #%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 <http://www.gnu.org/licenses/>.
* #L%
*/
/*
* #%L
* Alfresco Repository
* %%
* Copyright (C) 2005 - 2022 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.repo.module.tool;
import de.schlichtherle.truezip.file.TArchiveDetector;

View File

@@ -0,0 +1,43 @@
/*
* #%L
* Alfresco Repository
* %%
* Copyright (C) 2005 - 2022 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;
import org.junit.experimental.categories.Categories;
import org.junit.runner.RunWith;
import org.junit.runners.Suite;
/**
* All MMT Tool project UNIT test classes (no application context) should be added to this test suite.
*/
@RunWith(Categories.class)
@Suite.SuiteClasses({
org.alfresco.repo.module.tool.ModuleManagementToolTest.class,
org.alfresco.repo.module.tool.WarHelperImplTest.class,
org.alfresco.repo.module.tool.ModuleServiceImplTest.class
})
public class AllMmtUnitTestSuite
{
}

View File

@@ -2,7 +2,7 @@
* #%L
* Alfresco Repository
* %%
* Copyright (C) 2005 - 2016 Alfresco Software Limited
* Copyright (C) 2005 - 2022 Alfresco Software Limited
* %%
* This file is part of the Alfresco software.
* If the software was purchased under a paid Alfresco license, the terms of

View File

@@ -2,7 +2,7 @@
* #%L
* Alfresco Repository
* %%
* Copyright (C) 2005 - 2016 Alfresco Software Limited
* Copyright (C) 2005 - 2022 Alfresco Software Limited
* %%
* This file is part of the Alfresco software.
* If the software was purchased under a paid Alfresco license, the terms of

View File

@@ -2,7 +2,7 @@
* #%L
* Alfresco Repository
* %%
* Copyright (C) 2005 - 2016 Alfresco Software Limited
* Copyright (C) 2005 - 2022 Alfresco Software Limited
* %%
* This file is part of the Alfresco software.
* If the software was purchased under a paid Alfresco license, the terms of

View File

@@ -9,6 +9,6 @@
<parent>
<groupId>org.alfresco</groupId>
<artifactId>alfresco-community-repo-packaging</artifactId>
<version>14.92-SNAPSHOT</version>
<version>14.98</version>
</parent>
</project>

View File

@@ -7,7 +7,7 @@
<parent>
<groupId>org.alfresco</groupId>
<artifactId>alfresco-community-repo-packaging</artifactId>
<version>14.92-SNAPSHOT</version>
<version>14.98</version>
</parent>
<properties>

View File

@@ -7,7 +7,7 @@
<parent>
<groupId>org.alfresco</groupId>
<artifactId>alfresco-community-repo</artifactId>
<version>14.92-SNAPSHOT</version>
<version>14.98</version>
</parent>
<modules>

View File

@@ -1,4 +1,4 @@
TRANSFORMERS_TAG=2.5.5
TRANSFORMERS_TAG=2.5.6
SOLR6_TAG=2.0.2
POSTGRES_TAG=13.3
ACTIVEMQ_TAG=5.16.1

View File

@@ -6,7 +6,7 @@
<parent>
<groupId>org.alfresco</groupId>
<artifactId>alfresco-community-repo-packaging</artifactId>
<version>14.92-SNAPSHOT</version>
<version>14.98</version>
</parent>
<modules>

View File

@@ -9,7 +9,7 @@
<parent>
<groupId>org.alfresco</groupId>
<artifactId>alfresco-community-repo-tests</artifactId>
<version>14.92-SNAPSHOT</version>
<version>14.98</version>
</parent>
<developers>

View File

@@ -9,7 +9,7 @@
<parent>
<groupId>org.alfresco</groupId>
<artifactId>alfresco-community-repo-tests</artifactId>
<version>14.92-SNAPSHOT</version>
<version>14.98</version>
</parent>
<developers>

View File

@@ -9,7 +9,7 @@
<parent>
<groupId>org.alfresco</groupId>
<artifactId>alfresco-community-repo-tests</artifactId>
<version>14.92-SNAPSHOT</version>
<version>14.98</version>
</parent>
<developers>

View File

@@ -9,7 +9,7 @@
<parent>
<groupId>org.alfresco</groupId>
<artifactId>alfresco-community-repo-tests</artifactId>
<version>14.92-SNAPSHOT</version>
<version>14.98</version>
</parent>
<developers>

View File

@@ -9,7 +9,7 @@
<parent>
<groupId>org.alfresco</groupId>
<artifactId>alfresco-community-repo-tests</artifactId>
<version>14.92-SNAPSHOT</version>
<version>14.98</version>
</parent>
<developers>

View File

@@ -7,7 +7,7 @@
<parent>
<groupId>org.alfresco</groupId>
<artifactId>alfresco-community-repo-packaging</artifactId>
<version>14.92-SNAPSHOT</version>
<version>14.98</version>
</parent>
<properties>

16
pom.xml
View File

@@ -2,7 +2,7 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<artifactId>alfresco-community-repo</artifactId>
<version>14.92-SNAPSHOT</version>
<version>14.98</version>
<packaging>pom</packaging>
<name>Alfresco Community Repo Parent</name>
@@ -51,13 +51,13 @@
<dependency.alfresco-log-sanitizer.version>0.2</dependency.alfresco-log-sanitizer.version>
<dependency.activiti-engine.version>5.23.0</dependency.activiti-engine.version>
<dependency.activiti.version>5.23.0</dependency.activiti.version>
<dependency.alfresco-transform-model.version>1.4.7</dependency.alfresco-transform-model.version>
<dependency.alfresco-transform-model.version>1.4.8</dependency.alfresco-transform-model.version>
<dependency.alfresco-greenmail.version>6.2</dependency.alfresco-greenmail.version>
<dependency.acs-event-model.version>0.0.13</dependency.acs-event-model.version>
<dependency.spring.version>5.3.15</dependency.spring.version>
<dependency.antlr.version>3.5.2</dependency.antlr.version>
<dependency.jackson.version>2.13.0</dependency.jackson.version>
<dependency.jackson.version>2.13.1</dependency.jackson.version>
<dependency.jackson-databind.version>2.13.1</dependency.jackson-databind.version>
<dependency.cxf.version>3.5.0</dependency.cxf.version>
<dependency.opencmis.version>1.0.0</dependency.opencmis.version>
@@ -71,8 +71,8 @@
<dependency.httpclient.version>4.5.13</dependency.httpclient.version>
<dependency.httpcore.version>4.4.15</dependency.httpcore.version>
<dependency.commons-httpclient.version>3.1-HTTPCLIENT-1265</dependency.commons-httpclient.version>
<dependency.xercesImpl.version>2.12.1</dependency.xercesImpl.version>
<dependency.slf4j.version>1.7.33</dependency.slf4j.version>
<dependency.xercesImpl.version>2.12.2</dependency.xercesImpl.version>
<dependency.slf4j.version>1.7.35</dependency.slf4j.version>
<dependency.gytheio.version>0.12</dependency.gytheio.version>
<dependency.groovy.version>3.0.9</dependency.groovy.version>
<dependency.tika.version>2.2.1</dependency.tika.version>
@@ -146,7 +146,7 @@
<connection>scm:git:https://github.com/Alfresco/alfresco-community-repo.git</connection>
<developerConnection>scm:git:https://github.com/Alfresco/alfresco-community-repo.git</developerConnection>
<url>https://github.com/Alfresco/alfresco-community-repo</url>
<tag>HEAD</tag>
<tag>14.98</tag>
</scm>
<distributionManagement>
@@ -631,7 +631,7 @@
<dependency>
<groupId>com.github.junrar</groupId>
<artifactId>junrar</artifactId>
<version>7.4.0</version>
<version>7.4.1</version>
</dependency>
<dependency>
<groupId>com.github.fge</groupId>
@@ -850,7 +850,7 @@
<dependency>
<groupId>org.reflections</groupId>
<artifactId>reflections</artifactId>
<version>0.9.12</version>
<version>0.10.2</version>
</dependency>
<!-- swagger parser -->
<dependency>

View File

@@ -7,7 +7,7 @@
<parent>
<groupId>org.alfresco</groupId>
<artifactId>alfresco-community-repo</artifactId>
<version>14.92-SNAPSHOT</version>
<version>14.98</version>
</parent>
<dependencies>

View File

@@ -7,7 +7,7 @@
<parent>
<groupId>org.alfresco</groupId>
<artifactId>alfresco-community-repo</artifactId>
<version>14.92-SNAPSHOT</version>
<version>14.98</version>
</parent>
<dependencies>
@@ -198,24 +198,6 @@
<artifactId>maven-artifact</artifactId>
<version>${dependency.maven-artifact.version}</version>
</dependency>
<dependency>
<groupId>de.schlichtherle.truezip</groupId>
<artifactId>truezip-driver-zip</artifactId>
<version>${dependency.truezip.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>de.schlichtherle.truezip</groupId>
<artifactId>truezip-file</artifactId>
<version>${dependency.truezip.version}</version>
<scope>provided</scope>
<exclusions>
<exclusion>
<groupId>com.google.code.findbugs</groupId>
<artifactId>annotations</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>com.sun.pdfview</groupId>
<artifactId>pdfrenderer</artifactId>

View File

@@ -66,9 +66,6 @@ import org.junit.runners.Suite;
org.alfresco.repo.management.subsystems.CryptodocSwitchableApplicationContextFactoryTest.class,
org.alfresco.repo.module.ModuleDetailsImplTest.class,
org.alfresco.repo.module.ModuleVersionNumberTest.class,
org.alfresco.repo.module.tool.ModuleManagementToolTest.class,
org.alfresco.repo.module.tool.WarHelperImplTest.class,
org.alfresco.repo.module.tool.ModuleServiceImplTest.class,
org.alfresco.repo.node.integrity.IntegrityEventTest.class,
org.alfresco.repo.policy.MTPolicyComponentTest.class,
org.alfresco.repo.policy.PolicyComponentTest.class,
@@ -119,6 +116,7 @@ import org.junit.runners.Suite;
org.alfresco.util.schemacomp.validator.SchemaVersionValidatorTest.class,
org.alfresco.util.schemacomp.validator.TypeNameOnlyValidatorTest.class,
org.alfresco.util.test.OmittedTestClassFinderUnitTest.class,
org.alfresco.util.test.junitrules.RetryAtMostRuleTest.class,
org.alfresco.util.test.junitrules.TemporaryMockOverrideTest.class,
org.alfresco.repo.search.impl.solr.AbstractSolrQueryHTTPClientTest.class,
org.alfresco.repo.search.impl.solr.SpellCheckDecisionManagerTest.class,

View File

@@ -2,7 +2,7 @@
* #%L
* Alfresco Repository
* %%
* Copyright (C) 2005 - 2020 Alfresco Software Limited
* Copyright (C) 2005 - 2022 Alfresco Software Limited
* %%
* This file is part of the Alfresco software.
* If the software was purchased under a paid Alfresco license, the terms of
@@ -68,6 +68,10 @@ import org.junit.runners.Suite;
org.alfresco.filesys.repo.ContentDiskDriverTest.class,
org.alfresco.filesys.repo.LockKeeperImplTest.class,
org.alfresco.repo.activities.ActivityServiceImplTest.class,
org.alfresco.repo.activities.feed.cleanup.FeedCleanerTestCaseInsensitivity.class,
org.alfresco.repo.activities.SiteActivityTestCaseSensitivity.class,
org.alfresco.repo.activities.feed.cleanup.FeedCleanerTestCaseSensitivity.class,
org.alfresco.repo.activities.SiteActivityTestCaseInsensitivity.class,
org.alfresco.repo.admin.registry.RegistryServiceImplTest.class
})
public class AppContext01TestSuite

View File

@@ -1,28 +1,28 @@
/*
* #%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 <http://www.gnu.org/licenses/>.
* #L%
*/
/*
* #%L
* Alfresco Repository
* %%
* Copyright (C) 2005 - 2022 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.repo.activities;
import static org.junit.Assert.*;
@@ -102,19 +102,11 @@ public abstract class AbstractSiteActivityTest
// AppToolId for site membership activities
private static String appToolId = "siteService"; // refer to SiteService
private static boolean membersAddedUpdated = false;
private static boolean membersRemoved = false;
private static boolean controlsCreated = false;
public AbstractSiteActivityTest()
{
}
@Before
public void setUp() throws Exception
{
applicationContext = ApplicationContextHelper.getApplicationContext();
String testid = ""+System.currentTimeMillis();
String testid = "" + System.currentTimeMillis();
// Let's shut down the scheduler so that we aren't competing with the scheduled versions of the post lookup and
// feed generator jobs
@@ -189,10 +181,6 @@ public abstract class AbstractSiteActivityTest
deleteSite(site1);
deleteSite(site2);
deleteSite(site3);
membersAddedUpdated = false;
membersRemoved = false;
controlsCreated = false;
}
protected void createSite(String siteId, boolean isPublic) throws Exception
@@ -332,51 +320,39 @@ public abstract class AbstractSiteActivityTest
}
assertEquals(expectedCount, activityService.getUserFeedEntries(userId, siteId, excludeThisUser, excludeOtherUsers, null, null).size());
}
@Test
public void testUserFeedControls() throws Exception
public void configureFeedControls() throws Exception
{
if (! controlsCreated)
{
// user 1 opts out of all activities for site 1
login(user1, USER_PW);
addFeedControl(site1, null);
// user 2 opts out of site membership activities (across all sites)
login(user2, USER_PW);
addFeedControl(null, appToolId);
// user 3 opts out of site membership activities for site 1 only
login(user3, USER_PW);
addFeedControl(site1, appToolId);
// TODO add more here, once we have more appToolIds
controlsCreated = true;
}
// user 1 opts out of all activities for site 1
login(user1, USER_PW);
addFeedControl(site1, null);
// user 2 opts out of site membership activities (across all sites)
login(user2, USER_PW);
addFeedControl(null, appToolId);
// user 3 opts out of site membership activities for site 1 only
login(user3, USER_PW);
addFeedControl(site1, appToolId);
// TODO add more here, once we have more appToolIds
}
@Test
public void testAddAndUpdateMemberships() throws Exception
public void addAndUpdateMemberships() throws Exception
{
if (! membersAddedUpdated)
{
login(ADMIN_USER, ADMIN_PW);
addAndUpdateMemberships(site1, true); // public site, include all users
addAndUpdateMemberships(site2, true); // private site, include all users
addAndUpdateMemberships(site3, false); // private site, do not include user 4
generateFeed();
membersAddedUpdated = true;
}
login(ADMIN_USER, ADMIN_PW);
addAndUpdateMemberships(site1, true); // public site, include all users
addAndUpdateMemberships(site2, true); // private site, include all users
addAndUpdateMemberships(site3, false); // private site, do not include user 4
generateFeed();
}
@Test
public void testGetSiteFeedsAfterAddAndUpdateMemberships() throws Exception
{
testAddAndUpdateMemberships();
addAndUpdateMemberships();
login(ADMIN_USER, ADMIN_PW);
@@ -400,14 +376,9 @@ public abstract class AbstractSiteActivityTest
// ignore
}
}
@Test
public void testRemoveMemberships() throws Exception
public void removeMemberships() throws Exception
{
if (! membersRemoved)
{
testAddAndUpdateMemberships();
login(ADMIN_USER, ADMIN_PW);
removeMemberships(site1, true);
@@ -415,9 +386,6 @@ public abstract class AbstractSiteActivityTest
removeMemberships(site3, false);
generateFeed();
membersRemoved = true;
}
}
protected void addAndUpdateMemberships(String siteId, boolean includeUser4) throws Exception
@@ -456,8 +424,8 @@ public abstract class AbstractSiteActivityTest
@Test
public void testGetSiteFeedsAfterRemoveMemberships() throws Exception
{
testAddAndUpdateMemberships();
testRemoveMemberships();
addAndUpdateMemberships();
removeMemberships();
login(ADMIN_USER, ADMIN_PW);
@@ -493,11 +461,11 @@ public abstract class AbstractSiteActivityTest
}
@Test
public void testGetUserFeedsAfter() throws Exception
public void testGetUserFeedsAfterApplyingFeedControls() throws Exception
{
testUserFeedControls();
testAddAndUpdateMemberships();
testRemoveMemberships();
configureFeedControls();
addAndUpdateMemberships();
removeMemberships();
// as admin
@@ -506,22 +474,23 @@ public abstract class AbstractSiteActivityTest
// site 1, with 4 users, each with 1 join, 1 role change = 4x2 = 8
// site 2, with 4 users, each with 1 join, 1 role change = 4x2 = 8
// site 3, with 3 users, each with 1 join, 1 role change = 3x2 = 6
// Every user is removed from sites so in its feed it sees the removal for each site
// user 1 belongs to 3 sites = (2x8)+(1x6) = 22
// user 2 belongs to 3 sites = (2x8)+(1x6) = 22
// user 3 belongs to 3 sites = (2x8)+(1x6) = 22
// user 4 belongs to 2 sites = (2x8) = 16
getUserFeed(user1, true, 14); // 14 = (22 - 8) due to feed control - exclude site 1
// user 1 belongs to 3 sites and is removed from 3 sites = (2x8)+(1x6)+3 = 25
// user 2 belongs to 3 sites and is removed from 3 sites = (2x8)+(1x6)+3 = 25
// user 3 belongs to 3 sites and is removed from 3 sites = (2x8)+(1x6)+3 = 25
// user 4 belongs to 2 sites and is removed from 3 sites = (2x8)+2 = 18
getUserFeed(user1, true, 16); // 16 = (25 - 9) due to feed control - exclude site 1 (4 joins, 4 changes, 1 removal)
getUserFeed(user2, true, 0); // 0 = due to feed control - exclude site membership activities (across all sites)
getUserFeed(user3, true, 14); // 14 = (22 - 8) due to feed control - exclude site membership activities for site 1
getUserFeed(user4, true, 16); // 16 = no feed control
getUserFeed(user3, true, 16); // 16 = (25 - 9) due to feed control - exclude site membership activities for site 1
getUserFeed(user4, true, 18); // 18 = no feed control
// as user1
login(user1, USER_PW);
getUserFeed(user1, false, 14);
getUserFeed(user1, false, 16);
// as user2
@@ -529,7 +498,7 @@ public abstract class AbstractSiteActivityTest
try
{
getUserFeed(user1, true, 14);
getUserFeed(user1, true, 16);
fail("User feed should only be accessible to user or an admin");
}
@@ -543,12 +512,12 @@ public abstract class AbstractSiteActivityTest
login(user1, USER_PW);
getUserFeed(null, site1, false, false, false, 0);
getUserFeed(null, site2, false, false, false, 8);
getUserFeed(null, site3, false, false, false, 6);
getUserFeed(null, site2, false, false, false, 9);
getUserFeed(null, site3, false, false, false, 7);
getUserFeed(null, null, false, false, false, 14); // no filter
getUserFeed(null, null, false, false, false, 16); // no filter
getUserFeed(null, null, false, true, false, 12); // exclude any from user1
getUserFeed(null, null, false, false, true, 2); // exclude all except user1
getUserFeed(null, null, false, false, true, 4); // exclude all except user1
getUserFeed(null, null, false, true, true, 0); // exclude all (NOOP)
// TODO - add more (eg. other non-admin user activities)

View File

@@ -4,27 +4,32 @@
* %%
* Copyright (C) 2005 - 2021 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
* 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.repo.domain.permissions;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
@@ -61,23 +66,26 @@ import org.alfresco.service.cmr.security.PermissionService;
import org.alfresco.service.namespace.QName;
import org.alfresco.util.ApplicationContextHelper;
import org.alfresco.util.Pair;
import org.alfresco.util.test.junitrules.RetryAtMostRule;
import org.alfresco.util.test.junitrules.RetryAtMostRule.RetryAtMost;
import org.junit.After;
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.context.ApplicationContext;
import org.springframework.dao.ConcurrencyFailureException;
import junit.framework.TestCase;
/**
* Test class for {@link FixedAclUpdater}
*
*
* @author Andreea Dragoi
* @author sglover
* @since 4.2.7
*
*/
public class FixedAclUpdaterTest extends TestCase
public class FixedAclUpdaterTest
{
private static final Logger LOG = LoggerFactory.getLogger(FixedAclUpdaterTest.class);
@@ -103,7 +111,10 @@ public class FixedAclUpdaterTest extends TestCase
private static String TEST_GROUP_NAME_FULL = PermissionService.GROUP_PREFIX + TEST_GROUP_NAME;
private static String DEFAULT_PERMISSION = PermissionService.CONTRIBUTOR;
@Override
@Rule
public RetryAtMostRule retryAtMostRule = new RetryAtMostRule();
@Before
public void setUp() throws Exception
{
ctx = ApplicationContextHelper.getApplicationContext();
@@ -126,7 +137,7 @@ public class FixedAclUpdaterTest extends TestCase
setFixedAclMaxTransactionTime(permissionsDaoComponent, homeFolderNodeRef, maxTransactionTime);
}
@Override
@After
public void tearDown() throws Exception
{
AuthenticationUtil.clearCurrentSecurityContext();
@@ -202,6 +213,7 @@ public class FixedAclUpdaterTest extends TestCase
* Test setting permissions explicitly as async
*/
@Test
@RetryAtMost(3)
public void testAsync()
{
NodeRef folderRef = createFolderHierarchyInRootForFolderTests("testAsyncFolder");
@@ -248,6 +260,7 @@ public class FixedAclUpdaterTest extends TestCase
* MNT-21847 - Create a new content in folder that has the aspect applied
*/
@Test
@RetryAtMost(3)
public void testAsyncWithNodeCreation()
{
NodeRef folderRef = createFolderHierarchyInRootForFolderTests("testAsyncWithNodeCreationFolder");
@@ -278,6 +291,7 @@ public class FixedAclUpdaterTest extends TestCase
* MNT-22009 - Delete node that has the aspect applied before job runs
*/
@Test
@RetryAtMost(3)
public void testAsyncWithNodeDeletion()
{
NodeRef folderRef = createFolderHierarchyInRootForFolderTests("testAsyncWithNodeDeletionFolder");
@@ -368,6 +382,7 @@ public class FixedAclUpdaterTest extends TestCase
* MNT-22040 - Copy node that has the aspect applied before job runs
*/
@Test
@RetryAtMost(3)
public void testAsyncWithNodeCopy()
{
NodeRef folderRef = createFolderHierarchyInRootForFolderTests("testAsyncWithNodeCopyOriginFolder");
@@ -447,6 +462,7 @@ public class FixedAclUpdaterTest extends TestCase
* Copy node that has the aspect to another folder that also has the aspect applied before job runs
*/
@Test
@RetryAtMost(3)
public void testAsyncWithNodeCopyToPendingFolder()
{
NodeRef folderRef = createFolderHierarchyInRootForFolderTests("testAsyncWithNodeCopyOriginFolder");
@@ -538,6 +554,7 @@ public class FixedAclUpdaterTest extends TestCase
* runs
*/
@Test
@RetryAtMost(3)
public void testAsyncWithNodeCopyParentToChildPendingFolder()
{
NodeRef folderRef = createFolderHierarchyInRootForFolderTests("testAsyncWithNodeCopyOriginFolder");
@@ -649,6 +666,7 @@ public class FixedAclUpdaterTest extends TestCase
* runs
*/
@Test
@RetryAtMost(3)
public void testAsyncWithNodeMoveChildToChildPendingFolder()
{
NodeRef folderRef = createFolderHierarchyInRootForFolderTests("testAsyncWithNodeMoveChildToChildPendingFolderOrigin");
@@ -734,6 +752,7 @@ public class FixedAclUpdaterTest extends TestCase
* ACL
*/
@Test
@RetryAtMost(3)
public void testAsyncWithErrorsForceSharedACL()
{
NodeRef folderRef = createFolderHierarchyInRootForFolderTests("testAsyncWithErrorsForceSharedACL");
@@ -792,6 +811,7 @@ public class FixedAclUpdaterTest extends TestCase
* MNT-22040 - Move node that has the aspect applied before job runs
*/
@Test
@RetryAtMost(3)
public void testAsyncWithNodeMove()
{
NodeRef folderRef = createFolderHierarchyInRootForFolderTests("testAsyncWithNodeMoveOriginFolder");
@@ -868,6 +888,7 @@ public class FixedAclUpdaterTest extends TestCase
* Move node that has the aspect to another folder that also has the aspect applied before job runs
*/
@Test
@RetryAtMost(3)
public void testAsyncWithNodeMoveToPendingFolder()
{
NodeRef folderRef = createFolderHierarchyInRootForFolderTests("testAsyncWithNodeMoveOriginFolder");
@@ -956,6 +977,7 @@ public class FixedAclUpdaterTest extends TestCase
* Lock node that has the aspect applied before job runs
*/
@Test
@RetryAtMost(3)
public void testAsyncWithNodeLock()
{
NodeRef folderRef = createFolderHierarchyInRootForFileTests("testAsyncWithNodeLockFolder");
@@ -985,6 +1007,7 @@ public class FixedAclUpdaterTest extends TestCase
* Checkout a node for editing that has the aspect applied before job runs
*/
@Test
@RetryAtMost(3)
public void testAsyncWithNodeCheckout()
{
NodeRef folderRef = createFolderHierarchyInRootForFileTests("testAsyncWithNodeCheckoutFolder");
@@ -1015,6 +1038,7 @@ public class FixedAclUpdaterTest extends TestCase
* Update the permissions of a node that has the aspect applied (new permissions: fixed)
*/
@Test
@RetryAtMost(3)
public void testAsyncWithNodeUpdatePermissionsFixed()
{
NodeRef folderRef = createFolderHierarchyInRootForFolderTests("testAsyncWithNodeUpdatePermissionsFixedFolder");
@@ -1056,6 +1080,7 @@ public class FixedAclUpdaterTest extends TestCase
* Update the permissions of a node that has the aspect applied (new permissions: shared)
*/
@Test
@RetryAtMost(3)
public void testAsyncWithNodeUpdatePermissionsShared()
{
NodeRef folderRef = createFolderHierarchyInRootForFolderTests("testAsyncWithNodeUpdatePermissionsSharedFolder");
@@ -1094,6 +1119,7 @@ public class FixedAclUpdaterTest extends TestCase
* Update the permissions of the parent of a node that has the aspect applied (new permissions: fixed)
*/
@Test
@RetryAtMost(3)
public void testAsyncWithParentUpdatePermissionsFixed()
{
NodeRef folderRef = createFolderHierarchyInRootForFolderTests("testAsyncWithParentUpdatePermissionsFixedFolder");
@@ -1135,6 +1161,7 @@ public class FixedAclUpdaterTest extends TestCase
* Update the permissions of the parent of a node that has the aspect applied (new permissions: shared)
*/
@Test
@RetryAtMost(3)
public void testAsyncWithParentUpdatePermissionsShared()
{
NodeRef folderRef = createFolderHierarchyInRootForFolderTests("testAsyncWithParentUpdatePermissionsSharedFolder");
@@ -1173,6 +1200,7 @@ public class FixedAclUpdaterTest extends TestCase
}
@Test
@RetryAtMost(3)
public void testAsyncCascadeUpdatePermissions()
{
NodeRef folderRef = createFolderHierarchyInRootForFolderTests("testAsyncCascadeUpdatePermissionsFolder");
@@ -1225,6 +1253,7 @@ public class FixedAclUpdaterTest extends TestCase
* Update the content of a node that has the aspect applied before job runs
*/
@Test
@RetryAtMost(3)
public void testAsyncWithNodeContentUpdate()
{
NodeRef folderRef = createFolderHierarchyInRootForFileTests("testAsyncWithNodeContentUpdateFolder");
@@ -1257,6 +1286,7 @@ public class FixedAclUpdaterTest extends TestCase
* Test setting permissions concurrently to actually cause the expected concurrency exception
*/
@Test
@RetryAtMost(3)
public void testAsyncConcurrentPermissionsUpdate() throws Throwable
{
NodeRef folderRef = createFolderHierarchyInRootForFolderTests("testAsyncConcurrentPermissionsUpdateFolder");
@@ -1328,6 +1358,7 @@ public class FixedAclUpdaterTest extends TestCase
* exception but the job should be able to recover
*/
@Test
@RetryAtMost(3)
public void testAsyncConcurrentUpdateAndJob() throws Throwable
{
NodeRef folderRef = createFolderHierarchyInRootForFolderTests("testAsyncConcurrentUpdateAndJobFolder");
@@ -1802,7 +1833,7 @@ public class FixedAclUpdaterTest extends TestCase
/**
* Creates a level in folder/file hierarchy. Intermediate levels will contain folders and last ones files
*
*
* @param fileFolderService
* @param parent
* - parent node of the of hierarchy level

View File

@@ -99,7 +99,7 @@ public class SecurityTestSuite extends TestSuite
suite.addTest(new JUnit4TestAdapter(HomeFolderProviderSynchronizerTest.class));
suite.addTest(new JUnit4TestAdapter(AlfrescoSSLSocketFactoryTest.class));
suite.addTestSuite(FixedAclUpdaterTest.class);
suite.addTest(new JUnit4TestAdapter(FixedAclUpdaterTest.class));
suite.addTestSuite(DefaultRemoteUserMapperTest.class);
suite.addTestSuite(IdentityServiceRemoteUserMapperTest.class);

View File

@@ -2,7 +2,7 @@
* #%L
* Alfresco Repository
* %%
* Copyright (C) 2005 - 2020 Alfresco Software Limited
* Copyright (C) 2005 - 2022 Alfresco Software Limited
* %%
* This file is part of the Alfresco software.
* If the software was purchased under a paid Alfresco license, the terms of
@@ -29,10 +29,16 @@ import static java.util.Collections.emptySet;
import static java.util.stream.Collectors.toSet;
import static junit.framework.TestCase.assertEquals;
import static org.reflections.scanners.Scanners.MethodsAnnotated;
import static org.reflections.scanners.Scanners.SubTypes;
import static org.reflections.scanners.Scanners.TypesAnnotated;
import java.lang.annotation.Annotation;
import java.lang.reflect.Method;
import java.lang.reflect.Modifier;
import java.util.Arrays;
import java.util.HashSet;
import java.util.Objects;
import java.util.Set;
import java.util.stream.Stream;
@@ -49,6 +55,7 @@ import org.junit.experimental.categories.Category;
import org.junit.runners.Suite.SuiteClasses;
import org.reflections.Reflections;
import org.reflections.scanners.MethodAnnotationsScanner;
import org.reflections.scanners.Scanners;
import org.reflections.scanners.SubTypesScanner;
import org.reflections.scanners.TypeAnnotationsScanner;
@@ -69,7 +76,7 @@ public class OmittedTestClassFinderUnitTest
public void checkTestClassesReferencedInTestSuites()
{
// We assume that all of our tests are in org.alfresco.
Reflections reflections = new Reflections("org.alfresco", new MethodAnnotationsScanner(), new TypeAnnotationsScanner(), new SubTypesScanner());
Reflections reflections = new Reflections("org.alfresco", MethodsAnnotated, TypesAnnotated, SubTypes);
// Find the test classes which are not in test suites.
Set<String> testClasses = getTestClassesOnPath(reflections);
@@ -162,13 +169,14 @@ public class OmittedTestClassFinderUnitTest
* @param annotation The class of the annotation to look for.
* @return The set of canonical names of classes containing methods annotated with the annotation.
*/
private Set<String> findClassesWithMethodAnnotation(Reflections reflections, Class annotation)
private Set<String> findClassesWithMethodAnnotation(Reflections reflections, Class<? extends Annotation> annotation)
{
return reflections.getStore()
.get(MethodAnnotationsScanner.class, annotation.getName())
return reflections.getMethodsAnnotatedWith(annotation)
.stream()
// Get the class name from the method name.
.map(methodName -> methodName.split("\\.[^\\.]+\\(")[0])
.map(Method::getDeclaringClass)
.flatMap(c -> Stream.concat(Stream.of(c), reflections.getSubTypesOf(c).stream()))
.map(Class::getCanonicalName)
.filter(Objects::nonNull)
.collect(toSet());
}

View File

@@ -0,0 +1,132 @@
/*
* #%L
* Alfresco Repository
* %%
* Copyright (C) 2005 - 2022 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.util.test.junitrules;
import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.junit.Test;
import org.junit.rules.TestRule;
import org.junit.runner.Description;
import org.junit.runners.model.Statement;
/**
* This JUnit rule can be used to turn existing test code into retryable tests.
* The test methods marked with the {@link RetryAtMost} annotation will be attempted at most the specified
* amount of times, stopping at the first successful execution.
*
* @author Domenico Sibilio
*/
public class RetryAtMostRule implements TestRule
{
private static final Log LOG = LogFactory.getLog(RetryAtMostRule.class);
@Override
public Statement apply(final Statement statement, final Description description)
{
RetryAtMost retryAtMost = description.getAnnotation(RetryAtMost.class);
if (retryAtMost != null)
{
return new RetryAtMostTestStatement(statement, description, retryAtMost.value());
}
return statement;
}
private static class RetryAtMostTestStatement extends Statement
{
private final Statement statement;
private final Description description;
private final int retryCount;
private RetryAtMostTestStatement(Statement statement, Description description, int retryCount)
{
this.statement = statement;
this.description = description;
this.retryCount = retryCount;
}
@Override
public void evaluate() throws Throwable
{
validate();
for (int i = 0; i < retryCount; i++)
{
try
{
LOG.debug(
"Retryable testing configured for method: " + description.getMethodName()
+ " // Attempt #" + (i + 1));
statement.evaluate();
break; // stop at the first successful execution
}
catch (Throwable t)
{
// ignore failed test runs unless it's the last possible execution
if (isLastExecution(i))
{
throw t;
}
}
}
}
private void validate()
{
if (retryCount < 1)
{
String methodName = description.getMethodName();
throw new IllegalArgumentException(
"Invalid value for @RetryAtMost on method " + methodName + ": " + retryCount + " is less than 1.");
}
}
private boolean isLastExecution(int i)
{
return i == retryCount - 1;
}
}
/**
* This annotation is a marker used to identify a JUnit &#64;{@link Test} method as a retryable test.
*/
@Target(ElementType.METHOD)
@Retention(RetentionPolicy.RUNTIME)
@Documented
public @interface RetryAtMost
{
/**
* @return The amount of times a test will be attempted, at most.
*/
int value() default 1;
}
}

View File

@@ -0,0 +1,138 @@
/*
* #%L
* Alfresco Repository
* %%
* Copyright (C) 2005 - 2022 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.util.test.junitrules;
import static org.junit.Assert.assertSame;
import static org.mockito.Mockito.doThrow;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.verifyNoInteractions;
import java.lang.annotation.Annotation;
import java.util.concurrent.atomic.AtomicInteger;
import org.alfresco.util.test.junitrules.RetryAtMostRule.RetryAtMost;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.TestName;
import org.junit.runner.Description;
import org.junit.runner.RunWith;
import org.junit.runners.model.Statement;
import org.mockito.Mock;
import org.mockito.junit.MockitoJUnitRunner;
/**
* Test class for {@link RetryAtMostRule}.
*
* @author Domenico Sibilio
*/
@RunWith(MockitoJUnitRunner.class)
public class RetryAtMostRuleTest
{
private static final String ANNOTATION_WITH_NEGATIVE_VALUE = "annotationRetryAtMostNegativeTimes";
private static final String ANNOTATION_RETRY_AT_MOST_THRICE = "annotationRetryAtMostThrice";
private static final AtomicInteger EXECUTION_COUNT = new AtomicInteger(0);
@Rule
public RetryAtMostRule retryAtMostRule = new RetryAtMostRule();
@Rule
public TestName testNameRule = new TestName();
@Mock
private Statement statementMock;
@Test
public void testSucceedOnFirstAttempt() throws Throwable
{
Description description = Description.createTestDescription(RetryAtMostRuleTest.class.getSimpleName(),
testNameRule.getMethodName(), getAnnotationByMethodName(ANNOTATION_RETRY_AT_MOST_THRICE));
Statement statement = retryAtMostRule.apply(statementMock, description);
statement.evaluate();
verify(statementMock, times(1)).evaluate();
}
@Test
public void testSucceedOnSecondAttempt() throws Throwable
{
doThrow(new AssertionError("First execution should fail")).doNothing().when(statementMock).evaluate();
Description description = Description.createTestDescription(RetryAtMostRuleTest.class.getSimpleName(),
testNameRule.getMethodName(), getAnnotationByMethodName(ANNOTATION_RETRY_AT_MOST_THRICE));
Statement statement = retryAtMostRule.apply(statementMock, description);
statement.evaluate();
verify(statementMock, times(2)).evaluate();
}
@Test
@RetryAtMost(3)
public void testSucceedOnThirdAttempt()
{
int currentExecution = EXECUTION_COUNT.incrementAndGet();
assertSame("This test should be executed 3 times", 3, currentExecution);
}
@Test(expected = AssertionError.class)
public void testFailAfterMaxAttempts() throws Throwable
{
doThrow(new AssertionError("All executions should fail")).when(statementMock).evaluate();
Description description = Description.createTestDescription(RetryAtMostRuleTest.class.getSimpleName(),
testNameRule.getMethodName(), getAnnotationByMethodName(ANNOTATION_RETRY_AT_MOST_THRICE));
Statement statement = retryAtMostRule.apply(statementMock, description);
statement.evaluate();
}
@Test(expected = IllegalArgumentException.class)
public void testInvalidRetryAtMostTimes() throws Throwable
{
Description description = Description.createTestDescription(RetryAtMostRuleTest.class.getSimpleName(),
testNameRule.getMethodName(), getAnnotationByMethodName(ANNOTATION_WITH_NEGATIVE_VALUE));
Statement statement = retryAtMostRule.apply(statementMock, description);
statement.evaluate();
verifyNoInteractions(statementMock);
}
private Annotation getAnnotationByMethodName(String methodName) throws NoSuchMethodException
{
return this.getClass().getMethod(methodName).getAnnotation(RetryAtMost.class);
}
@RetryAtMost(-1)
public void annotationRetryAtMostNegativeTimes()
{
// intentionally empty
}
@RetryAtMost(3)
public void annotationRetryAtMostThrice()
{
// intentionally empty
}
}