mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-09-10 14:11:58 +00:00
Compare commits
25 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
67d3159650 | ||
|
ec8a760122 | ||
|
3d0ceca6da | ||
|
8c25d1f7e6 | ||
|
1e0972eaa1 | ||
|
616c666114 | ||
|
8520548e72 | ||
|
63f7f07465 | ||
|
35a3ff8032 | ||
|
695bf90891 | ||
|
d4dcc4fe2c | ||
|
ee44b6afa2 | ||
|
28b580b9fc | ||
|
7dc7a743f5 | ||
|
4bc92df38e | ||
|
048df99d91 | ||
|
b477d122f3 | ||
|
0cc2fe46cf | ||
|
671e1934bd | ||
|
d0452aaddb | ||
|
464db778fa | ||
|
905e813aa4 | ||
|
b55ba47c5e | ||
|
0607bb1485 | ||
|
f7c8298308 |
20
.travis.yml
20
.travis.yml
@@ -32,7 +32,7 @@ env:
|
||||
|
||||
stages:
|
||||
- name: test
|
||||
if: commit_message !~ /\[skip tests\]/
|
||||
if: commit_message !~ /\[skip tests\]/ AND commit_message !~ /\[force[^\]]*\]/
|
||||
- name: release
|
||||
if: commit_message !~ /\[no release\]/ AND (branch = master OR branch =~ /release\/.*/) AND type != pull_request AND fork = false
|
||||
- name: update_downstream
|
||||
@@ -60,7 +60,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.7
|
||||
- docker run -d -p 8090:8090 -e JAVA_OPTS=" -Xms256m -Xmx256m" alfresco/alfresco-transform-core-aio:2.6.0-A2
|
||||
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.7
|
||||
- docker run -d -p 8090:8090 -e JAVA_OPTS=" -Xms256m -Xmx256m" alfresco/alfresco-transform-core-aio:2.6.0-A2
|
||||
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.7
|
||||
- docker run -d -p 8090:8090 -e JAVA_OPTS=" -Xms256m -Xmx256m" alfresco/alfresco-transform-core-aio:2.6.0-A2
|
||||
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.7
|
||||
- docker run -d -p 8090:8090 -e JAVA_OPTS=" -Xms256m -Xmx256m" alfresco/alfresco-transform-core-aio:2.6.0-A2
|
||||
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.7
|
||||
- docker run -d -p 8090:8090 -e JAVA_OPTS=" -Xms256m -Xmx256m" alfresco/alfresco-transform-core-aio:2.6.0-A2
|
||||
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.7
|
||||
- docker run -d -p 8090:8090 -e JAVA_OPTS=" -Xms256m -Xmx256m" alfresco/alfresco-transform-core-aio:2.6.0-A2
|
||||
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.7
|
||||
- docker run -d -p 8090:8090 -e JAVA_OPTS=" -Xms256m -Xmx256m" alfresco/alfresco-transform-core-aio:2.6.0-A2
|
||||
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.7
|
||||
- docker run -d -p 8090:8090 -e JAVA_OPTS=" -Xms256m -Xmx256m" alfresco/alfresco-transform-core-aio:2.6.0-A2
|
||||
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.7
|
||||
- docker run -d -p 8090:8090 -e JAVA_OPTS=" -Xms256m -Xmx256m" alfresco/alfresco-transform-core-aio:2.6.0-A2
|
||||
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"
|
||||
|
@@ -7,7 +7,7 @@
|
||||
<parent>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-community-repo-amps</artifactId>
|
||||
<version>23.1.0.1</version>
|
||||
<version>23.1.0.8</version>
|
||||
</parent>
|
||||
|
||||
<modules>
|
||||
|
@@ -7,7 +7,7 @@
|
||||
<parent>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-governance-services-community-parent</artifactId>
|
||||
<version>23.1.0.1</version>
|
||||
<version>23.1.0.8</version>
|
||||
</parent>
|
||||
|
||||
<modules>
|
||||
|
@@ -7,7 +7,7 @@
|
||||
<parent>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-governance-services-automation-community-repo</artifactId>
|
||||
<version>23.1.0.1</version>
|
||||
<version>23.1.0.8</version>
|
||||
</parent>
|
||||
|
||||
<build>
|
||||
|
@@ -7,7 +7,7 @@
|
||||
<parent>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-governance-services-community-parent</artifactId>
|
||||
<version>23.1.0.1</version>
|
||||
<version>23.1.0.8</version>
|
||||
</parent>
|
||||
|
||||
<modules>
|
||||
|
@@ -1,4 +1,4 @@
|
||||
TRANSFORMERS_TAG=2.5.7
|
||||
TRANSFORMERS_TAG=2.6.0-A2
|
||||
SOLR6_TAG=2.0.3
|
||||
POSTGRES_TAG=13.3
|
||||
ACTIVEMQ_TAG=5.16.1
|
||||
|
@@ -8,7 +8,7 @@
|
||||
<parent>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-governance-services-community-repo-parent</artifactId>
|
||||
<version>23.1.0.1</version>
|
||||
<version>23.1.0.8</version>
|
||||
</parent>
|
||||
|
||||
<properties>
|
||||
|
@@ -3,8 +3,8 @@
|
||||
#
|
||||
|
||||
# Version label
|
||||
version.major=7
|
||||
version.minor=0
|
||||
version.major=23
|
||||
version.minor=1
|
||||
version.revision=0
|
||||
version.label=
|
||||
|
||||
|
@@ -7,7 +7,7 @@
|
||||
<parent>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-governance-services-community-repo-parent</artifactId>
|
||||
<version>23.1.0.1</version>
|
||||
<version>23.1.0.8</version>
|
||||
</parent>
|
||||
|
||||
<build>
|
||||
|
@@ -7,7 +7,7 @@
|
||||
<parent>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-community-repo</artifactId>
|
||||
<version>23.1.0.1</version>
|
||||
<version>23.1.0.8</version>
|
||||
</parent>
|
||||
|
||||
<modules>
|
||||
|
@@ -8,7 +8,7 @@
|
||||
<parent>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-community-repo-amps</artifactId>
|
||||
<version>23.1.0.1</version>
|
||||
<version>23.1.0.8</version>
|
||||
</parent>
|
||||
|
||||
<properties>
|
||||
|
@@ -7,7 +7,7 @@
|
||||
<parent>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-community-repo</artifactId>
|
||||
<version>23.1.0.1</version>
|
||||
<version>23.1.0.8</version>
|
||||
</parent>
|
||||
|
||||
<dependencies>
|
||||
|
@@ -7,7 +7,7 @@
|
||||
<parent>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-community-repo</artifactId>
|
||||
<version>23.1.0.1</version>
|
||||
<version>23.1.0.8</version>
|
||||
</parent>
|
||||
|
||||
<properties>
|
||||
|
@@ -7,7 +7,7 @@
|
||||
<parent>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-community-repo</artifactId>
|
||||
<version>23.1.0.1</version>
|
||||
<version>23.1.0.8</version>
|
||||
</parent>
|
||||
|
||||
<dependencies>
|
||||
|
@@ -9,6 +9,6 @@
|
||||
<parent>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-community-repo-packaging</artifactId>
|
||||
<version>23.1.0.1</version>
|
||||
<version>23.1.0.8</version>
|
||||
</parent>
|
||||
</project>
|
||||
|
@@ -7,7 +7,7 @@
|
||||
<parent>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-community-repo-packaging</artifactId>
|
||||
<version>23.1.0.1</version>
|
||||
<version>23.1.0.8</version>
|
||||
</parent>
|
||||
|
||||
<properties>
|
||||
|
@@ -7,7 +7,7 @@
|
||||
<parent>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-community-repo</artifactId>
|
||||
<version>23.1.0.1</version>
|
||||
<version>23.1.0.8</version>
|
||||
</parent>
|
||||
|
||||
<modules>
|
||||
|
@@ -1,4 +1,4 @@
|
||||
TRANSFORMERS_TAG=2.5.7
|
||||
TRANSFORMERS_TAG=2.6.0-A2
|
||||
SOLR6_TAG=2.0.3
|
||||
POSTGRES_TAG=13.3
|
||||
ACTIVEMQ_TAG=5.16.1
|
||||
|
@@ -6,7 +6,7 @@
|
||||
<parent>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-community-repo-packaging</artifactId>
|
||||
<version>23.1.0.1</version>
|
||||
<version>23.1.0.8</version>
|
||||
</parent>
|
||||
|
||||
<modules>
|
||||
|
@@ -9,7 +9,7 @@
|
||||
<parent>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-community-repo-tests</artifactId>
|
||||
<version>23.1.0.1</version>
|
||||
<version>23.1.0.8</version>
|
||||
</parent>
|
||||
|
||||
<developers>
|
||||
|
@@ -9,7 +9,7 @@
|
||||
<parent>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-community-repo-tests</artifactId>
|
||||
<version>23.1.0.1</version>
|
||||
<version>23.1.0.8</version>
|
||||
</parent>
|
||||
|
||||
<developers>
|
||||
|
@@ -9,7 +9,7 @@
|
||||
<parent>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-community-repo-tests</artifactId>
|
||||
<version>23.1.0.1</version>
|
||||
<version>23.1.0.8</version>
|
||||
</parent>
|
||||
|
||||
<developers>
|
||||
|
@@ -9,7 +9,7 @@
|
||||
<parent>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-community-repo-tests</artifactId>
|
||||
<version>23.1.0.1</version>
|
||||
<version>23.1.0.8</version>
|
||||
</parent>
|
||||
|
||||
<developers>
|
||||
|
@@ -9,7 +9,7 @@
|
||||
<parent>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-community-repo-tests</artifactId>
|
||||
<version>23.1.0.1</version>
|
||||
<version>23.1.0.8</version>
|
||||
</parent>
|
||||
|
||||
<developers>
|
||||
|
@@ -7,7 +7,7 @@
|
||||
<parent>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-community-repo-packaging</artifactId>
|
||||
<version>23.1.0.1</version>
|
||||
<version>23.1.0.8</version>
|
||||
</parent>
|
||||
|
||||
<properties>
|
||||
|
10
pom.xml
10
pom.xml
@@ -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>23.1.0.1</version>
|
||||
<version>23.1.0.8</version>
|
||||
<packaging>pom</packaging>
|
||||
<name>Alfresco Community Repo Parent</name>
|
||||
|
||||
@@ -23,11 +23,11 @@
|
||||
</modules>
|
||||
|
||||
<properties>
|
||||
<acs.version.major>7</acs.version.major>
|
||||
<acs.version.minor>2</acs.version.minor>
|
||||
<acs.version.major>23</acs.version.major>
|
||||
<acs.version.minor>1</acs.version.minor>
|
||||
<acs.version.revision>0</acs.version.revision>
|
||||
<acs.version.label />
|
||||
<amp.min.version>${acs.version.major}.0.0</amp.min.version>
|
||||
<amp.min.version>${acs.version.major}.1.0</amp.min.version>
|
||||
|
||||
<version.edition>Community</version.edition>
|
||||
<licenseName>community</licenseName>
|
||||
@@ -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>23.1.0.1</tag>
|
||||
<tag>23.1.0.8</tag>
|
||||
</scm>
|
||||
|
||||
<distributionManagement>
|
||||
|
@@ -7,7 +7,7 @@
|
||||
<parent>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-community-repo</artifactId>
|
||||
<version>23.1.0.1</version>
|
||||
<version>23.1.0.8</version>
|
||||
</parent>
|
||||
|
||||
<dependencies>
|
||||
|
@@ -7,7 +7,7 @@
|
||||
<parent>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-community-repo</artifactId>
|
||||
<version>23.1.0.1</version>
|
||||
<version>23.1.0.8</version>
|
||||
</parent>
|
||||
|
||||
<dependencies>
|
||||
|
@@ -25,6 +25,9 @@
|
||||
*/
|
||||
package org.alfresco.opencmis;
|
||||
|
||||
import static java.time.Duration.of;
|
||||
import static java.time.temporal.ChronoUnit.MILLIS;
|
||||
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
@@ -61,7 +64,7 @@ import org.alfresco.util.ApplicationContextHelper;
|
||||
import org.alfresco.util.FileFilterMode.Client;
|
||||
import org.alfresco.util.GUID;
|
||||
import org.alfresco.util.TempFileProvider;
|
||||
import org.alfresco.util.testing.category.FrequentlyFailingTests;
|
||||
import org.alfresco.util.TestHelper;
|
||||
import org.alfresco.util.testing.category.LuceneTests;
|
||||
import org.aopalliance.intercept.MethodInterceptor;
|
||||
import org.aopalliance.intercept.MethodInvocation;
|
||||
@@ -77,6 +80,7 @@ import org.apache.chemistry.opencmis.commons.data.ContentStream;
|
||||
import org.apache.chemistry.opencmis.commons.enums.BaseTypeId;
|
||||
import org.apache.chemistry.opencmis.commons.enums.BindingType;
|
||||
import org.apache.chemistry.opencmis.commons.enums.VersioningState;
|
||||
import org.apache.chemistry.opencmis.commons.exceptions.CmisRuntimeException;
|
||||
import org.apache.chemistry.opencmis.commons.exceptions.CmisStorageException;
|
||||
import org.apache.chemistry.opencmis.commons.impl.dataobjects.ContentStreamImpl;
|
||||
import org.apache.chemistry.opencmis.commons.impl.server.AbstractServiceFactory;
|
||||
@@ -87,6 +91,7 @@ import org.apache.chemistry.opencmis.server.shared.TempStoreOutputStreamFactory;
|
||||
import org.junit.experimental.categories.Category;
|
||||
import org.springframework.aop.framework.ProxyFactory;
|
||||
import org.springframework.context.ApplicationContext;
|
||||
import org.springframework.dao.ConcurrencyFailureException;
|
||||
|
||||
/**
|
||||
* Tests basic local CMIS interaction
|
||||
@@ -467,7 +472,6 @@ public class OpenCmisLocalTest extends TestCase
|
||||
* This test would have fit better within CheckOutCheckInServiceImplTest but
|
||||
* was added here to make use of existing methods
|
||||
*/
|
||||
@Category(FrequentlyFailingTests.class) // ACS-962
|
||||
public void testCancelCheckoutWhileInCheckedOutState()
|
||||
{
|
||||
ServiceRegistry serviceRegistry = (ServiceRegistry) ctx.getBean(ServiceRegistry.SERVICE_REGISTRY);
|
||||
@@ -484,7 +488,7 @@ public class OpenCmisLocalTest extends TestCase
|
||||
|
||||
// Set file properties
|
||||
String docname = "myDoc-" + GUID.generate() + ".txt";
|
||||
Map<String, String> props = new HashMap<String, String>();
|
||||
Map<String, String> props = new HashMap<>();
|
||||
{
|
||||
props.put(PropertyIds.OBJECT_TYPE_ID, BaseTypeId.CMIS_DOCUMENT.value());
|
||||
props.put(PropertyIds.NAME, docname);
|
||||
@@ -501,7 +505,9 @@ public class OpenCmisLocalTest extends TestCase
|
||||
NodeRef doc1WorkingCopy = cociService.getWorkingCopy(doc1NodeRef);
|
||||
|
||||
/* Cancel Checkout */
|
||||
cociService.cancelCheckout(doc1WorkingCopy);
|
||||
TestHelper.waitForMethodToFinish(of(100, MILLIS), () ->
|
||||
cociService.cancelCheckout(doc1WorkingCopy),
|
||||
CmisRuntimeException.class, ConcurrencyFailureException.class);
|
||||
|
||||
/* Check if both the working copy and the document were deleted */
|
||||
NodeService nodeService = serviceRegistry.getNodeService();
|
||||
|
@@ -29,7 +29,6 @@ import static java.time.Duration.of;
|
||||
import static java.time.temporal.ChronoUnit.MILLIS;
|
||||
import static java.time.temporal.ChronoUnit.SECONDS;
|
||||
|
||||
import java.time.Duration;
|
||||
import java.util.concurrent.atomic.AtomicInteger;
|
||||
|
||||
import junit.framework.AssertionFailedError;
|
||||
@@ -44,6 +43,7 @@ import org.alfresco.service.namespace.QName;
|
||||
import org.alfresco.service.transaction.TransactionService;
|
||||
import org.alfresco.test_category.OwnJVMTestsCategory;
|
||||
import org.alfresco.util.ApplicationContextHelper;
|
||||
import org.alfresco.util.TestHelper;
|
||||
import org.alfresco.util.testing.category.DBTests;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
@@ -549,22 +549,22 @@ public class JobLockServiceTest extends TestCase
|
||||
|
||||
if (callback == null) throw new IllegalStateException();
|
||||
|
||||
waitForAssertion(of(100, MILLIS), () -> {
|
||||
TestHelper.waitForMethodToFinish(of(100, MILLIS), () -> {
|
||||
assertEquals(false,callback.released);
|
||||
assertEquals(0,callback.getIsActiveCount());
|
||||
});
|
||||
}, AssertionFailedError.class);
|
||||
|
||||
waitForAssertion(of(1, SECONDS), () -> {
|
||||
TestHelper.waitForMethodToFinish(of(1, SECONDS), () -> {
|
||||
assertEquals(false, callback.released);
|
||||
assertEquals(1, callback.getIsActiveCount());
|
||||
});
|
||||
}, AssertionFailedError.class);
|
||||
|
||||
callback.isActive = false;
|
||||
|
||||
waitForAssertion(of(2, SECONDS), () -> {
|
||||
TestHelper.waitForMethodToFinish(of(2, SECONDS), () -> {
|
||||
assertEquals(true, callback.released);
|
||||
assertEquals(2, callback.getIsActiveCount());
|
||||
});
|
||||
}, AssertionFailedError.class);
|
||||
}
|
||||
catch (IllegalArgumentException e)
|
||||
{
|
||||
@@ -621,43 +621,6 @@ public class JobLockServiceTest extends TestCase
|
||||
Logger.getLogger("org.alfresco.repo.lock").setLevel(saveLogLevel);
|
||||
}
|
||||
}
|
||||
|
||||
private static void waitForAssertion(Duration timeout, Runnable assertion)
|
||||
{
|
||||
logger.debug("Waiting for assertion to succeed.");
|
||||
final long lastStep = 10;
|
||||
final long delayMillis = timeout.toMillis() > lastStep ? timeout.toMillis() / lastStep : 1;
|
||||
|
||||
for (int s = 0; s <= lastStep; s++)
|
||||
{
|
||||
try
|
||||
{
|
||||
assertion.run();
|
||||
logger.debug("Assertion succeeded.");
|
||||
return;
|
||||
}
|
||||
catch (AssertionFailedError e)
|
||||
{
|
||||
if (s == lastStep)
|
||||
{
|
||||
logger.debug("Assertion failed. No more waiting.");
|
||||
throw e;
|
||||
}
|
||||
logger.debug("Assertion failed. Waiting until it succeeds.", e);
|
||||
}
|
||||
try
|
||||
{
|
||||
Thread.sleep(delayMillis);
|
||||
}
|
||||
catch (InterruptedException e)
|
||||
{
|
||||
Thread.currentThread().interrupt();
|
||||
fail("Thread has been interrupted.");
|
||||
}
|
||||
}
|
||||
|
||||
throw new IllegalStateException("Unexpected.");
|
||||
}
|
||||
|
||||
private class TestCallback implements JobLockRefreshCallback
|
||||
{
|
||||
|
@@ -29,8 +29,13 @@ package org.alfresco.util;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
import static org.junit.Assert.fail;
|
||||
|
||||
import java.time.Duration;
|
||||
import java.util.Arrays;
|
||||
import java.util.function.Supplier;
|
||||
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
|
||||
/**
|
||||
* A helper class to create a concise test.
|
||||
*
|
||||
@@ -39,6 +44,8 @@ import java.util.function.Supplier;
|
||||
*/
|
||||
public class TestHelper
|
||||
{
|
||||
private static final Log logger = LogFactory.getLog(TestHelper.class);
|
||||
|
||||
/**
|
||||
* Checks the thrown exception is the expected exception.
|
||||
*
|
||||
@@ -94,4 +101,59 @@ public class TestHelper
|
||||
|
||||
return t;
|
||||
}
|
||||
|
||||
/**
|
||||
* Waits for <b>{@code method}</b> to succeed until <b>({@code timeout})</b>.
|
||||
* <p>
|
||||
* If the method failed to succeed because of previous step of test is not finished yet,
|
||||
* it waits and re-executes the given method again.
|
||||
* This will continue until the method do not fail or the <b>{@code timeout}</b> has been reached.
|
||||
*
|
||||
* @param timeout max time of wait.
|
||||
* @param method the method that is called for retry.
|
||||
* @param expectedExceptions array of excepted exception.
|
||||
* @throws Exception after failing to finish given method with success.
|
||||
*/
|
||||
@SafeVarargs
|
||||
public static void waitForMethodToFinish(
|
||||
Duration timeout,
|
||||
Runnable method,
|
||||
Class<? extends Throwable> ... expectedExceptions)
|
||||
{
|
||||
logger.debug("Waiting for method to succeed.");
|
||||
final long lastStep = 10;
|
||||
final long delayMillis = timeout.toMillis() > lastStep ? timeout.toMillis() / lastStep : 1;
|
||||
|
||||
for (int step = 0; step <= lastStep; step++)
|
||||
{
|
||||
try
|
||||
{
|
||||
method.run();
|
||||
logger.debug("Method succeeded.");
|
||||
return;
|
||||
} catch (Throwable e)
|
||||
{
|
||||
if(Arrays.stream(expectedExceptions).noneMatch(expEx -> expEx.isInstance(e)))
|
||||
{
|
||||
throw e;
|
||||
}
|
||||
if (step == lastStep)
|
||||
{
|
||||
logger.debug("Method failed - no more waiting.");
|
||||
throw e;
|
||||
}
|
||||
logger.debug("Method failed. Waiting until it succeeds.", e);
|
||||
}
|
||||
try
|
||||
{
|
||||
Thread.sleep(delayMillis);
|
||||
} catch (InterruptedException e)
|
||||
{
|
||||
Thread.currentThread().interrupt();
|
||||
fail("Thread has been interrupted.");
|
||||
}
|
||||
}
|
||||
|
||||
throw new IllegalStateException("Unexpected.");
|
||||
}
|
||||
}
|
||||
|
@@ -33,7 +33,11 @@ git status
|
||||
git --no-pager diff pom.xml
|
||||
git add pom.xml
|
||||
|
||||
if git status --untracked-files=no --porcelain | grep -q '^' ; then
|
||||
if [[ "${TRAVIS_COMMIT_MESSAGE}" =~ \[force[^\]]*\] ]]; then
|
||||
FORCE_TOKEN=$(echo "${TRAVIS_COMMIT_MESSAGE}" | sed "s|^.*\(\[force[^]]*\]\).*$|\1|g")
|
||||
git commit --allow-empty -m "${FORCE_TOKEN} Update upstream version to ${VERSION}"
|
||||
git push
|
||||
elif git status --untracked-files=no --porcelain | grep -q '^' ; then
|
||||
git commit -m "Update upstream version to ${VERSION}"
|
||||
git push
|
||||
else
|
||||
|
Reference in New Issue
Block a user