Compare commits

...

129 Commits

Author SHA1 Message Date
Travis CI User
2a5f03889e [maven-release-plugin][skip ci] prepare release 14.107 2022-02-14 13:57:41 +00:00
kcichonczyk
0e11091d19 Add further tests for ReST integration tests (#945)
* [ACS-1982] Extended tests for REST integration tests
2022-02-14 14:08:54 +01:00
Travis CI User
3cb838865a [maven-release-plugin][skip ci] prepare for next development iteration 2022-02-14 10:54:30 +00:00
Travis CI User
f89d85b431 [maven-release-plugin][skip ci] prepare release 14.106 2022-02-14 10:54:27 +00:00
Sara
9d91ee4cae ACS-2557 Enable system-wide DAUs (#964) 2022-02-14 10:02:19 +00:00
Travis CI User
1e792eb625 [maven-release-plugin][skip ci] prepare for next development iteration 2022-02-11 15:59:25 +00:00
Travis CI User
3d881b9022 [maven-release-plugin][skip ci] prepare release 14.105 2022-02-11 15:59:21 +00:00
George Evangelopoulos
b890af95b4 Revert "ACS-2476 Bump Camel version to 3.8.0 (#957)" (#959)
This reverts commit 64b9564dc7.
2022-02-11 15:10:57 +00:00
Travis CI User
706aac3ffa [maven-release-plugin][skip ci] prepare for next development iteration 2022-02-11 12:26:55 +00:00
Travis CI User
22230ea04b [maven-release-plugin][skip ci] prepare release 14.104 2022-02-11 12:26:52 +00:00
Sara
798a3faa5b ACS-1988 Implement DAU Version Renditions code (#931)
* ACS-1988 Implement DAU Version Renditions code

* ACS-1988 Replace directAccessUrlRequest with request-direct-access-url

* ACS-1988 fix and move DAU version rendition test

* ACS-1988 Add NodeVersionRenditionsApiTest to test suite

* ACS-1988 Remove unused import

* ACS-1988 add error response tests

* ACS-1988 remove redundant constant

* ACS-1988 updates from review

* ACS-1988 updates from review
2022-02-11 11:35:28 +00:00
Domenico Sibilio
105c83ca7e ACS-2276 Add missing indexControl on hidden nodes to avoid Elasticsearch indexing
* ACS-2276 - Add indexControl to extensions and module-deployments

* ACS-2276 - Remove unnecessary test import
2022-02-11 11:44:48 +01:00
George Evangelopoulos
64b9564dc7 ACS-2476 Bump Camel version to 3.8.0 (#957) 2022-02-11 09:26:51 +00:00
Travis CI User
a3ccf20a74 [maven-release-plugin][skip ci] prepare for next development iteration 2022-02-10 12:49:45 +00:00
Travis CI User
fa7f74f2ee [maven-release-plugin][skip ci] prepare release 14.103 2022-02-10 12:49:43 +00:00
Vítor Moreira
30e339db12 MNT-22807: improve sitesTest test (#925) (#951)
(cherry picked from commit 1b42d80f94)
2022-02-10 12:00:02 +00:00
dependabot[bot]
8f5aed72d2 Bump restapi from 1.68 to 1.71 (#953)
Bumps [restapi](https://github.com/Alfresco/alfresco-tas-restapi) from 1.68 to 1.71.
- [Release notes](https://github.com/Alfresco/alfresco-tas-restapi/releases)
- [Commits](https://github.com/Alfresco/alfresco-tas-restapi/compare/v1.68...v1.71)

---
updated-dependencies:
- dependency-name: org.alfresco.tas:restapi
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-02-10 10:34:34 +01:00
Travis CI User
dc0582b1ab [maven-release-plugin][skip ci] prepare for next development iteration 2022-02-09 15:07:27 +00:00
Travis CI User
92eb339237 [maven-release-plugin][skip ci] prepare release 14.102 2022-02-09 15:07:24 +00:00
Jan Vonka
3b6983170b Revert "Bump mysql-connector-java from 8.0.27 to 8.0.28 (#901)"
This reverts commit 085e2acaac.
2022-02-09 14:17:06 +00:00
Alan Davis
338e2b93dd ACS-2498 Add coreVersion to T-Engine config (#937)
Added isSupported(CoreFunction function, String transformerName) and isSupported(CoreFunction function, LocalTransform transform) ready for work on the ACS-2493 & ACS-2494.
2022-02-09 13:39:57 +00:00
Stefan Kopf
fea50a2206 PRODSEC-6083 migrate to reload4j (#949) 2022-02-09 11:15:26 +01:00
evasques
85b5b2660e MNT-22710 - ContentURLs with CRC collision and same last 12 chars are assumed as duplicates and node is linked to the wrong contentURL (#944)
* Added a validation to assure the URL is the same and if it is not, throw an error
* Added a unit test to replicate the problem
2022-02-08 18:22:18 +00:00
dependabot[bot]
085e2acaac Bump mysql-connector-java from 8.0.27 to 8.0.28 (#901)
Bumps [mysql-connector-java](https://github.com/mysql/mysql-connector-j) from 8.0.27 to 8.0.28.
- [Release notes](https://github.com/mysql/mysql-connector-j/releases)
- [Changelog](https://github.com/mysql/mysql-connector-j/blob/release/8.0/CHANGES)
- [Commits](https://github.com/mysql/mysql-connector-j/commits)

---
updated-dependencies:
- dependency-name: mysql:mysql-connector-java
  dependency-type: direct:production
  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-02-08 17:44:28 +00:00
Travis CI User
58b4d9f18f [maven-release-plugin][skip ci] prepare for next development iteration 2022-02-08 09:42:14 +00:00
Travis CI User
336e7cf817 [maven-release-plugin][skip ci] prepare release 14.101 2022-02-08 09:42:11 +00:00
dependabot[bot]
13a2bea2ce Bump postgresql from 42.3.1 to 42.3.2 (#927)
Bumps [postgresql](https://github.com/pgjdbc/pgjdbc) from 42.3.1 to 42.3.2.
- [Release notes](https://github.com/pgjdbc/pgjdbc/releases)
- [Changelog](https://github.com/pgjdbc/pgjdbc/blob/master/CHANGELOG.md)
- [Commits](https://github.com/pgjdbc/pgjdbc/compare/REL42.3.1...REL42.3.2)

---
updated-dependencies:
- dependency-name: org.postgresql:postgresql
  dependency-type: direct:production
  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-02-08 08:48:13 +00:00
Travis CI User
9139500fa5 [maven-release-plugin][skip ci] prepare for next development iteration 2022-02-04 17:31:26 +00:00
Travis CI User
2a43657e2f [maven-release-plugin][skip ci] prepare release 14.100 2022-02-04 17:31:23 +00:00
dependabot[bot]
8145e2ea39 Bump json-path from 2.5.0 to 2.7.0 (#921)
Bumps [json-path](https://github.com/jayway/JsonPath) from 2.5.0 to 2.7.0.
- [Release notes](https://github.com/jayway/JsonPath/releases)
- [Changelog](https://github.com/json-path/JsonPath/blob/master/changelog.md)
- [Commits](https://github.com/jayway/JsonPath/compare/json-path-2.5.0...json-path-2.7.0)

---
updated-dependencies:
- dependency-name: com.jayway.jsonpath:json-path
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-02-04 16:33:52 +00:00
Travis CI User
db1bc1d9e2 [maven-release-plugin][skip ci] prepare for next development iteration 2022-02-04 13:34:53 +00:00
Travis CI User
2f0f3aa310 [maven-release-plugin][skip ci] prepare release 14.99 2022-02-04 13:34:50 +00:00
kcichonczyk
873508bfb7 [ACS-2504] 7.2.0-A3 (#932) 2022-02-04 13:41:16 +01:00
Travis CI User
e71f681e6e [maven-release-plugin][skip ci] prepare for next development iteration 2022-02-03 18:25:41 +00:00
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
Travis CI User
611b89e544 [maven-release-plugin][skip ci] prepare for next development iteration 2022-01-27 12:23:04 +00:00
Travis CI User
9205486959 [maven-release-plugin][skip ci] prepare release 14.91 2022-01-27 12:23:02 +00:00
Denys Vuika
47e58e1303 ACS-2408 update rest-api-explorer to 7.2.0-M2 2022-01-27 11:31:13 +00:00
Travis CI User
398a03f3dd [maven-release-plugin][skip ci] prepare for next development iteration 2022-01-26 22:25:51 +00:00
Travis CI User
4338693f81 [maven-release-plugin][skip ci] prepare release 14.90 2022-01-26 22:25:48 +00:00
alandavis
449fe34856 ATS-973 Bump t-core to 2.5.5 2022-01-26 21:30:09 +00:00
Travis CI User
930fbe4cda [maven-release-plugin][skip ci] prepare for next development iteration 2022-01-25 18:09:14 +00:00
Travis CI User
e45d223124 [maven-release-plugin][skip ci] prepare release 14.89 2022-01-25 18:09:11 +00:00
mpichura
4e0e797d9f ACS-2104: Changing apache.camel and netty-codec-http dependency versions due to conflicts and vulnerabilities. (#908) 2022-01-25 18:15:39 +01:00
Travis CI User
5418c3936d [maven-release-plugin][skip ci] prepare for next development iteration 2022-01-25 15:45:28 +00:00
Travis CI User
f876016bb9 [maven-release-plugin][skip ci] prepare release 14.88 2022-01-25 15:45:25 +00:00
Tom Page
00186e5594 ACS-2303 Include license report in share-services amp. (#907) 2022-01-25 14:51:44 +00:00
Travis CI User
d6c39cc990 [maven-release-plugin][skip ci] prepare for next development iteration 2022-01-25 14:30:22 +00:00
Travis CI User
5a2bb6db5b [maven-release-plugin][skip ci] prepare release 14.87 2022-01-25 14:30:19 +00:00
Tom Page
351c3ac73a ACS-2303 Gytheio is a first party library. (#906) 2022-01-25 13:40:28 +00:00
Travis CI User
62f72f92be [maven-release-plugin][skip ci] prepare for next development iteration 2022-01-24 11:26:07 +00:00
Travis CI User
faa0ff0e40 [maven-release-plugin][skip ci] prepare release 14.86 2022-01-24 11:26:04 +00:00
dependabot[bot]
7d6037a85f Bump restapi from 1.67 to 1.68 (#904)
Bumps [restapi](https://github.com/Alfresco/alfresco-tas-restapi) from 1.67 to 1.68.
- [Release notes](https://github.com/Alfresco/alfresco-tas-restapi/releases)
- [Commits](https://github.com/Alfresco/alfresco-tas-restapi/compare/v1.67...v1.68)

---
updated-dependencies:
- dependency-name: org.alfresco.tas:restapi
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-01-24 11:35:54 +01:00
Travis CI User
2aa5f162cc [maven-release-plugin][skip ci] prepare for next development iteration 2022-01-18 10:28:37 +00:00
Travis CI User
13bdfe6ac3 [maven-release-plugin][skip ci] prepare release 14.85 2022-01-18 10:28:34 +00:00
Piotr Żurek
d0dbef04f4 PRODSEC-5799 Upgrade mybatis (#879) 2022-01-18 10:33:46 +01:00
Tom Page
d8f086640a ACS-2365 Include license report in AGS amp. (#899) 2022-01-18 08:57:42 +00:00
Travis CI User
452fa1d2d8 [maven-release-plugin][skip ci] prepare for next development iteration 2022-01-17 05:17:45 +00:00
Travis CI User
68e9d2bc7d [maven-release-plugin][skip ci] prepare release 14.84 2022-01-17 05:17:42 +00:00
Travis CI User
0e083bbf6b [maven-release-plugin][skip ci] prepare for next development iteration 2022-01-14 13:00:50 +00:00
Travis CI User
3a17a30e8c [maven-release-plugin][skip ci] prepare release 14.83 2022-01-14 13:00:48 +00:00
dependabot[bot]
c65a56b945 Bump json from 20210307 to 20211205 (#828)
Bumps [json](https://github.com/douglascrockford/JSON-java) from 20210307 to 20211205.
- [Release notes](https://github.com/douglascrockford/JSON-java/releases)
- [Changelog](https://github.com/stleary/JSON-java/blob/master/docs/RELEASES.md)
- [Commits](https://github.com/douglascrockford/JSON-java/commits)

---
updated-dependencies:
- dependency-name: org.json:json
  dependency-type: direct:production
  update-type: version-update:semver-major
...

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-01-14 12:09:44 +00:00
Travis CI User
aa6c0fb2a9 [maven-release-plugin][skip ci] prepare for next development iteration 2022-01-14 11:34:06 +00:00
Travis CI User
235bef78a9 [maven-release-plugin][skip ci] prepare release 14.82 2022-01-14 11:34:03 +00:00
Alan Davis
f80767359f MNT-22696 Replace Rendition REST API (#880)
Code to reject zero byte renditions
Addition of:
DELETE /nodes/{nodeId}/renditions/{renditionId} 
DELETE /nodes/{nodeId}/versions/{versionId}/renditions/{renditionId} end points

Co-authored-by: kmagdziarz <Kacper.Magdziarz@hyland.com>
2022-01-14 11:28:50 +01:00
dependabot[bot]
8cd843df9d Bump dependency.slf4j.version from 1.7.32 to 1.7.33 (#893)
Bumps `dependency.slf4j.version` from 1.7.32 to 1.7.33.

Updates `slf4j-api` from 1.7.32 to 1.7.33
- [Release notes](https://github.com/qos-ch/slf4j/releases)
- [Commits](https://github.com/qos-ch/slf4j/compare/v_1.7.32...v_1.7.33)

Updates `slf4j-log4j12` from 1.7.32 to 1.7.33
- [Release notes](https://github.com/qos-ch/slf4j/releases)
- [Commits](https://github.com/qos-ch/slf4j/compare/v_1.7.32...v_1.7.33)

---
updated-dependencies:
- dependency-name: org.slf4j:slf4j-api
  dependency-type: direct:production
  update-type: version-update:semver-patch
- dependency-name: org.slf4j:slf4j-log4j12
  dependency-type: direct:production
  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-14 10:03:18 +00:00
dependabot[bot]
ce30495376 Bump maven-jar-plugin from 3.2.1 to 3.2.2 (#887)
Bumps [maven-jar-plugin](https://github.com/apache/maven-jar-plugin) from 3.2.1 to 3.2.2.
- [Release notes](https://github.com/apache/maven-jar-plugin/releases)
- [Commits](https://github.com/apache/maven-jar-plugin/compare/maven-jar-plugin-3.2.1...maven-jar-plugin-3.2.2)

---
updated-dependencies:
- dependency-name: org.apache.maven.plugins:maven-jar-plugin
  dependency-type: direct:production
  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>

[skip ci] 1 more PR merge to follow
2022-01-14 10:02:13 +00:00
dependabot[bot]
5b73d52753 Bump jboss-logging from 3.4.2.Final to 3.4.3.Final (#886)
Bumps [jboss-logging](https://github.com/jboss-logging/jboss-logging) from 3.4.2.Final to 3.4.3.Final.
- [Release notes](https://github.com/jboss-logging/jboss-logging/releases)
- [Commits](https://github.com/jboss-logging/jboss-logging/compare/3.4.2.Final...3.4.3.Final)

---
updated-dependencies:
- dependency-name: org.jboss.logging:jboss-logging
  dependency-type: direct:production
  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>

[skip ci] 2 more PR merges to follow
2022-01-14 10:00:40 +00:00
dependabot[bot]
7bb829d756 Bump dependency.webscripts.version from 8.27 to 8.28 (#892)
Bumps `dependency.webscripts.version` from 8.27 to 8.28.

Updates `spring-surf-core-configservice` from 8.27 to 8.28

Updates `spring-webscripts` from 8.27 to 8.28
- [Release notes](https://github.com/Alfresco/surf-webscripts/releases)
- [Commits](https://github.com/Alfresco/surf-webscripts/compare/spring-surf-webscripts-parent-8.27...spring-surf-webscripts-parent-8.28)

Updates `spring-webscripts` from 8.27 to 8.28
- [Release notes](https://github.com/Alfresco/surf-webscripts/releases)
- [Commits](https://github.com/Alfresco/surf-webscripts/compare/spring-surf-webscripts-parent-8.27...spring-surf-webscripts-parent-8.28)

Updates `spring-webscripts-api` from 8.27 to 8.28

---
updated-dependencies:
- dependency-name: org.alfresco.surf:spring-surf-core-configservice
  dependency-type: direct:production
  update-type: version-update:semver-minor
- dependency-name: org.alfresco.surf:spring-webscripts
  dependency-type: direct:production
  update-type: version-update:semver-minor
- dependency-name: org.alfresco.surf:spring-webscripts:tests
  dependency-type: direct:production
  update-type: version-update:semver-minor
- dependency-name: org.alfresco.surf:spring-webscripts-api
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-01-14 09:30:16 +00:00
dependabot[bot]
3bedfb2c33 Bump dependency.spring.version from 5.3.14 to 5.3.15 (#891)
Bumps `dependency.spring.version` from 5.3.14 to 5.3.15.

Updates `spring-aop` from 5.3.14 to 5.3.15
- [Release notes](https://github.com/spring-projects/spring-framework/releases)
- [Commits](https://github.com/spring-projects/spring-framework/compare/v5.3.14...v5.3.15)

Updates `spring-beans` from 5.3.14 to 5.3.15
- [Release notes](https://github.com/spring-projects/spring-framework/releases)
- [Commits](https://github.com/spring-projects/spring-framework/compare/v5.3.14...v5.3.15)

Updates `spring-context` from 5.3.14 to 5.3.15
- [Release notes](https://github.com/spring-projects/spring-framework/releases)
- [Commits](https://github.com/spring-projects/spring-framework/compare/v5.3.14...v5.3.15)

Updates `spring-context-support` from 5.3.14 to 5.3.15
- [Release notes](https://github.com/spring-projects/spring-framework/releases)
- [Commits](https://github.com/spring-projects/spring-framework/compare/v5.3.14...v5.3.15)

Updates `spring-core` from 5.3.14 to 5.3.15
- [Release notes](https://github.com/spring-projects/spring-framework/releases)
- [Commits](https://github.com/spring-projects/spring-framework/compare/v5.3.14...v5.3.15)

Updates `spring-expression` from 5.3.14 to 5.3.15
- [Release notes](https://github.com/spring-projects/spring-framework/releases)
- [Commits](https://github.com/spring-projects/spring-framework/compare/v5.3.14...v5.3.15)

Updates `spring-jdbc` from 5.3.14 to 5.3.15
- [Release notes](https://github.com/spring-projects/spring-framework/releases)
- [Commits](https://github.com/spring-projects/spring-framework/compare/v5.3.14...v5.3.15)

Updates `spring-jms` from 5.3.14 to 5.3.15
- [Release notes](https://github.com/spring-projects/spring-framework/releases)
- [Commits](https://github.com/spring-projects/spring-framework/compare/v5.3.14...v5.3.15)

Updates `spring-test` from 5.3.14 to 5.3.15
- [Release notes](https://github.com/spring-projects/spring-framework/releases)
- [Commits](https://github.com/spring-projects/spring-framework/compare/v5.3.14...v5.3.15)

Updates `spring-orm` from 5.3.14 to 5.3.15
- [Release notes](https://github.com/spring-projects/spring-framework/releases)
- [Commits](https://github.com/spring-projects/spring-framework/compare/v5.3.14...v5.3.15)

Updates `spring-tx` from 5.3.14 to 5.3.15
- [Release notes](https://github.com/spring-projects/spring-framework/releases)
- [Commits](https://github.com/spring-projects/spring-framework/compare/v5.3.14...v5.3.15)

Updates `spring-web` from 5.3.14 to 5.3.15
- [Release notes](https://github.com/spring-projects/spring-framework/releases)
- [Commits](https://github.com/spring-projects/spring-framework/compare/v5.3.14...v5.3.15)

Updates `spring-webmvc` from 5.3.14 to 5.3.15
- [Release notes](https://github.com/spring-projects/spring-framework/releases)
- [Commits](https://github.com/spring-projects/spring-framework/compare/v5.3.14...v5.3.15)

---
updated-dependencies:
- dependency-name: org.springframework:spring-aop
  dependency-type: direct:production
  update-type: version-update:semver-patch
- dependency-name: org.springframework:spring-beans
  dependency-type: direct:production
  update-type: version-update:semver-patch
- dependency-name: org.springframework:spring-context
  dependency-type: direct:production
  update-type: version-update:semver-patch
- dependency-name: org.springframework:spring-context-support
  dependency-type: direct:production
  update-type: version-update:semver-patch
- dependency-name: org.springframework:spring-core
  dependency-type: direct:production
  update-type: version-update:semver-patch
- dependency-name: org.springframework:spring-expression
  dependency-type: direct:production
  update-type: version-update:semver-patch
- dependency-name: org.springframework:spring-jdbc
  dependency-type: direct:production
  update-type: version-update:semver-patch
- dependency-name: org.springframework:spring-jms
  dependency-type: direct:production
  update-type: version-update:semver-patch
- dependency-name: org.springframework:spring-test
  dependency-type: direct:production
  update-type: version-update:semver-patch
- dependency-name: org.springframework:spring-orm
  dependency-type: direct:production
  update-type: version-update:semver-patch
- dependency-name: org.springframework:spring-tx
  dependency-type: direct:production
  update-type: version-update:semver-patch
- dependency-name: org.springframework:spring-web
  dependency-type: direct:production
  update-type: version-update:semver-patch
- dependency-name: org.springframework:spring-webmvc
  dependency-type: direct:production
  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>

[skip ci] another PR is about to be merged
2022-01-14 09:25:31 +00:00
alandavis
9058b5923b Pick up T-Engines 2.5.5-A3 & T-Model 1.4.7
* Five fixes too many
2022-01-14 09:13:33 +00:00
alandavis
07084b22f9 Pick up T-Engines 2.5.5-A3 & T-Model 1.4.7
* More "Pangram, fox, dog, Gym class featuring" test fixes
2022-01-14 09:09:34 +00:00
kcichonczyk
5c884c8552 [PRODSEC-5657] Added netty-codec-http version 4.1.71.Final to fix vulnerability nested in camel-amqp dependency. (#890) 2022-01-14 10:03:13 +01:00
alandavis
becf46f58a Pick up T-Engines 2.5.5-A3 & T-Model 1.4.7
* Raw metadata "subject" change resulting in cm:description change
2022-01-14 07:48:58 +00:00
alandavis
839afbbc1c Pick up T-Engines 2.5.5-A3 & T-Model 1.4.7 [no downstream] 2022-01-13 23:15:29 +00:00
David Edwards
daacceebd2 ACS-2407 Upgrade rest-api-explorer to 7.2.0-A2 (#888) 2022-01-13 13:07:40 +00:00
Vítor Moreira
cc11c13e54 MNT-22563: bumped jdom2 version to 2.0.6.1 (#885)
* MNT-22563: bumped jdom2 version to 2.0.6.1
2022-01-13 12:37:14 +00:00
Travis CI User
9e1ece208f [maven-release-plugin][skip ci] prepare for next development iteration 2022-01-13 12:03:24 +00:00
Travis CI User
82ba856d2c [maven-release-plugin][skip ci] prepare release 14.81 2022-01-13 12:03:22 +00:00
mpichura
8278c9ced2 ACS-2334 improve ArchivedIOException logging (#859)
* ACS-2234: Improving ArchivedIOException logging.

* ACS-2234: Improving ArchivedIOException logging.

* ACS-2234: Throw WebScriptException wit 412 status code when ArchivedIOException caught.

* ACS-2234: Fixing formatting and removing unused import.
2022-01-13 10:51:12 +01:00
Travis CI User
4e9f362482 [maven-release-plugin][skip ci] prepare for next development iteration 2022-01-12 12:24:47 +00:00
Travis CI User
68bc3c5391 [maven-release-plugin][skip ci] prepare release 14.80 2022-01-12 12:24:44 +00:00
alandavis
e484ede6c4 Upgrade to alfresco/alfresco-base-tomcat:9.0.54-java-11-centos-7 from alfresco/alfresco-base-tomcat:9.0.52-java-11-centos-7 2022-01-12 11:32:57 +00:00
Travis CI User
cecc517674 [maven-release-plugin][skip ci] prepare for next development iteration 2022-01-12 09:45:17 +00:00
Travis CI User
43224ade71 [maven-release-plugin][skip ci] prepare release 14.79 2022-01-12 09:45:14 +00:00
dependabot[bot]
5ec2d430e0 Bump icu4j from 68.2 to 70.1 (#783)
Bumps [icu4j](https://github.com/unicode-org/icu) from 68.2 to 70.1.
- [Release notes](https://github.com/unicode-org/icu/releases)
- [Commits](https://github.com/unicode-org/icu/commits)

---
updated-dependencies:
- dependency-name: com.ibm.icu:icu4j
  dependency-type: direct:production
  update-type: version-update:semver-major
...

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
[skip ci]
2022-01-12 08:15:33 +00:00
Travis CI User
b0ff60adba [maven-release-plugin][skip ci] prepare for next development iteration 2022-01-12 08:07:55 +00:00
Travis CI User
7a7a9f0964 [maven-release-plugin][skip ci] prepare release 14.78 2022-01-12 08:07:51 +00:00
dependabot[bot]
720256159f Bump dependency.spring.version from 5.3.13 to 5.3.14 (#849)
Bumps `dependency.spring.version` from 5.3.13 to 5.3.14.

Updates `spring-aop` from 5.3.13 to 5.3.14
- [Release notes](https://github.com/spring-projects/spring-framework/releases)
- [Commits](https://github.com/spring-projects/spring-framework/compare/v5.3.13...v5.3.14)

Updates `spring-beans` from 5.3.13 to 5.3.14
- [Release notes](https://github.com/spring-projects/spring-framework/releases)
- [Commits](https://github.com/spring-projects/spring-framework/compare/v5.3.13...v5.3.14)

Updates `spring-context` from 5.3.13 to 5.3.14
- [Release notes](https://github.com/spring-projects/spring-framework/releases)
- [Commits](https://github.com/spring-projects/spring-framework/compare/v5.3.13...v5.3.14)

Updates `spring-context-support` from 5.3.13 to 5.3.14
- [Release notes](https://github.com/spring-projects/spring-framework/releases)
- [Commits](https://github.com/spring-projects/spring-framework/compare/v5.3.13...v5.3.14)

Updates `spring-core` from 5.3.13 to 5.3.14
- [Release notes](https://github.com/spring-projects/spring-framework/releases)
- [Commits](https://github.com/spring-projects/spring-framework/compare/v5.3.13...v5.3.14)

Updates `spring-expression` from 5.3.13 to 5.3.14
- [Release notes](https://github.com/spring-projects/spring-framework/releases)
- [Commits](https://github.com/spring-projects/spring-framework/compare/v5.3.13...v5.3.14)

Updates `spring-jdbc` from 5.3.13 to 5.3.14
- [Release notes](https://github.com/spring-projects/spring-framework/releases)
- [Commits](https://github.com/spring-projects/spring-framework/compare/v5.3.13...v5.3.14)

Updates `spring-jms` from 5.3.13 to 5.3.14
- [Release notes](https://github.com/spring-projects/spring-framework/releases)
- [Commits](https://github.com/spring-projects/spring-framework/compare/v5.3.13...v5.3.14)

Updates `spring-test` from 5.3.13 to 5.3.14
- [Release notes](https://github.com/spring-projects/spring-framework/releases)
- [Commits](https://github.com/spring-projects/spring-framework/compare/v5.3.13...v5.3.14)

Updates `spring-orm` from 5.3.13 to 5.3.14
- [Release notes](https://github.com/spring-projects/spring-framework/releases)
- [Commits](https://github.com/spring-projects/spring-framework/compare/v5.3.13...v5.3.14)

Updates `spring-tx` from 5.3.13 to 5.3.14
- [Release notes](https://github.com/spring-projects/spring-framework/releases)
- [Commits](https://github.com/spring-projects/spring-framework/compare/v5.3.13...v5.3.14)

Updates `spring-web` from 5.3.13 to 5.3.14
- [Release notes](https://github.com/spring-projects/spring-framework/releases)
- [Commits](https://github.com/spring-projects/spring-framework/compare/v5.3.13...v5.3.14)

Updates `spring-webmvc` from 5.3.13 to 5.3.14
- [Release notes](https://github.com/spring-projects/spring-framework/releases)
- [Commits](https://github.com/spring-projects/spring-framework/compare/v5.3.13...v5.3.14)

---
updated-dependencies:
- dependency-name: org.springframework:spring-aop
  dependency-type: direct:production
  update-type: version-update:semver-patch
- dependency-name: org.springframework:spring-beans
  dependency-type: direct:production
  update-type: version-update:semver-patch
- dependency-name: org.springframework:spring-context
  dependency-type: direct:production
  update-type: version-update:semver-patch
- dependency-name: org.springframework:spring-context-support
  dependency-type: direct:production
  update-type: version-update:semver-patch
- dependency-name: org.springframework:spring-core
  dependency-type: direct:production
  update-type: version-update:semver-patch
- dependency-name: org.springframework:spring-expression
  dependency-type: direct:production
  update-type: version-update:semver-patch
- dependency-name: org.springframework:spring-jdbc
  dependency-type: direct:production
  update-type: version-update:semver-patch
- dependency-name: org.springframework:spring-jms
  dependency-type: direct:production
  update-type: version-update:semver-patch
- dependency-name: org.springframework:spring-test
  dependency-type: direct:production
  update-type: version-update:semver-patch
- dependency-name: org.springframework:spring-orm
  dependency-type: direct:production
  update-type: version-update:semver-patch
- dependency-name: org.springframework:spring-tx
  dependency-type: direct:production
  update-type: version-update:semver-patch
- dependency-name: org.springframework:spring-web
  dependency-type: direct:production
  update-type: version-update:semver-patch
- dependency-name: org.springframework:spring-webmvc
  dependency-type: direct:production
  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-11 18:30:57 +00:00
Stefan Kopf
cbc38c59c9 ACS-2180 solr shared secret (#883) 2022-01-11 18:46:34 +01:00
dependabot[bot]
b061dd4095 Bump jackson-databind from 2.13.0 to 2.13.1 (#857)
Bumps [jackson-databind](https://github.com/FasterXML/jackson) from 2.13.0 to 2.13.1.
- [Release notes](https://github.com/FasterXML/jackson/releases)
- [Commits](https://github.com/FasterXML/jackson/commits)

---
updated-dependencies:
- dependency-name: com.fasterxml.jackson.core:jackson-databind
  dependency-type: direct:production
  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-11 17:08:42 +00:00
Travis CI User
75bf1bff01 [maven-release-plugin][skip ci] prepare for next development iteration 2022-01-11 17:08:15 +00:00
Travis CI User
d85eecddef [maven-release-plugin][skip ci] prepare release 14.77 2022-01-11 17:08:12 +00:00
dependabot[bot]
96088f2643 Bump maven-jar-plugin from 3.2.0 to 3.2.1 (#882)
Bumps [maven-jar-plugin](https://github.com/apache/maven-jar-plugin) from 3.2.0 to 3.2.1.
- [Release notes](https://github.com/apache/maven-jar-plugin/releases)
- [Commits](https://github.com/apache/maven-jar-plugin/compare/maven-jar-plugin-3.2.0...maven-jar-plugin-3.2.1)

---
updated-dependencies:
- dependency-name: org.apache.maven.plugins:maven-jar-plugin
  dependency-type: direct:production
  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-11 16:14:13 +00:00
dependabot[bot]
b6c955f28d Bump dependency.cxf.version from 3.4.5 to 3.5.0 (#861)
Bumps `dependency.cxf.version` from 3.4.5 to 3.5.0.

Updates `cxf-rt-frontend-jaxws` from 3.4.5 to 3.5.0

Updates `cxf-rt-frontend-jaxrs` from 3.4.5 to 3.5.0

Updates `cxf-rt-rs-client` from 3.4.5 to 3.5.0

Updates `cxf-rt-transports-http` from 3.4.5 to 3.5.0

Updates `cxf-rt-ws-policy` from 3.4.5 to 3.5.0

---
updated-dependencies:
- dependency-name: org.apache.cxf:cxf-rt-frontend-jaxws
  dependency-type: direct:production
  update-type: version-update:semver-minor
- dependency-name: org.apache.cxf:cxf-rt-frontend-jaxrs
  dependency-type: direct:production
  update-type: version-update:semver-minor
- dependency-name: org.apache.cxf:cxf-rt-rs-client
  dependency-type: direct:production
  update-type: version-update:semver-minor
- dependency-name: org.apache.cxf:cxf-rt-transports-http
  dependency-type: direct:production
  update-type: version-update:semver-minor
- dependency-name: org.apache.cxf:cxf-rt-ws-policy
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

[skip ci]
2022-01-11 16:13:57 +00:00
dependabot[bot]
b796441f8f Bump spring-security-core from 5.5.2 to 5.6.1 (#858)
Bumps [spring-security-core](https://github.com/spring-projects/spring-security) from 5.5.2 to 5.6.1.
- [Release notes](https://github.com/spring-projects/spring-security/releases)
- [Changelog](https://github.com/spring-projects/spring-security/blob/main/RELEASE.adoc)
- [Commits](https://github.com/spring-projects/spring-security/compare/5.5.2...5.6.1)

---
updated-dependencies:
- dependency-name: org.springframework.security:spring-security-core
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-01-11 16:13:06 +00:00
dependabot[bot]
b3b6f72286 Bump dependency.tika.version from 2.1.0 to 2.2.1 (#865)
Bumps `dependency.tika.version` from 2.1.0 to 2.2.1.

Updates `tika-core` from 2.1.0 to 2.2.1
- [Release notes](https://github.com/apache/tika/releases)
- [Changelog](https://github.com/apache/tika/blob/main/CHANGES.txt)
- [Commits](https://github.com/apache/tika/commits)

Updates `tika-parsers-standard-package` from 2.1.0 to 2.2.1

---
updated-dependencies:
- dependency-name: org.apache.tika:tika-core
  dependency-type: direct:production
  update-type: version-update:semver-minor
- dependency-name: org.apache.tika:tika-parsers-standard-package
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

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

Authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-01-11 15:22:28 +00:00
montgolfiere
cec820bc88 ACS-2391: ACS-2391: StorageObjectProps - add version content specific endpoints (#881)
- fix blatant typo - thanks MP for detailed verification and feedback
- Note: e2e API sanity check will be added as part of ACS-2406
2022-01-11 10:24:20 +00:00
Travis CI User
49d7f5c2b1 [maven-release-plugin][skip ci] prepare for next development iteration 2022-01-10 14:42:36 +00:00
Travis CI User
1cc351b1d5 [maven-release-plugin][skip ci] prepare release 14.76 2022-01-10 14:42:33 +00:00
Tom Page
c6be5bc4da [skip tests] Add ability to build without updating AGS license year. 2022-01-10 14:29:26 +00:00
Travis CI User
054e6fccce [maven-release-plugin][skip ci] prepare for next development iteration 2022-01-08 14:03:41 +00:00
Travis CI User
c31000d842 [maven-release-plugin][skip ci] prepare release 14.75 2022-01-08 14:03:39 +00:00
dependabot[bot]
e613b268f7 Bump dependency.alfresco-transform-model.version from 1.4.5 to 1.4.6 (#875)
Bumps `dependency.alfresco-transform-model.version` from 1.4.5 to 1.4.6.

Updates `alfresco-transform-model` from 1.4.5 to 1.4.6
- [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.5 to 1.4.6
- [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-08 13:11:59 +00:00
Travis CI User
d1d2cfb400 [maven-release-plugin][skip ci] prepare for next development iteration 2022-01-08 11:51:07 +00:00
Travis CI User
63770758ae [maven-release-plugin][skip ci] prepare release 14.74 2022-01-08 11:51:04 +00:00
dependabot[bot]
44280f1aee Bump rhino from 1.7.13 to 1.7.14 (#876)
Bumps [rhino](https://github.com/mozilla/rhino) from 1.7.13 to 1.7.14.
- [Release notes](https://github.com/mozilla/rhino/releases)
- [Changelog](https://github.com/mozilla/rhino/blob/master/RELEASE-NOTES.md)
- [Commits](https://github.com/mozilla/rhino/commits)

---
updated-dependencies:
- dependency-name: org.mozilla:rhino
  dependency-type: direct:production
  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-08 10:56:41 +00:00
Travis CI User
50b9f67a32 [maven-release-plugin][skip ci] prepare for next development iteration 2022-01-07 19:06:46 +00:00
101 changed files with 1709 additions and 494 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-A1
- 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-A1
- 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-A1
- 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-A1
- 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-A1
- 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-A1
- 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-A1
- 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-A1
- 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-A1
- 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.73</version>
<version>14.107</version>
</parent>
<modules>
@@ -21,6 +21,7 @@
<license.update.dryrun>true</license.update.dryrun>
<license.verbose>false</license.verbose>
<license.failOnNotUptodateHeader>true</license.failOnNotUptodateHeader>
</properties>
<build>
@@ -70,7 +71,7 @@
<!-- dry run options -->
<dryRun>${license.update.dryrun}</dryRun>
<failOnMissingHeader>true</failOnMissingHeader>
<failOnNotUptodateHeader>true</failOnNotUptodateHeader>
<failOnNotUptodateHeader>${license.failOnNotUptodateHeader}</failOnNotUptodateHeader>
<!-- default root -->
<roots>

View File

@@ -7,7 +7,7 @@
<parent>
<groupId>org.alfresco</groupId>
<artifactId>alfresco-governance-services-community-parent</artifactId>
<version>14.73</version>
<version>14.107</version>
</parent>
<modules>

View File

@@ -7,7 +7,7 @@
<parent>
<groupId>org.alfresco</groupId>
<artifactId>alfresco-governance-services-automation-community-repo</artifactId>
<version>14.73</version>
<version>14.107</version>
</parent>
<build>
@@ -44,8 +44,8 @@
<dependencies>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
<version>1.7.32</version>
<artifactId>slf4j-reload4j</artifactId>
<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.73</version>
<version>14.107</version>
</parent>
<modules>

View File

@@ -1,4 +1,4 @@
TRANSFORMERS_TAG=2.5.5-A1
SOLR6_TAG=2.0.2-RC1
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.73</version>
<version>14.107</version>
</parent>
<properties>
@@ -217,6 +217,7 @@
<fileset dir="${project.build.outputDirectory}/alfresco" />
</move>
<copy file="${project.build.directory}/${project.build.finalName}/config/alfresco/module/org_alfresco_module_rm/module.properties" todir="${project.build.directory}/${project.build.finalName}" />
<copy file="${project.build.directory}/generated-sources/license/THIRD-PARTY.txt" todir="${project.build.directory}/${project.build.finalName}/licenses/${artifactId}" />
</target>
</configuration>
</execution>

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.73</version>
<version>14.107</version>
</parent>
<build>

View File

@@ -7,7 +7,7 @@
<parent>
<groupId>org.alfresco</groupId>
<artifactId>alfresco-community-repo</artifactId>
<version>14.73</version>
<version>14.107</version>
</parent>
<modules>

View File

@@ -8,7 +8,7 @@
<parent>
<groupId>org.alfresco</groupId>
<artifactId>alfresco-community-repo-amps</artifactId>
<version>14.73</version>
<version>14.107</version>
</parent>
<properties>
@@ -168,6 +168,10 @@
<targetPath>../${project.build.finalName}</targetPath>
<filtering>true</filtering>
</resource>
<resource>
<directory>${project.build.directory}/generated-sources/license</directory>
<targetPath>../${project.build.finalName}/licenses/${artifactId}</targetPath>
</resource>
</resources>
<testResources>
<testResource>

View File

@@ -7,7 +7,7 @@
<parent>
<groupId>org.alfresco</groupId>
<artifactId>alfresco-community-repo</artifactId>
<version>14.73</version>
<version>14.107</version>
</parent>
<dependencies>
@@ -54,9 +54,9 @@
<classifier>asl</classifier>
</dependency>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.17</version>
<groupId>ch.qos.reload4j</groupId>
<artifactId>reload4j</artifactId>
<version>1.2.19</version>
</dependency>
<dependency>
<groupId>org.json</groupId>
@@ -114,7 +114,7 @@
<!-- Test only dependencies, as popped up while running mvn test -->
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
<artifactId>slf4j-reload4j</artifactId>
<scope>test</scope>
</dependency>
<dependency>

View File

@@ -7,7 +7,7 @@
<parent>
<groupId>org.alfresco</groupId>
<artifactId>alfresco-community-repo</artifactId>
<version>14.73</version>
<version>14.107</version>
</parent>
<properties>

View File

@@ -7,7 +7,7 @@
<parent>
<groupId>org.alfresco</groupId>
<artifactId>alfresco-community-repo</artifactId>
<version>14.73</version>
<version>14.107</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.73</version>
<version>14.107</version>
</parent>
</project>

View File

@@ -1,6 +1,6 @@
# Fetch image based on Tomcat 9.0, Java 11 and Centos 8
# More infos about this image: https://github.com/Alfresco/alfresco-docker-base-tomcat
FROM alfresco/alfresco-base-tomcat:9.0.52-java-11-centos-7
FROM alfresco/alfresco-base-tomcat:9.0.54-java-11-centos-7
# Set default docker_context.
ARG resource_path=target

View File

@@ -7,7 +7,7 @@
<parent>
<groupId>org.alfresco</groupId>
<artifactId>alfresco-community-repo-packaging</artifactId>
<version>14.73</version>
<version>14.107</version>
</parent>
<properties>

View File

@@ -7,7 +7,7 @@
<parent>
<groupId>org.alfresco</groupId>
<artifactId>alfresco-community-repo</artifactId>
<version>14.73</version>
<version>14.107</version>
</parent>
<modules>

View File

@@ -1,4 +1,4 @@
TRANSFORMERS_TAG=2.5.5-A1
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.73</version>
<version>14.107</version>
</parent>
<modules>

View File

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

View File

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

View File

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

View File

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

View File

@@ -347,13 +347,30 @@ public class GetSitesTests extends RestTest
public void checkPaginationWithSkipCountAndMaxItems() throws Exception
{
sites = restClient.authenticateUser(regularUser).withParams("skipCount=10&maxItems=110").withCoreAPI().getSites();
int expectedCount;
if (sites.getPagination().isHasMoreItems())
{
expectedCount = sites.getPagination().getMaxItems();
}
else
{
if (sites.getPagination().getTotalItems() < sites.getPagination().getSkipCount())
{
expectedCount = 0;
}
else
{
expectedCount = sites.getPagination().getTotalItems() - sites.getPagination().getSkipCount();
}
}
sites.getPagination().assertThat()
.field("totalItems").isNotEmpty().and()
.field("maxItems").is("110").and()
.field("hasMoreItems").is((sites.getPagination().getTotalItems() - sites.getPagination().getSkipCount() > sites.getPagination().getMaxItems())?"true":"false").and()
.field("skipCount").is("10").and()
.field("count").is((sites.getPagination().isHasMoreItems()) ? sites.getPagination().getMaxItems()
: sites.getPagination().getTotalItems() - sites.getPagination().getSkipCount());
.field("count").is(expectedCount);
}
@Test(groups = { TestGroup.REST_API, TestGroup.SITES, TestGroup.REGRESSION})

View File

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

View File

@@ -7,7 +7,7 @@
<parent>
<groupId>org.alfresco</groupId>
<artifactId>alfresco-community-repo-packaging</artifactId>
<version>14.73</version>
<version>14.107</version>
</parent>
<properties>

67
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.73</version>
<version>14.107</version>
<packaging>pom</packaging>
<name>Alfresco Community Repo Parent</name>
@@ -51,38 +51,38 @@
<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.5</dependency.alfresco-transform-model.version>
<dependency.alfresco-transform-model.version>1.4.9</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.13</dependency.spring.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-databind.version>2.13.0</dependency.jackson-databind.version>
<dependency.cxf.version>3.4.5</dependency.cxf.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>
<dependency.webscripts.version>8.27</dependency.webscripts.version>
<dependency.webscripts.version>8.28</dependency.webscripts.version>
<dependency.bouncycastle.version>1.70</dependency.bouncycastle.version>
<dependency.mockito-core.version>3.11.2</dependency.mockito-core.version>
<dependency.org-json.version>20210307</dependency.org-json.version>
<dependency.org-json.version>20211205</dependency.org-json.version>
<dependency.commons-dbcp.version>1.4-DBCP330</dependency.commons-dbcp.version>
<dependency.commons-io.version>2.11.0</dependency.commons-io.version>
<dependency.gson.version>2.8.5</dependency.gson.version>
<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.32</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.1.0</dependency.tika.version>
<dependency.spring-security.version>5.5.2</dependency.spring-security.version>
<dependency.tika.version>2.2.1</dependency.tika.version>
<dependency.spring-security.version>5.6.1</dependency.spring-security.version>
<dependency.truezip.version>7.7.10</dependency.truezip.version>
<dependency.poi.version>4.1.2</dependency.poi.version>
<dependency.ooxml-schemas.version>1.4</dependency.ooxml-schemas.version>
<dependency.keycloak.version>15.0.2</dependency.keycloak.version>
<dependency.jboss.logging.version>3.4.2.Final</dependency.jboss.logging.version>
<dependency.camel.version>3.7.4</dependency.camel.version>
<dependency.jboss.logging.version>3.4.3.Final</dependency.jboss.logging.version>
<dependency.camel.version>3.7.7</dependency.camel.version> <!-- when bumping this version, please keep track/sync with included netty.io dependencies (can cause dependency conflicts)-->
<dependency.activemq.version>5.16.1</dependency.activemq.version>
<dependency.apache-compress.version>1.21</dependency.apache-compress.version>
<dependency.apache.taglibs.version>1.2.5</dependency.apache.taglibs.version>
@@ -91,6 +91,7 @@
<dependency.swagger-parser.version>1.0.56</dependency.swagger-parser.version>
<dependency.maven-filtering.version>3.1.1</dependency.maven-filtering.version>
<dependency.maven-artifact.version>3.8.4</dependency.maven-artifact.version>
<dependency.jdom2.version>2.0.6.1</dependency.jdom2.version>
<dependency.jakarta-jaxb-api.version>2.3.3</dependency.jakarta-jaxb-api.version>
<dependency.jakarta-ws-api.version>2.3.3</dependency.jakarta-ws-api.version>
@@ -101,23 +102,23 @@
<dependency.jakarta-jws-api.version>2.1.0</dependency.jakarta-jws-api.version>
<dependency.jakarta-mail-api.version>1.6.5</dependency.jakarta-mail-api.version>
<dependency.jakarta-json-api.version>1.1.6</dependency.jakarta-json-api.version>
<dependency.jakarta-json-path.version>2.5.0</dependency.jakarta-json-path.version>
<dependency.jakarta-json-path.version>2.7.0</dependency.jakarta-json-path.version>
<dependency.jakarta-rpc-api.version>1.1.4</dependency.jakarta-rpc-api.version>
<alfresco.googledrive.version>3.2.1.3</alfresco.googledrive.version>
<alfresco.aos-module.version>1.4.0.1</alfresco.aos-module.version>
<alfresco.api-explorer.version>7.1.0.1</alfresco.api-explorer.version> <!-- Also in alfresco-enterprise-share -->
<alfresco.api-explorer.version>7.2.0-A3</alfresco.api-explorer.version> <!-- Also in alfresco-enterprise-share -->
<alfresco.maven-plugin.version>2.2.0</alfresco.maven-plugin.version>
<license-maven-plugin.version>2.0.1.alfresco-1</license-maven-plugin.version>
<dependency.postgresql.version>42.3.1</dependency.postgresql.version>
<dependency.postgresql.version>42.3.2</dependency.postgresql.version>
<dependency.mysql.version>8.0.27</dependency.mysql.version>
<dependency.mysql-image.version>8</dependency.mysql-image.version>
<dependency.mariadb.version>2.7.4</dependency.mariadb.version>
<dependency.tas-utility.version>3.0.47</dependency.tas-utility.version>
<dependency.rest-assured.version>3.3.0</dependency.rest-assured.version>
<dependency.tas-restapi.version>1.67</dependency.tas-restapi.version>
<dependency.tas-restapi.version>1.71</dependency.tas-restapi.version>
<dependency.tas-cmis.version>1.31</dependency.tas-cmis.version>
<dependency.tas-email.version>1.8</dependency.tas-email.version>
<dependency.tas-webdav.version>1.6</dependency.tas-webdav.version>
@@ -145,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>14.73</tag>
<tag>14.107</tag>
</scm>
<distributionManagement>
@@ -562,6 +563,12 @@
<groupId>org.alfresco</groupId>
<artifactId>alfresco-log-sanitizer</artifactId>
<version>${dependency.alfresco-log-sanitizer.version}</version>
<exclusions>
<exclusion>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.alfresco.aos-module</groupId>
@@ -605,7 +612,7 @@
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
<artifactId>slf4j-reload4j</artifactId>
<version>${dependency.slf4j.version}</version>
</dependency>
<dependency>
@@ -630,7 +637,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>
@@ -654,6 +661,12 @@
<artifactId>commons-csv</artifactId>
<version>1.9.0</version>
</dependency>
<!-- upgrade dependency from TIKA -->
<dependency>
<groupId>org.jdom</groupId>
<artifactId>jdom2</artifactId>
<version>${dependency.jdom2.version}</version>
</dependency>
<dependency>
<groupId>org.postgresql</groupId>
@@ -783,6 +796,12 @@
</exclusions>
</dependency>
<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-codec-http</artifactId>
<version>4.1.72.Final</version>
</dependency>
<dependency>
<!-- If you are going to bump dependency.camel.version, please check if the netty-codec-http has higher version that the one above.-->
<groupId>org.apache.camel</groupId>
<artifactId>camel-amqp</artifactId>
<version>${dependency.camel.version}</version>
@@ -837,7 +856,7 @@
<dependency>
<groupId>org.reflections</groupId>
<artifactId>reflections</artifactId>
<version>0.9.12</version>
<version>0.10.2</version>
</dependency>
<!-- swagger parser -->
<dependency>
@@ -880,7 +899,7 @@
</plugin>
<plugin>
<artifactId>maven-jar-plugin</artifactId>
<version>3.2.0</version>
<version>3.2.2</version>
</plugin>
<plugin>
<artifactId>maven-war-plugin</artifactId>
@@ -925,7 +944,7 @@
<configuration>
<failOnMissing>true</failOnMissing>
<excludedScopes>provided,test</excludedScopes>
<excludedGroups>^(org\.alfresco|com\.alfresco|org\.activiti).*</excludedGroups>
<excludedGroups>^(org\.alfresco|com\.alfresco|org\.activiti|org\.gytheio).*</excludedGroups>
<failIfWarning>false</failIfWarning>
<includedLicenses>
https://raw.githubusercontent.com/Alfresco/third-party-license-overrides/master/includedLicenses.txt

View File

@@ -7,7 +7,7 @@
<parent>
<groupId>org.alfresco</groupId>
<artifactId>alfresco-community-repo</artifactId>
<version>14.73</version>
<version>14.107</version>
</parent>
<dependencies>

View File

@@ -47,6 +47,7 @@ import org.alfresco.repo.transaction.RetryingTransactionHelper;
import org.alfresco.repo.transaction.RetryingTransactionHelper.RetryingTransactionCallback;
import org.alfresco.repo.transaction.TooBusyException;
import org.alfresco.repo.web.scripts.bean.LoginPost;
import org.alfresco.service.cmr.repository.ArchivedIOException;
import org.alfresco.service.cmr.repository.NodeRef;
import org.alfresco.service.cmr.repository.TemplateService;
import org.alfresco.service.cmr.security.AuthorityService;
@@ -506,6 +507,10 @@ public class RepositoryContainer extends AbstractRuntimeContainer
return;
}
}
catch (ArchivedIOException e) // handle ArchivedIOException to lower log pollution
{
handleArchivedIOException(e);
}
catch (IOException e)
{
handleIOException(e);
@@ -606,6 +611,10 @@ public class RepositoryContainer extends AbstractRuntimeContainer
// Map TooBusyException to a 503 status code
throw new WebScriptException(HttpServletResponse.SC_SERVICE_UNAVAILABLE, e.getMessage(), e);
}
catch (ArchivedIOException e) // handle ArchivedIOException to lower log pollution
{
handleArchivedIOException(e);
}
// Ensure a response is always flushed after successful execution
if (bufferedRes != null)
@@ -615,6 +624,19 @@ public class RepositoryContainer extends AbstractRuntimeContainer
}
}
private void handleArchivedIOException(ArchivedIOException e)
{
if (logger.isDebugEnabled()) // log with stack trace at debug level
{
logger.debug("ArchivedIOException error ", e);
}
else if (logger.isInfoEnabled()) // log without stack trace at info level
{
logger.info("ArchivedIOException error. Message: " + e.getMessage());
}
throw new WebScriptException(HttpServletResponse.SC_PRECONDITION_FAILED, "Content is archived and not accessible.");
}
private static void handleIOException(final IOException ioe) throws IOException
{
Throwable socketException = ExceptionStackUtil.getCause(ioe, SocketException.class);

View File

@@ -2,7 +2,7 @@
* #%L
* Alfresco Remote API
* %%
* Copyright (C) 2005 - 2021 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
@@ -147,6 +147,25 @@ public interface Renditions
void createRenditions(NodeRef nodeRef, String versionId, List<Rendition> renditions, Parameters parameters)
throws NotFoundException, ConstraintViolatedException;
/**
* Delete the rendition node.
*
* @param nodeRef the source nodeRef, ie. live node
* @param renditionId the rendition id
* @param parameters the {@link Parameters} object to get the parameters passed into the request
*/
void deleteRendition(NodeRef nodeRef, String renditionId, Parameters parameters);
/**
* Delete the rendition node.
*
* @param nodeRef the source nodeRef, ie. live node
* @param versionId the version id (aka version label)
* @param renditionId the rendition id
* @param parameters the {@link Parameters} object to get the parameters passed into the request
*/
void deleteRendition(NodeRef nodeRef, String versionId, String renditionId, Parameters parameters);
/**
* Downloads rendition.
*

View File

@@ -2,7 +2,7 @@
* #%L
* Alfresco Remote API
* %%
* Copyright (C) 2005 - 2021 Alfresco Software LimitedP
* Copyright (C) 2005 - 2022 Alfresco Software LimitedP
* %%
* This file is part of the Alfresco software.
* If the software was purchased under a paid Alfresco license, the terms of
@@ -444,6 +444,31 @@ public class RenditionsImpl implements Renditions, ResourceLoaderAware
}
@Override
public void deleteRendition(NodeRef nodeRef, String renditionId, Parameters parameters)
{
deleteRendition(nodeRef, null, renditionId, parameters);
}
@Override
public void deleteRendition(NodeRef nodeRef, String versionId, String renditionId, Parameters parameters)
{
if (!renditionService2.isEnabled())
{
throw new DisabledServiceException("Rendition generation has been disabled.");
}
final NodeRef validatedNodeRef = validateNode(nodeRef.getStoreRef(), nodeRef.getId(), versionId, parameters);
NodeRef renditionNodeRef = getRenditionByName(validatedNodeRef, renditionId, parameters);
if (renditionNodeRef == null)
{
throw new NotFoundException(renditionId + " is not registered.");
}
renditionService2.clearRenditionContentDataInTransaction(renditionNodeRef);
}
private String getName(Rendition rendition)
{
String renditionName = rendition.getId();

View File

@@ -2,7 +2,7 @@
* #%L
* Alfresco Remote API
* %%
* Copyright (C) 2005 - 2021 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
@@ -65,6 +65,7 @@ public class NodeRenditionsRelation implements RelationshipResourceAction.Read<R
RelationshipResourceAction.ReadById<Rendition>,
RelationshipResourceAction.Create<Rendition>,
RelationshipResourceBinaryAction.Read,
RelationshipResourceAction.Delete,
InitializingBean
{
@@ -110,6 +111,14 @@ public class NodeRenditionsRelation implements RelationshipResourceAction.Read<R
return null;
}
@WebApiDescription(title = "Delete rendition")
@Override
public void delete(String nodeId, String renditionId, Parameters parameters)
{
NodeRef nodeRef = new NodeRef(StoreRef.STORE_REF_WORKSPACE_SPACESSTORE, nodeId);
renditions.deleteRendition(nodeRef, renditionId, parameters);
}
@WebApiDescription(title = "Download rendition", description = "Download rendition")
@BinaryProperties({ "content" })
@Override

View File

@@ -2,7 +2,7 @@
* #%L
* Alfresco Remote API
* %%
* Copyright (C) 2005 - 2021 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
@@ -26,18 +26,28 @@
package org.alfresco.rest.api.nodes;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
import org.alfresco.repo.content.directurl.DirectAccessUrlDisabledException;
import org.alfresco.rest.api.DirectAccessUrlHelper;
import org.alfresco.rest.api.Renditions;
import org.alfresco.rest.api.model.DirectAccessUrlRequest;
import org.alfresco.rest.api.model.Rendition;
import org.alfresco.rest.framework.BinaryProperties;
import org.alfresco.rest.framework.Operation;
import org.alfresco.rest.framework.WebApiDescription;
import org.alfresco.rest.framework.WebApiParam;
import org.alfresco.rest.framework.core.ResourceParameter;
import org.alfresco.rest.framework.core.exceptions.DisabledServiceException;
import org.alfresco.rest.framework.resource.RelationshipResource;
import org.alfresco.rest.framework.resource.actions.interfaces.RelationshipResourceAction;
import org.alfresco.rest.framework.resource.actions.interfaces.RelationshipResourceBinaryAction;
import org.alfresco.rest.framework.resource.content.BinaryResource;
import org.alfresco.rest.framework.resource.parameters.CollectionWithPagingInfo;
import org.alfresco.rest.framework.resource.parameters.Parameters;
import org.alfresco.rest.framework.webscripts.WithResponse;
import org.alfresco.service.cmr.repository.DirectAccessUrl;
import org.alfresco.service.cmr.repository.NodeRef;
import org.alfresco.service.cmr.repository.StoreRef;
import org.alfresco.util.PropertyCheck;
@@ -48,10 +58,12 @@ import org.springframework.extensions.webscripts.Status;
*
* Node version renditions
*
* - GET /nodes/{nodeId}/versions/{versionId}/renditions
* - POST /nodes/{nodeId}/versions/{versionId}/renditions
* - GET /nodes/{nodeId}/versions/{versionId}/renditions/{renditionId}
* - GET /nodes/{nodeId}/versions/{versionId}/renditions/{renditionId}/content
* - GET /nodes/{nodeId}/versions/{versionId}/renditions
* - POST /nodes/{nodeId}/versions/{versionId}/renditions
* - GET /nodes/{nodeId}/versions/{versionId}/renditions/{renditionId}
* - DELETE /nodes/{nodeId}/versions/{versionId}/renditions/{renditionId}
* - GET /nodes/{nodeId}/versions/{versionId}/renditions/{renditionId}/content
* - POST /nodes/{nodeId}/versions/{versionId}/renditions/{renditionId}/request-direct-access-url
*
* @author janv
*/
@@ -59,16 +71,23 @@ import org.springframework.extensions.webscripts.Status;
public class NodeVersionRenditionsRelation implements RelationshipResourceAction.Read<Rendition>,
RelationshipResourceAction.ReadById<Rendition>,
RelationshipResourceAction.Create<Rendition>,
RelationshipResourceAction.Delete,
RelationshipResourceBinaryAction.Read,
InitializingBean
{
private Renditions renditions;
private DirectAccessUrlHelper directAccessUrlHelper;
public void setRenditions(Renditions renditions)
{
this.renditions = renditions;
}
public void setDirectAccessUrlHelper(DirectAccessUrlHelper directAccessUrlHelper)
{
this.directAccessUrlHelper = directAccessUrlHelper;
}
@Override
public void afterPropertiesSet() throws Exception
{
@@ -115,4 +134,43 @@ public class NodeVersionRenditionsRelation implements RelationshipResourceAction
return renditions.getContent(nodeRef, versionId, renditionId, parameters);
}
@Operation ("request-direct-access-url")
@WebApiParam (name = "directAccessUrlRequest",
title = "Request direct access url",
description = "Options for direct access url request",
kind = ResourceParameter.KIND.HTTP_BODY_OBJECT)
@WebApiDescription(title = "Request content url",
description="Generates a direct access URL.",
successStatus = HttpServletResponse.SC_OK)
public DirectAccessUrl requestContentDirectUrl(String nodeId,
String versionId,
DirectAccessUrlRequest directAccessUrlRequest,
Parameters parameters, WithResponse withResponse)
{
boolean attachment = directAccessUrlHelper.getAttachment(directAccessUrlRequest);
Long validFor = directAccessUrlHelper.getDefaultExpiryTimeInSec();
NodeRef nodeRef = new NodeRef(StoreRef.STORE_REF_WORKSPACE_SPACESSTORE, nodeId);
String renditionId = parameters.getRelationship2Id();
DirectAccessUrl directAccessUrl;
try
{
directAccessUrl = renditions.requestContentDirectUrl(nodeRef, versionId, renditionId, attachment, validFor);
}
catch (DirectAccessUrlDisabledException ex)
{
throw new DisabledServiceException(ex.getMessage());
}
return directAccessUrl;
}
@WebApiDescription(title = "Delete rendition")
@Override
public void delete(String nodeId, String versionId, Parameters parameters)
{
String renditionId = parameters.getRelationship2Id();
NodeRef nodeRef = new NodeRef(StoreRef.STORE_REF_WORKSPACE_SPACESSTORE, nodeId);
renditions.deleteRendition(nodeRef, versionId, renditionId, parameters);
}
}

View File

@@ -86,15 +86,9 @@ public class NodeVersionsStorageInfoRelation implements RelationshipResourceActi
{
String contentPropQNameId = parameters.getRelationship2Id();
Version version = nodeVersions.findVersion(nodeId, versionId);
NodeRef versionNodeRef = findVersionNodeRef(nodeId, versionId);
if (version != null)
{
NodeRef versionNodeRef = version.getFrozenStateNodeRef();
return storageInformation.getStorageInfo(versionNodeRef, contentPropQNameId, parameters);
}
throw new EntityNotFoundException(nodeId+"-"+versionId);
return storageInformation.getStorageInfo(versionNodeRef, contentPropQNameId, parameters);
}
@Experimental
@@ -105,27 +99,21 @@ public class NodeVersionsStorageInfoRelation implements RelationshipResourceActi
description = "Submits a request to send version content to archive",
successStatus = HttpServletResponse.SC_OK)
public void requestArchiveContent(String nodeId, String versionId, ArchiveContentRequest archiveContentRequest, Parameters parameters,
WithResponse withResponse)
WithResponse withResponse)
{
String contentPropQNameId = parameters.getRelationship2Id();
Version version = nodeVersions.findVersion(nodeId, versionId);
NodeRef versionNodeRef = findVersionNodeRef(nodeId, versionId);
if (version != null)
final boolean result = storageInformation.requestArchiveContent(versionNodeRef, contentPropQNameId, archiveContentRequest);
if (result)
{
NodeRef versionNodeRef = version.getFrozenStateNodeRef();
final boolean result = storageInformation.requestArchiveContent(versionNodeRef, contentPropQNameId, archiveContentRequest);
if (result)
{
withResponse.setStatus(HttpServletResponse.SC_OK);
}
else
{
withResponse.setStatus(HttpServletResponse.SC_NOT_IMPLEMENTED);
}
withResponse.setStatus(HttpServletResponse.SC_OK);
}
else
{
withResponse.setStatus(HttpServletResponse.SC_NOT_IMPLEMENTED);
}
throw new EntityNotFoundException(nodeId+"-"+versionId);
}
@Experimental
@@ -140,22 +128,26 @@ public class NodeVersionsStorageInfoRelation implements RelationshipResourceActi
{
String contentPropQNameId = parameters.getRelationship2Id();
Version version = nodeVersions.findVersion(nodeId, versionId);
NodeRef versionNodeRef = findVersionNodeRef(nodeId, versionId);
if (version != null)
final boolean result = storageInformation.requestRestoreContentFromArchive(versionNodeRef, contentPropQNameId, restoreArchivedContentRequest);
if (result)
{
NodeRef versionNodeRef = version.getFrozenStateNodeRef();
final boolean result = storageInformation.requestRestoreContentFromArchive(versionNodeRef, contentPropQNameId, restoreArchivedContentRequest);
if (result)
{
withResponse.setStatus(HttpServletResponse.SC_ACCEPTED);
}
else
{
withResponse.setStatus(HttpServletResponse.SC_NOT_IMPLEMENTED);
}
withResponse.setStatus(HttpServletResponse.SC_ACCEPTED);
}
else
{
withResponse.setStatus(HttpServletResponse.SC_NOT_IMPLEMENTED);
}
}
throw new EntityNotFoundException(nodeId+"-"+versionId);
private NodeRef findVersionNodeRef(String nodeId, String versionId)
{
Version version = nodeVersions.findVersion(nodeId, versionId);
if (version == null)
{
throw new EntityNotFoundException(nodeId+"-"+versionId);
}
return version.getFrozenStateNodeRef();
}
}

View File

@@ -2,7 +2,7 @@
* #%L
* Alfresco Remote API
* %%
* 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
@@ -188,6 +188,8 @@ public class Params implements Parameters
builder.append(this.entityId);
builder.append(", relationshipId=");
builder.append(this.relationshipId);
builder.append(", relationship2Id=");
builder.append(this.relationship2Id);
builder.append(", passedIn=");
builder.append(this.passedIn);
builder.append(", paging=");

View File

@@ -2,7 +2,7 @@
* #%L
* Alfresco Remote API
* %%
* 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,7 @@ public class ResourceWebScriptDelete extends AbstractResourceWebScript implement
final Map<String, String> resourceVars = locator.parseTemplateVars(req.getServiceMatch().getTemplateVars());
final String entityId = resourceVars.get(ResourceLocator.ENTITY_ID);
final String relationshipId = resourceVars.get(ResourceLocator.RELATIONSHIP_ID);
final String relationship2Id = resourceVars.get(ResourceLocator.RELATIONSHIP2_ID);
final Params.RecognizedParams params = getRecognizedParams(req);
@@ -78,7 +79,15 @@ public class ResourceWebScriptDelete extends AbstractResourceWebScript implement
return Params.valueOf(params, entityId, relationshipId, req);
case RELATIONSHIP:
// note: relationshipId can be null - when deleting a related set/collection
return Params.valueOf(params, entityId, relationshipId, req);
if (StringUtils.isNotBlank(relationship2Id))
{
return Params.valueOf(false, entityId, relationshipId, relationship2Id,
null, null, null, params, null, req);
}
else
{
return Params.valueOf(params, entityId, relationshipId, req);
}
case PROPERTY:
final String resourceName = resourceVars.get(ResourceLocator.RELATIONSHIP_RESOURCE);
final String propertyName = resourceVars.get(ResourceLocator.PROPERTY);

View File

@@ -29,8 +29,12 @@ package org.alfresco.web.app.servlet;
import java.io.IOException;
import java.util.Properties;
import javax.servlet.ServletContext;
import javax.servlet.*;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.alfresco.error.AlfrescoRuntimeException;
import org.alfresco.httpclient.HttpClientFactory;
import org.alfresco.httpclient.HttpClientFactory.SecureCommsType;
import org.alfresco.web.scripts.servlet.X509ServletFilterBase;
import org.apache.commons.logging.Log;
@@ -46,40 +50,86 @@ import org.springframework.web.context.support.WebApplicationContextUtils;
public class AlfrescoX509ServletFilter extends X509ServletFilterBase
{
private static final String BEAN_GLOBAL_PROPERTIES = "global-properties";
private static final String SECURE_COMMS = "solr.secureComms";
private SecureCommsType secureComms = SecureCommsType.HTTPS;
private String sharedSecret;
private String sharedSecretHeader = HttpClientFactory.DEFAULT_SHAREDSECRET_HEADER;
private static final String BEAN_GLOBAL_PROPERTIES = "global-properties";
private static final String PROP_SECURE_COMMS = "solr.secureComms";
private static final String PROP_SHARED_SECRET = "solr.sharedSecret";
private static final String PROP_SHARED_SECRET_HEADER = "solr.sharedSecret.header";
private static Log logger = LogFactory.getLog(AlfrescoX509ServletFilter.class);
public void init(FilterConfig config) throws ServletException
{
WebApplicationContext wc = WebApplicationContextUtils.getRequiredWebApplicationContext(config.getServletContext());
Properties globalProperties = (Properties) wc.getBean(BEAN_GLOBAL_PROPERTIES);
String secureCommsProp = globalProperties.getProperty(PROP_SECURE_COMMS);
if(secureCommsProp != null && !secureCommsProp.isEmpty()) {
secureComms = SecureCommsType.getType(secureCommsProp);
}
sharedSecret = globalProperties.getProperty(PROP_SHARED_SECRET);
sharedSecretHeader = globalProperties.getProperty(PROP_SHARED_SECRET_HEADER);
if(secureComms == SecureCommsType.SECRET)
{
if(sharedSecret == null || sharedSecret.length()==0)
{
logger.fatal("Missing value for solr.sharedSecret configuration property. If solr.secureComms is set to \"secret\", a value for solr.sharedSecret is required. See https://docs.alfresco.com/search-services/latest/install/options/");
throw new AlfrescoRuntimeException("Missing value for solr.sharedSecret configuration property");
}
if(sharedSecretHeader == null || sharedSecretHeader.length()==0)
{
throw new AlfrescoRuntimeException("Missing value for sharedSecretHeader");
}
}
/*
// TODO: Activate this part after OPSEXP-1163 got implemented
if(secureComms == SecureCommsType.NONE)
{
if(!"true".equalsIgnoreCase(config.getInitParameter("allow-unauthenticated-solr-endpoint")))
{
throw new AlfrescoRuntimeException("solr.secureComms=none is no longer supported. Please use https or secret");
}
}
*/
super.init(config);
}
public void doFilter(ServletRequest request,
ServletResponse response,
FilterChain chain) throws IOException, ServletException
{
HttpServletRequest httpRequest = (HttpServletRequest)request;
HttpServletResponse httpResponse = (HttpServletResponse) response;
switch(secureComms) {
case HTTPS:
super.doFilter(request,response,chain);
return;
case SECRET:
if(sharedSecret.equals(httpRequest.getHeader(sharedSecretHeader)))
{
chain.doFilter(request, response);
}
else
{
httpResponse.sendError(HttpServletResponse.SC_FORBIDDEN, "Authentication failure");
}
return;
case NONE:
chain.doFilter(request,response);
return;
default:
httpResponse.sendError(HttpServletResponse.SC_FORBIDDEN, "Authentication failure");
}
}
@Override
protected boolean checkEnforce(ServletContext servletContext) throws IOException
{
/*
* Get the secureComms setting from the global properties bean.
*/
WebApplicationContext wc = WebApplicationContextUtils.getRequiredWebApplicationContext(servletContext);
Properties globalProperties = (Properties) wc.getBean(BEAN_GLOBAL_PROPERTIES);
String prop = globalProperties.getProperty(SECURE_COMMS);
if(logger.isDebugEnabled())
{
logger.debug("secureComms:"+prop);
}
/*
* Return true or false based on the property. This will switch on/off X509 enforcement in the X509ServletFilterBase.
*/
if (prop == null ||
SecureCommsType.getType(prop) == SecureCommsType.NONE ||
SecureCommsType.getType(prop) == SecureCommsType.SECRET)
{
return false;
}
else
{
return true;
}
return secureComms == SecureCommsType.HTTPS;
}
}

View File

@@ -1452,6 +1452,7 @@
<bean class="org.alfresco.rest.api.nodes.NodeVersionRenditionsRelation">
<property name="renditions" ref="Renditions" />
<property name="directAccessUrlHelper" ref="directAccessUrlHelper" />
</bean>
<bean class="org.alfresco.rest.api.quicksharelinks.QuickShareLinkRenditionsRelation">

View File

@@ -53,6 +53,7 @@ import org.junit.runners.Suite;
org.alfresco.rest.api.tests.NodeApiTest.class,
org.alfresco.rest.api.tests.NodeAssociationsApiTest.class,
org.alfresco.rest.api.tests.NodeVersionsApiTest.class,
org.alfresco.rest.api.tests.NodeVersionRenditionsApiTest.class,
org.alfresco.rest.api.tests.QueriesNodesApiTest.class,
org.alfresco.rest.api.tests.QueriesPeopleApiTest.class,
org.alfresco.rest.api.tests.QueriesSitesApiTest.class,

View File

@@ -2,7 +2,7 @@
* #%L
* Alfresco Remote API
* %%
* Copyright (C) 2005 - 2021 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
@@ -25,6 +25,8 @@
*/
package org.alfresco.rest.api.tests;
import org.alfresco.repo.content.directurl.SystemWideDirectUrlConfig;
import org.alfresco.rest.api.impl.directurl.RestApiDirectUrlConfig;
import org.alfresco.rest.api.tests.client.PublicApiHttpClient;
import static org.alfresco.rest.api.tests.util.RestApiUtil.toJsonAsString;
import static org.alfresco.rest.api.tests.util.RestApiUtil.toJsonAsStringNonNull;
@@ -219,6 +221,11 @@ public abstract class AbstractBaseApiTest extends EnterpriseTestApi
return URL_NODES + "/" + nodeId + "/" + REQUEST_DIRECT_ACCESS_URL;
}
protected String getRequestVersionRenditionContentDirectUrl(String nodeId, String versionId, String renditionId)
{
return getNodeVersionRenditionIdUrl(nodeId, versionId, renditionId) + "/" + REQUEST_DIRECT_ACCESS_URL;
}
protected String getRequestArchivedContentDirectUrl(String nodeId)
{
return URL_DELETED_NODES + "/" + nodeId + "/" + REQUEST_DIRECT_ACCESS_URL;
@@ -229,6 +236,17 @@ public abstract class AbstractBaseApiTest extends EnterpriseTestApi
return URL_DELETED_NODES + "/" + nodeId + "/" + URL_RENDITIONS + "/" + renditionID + "/" + REQUEST_DIRECT_ACCESS_URL;
}
protected String getRequestRenditionDirectAccessUrl(String nodeId, String renditionID)
{
return URL_NODES + "/" + nodeId + "/" + URL_RENDITIONS + "/" + renditionID + "/" + REQUEST_DIRECT_ACCESS_URL;
}
protected String getRequestVersionDirectAccessUrl(String nodeId, String versionId)
{
return URL_NODES + "/" + nodeId + "/" + URL_VERSIONS + "/" + versionId + "/" + REQUEST_DIRECT_ACCESS_URL;
}
/**
* The api scope. either public or private
*
@@ -724,6 +742,18 @@ public abstract class AbstractBaseApiTest extends EnterpriseTestApi
return createNode(parentId, folderName, TYPE_CM_FOLDER, props, Folder.class);
}
protected String createUniqueFolder(String parentId) throws Exception
{
return createFolder(parentId, "folder-" + System.currentTimeMillis()).getId();
}
protected String createUniqueContent(String folderId) throws Exception
{
Document documentResp = createTextFile(folderId, "file-" + System.currentTimeMillis(),
"some text-" + System.currentTimeMillis(), "UTF-8", null);
return documentResp.getId();
}
protected Node createNode(String parentId, String nodeName, String nodeType, Map<String, Object> props) throws Exception
{
return createNode(parentId, nodeName, nodeType, props, Node.class);
@@ -1035,6 +1065,16 @@ public abstract class AbstractBaseApiTest extends EnterpriseTestApi
return URL_NODES + "/" + nodeId + "/" + URL_RENDITIONS;
}
protected String getNodeRenditionIdUrl(String nodeId, String renditionID)
{
return URL_NODES + "/" + nodeId + "/" + URL_RENDITIONS + "/" + renditionID;
}
protected String getNodeVersionRenditionIdUrl(String nodeId, String versionId, String renditionID)
{
return URL_NODES + "/" + nodeId + "/" + URL_VERSIONS + "/" + versionId + "/" + URL_RENDITIONS + "/" + renditionID;
}
protected String getNodeVersionsUrl(String nodeId)
{
return URL_NODES + "/" + nodeId + "/" + URL_VERSIONS;
@@ -1065,5 +1105,20 @@ public abstract class AbstractBaseApiTest extends EnterpriseTestApi
return URL_NODES + "/" + nodeId;
}
protected void enableRestDirectAccessUrls()
{
SystemWideDirectUrlConfig systemDauConfig = (SystemWideDirectUrlConfig) applicationContext.getBean("systemWideDirectUrlConfig");
systemDauConfig.setEnabled(true);
RestApiDirectUrlConfig restDauConfig = (RestApiDirectUrlConfig) applicationContext.getBean("restApiDirectUrlConfig");
restDauConfig.setEnabled(true);
}
protected void disableRestDirectAccessUrls()
{
SystemWideDirectUrlConfig systemDauConfig = (SystemWideDirectUrlConfig) applicationContext.getBean("systemWideDirectUrlConfig");
systemDauConfig.setEnabled(false);
RestApiDirectUrlConfig restDauConfig = (RestApiDirectUrlConfig) applicationContext.getBean("restApiDirectUrlConfig");
restDauConfig.setEnabled(false);
}
}

View File

@@ -2,7 +2,7 @@
* #%L
* Alfresco Remote API
* %%
* Copyright (C) 2005 - 2021 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
@@ -6278,6 +6278,73 @@ public class NodeApiTest extends AbstractSingleNetworkSiteTest
HttpResponse dauResponse = post(getRequestContentDirectUrl(contentNodeId), null, null, null, null, 501);
}
@Test
public void testRequestContentDirectUrlClientErrorResponseForNodes() throws Exception
{
enableRestDirectAccessUrls();
//Node does not exist
setRequestContext(user1);
HttpResponse nodeDoesNotExistResponse = post(getRequestContentDirectUrl("non-existing-node-id"), null, 404);
//Node is not a file
String folderId = createFolder(tDocLibNodeId, "some-folder-name").getId();
HttpResponse nodeIsNotAFileReponse = post(getRequestContentDirectUrl(folderId), null, 400);
disableRestDirectAccessUrls();
}
@Test
public void testRequestContentDirectUrlClientErrorResponseForVersions() throws Exception
{
enableRestDirectAccessUrls();
// Create a document
setRequestContext(user1);
String folderNodeId = createUniqueFolder(getMyNodeId());
String contentNodeId = createUniqueContent(folderNodeId);
// Verify versions
HttpResponse versionIdDoesNotExistReponse = post(getRequestVersionDirectAccessUrl(contentNodeId, "1.2"), null, null, null, null, 404);
HttpResponse versionIdInvalidReponse = post(getRequestVersionDirectAccessUrl(contentNodeId, "invalid-version"), null, null, null, null, 404);
disableRestDirectAccessUrls();
}
@Test
public void testRequestContentDirectUrlClientErrorResponseForRenditions() throws Exception
{
enableRestDirectAccessUrls();
// Create a document
setRequestContext(user1);
String folderNodeId = createUniqueFolder(getMyNodeId());
String contentNodeId = createUniqueContent(folderNodeId);
// Verify renditions
HttpResponse renditionIdDoesNotExistReponse = post(getRequestRenditionDirectAccessUrl(contentNodeId, "pdf"), null, null, null, null, 404);
HttpResponse renditionIdInvalidReponse = post(getRequestRenditionDirectAccessUrl(contentNodeId, "invalid-rendition"), null, null, null, null, 404);
disableRestDirectAccessUrls();
}
@Test
public void testRequestContentDirectUrlClientErrorResponseForDeletion() throws Exception
{
enableRestDirectAccessUrls();
// Create a document
setRequestContext(user1);
String folderNodeId = createUniqueFolder(getMyNodeId());
String contentNodeId = createUniqueContent(folderNodeId);
// Verify deletion
HttpResponse nodeNotDeletedReponse = post(getRequestArchivedContentDirectUrl(contentNodeId), null, null, null, null, 404);
disableRestDirectAccessUrls();
}
@Test
public void testRequestVersionsContentDirectUrl() throws Exception
{
@@ -6366,5 +6433,92 @@ public class NodeApiTest extends AbstractSingleNetworkSiteTest
HttpResponse dauResponse = post(getRequestContentDirectUrl(contentNodeId), null, null, null, null, 501);
}
@Test
public void testRequestDeleteRendition() throws Exception
{
setRequestContext(networkOne.getId(), user1, null);
String myNodeId = getMyNodeId();
// Create multipart request - txt file
String renditionName = "pdf";
String fileName = "quick-1.txt";
File file = getResourceFile(fileName);
MultiPartRequest reqBody = MultiPartBuilder.create()
.setFileData(new FileData(fileName, file))
.setRenditions(Collections.singletonList(renditionName))
.build();
//Upload file to user home node
HttpResponse response = post(getNodeChildrenUrl(myNodeId), reqBody.getBody(), null, reqBody.getContentType(), 201);
Document document = RestApiUtil.parseRestApiEntry(response.getJsonResponse(), Document.class);
String contentNodeId = document.getId();
// wait and check that rendition is created ...
Rendition rendition = waitAndGetRendition(contentNodeId, null, renditionName);
assertNotNull(rendition);
assertEquals(Rendition.RenditionStatus.CREATED, rendition.getStatus());
//clean rendition
delete(getNodeRenditionIdUrl(contentNodeId, renditionName), null, null, null, null, 204);
//retry to double-check deletion
delete(getNodeRenditionIdUrl(contentNodeId, renditionName), null, null, null, null, 404);
//check if rendition was cleaned
HttpResponse getResponse = getSingle(getNodeRenditionIdUrl(contentNodeId, renditionName), null, 200);
Rendition renditionDeleted = RestApiUtil.parseRestApiEntry(getResponse.getJsonResponse(), Rendition.class);
assertNotNull(renditionDeleted);
assertEquals(Rendition.RenditionStatus.NOT_CREATED, renditionDeleted.getStatus());
}
@Test
public void testRequestVersionDeleteRendition() throws Exception
{
setRequestContext(networkOne.getId(), user1, null);
String myNodeId = getMyNodeId();
// Create multipart request - txt file
String renditionName = "pdf";
String fileName = "quick-1.txt";
File file = getResourceFile(fileName);
MultiPartRequest reqBody = MultiPartBuilder.create()
.setFileData(new FileData(fileName, file))
.setRenditions(Collections.singletonList(renditionName))
.build();
//Upload file to user home node
HttpResponse response = post(getNodeChildrenUrl(myNodeId), reqBody.getBody(), null, reqBody.getContentType(), 201);
Document document = RestApiUtil.parseRestApiEntry(response.getJsonResponse(), Document.class);
String contentNodeId = document.getId();
//Update file to newer version
String content = "The quick brown fox jumps over the lazy dog\n the lazy dog jumps over the quick brown fox";
Map<String, String> params = new HashMap<>();
params.put("comment", "my version ");
document = updateTextFile(contentNodeId, content, params);
assertTrue(document.getAspectNames().contains("cm:versionable"));
assertNotNull(document.getProperties());
assertEquals("1.1", document.getProperties().get("cm:versionLabel"));
// create rendition for old version and check that rendition is created ...
Rendition renditionUpdated = createAndGetRendition(contentNodeId, "1.0", renditionName);
assertNotNull(renditionUpdated);
assertEquals(Rendition.RenditionStatus.CREATED, renditionUpdated.getStatus());
//clean rendition
delete(getNodeVersionRenditionIdUrl(contentNodeId, "1.0", renditionName), null, null, null, null, 204);
//retry to double-check deletion
delete(getNodeVersionRenditionIdUrl(contentNodeId, "1.0", renditionName), null, null, null, null, 404);
//check if rendition was cleaned
HttpResponse getResponse = getSingle(getNodeVersionRenditionIdUrl(contentNodeId, "1.0", renditionName), null, 200);
Rendition renditionDeleted = RestApiUtil.parseRestApiEntry(getResponse.getJsonResponse(), Rendition.class);
assertNotNull(renditionDeleted);
assertEquals(Rendition.RenditionStatus.NOT_CREATED, renditionDeleted.getStatus());
}
}

View File

@@ -2,7 +2,7 @@
* #%L
* Alfresco Remote API
* %%
* 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
@@ -27,20 +27,32 @@ package org.alfresco.rest.api.tests;
import org.alfresco.repo.content.MimetypeMap;
import org.alfresco.repo.security.authentication.AuthenticationUtil;
import org.alfresco.repo.web.scripts.RepositoryContainer;
import org.alfresco.rest.AbstractSingleNetworkSiteTest;
import org.alfresco.rest.api.DirectAccessUrlHelper;
import org.alfresco.rest.api.impl.directurl.RestApiDirectUrlConfig;
import org.alfresco.rest.api.model.Site;
import org.alfresco.rest.api.nodes.NodesEntityResource;
import org.alfresco.rest.api.tests.client.HttpResponse;
import org.alfresco.rest.api.tests.client.PublicApiClient.Paging;
import org.alfresco.rest.api.tests.client.data.ContentInfo;
import org.alfresco.rest.api.tests.client.data.Document;
import org.alfresco.rest.api.tests.client.data.Node;
import org.alfresco.rest.api.tests.client.data.Rendition;
import org.alfresco.rest.api.tests.util.MultiPartBuilder;
import org.alfresco.rest.api.tests.util.MultiPartBuilder.FileData;
import org.alfresco.rest.api.tests.util.MultiPartBuilder.MultiPartRequest;
import org.alfresco.rest.api.tests.util.RestApiUtil;
import static org.alfresco.rest.api.tests.util.RestApiUtil.toJsonAsString;
import static org.junit.Assert.*;
import org.alfresco.service.cmr.site.SiteVisibility;
import org.junit.After;
import org.junit.Test;
import org.mockito.Mockito;
import java.io.File;
import java.util.*;
/**
@@ -273,6 +285,138 @@ public class NodeVersionRenditionsApiTest extends AbstractSingleNetworkSiteTest
}
}
@Test
public void testRequestVersionRenditionContentDirectUrl() throws Exception
{
setRequestContext(user1);
RepoService.TestNetwork networkN1;
RepoService.TestPerson userOneN1;
Site userOneN1Site;
networkN1 = repoService.createNetworkWithAlias("ping", true);
networkN1.create();
userOneN1 = networkN1.createUser();
setRequestContext(networkN1.getId(), userOneN1.getId(), null);
String siteTitle = "RandomSite" + System.currentTimeMillis();
userOneN1Site = createSite(siteTitle, SiteVisibility.PRIVATE);
String PROP_LTM = "cm:lastThumbnailModification";
String RENDITION_NAME = "imgpreview";
String userId = userOneN1.getId();
setRequestContext(networkN1.getId(), userOneN1.getId(), null);
// Create a folder within the site document's library
String folderName = "folder" + System.currentTimeMillis();
String parentId = getSiteContainerNodeId(userOneN1Site.getId(), "documentLibrary");
String folder_Id = createNode(parentId, folderName, TYPE_CM_FOLDER, null).getId();
// Create multipart request - pdf file
String fileName = "quick.pdf";
File file = getResourceFile(fileName);
MultiPartRequest reqBody = MultiPartBuilder.create()
.setFileData(new FileData(fileName, file))
.build();
Map<String, String> params = Collections.singletonMap("include", "properties");
// Upload quick.pdf file into 'folder' - do not include request to create 'doclib' thumbnail
HttpResponse response = post(getNodeChildrenUrl(folder_Id), reqBody.getBody(), params, null, "alfresco", reqBody.getContentType(), 201);
Document document1 = RestApiUtil.parseRestApiEntry(response.getJsonResponse(), Document.class);
String contentNodeId = document1.getId();
assertNotNull(document1.getProperties());
// pause briefly
Thread.sleep(DELAY_IN_MS);
// Get rendition (not created yet) information for node
response = getSingle(getNodeRenditionsUrl(contentNodeId), RENDITION_NAME, 200);
Rendition rendition = RestApiUtil.parseRestApiEntry(response.getJsonResponse(), Rendition.class);
assertNotNull(rendition);
assertEquals(Rendition.RenditionStatus.NOT_CREATED, rendition.getStatus());
params = new HashMap<>();
params.put("placeholder", "false");
getSingle(getNodeRenditionsUrl(contentNodeId), (RENDITION_NAME + "/content"), params, 404);
// Create and get 'imgpreview' rendition
rendition = createAndGetRendition(contentNodeId, RENDITION_NAME);
assertNotNull(rendition);
params = new HashMap<>();
params.put("placeholder", "false");
response = getSingle(getNodeRenditionsUrl(contentNodeId), (RENDITION_NAME + "/content"), params, 200);
byte[] renditionBytes1 = response.getResponseAsBytes();
assertNotNull(renditionBytes1);
// check node details ...
params = Collections.singletonMap("include", "properties");
response = getSingle(NodesEntityResource.class, contentNodeId, params, 200);
Document document1b = RestApiUtil.parseRestApiEntry(response.getJsonResponse(), Document.class);
assertEquals(document1b.getModifiedByUser().getId(), document1.getModifiedByUser().getId());
// upload another version of "quick.pdf" and check again
fileName = "quick-2.pdf";
file = getResourceFile(fileName);
reqBody = MultiPartBuilder.create()
.setFileData(new FileData("quick.pdf", file))
.setOverwrite(true)
.build();
response = post(getNodeChildrenUrl(folder_Id), reqBody.getBody(), null, null, "alfresco", reqBody.getContentType(), 201);
Document document2 = RestApiUtil.parseRestApiEntry(response.getJsonResponse(), Document.class);
assertEquals(contentNodeId, document2.getId());
// wait to allow new version of the rendition to be created ...
Thread.sleep(DELAY_IN_MS * 4);
params = new HashMap<>();
params.put("placeholder", "false");
response = getSingle(getNodeRenditionsUrl(contentNodeId), (RENDITION_NAME + "/content"), params, 200);
assertNotNull(response.getResponseAsBytes());
// check rendition binary has changed
assertNotEquals(renditionBytes1, response.getResponseAsBytes());
params = Collections.singletonMap("include", "properties");
response = getSingle(NodesEntityResource.class, contentNodeId, params, 200);
Document document2b = RestApiUtil.parseRestApiEntry(response.getJsonResponse(), Document.class);
String contentNodeId2b = document2b.getId();
HttpResponse dauResponse = post(getRequestVersionRenditionContentDirectUrl(contentNodeId2b, "1.0", RENDITION_NAME), null, null, null, null, 501);
}
@Test
public void testRequestVersionRenditionContentDirectUrlErrorResponses () throws Exception
{
setRequestContext(user1);
String folderNodeId = createUniqueFolder(getMyNodeId());
String contentNodeId = createUniqueContent(folderNodeId);
createVersionRendition(contentNodeId, "1.0", "doclib");
// REST direct access URLs must be enabled in order to test DAU error responses
enableRestDirectAccessUrls();
// Test error response for node does not exist
HttpResponse dauResponseForNoSuchNode = post(getRequestVersionRenditionContentDirectUrl("nosuchnode", "1.0", "doclib"), null, 404);
// Test error response for node is not a file
HttpResponse dauResponseForNodeIsNotAFile = post(getRequestVersionRenditionContentDirectUrl(folderNodeId, "1.0", "doclib"), null, 400);
// Test error response for version does not exist
HttpResponse dauResponseForNoSuchVersion = post(getRequestVersionRenditionContentDirectUrl(contentNodeId, "2.0", "doclib"), null, 404);
// Test error response for rendition does not exist
HttpResponse dauResponseForNoSuchRendition = post(getRequestVersionRenditionContentDirectUrl(contentNodeId, "1.0", "avatar"), null, 404);
disableRestDirectAccessUrls();
}
private void checkCreateAndGetVersionRendition(String docId, String versionId, String renditionId) throws Exception
{
String getRenditionsUrl;
@@ -361,6 +505,12 @@ public class NodeVersionRenditionsApiTest extends AbstractSingleNetworkSiteTest
assertTrue(contentInfo.getSizeInBytes() > 0);
}
private void createVersionRendition(String contentNodeId, String versionId, String renditionId) throws Exception
{
getAll(getNodeVersionRenditionsUrl(contentNodeId, versionId), null, 200);
checkCreateAndGetVersionRendition(contentNodeId, versionId, renditionId);
}
@Override
public String getScope()
{

View File

@@ -204,7 +204,7 @@ public class SharedLinkApiTest extends AbstractBaseApiTest
assertEquals(d1Id, resp.getNodeId());
assertEquals(fileName1, resp.getName());
assertEquals("The quick brown fox jumps over the lazy dog", resp.getTitle());
assertEquals("Gym class featuring a brown fox and lazy dog", resp.getDescription());
assertEquals("Pangram, fox, dog, Gym class featuring a brown fox and lazy dog", resp.getDescription());
assertEquals(file1_MimeType, resp.getContent().getMimeType());
assertEquals("Adobe PDF Document", resp.getContent().getMimeTypeName());
@@ -245,7 +245,7 @@ public class SharedLinkApiTest extends AbstractBaseApiTest
assertEquals(shared1Id, resp.getId());
assertEquals(fileName1, resp.getName());
assertEquals("The quick brown fox jumps over the lazy dog", resp.getTitle());
assertEquals("Gym class featuring a brown fox and lazy dog", resp.getDescription());
assertEquals("Pangram, fox, dog, Gym class featuring a brown fox and lazy dog", resp.getDescription());
assertEquals(d1Id, resp.getNodeId());
assertNull(resp.getAllowableOperations()); // include is ignored
assertNull(resp.getAllowableOperationsOnTarget()); // include is ignored
@@ -1319,7 +1319,7 @@ public class SharedLinkApiTest extends AbstractBaseApiTest
// Quick check that some extended info is present.
assertEquals("The quick brown fox jumps over the lazy dog", sharedLink.getTitle());
assertEquals("Gym class featuring a brown fox and lazy dog", sharedLink.getDescription());
assertEquals("Pangram, fox, dog, Gym class featuring a brown fox and lazy dog", sharedLink.getDescription());
});
}

View File

@@ -7,7 +7,7 @@
<parent>
<groupId>org.alfresco</groupId>
<artifactId>alfresco-community-repo</artifactId>
<version>14.73</version>
<version>14.107</version>
</parent>
<dependencies>
@@ -46,6 +46,10 @@
<groupId>com.sun.mail</groupId>
<artifactId>javax.mail</artifactId>
</exclusion>
<exclusion>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
</exclusion>
</exclusions>
</dependency>
@@ -122,7 +126,7 @@
<dependency>
<groupId>com.ibm.icu</groupId>
<artifactId>icu4j</artifactId>
<version>68.2</version>
<version>70.1</version>
</dependency>
<dependency>
<groupId>com.googlecode.json-simple</groupId>
@@ -138,7 +142,7 @@
<dependency>
<groupId>org.mozilla</groupId>
<artifactId>rhino</artifactId>
<version>1.7.13</version>
<version>1.7.14</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
@@ -198,24 +202,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>
@@ -237,7 +223,7 @@
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
<artifactId>slf4j-reload4j</artifactId>
</dependency>
<dependency>
<groupId>xerces</groupId>
@@ -427,12 +413,12 @@
<dependency>
<groupId>org.mybatis</groupId>
<artifactId>mybatis</artifactId>
<version>3.3.0</version>
<version>3.5.9</version>
</dependency>
<dependency>
<groupId>org.mybatis</groupId>
<artifactId>mybatis-spring</artifactId>
<version>1.2.5</version>
<version>2.0.6</version>
</dependency>
<!-- Activiti -->

View File

@@ -2,7 +2,7 @@
* #%L
* Alfresco Repository
* %%
* Copyright (C) 2005 - 2021 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
@@ -28,6 +28,7 @@ package org.alfresco.ibatis;
import org.alfresco.metrics.db.DBMetricsReporter;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.ibatis.cursor.Cursor;
import org.apache.ibatis.executor.BatchResult;
import org.apache.ibatis.session.Configuration;
import org.apache.ibatis.session.ResultContext;
@@ -246,6 +247,48 @@ public class SqlSessionMetricsWrapper implements SqlSession
}
}
@Override
public <T> Cursor<T> selectCursor(String statement)
{
long startTime = System.currentTimeMillis();
try
{
return this.sqlSession.selectCursor(statement);
}
finally
{
reportQueryExecuted(startTime, SELECT_LABEL, statement);
}
}
@Override
public <T> Cursor<T> selectCursor(String statement, Object parameter)
{
long startTime = System.currentTimeMillis();
try
{
return this.sqlSession.selectCursor(statement, parameter);
}
finally
{
reportQueryExecuted(startTime, SELECT_LABEL, statement);
}
}
@Override
public <T> Cursor<T> selectCursor(String statement, Object parameter, RowBounds rowBounds)
{
long startTime = System.currentTimeMillis();
try
{
return this.sqlSession.selectCursor(statement, parameter, rowBounds);
}
finally
{
reportQueryExecuted(startTime, SELECT_LABEL, statement);
}
}
@Override
public int insert(String statement)
{

View File

@@ -86,6 +86,7 @@ public abstract class AbstractLocalTransform implements LocalTransform
String renditionName, NodeRef sourceNodeRef)
throws UnsupportedTransformationException, ContentIOException;
@Override
public String getName()
{
return name;

View File

@@ -2,7 +2,7 @@
* #%L
* Alfresco Repository
* %%
* Copyright (C) 2019 Alfresco Software Limited
* Copyright (C) 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
@@ -25,6 +25,7 @@
*/
package org.alfresco.repo.content.transform;
import org.alfresco.transform.client.model.config.CoreFunction;
import org.alfresco.transform.client.registry.TransformServiceRegistry;
import java.util.Map;
@@ -49,4 +50,10 @@ public class DummyTransformServiceRegistry implements TransformServiceRegistry
{
return null;
}
@Override
public boolean isSupported(CoreFunction function, String transformerName)
{
return true;
}
}

View File

@@ -2,7 +2,7 @@
* #%L
* Alfresco Repository
* %%
* Copyright (C) 2019 Alfresco Software Limited
* Copyright (C) 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
@@ -54,4 +54,9 @@ public interface LocalTransform
void transform(ContentReader reader, ContentWriter writer, Map<String, String> transformOptions,
String renditionName, NodeRef sourceNodeRef)
throws UnsupportedTransformationException, ContentIOException;
/**
* @return the name of the transform.
*/
String getName();
}

View File

@@ -2,7 +2,7 @@
* #%L
* Alfresco Repository
* %%
* Copyright (C) 2019 - 2021 Alfresco Software Limited
* Copyright (C) 2019 - 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
@@ -36,6 +36,7 @@ import java.util.function.Consumer;
import java.util.stream.Collectors;
import org.alfresco.service.cmr.repository.MimetypeService;
import org.alfresco.transform.client.model.config.CoreFunction;
import org.alfresco.transform.client.model.config.TransformOptionGroup;
import org.alfresco.transform.client.registry.CombinedConfig;
import org.alfresco.transform.client.model.config.TransformOption;
@@ -473,4 +474,17 @@ public class LocalTransformServiceRegistry extends TransformServiceRegistryImpl
}
return localTransform;
}
/**
* Returns {@code true} if the {@code function} is supported by the transform. Not all transforms are
* able to support all functionality, as newer features may have been introduced into the core t-engine code since
* it was released.
* @param function to be checked.
* @param transform the local transform.
* @return {@code true} is supported, {@code false} otherwise.
*/
boolean isSupported(CoreFunction function, LocalTransform transform)
{
return isSupported(function, transform.getName());
}
}

View File

@@ -352,13 +352,20 @@ public abstract class AbstractContentDataDAOImpl implements ContentDataDAO
}
/**
* Looks the node up based on the NodeRef of the given node
* Looks the entity up based on the ContentURL of the given node
*/
@Override
public Pair<Long, ContentUrlEntity> findByValue(ContentUrlEntity entity)
{
String contentUrl = entity.getContentUrl();
ContentUrlEntity ret = getContentUrlEntity(contentUrl);
// Validate if this entity has exactly the value we are looking for or if it is a CRC collision
if (ret != null && !entity.getContentUrl().equals(ret.getContentUrl()))
{
throw new IllegalArgumentException("Collision detected for this contentURL. '" + entity.getContentUrl()
+ "' collides with existing contentURL '" + ret.getContentUrl() + "'. (ContentUrlShort;ContentUrlCrc) pair collision: ('"
+ entity.getContentUrlShort() + "';'" + entity.getContentUrlCrc() + "')");
}
return (ret != null ? new Pair<Long, ContentUrlEntity>(ret.getId(), ret) : null);
}

View File

@@ -2,7 +2,7 @@
* #%L
* Alfresco Repository
* %%
* Copyright (C) 2005 - 2018 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
@@ -112,6 +112,14 @@ public interface RenditionService2
@NotAuditable
ChildAssociationRef getRenditionByName(NodeRef sourceNodeRef, String renditionName);
/**
* This method clears source nodeRef rendition content and content hash code using supplied rendition name.
*
* @param renditionNode the rendition node
*/
@NotAuditable
void clearRenditionContentDataInTransaction(NodeRef renditionNode);
/**
* Indicates if renditions are enabled. Set using the {@code system.thumbnail.generate} value.
*/

View File

@@ -2,7 +2,7 @@
* #%L
* Alfresco Repository
* %%
* Copyright (C) 2005 - 2021 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
@@ -38,6 +38,7 @@ import org.alfresco.repo.transaction.RetryingTransactionHelper;
import org.alfresco.repo.util.PostTxnCallbackScheduler;
import org.alfresco.service.cmr.repository.ChildAssociationRef;
import org.alfresco.service.cmr.repository.ContentData;
import org.alfresco.service.cmr.repository.ContentReader;
import org.alfresco.service.cmr.repository.ContentService;
import org.alfresco.service.cmr.repository.ContentWriter;
import org.alfresco.service.cmr.repository.NodeRef;
@@ -553,11 +554,21 @@ public class RenditionService2Impl implements RenditionService2, InitializingBea
contentWriter.setEncoding(DEFAULT_ENCODING);
ContentWriter renditionWriter = contentWriter;
renditionWriter.putContent(transformInputStream);
if (logger.isDebugEnabled())
ContentReader contentReader = renditionWriter.getReader();
long sizeOfRendition = contentReader.getSize();
if (sizeOfRendition > 0L)
{
logger.debug("Set rendition hashcode for " + renditionName);
if (logger.isDebugEnabled()) {
logger.debug("Set rendition hashcode for " + renditionName);
}
nodeService.setProperty(renditionNode, RenditionModel.PROP_RENDITION_CONTENT_HASH_CODE, transformContentHashCode);
}
else
{
logger.error("Transform was zero bytes for " + renditionName + " on " + sourceNodeRef);
clearRenditionContentData(renditionNode);
}
nodeService.setProperty(renditionNode, RenditionModel.PROP_RENDITION_CONTENT_HASH_CODE, transformContentHashCode);
}
catch (Exception e)
{
@@ -892,6 +903,17 @@ public class RenditionService2Impl implements RenditionService2, InitializingBea
}
}
@Override
public void clearRenditionContentDataInTransaction(NodeRef renditionNode)
{
AuthenticationUtil.runAsSystem((AuthenticationUtil.RunAsWork<Void>) () ->
transactionService.getRetryingTransactionHelper().doInTransaction(() ->
{
clearRenditionContentData(renditionNode);
return null;
}, false, true));
}
@Override
public boolean isEnabled()
{

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
@@ -25,6 +25,7 @@
*/
package org.alfresco.repo.rendition2;
import org.alfresco.transform.client.model.config.CoreFunction;
import org.alfresco.transform.client.registry.TransformServiceRegistry;
import java.util.Map;
@@ -78,4 +79,10 @@ public class SwitchingTransformServiceRegistry implements TransformServiceRegist
}
return name;
}
@Override
public boolean isSupported(CoreFunction function, String transformerName)
{
return primary.isSupported(function, transformerName) && secondary.isSupported(function, transformerName);
}
}

View File

@@ -47,6 +47,8 @@ import java.io.StringReader;
import java.util.Collections;
import java.util.List;
import static org.alfresco.transform.client.util.RequestParamMap.INCLUDE_CORE_VERSION;
/**
* This class reads multiple T-Engine config and local files and registers as if they were all
* in one file. Transform options are shared between all sources.<p>
@@ -104,7 +106,7 @@ public class CombinedConfig extends CombinedTransformConfig
private boolean addRemoteConfig(String baseUrl, String remoteType)
{
String url = baseUrl + (baseUrl.endsWith("/") ? "" : "/") + "transform/config";
String url = baseUrl + (baseUrl.endsWith("/") ? "" : "/") + "transform/config?" + INCLUDE_CORE_VERSION + "=" + true;
HttpGet httpGet = new HttpGet(url);
boolean successReadingConfig = true;
try

View File

@@ -33,9 +33,12 @@
<view:properties>
<cm:description></cm:description>
<cm:name>extensions</cm:name>
<cm:isIndexed>false</cm:isIndexed>
<cm:isContentIndexed>false</cm:isContentIndexed>
</view:properties>
<view:aspects>
<sys:hidden/>
<cm:indexControl/>
</view:aspects>
</cm:folder>
</cm:contains>
@@ -50,9 +53,12 @@
<view:properties>
<cm:description></cm:description>
<cm:name>module-deployments</cm:name>
<cm:isIndexed>false</cm:isIndexed>
<cm:isContentIndexed>false</cm:isContentIndexed>
</view:properties>
<view:aspects>
<sys:hidden/>
<cm:indexControl/>
</view:aspects>
</cm:folder>
</cm:contains>

View File

@@ -49,12 +49,12 @@
<select id="select_Tenant" resultMap="result_Tenant">
select
tenant_domain as tenantDomain,
tenant_domain as tenant_domain,
version as version,
enabled as enabled,
tenant_name as tenantName,
content_root as contentRoot,
db_url as dbUrl
enabled enabled,
tenant_name tenant_name,
content_root content_root,
db_url db_url
from
alf_tenant
where
@@ -63,12 +63,12 @@
<select id="select_Tenants" parameterType="TenantQuery" resultMap="result_Tenant">
select
tenant_domain as tenantDomain,
version as version,
enabled as enabled,
tenant_name as tenantName,
content_root as contentRoot,
db_url as dbUrl
tenant_domain as tenant_domain,
version as version,
enabled as enabled,
tenant_name as tenant_name,
content_root as content_root,
db_url as db_url
from
alf_tenant
<where>

View File

@@ -15,7 +15,7 @@
</if>
</select>
<select id="select_ChildNodeIds_Limited" parameterType="Ids" resultMap="alfresco.node.result_ChildAssocIds" fetchSize="-2147483648">
<select id="select_ChildNodeIds_Limited" parameterType="ChildAssoc" resultMap="alfresco.node.result_ChildAssocIds" fetchSize="-2147483648">
<include refid="alfresco.node.select_ChildNodeIds_Limited_Snippet"/>
</select>

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

@@ -430,7 +430,7 @@ public class ActionServiceImpl2Test
{
public Void execute() throws Throwable
{
assertEquals("Gym class featuring a brown fox and lazy dog",
assertEquals("Pangram, fox, dog, Gym class featuring a brown fox and lazy dog",
nodeService.getProperty(testNode, ContentModel.PROP_DESCRIPTION));
return null;
}

View File

@@ -85,7 +85,7 @@ import java.util.Set;
public class ContentMetadataExtracterTest extends BaseSpringTest
{
protected static final String QUICK_TITLE = "The quick brown fox jumps over the lazy dog";
protected static final String QUICK_DESCRIPTION = "Gym class featuring a brown fox and lazy dog";
protected static final String QUICK_DESCRIPTION = "Pangram, fox, dog, Gym class featuring a brown fox and lazy dog";
protected static final String QUICK_CREATOR = "Nevin Nollop";
private NodeService nodeService;

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

@@ -84,7 +84,7 @@ public abstract class AbstractMetadataExtracterTest extends TestCase
protected ApplicationContext ctx;
public static final String QUICK_TITLE = "The quick brown fox jumps over the lazy dog";
public static final String QUICK_DESCRIPTION = "Gym class featuring a brown fox and lazy dog";
public static final String QUICK_DESCRIPTION = "Pangram, fox, dog, Gym class featuring a brown fox and lazy dog";
public static final String QUICK_CREATOR = "Nevin Nollop";
public static final String QUICK_CREATOR_EMAIL = "nevin.nollop@alfresco.com";
public static final String QUICK_PREVIOUS_AUTHOR = "Derek Hulley";

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

@@ -113,6 +113,31 @@ public class ImporterComponentTest extends BaseSpringTest
importerService.importView(testReader, location, null, new ImportTimerProgress());
System.out.println(NodeStoreInspector.dumpNodeStore(nodeService, storeRef));
}
@Test
public void testImportNotIndexedSubfolder() throws Exception
{
InputStream test = getClass().getClassLoader().getResourceAsStream(
"org/alfresco/repo/importer/import_not_indexed_subfolder.xml");
try (InputStreamReader testReader = new InputStreamReader(test, "UTF-8"))
{
Location location = new Location(storeRef);
importerService.importView(testReader, location, null, new ImportTimerProgress());
NodeRef rootNodeRef = nodeService.getRootNode(storeRef);
NodeRef testParentFolderRef = nodeService.getChildAssocs(rootNodeRef).get(0).getChildRef();
NodeRef testSubfolderRef = nodeService.getChildAssocs(testParentFolderRef).get(0).getChildRef();
assertFalse("The node's isIndexed property should be false.",
DefaultTypeConverter.INSTANCE.convert(Boolean.class,
nodeService.getProperty(testSubfolderRef, ContentModel.PROP_IS_INDEXED)));
assertFalse("The node's isContentIndexed property should be false.",
DefaultTypeConverter.INSTANCE.convert(Boolean.class,
nodeService.getProperty(testSubfolderRef, ContentModel.PROP_IS_CONTENT_INDEXED)));
assertTrue("The node should be marked with the indexControl aspect.",
nodeService.getAspects(testSubfolderRef).contains(ContentModel.ASPECT_INDEX_CONTROL));
}
}
@Test
public void testImportWithAuditableProperties() throws Exception

View File

@@ -41,6 +41,7 @@ import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Locale;
import java.util.Map;
@@ -52,6 +53,8 @@ import org.alfresco.repo.cache.SimpleCache;
import org.alfresco.repo.cache.TransactionalCache;
import org.alfresco.repo.cache.TransactionalCache.ValueHolder;
import org.alfresco.repo.content.MimetypeMap;
import org.alfresco.repo.domain.contentdata.ContentDataDAO;
import org.alfresco.repo.domain.contentdata.ContentUrlEntity;
import org.alfresco.repo.domain.node.Node;
import org.alfresco.repo.domain.node.NodeDAO;
import org.alfresco.repo.domain.node.NodeEntity;
@@ -95,6 +98,9 @@ import org.alfresco.service.cmr.repository.StoreRef;
import org.alfresco.service.cmr.repository.datatype.DefaultTypeConverter;
import org.alfresco.service.cmr.security.PermissionService;
import org.alfresco.service.cmr.security.PersonService;
import org.alfresco.service.cmr.version.Version;
import org.alfresco.service.cmr.version.VersionHistory;
import org.alfresco.service.cmr.version.VersionService;
import org.alfresco.service.namespace.NamespaceService;
import org.alfresco.service.namespace.QName;
import org.alfresco.service.namespace.RegexQNamePattern;
@@ -145,12 +151,15 @@ public class NodeServiceTest
private static ContentService contentService;
private static PermissionService permissionService;
private static NodeDAO nodeDAO;
private static VersionService versionService;
private static TransactionService txnService;
private static PolicyComponent policyComponent;
private static CannedQueryDAO cannedQueryDAOForTesting;
private static SimpleCache<Serializable, ValueHolder<Serializable>> nodesCache;
private static SimpleCache<Serializable, ValueHolder<Serializable>> propsCache;
private static SimpleCache<Serializable, ValueHolder<Serializable>> aspectsCache;
private static SimpleCache<Long, ContentUrlEntity> contentDataCache;
private static SimpleCache<Long, ContentUrlEntity> contentUrlCache;
private static Long deletedTypeQNameId;
@@ -168,6 +177,7 @@ public class NodeServiceTest
contentService = serviceRegistry.getContentService();
permissionService = serviceRegistry.getPermissionService();
nodeDAO = (NodeDAO) APP_CONTEXT_INIT.getApplicationContext().getBean("nodeDAO");
versionService = serviceRegistry.getVersionService();
txnService = serviceRegistry.getTransactionService();
policyComponent = (PolicyComponent) APP_CONTEXT_INIT.getApplicationContext().getBean("policyComponent");
cannedQueryDAOForTesting = (CannedQueryDAO) APP_CONTEXT_INIT.getApplicationContext().getBean("cannedQueryDAOForTesting");
@@ -176,11 +186,15 @@ public class NodeServiceTest
nodesCache = (SimpleCache<Serializable, ValueHolder<Serializable>>) APP_CONTEXT_INIT.getApplicationContext().getBean("node.nodesSharedCache");
propsCache = (SimpleCache<Serializable, ValueHolder<Serializable>>) APP_CONTEXT_INIT.getApplicationContext().getBean("node.propertiesSharedCache");
aspectsCache = (SimpleCache<Serializable, ValueHolder<Serializable>>) APP_CONTEXT_INIT.getApplicationContext().getBean("node.aspectsSharedCache");
contentDataCache = (SimpleCache<Long, ContentUrlEntity>) APP_CONTEXT_INIT.getApplicationContext().getBean("contentDataCache");
contentUrlCache = (SimpleCache<Long, ContentUrlEntity>) APP_CONTEXT_INIT.getApplicationContext().getBean("contentUrlCache");
// Clear the caches to remove fluff
nodesCache.clear();
propsCache.clear();
aspectsCache.clear();
contentDataCache.clear();
contentUrlCache.clear();
AuthenticationUtil.setRunAsUserSystem();
@@ -2433,6 +2447,125 @@ public class NodeServiceTest
return null;
}, userName1);
}
/**
* See MNT-22710
*/
@Test
public void testChangeContentURLSameCRC()
{
ContentPropertyRestrictionInterceptor contentPropertyRestrictionInterceptor =
(ContentPropertyRestrictionInterceptor) APP_CONTEXT_INIT.getApplicationContext().getBean("contentPropertyRestrictionInterceptor");
contentPropertyRestrictionInterceptor.setGlobalContentPropertyRestrictionWhiteList(this.getClass().getName());
try
{
NodeRef workspaceRootNodeRef = nodeService.getRootNode(StoreRef.STORE_REF_WORKSPACE_SPACESSTORE);
Map<QName, Serializable> props = new HashMap<>(3);
props.put(ContentModel.PROP_NAME, GUID.generate());
NodeRef testFolder = nodeService.createNode(
workspaceRootNodeRef,
ContentModel.ASSOC_CHILDREN,
QName.createQName(NAMESPACE, GUID.generate()),
ContentModel.TYPE_FOLDER,
props).getChildRef();
NodeRef nodeRef1 = nodeService.createNode(
testFolder,
ContentModel.ASSOC_CONTAINS,
QName.createQName("180225704974-DSA Correspondence 1"),
ContentModel.TYPE_CONTENT).getChildRef();
NodeRef nodeRef2 = nodeService.createNode(
testFolder,
ContentModel.ASSOC_CONTAINS,
QName.createQName("090502800600-General Correspondence 1"),
ContentModel.TYPE_CONTENT).getChildRef();
// CRC: 2997538036
String contentURL1 = "s3v2://contentstore/1597325412593_1610985343942_3708/SLC/IC/DSA/2018/02/16/20/180225704974-DSA Correspondence 1";
// CRC: 2921900407
String contentURL2 = "s3v2://contentstore/1639588316822_1642775862393_49/SLC/IC/GENERAL/2009/05/27/16/090502800600-General Correspondence 1";
// CRC: 2997538036 (same CRC as contentURL1)
String contentURL3 = "s3v2://contentstore/1639588316821_1642775862393_49/SLC/IC/GENERAL/2009/05/27/16/090502800600-General Correspondence 1";
ContentData contentData1 = new ContentData(
contentURL1,
"application/pdf",
100L,
"UTF-8"
);
ContentData contentData2 = new ContentData(
contentURL2,
"application/pdf",
100L,
"UTF-8"
);
ContentData contentData3 = new ContentData(
contentURL3,
"application/pdf",
100L,
"UTF-8"
);
// Setting same contentURLs
nodeService.setProperty(nodeRef1, ContentModel.PROP_CONTENT, contentData1);
nodeService.setProperty(nodeRef2, ContentModel.PROP_CONTENT, contentData1);
//Validate the data
ContentData cdNode1Val0= (ContentData) nodeService.getProperty(nodeRef1, ContentModel.PROP_CONTENT);
ContentData cdNode2Val0= (ContentData) nodeService.getProperty(nodeRef2, ContentModel.PROP_CONTENT);
assertEquals("ContentURL for node1 should be contentURL1",contentURL1,cdNode1Val0.getContentUrl());
assertEquals("ContentURL for node2 should also be the same as node1",contentURL1,cdNode2Val0.getContentUrl());
// Setting non colliding URLS
nodeService.setProperty(nodeRef2, ContentModel.PROP_CONTENT, contentData2);
//Validate the data
ContentData cdNode1Val1= (ContentData) nodeService.getProperty(nodeRef1, ContentModel.PROP_CONTENT);
ContentData cdNode2Val1= (ContentData) nodeService.getProperty(nodeRef2, ContentModel.PROP_CONTENT);
assertEquals("ContentURL for node1 should be contentURL1",contentURL1,cdNode1Val1.getContentUrl());
assertEquals("ContentURL for node2 should be contentURL2",contentURL2,cdNode2Val1.getContentUrl());
//Set a colliding URL
try
{
nodeService.setProperty(nodeRef2, ContentModel.PROP_CONTENT, contentData3);
fail("Should not be possible to set a contentUrl with the same CRC and different value");
}
catch (IllegalArgumentException e)
{
//Expected
}
//Validate the contentURL values
ContentData cdNode1Val2= (ContentData) nodeService.getProperty(nodeRef1, ContentModel.PROP_CONTENT);
ContentData cdNode2Val2= (ContentData) nodeService.getProperty(nodeRef2, ContentModel.PROP_CONTENT);
assertFalse("Collision detected on node 1",contentURL3.equals(cdNode1Val2.getContentUrl()));
assertFalse("Collision detected on node 2",contentURL1.equals(cdNode2Val2.getContentUrl()));
//Clear caches and validate again
propsCache.clear();
contentDataCache.clear();
contentUrlCache.clear();
ContentData cdNode1Val3= (ContentData) nodeService.getProperty(nodeRef1, ContentModel.PROP_CONTENT);
ContentData cdNode2Val3= (ContentData) nodeService.getProperty(nodeRef2, ContentModel.PROP_CONTENT);
assertFalse("Collision detected on node 1 after clear caches",contentURL3.equals(cdNode1Val3.getContentUrl()));
assertFalse("Collision detected on node 2 after clear caches",contentURL1.equals(cdNode2Val3.getContentUrl()));
assertEquals("ContentURL for node1 should be contentURL1",contentURL1,cdNode1Val3.getContentUrl());
assertEquals("ContentURL for node2 should be contentURL2",contentURL2,cdNode2Val3.getContentUrl());
}
finally
{
contentPropertyRestrictionInterceptor.setGlobalContentPropertyRestrictionWhiteList("");
}
}
private void addContentToNode(NodeRef nodeRef)
{

View File

@@ -2,7 +2,7 @@
* #%L
* Alfresco Repository
* %%
* Copyright (C) 2005 - 2021 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
@@ -28,6 +28,8 @@ package org.alfresco.repo.rendition2;
import static org.alfresco.model.ContentModel.PROP_CONTENT;
import static org.junit.Assert.assertNotEquals;
import java.io.ByteArrayInputStream;
import java.io.InputStream;
import java.util.List;
import org.alfresco.model.ContentModel;
@@ -358,7 +360,25 @@ public class RenditionService2IntegrationTest extends AbstractRenditionIntegrati
* </p>
*/
@Test
public void testRenditionWithoutContentButWithContentHashCode()
public void testRenditionWithNullContentButWithContentHashCode()
{
testRenditionWithoutContentButWithContentHashCode(null);
}
/**
* Tests if a rendition without content (but with contentHashCode) can be generated again.
* <p>
* If the rendition consumption receives a zero length InputStream, the contentHashCode should be cleaned from the
* rendition node, allowing new requests to generate the rendition.
* </p>
*/
@Test
public void testRenditionWithZeroContentButWithContentHashCode()
{
testRenditionWithoutContentButWithContentHashCode(new ByteArrayInputStream(new byte[0]));
}
private void testRenditionWithoutContentButWithContentHashCode(InputStream transformInputStream)
{
// Create a node with an actual rendition
NodeRef sourceNodeRef = createSource(ADMIN, "quick.jpg");
@@ -379,7 +399,7 @@ public class RenditionService2IntegrationTest extends AbstractRenditionIntegrati
// This is explicitly called to prove that rendition hash code will be cleaned (as opposite to previous behavior)
RenditionDefinition2 renditionDefinition = renditionDefinitionRegistry2.getRenditionDefinition(DOC_LIB);
AuthenticationUtil.runAs(() -> {
renditionService2.consume(sourceNodeRef, null, renditionDefinition, contentHashCode);
renditionService2.consume(sourceNodeRef, transformInputStream, renditionDefinition, contentHashCode);
return null;
}, ADMIN);
waitForRendition(ADMIN, sourceNodeRef, DOC_LIB, false);

View File

@@ -2,7 +2,7 @@
* #%L
* Alfresco Repository
* %%
* Copyright (C) 2005 - 2019 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
@@ -25,6 +25,7 @@
*/
package org.alfresco.repo.rendition2;
import org.alfresco.transform.client.model.config.CoreFunction;
import org.alfresco.transform.client.registry.TransformServiceRegistry;
import java.util.Map;
@@ -69,4 +70,10 @@ public class TestTransformServiceRegistry implements TransformServiceRegistry
{
throw new UnsupportedOperationException("not implemented");
}
@Override
public boolean isSupported(CoreFunction function, String transformerName)
{
return true;
}
}

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
}
}

Some files were not shown because too many files have changed in this diff Show More