Skip to content

Commit 3698e61

Browse files
authored
Update AEM dependencies to 6.5.10 (#3081)
1 parent 3edec67 commit 3698e61

File tree

12 files changed

+2780
-1489
lines changed

12 files changed

+2780
-1489
lines changed

bundle/pom.xml

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -306,6 +306,12 @@
306306
<artifactId>jsr305</artifactId>
307307
<scope>provided</scope>
308308
</dependency>
309+
<dependency>
310+
<groupId>org.jetbrains</groupId>
311+
<artifactId>annotations</artifactId>
312+
<scope>provided</scope>
313+
</dependency>
314+
309315
<!-- @PostConstruct -->
310316
<dependency>
311317
<groupId>javax.annotation</groupId>
@@ -372,7 +378,7 @@
372378
</dependency>
373379
<dependency>
374380
<groupId>javax.mail</groupId>
375-
<artifactId>mail</artifactId>
381+
<artifactId>javax.mail-api</artifactId>
376382
<scope>provided</scope>
377383
</dependency>
378384
<!-- for com.adobe.acs.commons.logging.impl.SyslogAppender -->
@@ -581,6 +587,12 @@
581587
<version>1.7</version>
582588
<scope>test</scope>
583589
</dependency>
590+
<dependency>
591+
<groupId>com.sun.mail</groupId>
592+
<artifactId>javax.mail</artifactId>
593+
<version>1.6.2</version>
594+
<scope>test</scope>
595+
</dependency>
584596
<!-- needed to override the embedded commons.osgi in org.apache.sling.models.impl -->
585597
<dependency>
586598
<groupId>org.apache.sling</groupId>
@@ -609,12 +621,6 @@
609621
<artifactId>jackrabbit-jcr-commons</artifactId>
610622
<scope>test</scope>
611623
</dependency>
612-
<dependency>
613-
<artifactId>jackrabbit-api</artifactId>
614-
<version>2.16.3</version>
615-
<groupId>org.apache.jackrabbit</groupId>
616-
<scope>test</scope>
617-
</dependency>
618624
<dependency>
619625
<groupId>org.apache.commons</groupId>
620626
<artifactId>commons-imaging</artifactId>
@@ -679,6 +685,10 @@
679685
<groupId>org.apache.tika</groupId>
680686
<artifactId>tika-core</artifactId>
681687
</exclusion>
688+
<exclusion>
689+
<groupId>org.apache.jackrabbit</groupId>
690+
<artifactId>jackrabbit-api</artifactId>
691+
</exclusion>
682692
</exclusions>
683693
</dependency>
684694
<dependency>
@@ -732,7 +742,6 @@
732742
<dependency>
733743
<groupId>com.adobe.aem</groupId>
734744
<artifactId>uber-jar</artifactId>
735-
<classifier>apis</classifier>
736745
<scope>provided</scope>
737746
</dependency>
738747
</dependencies>

bundle/src/test/java/com/adobe/acs/commons/mcp/impl/processes/cfi/MockContentFragment.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,16 @@
2626
import com.adobe.cq.dam.cfm.VariationTemplate;
2727
import com.adobe.cq.dam.cfm.VersionDef;
2828
import com.adobe.cq.dam.cfm.VersionedContent;
29+
30+
import java.util.Calendar;
2931
import java.util.HashMap;
3032
import java.util.Iterator;
3133
import java.util.Map;
3234
import java.util.stream.Collectors;
3335
import javax.annotation.CheckForNull;
3436
import javax.annotation.Nonnull;
3537
import org.apache.sling.api.resource.Resource;
38+
import org.jetbrains.annotations.NotNull;
3639

3740
/**
3841
* Incomplete mock that provides just enough for basic testing
@@ -156,5 +159,11 @@ public <AdapterType> AdapterType adaptTo(@Nonnull Class<AdapterType> aClass) {
156159
@Override
157160
public void removeVariation(String name) throws ContentFragmentException {
158161
}
162+
163+
@NotNull
164+
@Override
165+
public Calendar getLastModifiedDeep() throws ContentFragmentException {
166+
return Calendar.getInstance();
167+
}
159168

160169
}

bundle/src/test/java/com/adobe/acs/commons/mcp/impl/processes/cfi/MockDataType.java

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919

2020
import com.adobe.cq.dam.cfm.DataType;
2121
import org.jetbrains.annotations.NotNull;
22+
import org.jetbrains.annotations.Nullable;
2223

2324
public class MockDataType implements DataType {
2425

@@ -38,4 +39,14 @@ public String getTypeString() {
3839
public boolean isMultiValue() {
3940
return false;
4041
}
42+
43+
@Override
44+
public @Nullable String getSemanticType() {
45+
return type;
46+
}
47+
48+
@Override
49+
public @NotNull String getValueType() {
50+
return type;
51+
}
4152
}

bundle/src/test/java/com/adobe/acs/commons/remoteassets/impl/RemoteAssetDecoratorTest.java

Lines changed: 62 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -17,37 +17,54 @@
1717
*/
1818
package com.adobe.acs.commons.remoteassets.impl;
1919

20-
import com.adobe.acs.commons.testutil.LogTester;
21-
import com.adobe.acs.commons.util.RequireAem;
22-
import com.day.cq.commons.jcr.JcrConstants;
23-
import com.day.cq.dam.api.DamConstants;
24-
import io.wcm.testing.mock.aem.junit.AemContext;
20+
import static com.adobe.acs.commons.remoteassets.impl.RemoteAssets.IS_REMOTE_ASSET;
21+
import static com.adobe.acs.commons.remoteassets.impl.RemoteAssetsTestUtil.TEST_RETRY_DELAY;
22+
import static com.adobe.acs.commons.remoteassets.impl.RemoteAssetsTestUtil.TEST_WHITELISTED_SVC_USER_A;
23+
import static com.adobe.acs.commons.remoteassets.impl.RemoteAssetsTestUtil.getRemoteAssetsConfigs;
24+
import static com.adobe.acs.commons.remoteassets.impl.RemoteAssetsTestUtil.setupRemoteAssetsServiceUser;
25+
import static org.junit.Assert.assertEquals;
26+
import static org.junit.Assert.assertFalse;
27+
import static org.junit.Assert.assertTrue;
28+
import static org.mockito.ArgumentMatchers.any;
29+
import static org.mockito.Mockito.doReturn;
30+
import static org.mockito.Mockito.doThrow;
31+
import static org.mockito.Mockito.mock;
32+
import static org.mockito.Mockito.spy;
33+
import static org.mockito.Mockito.when;
34+
35+
import java.lang.reflect.Field;
36+
import java.util.Calendar;
37+
import java.util.Collections;
38+
import java.util.HashMap;
39+
import java.util.Map;
40+
41+
import javax.jcr.Node;
42+
import javax.jcr.RepositoryException;
43+
import javax.jcr.Session;
44+
import javax.jcr.ValueFactory;
45+
2546
import org.apache.jackrabbit.api.security.user.User;
2647
import org.apache.jackrabbit.api.security.user.UserManager;
2748
import org.apache.sling.api.resource.ModifiableValueMap;
2849
import org.apache.sling.api.resource.Resource;
2950
import org.apache.sling.api.resource.ResourceResolver;
3051
import org.apache.sling.api.resource.ResourceResolverFactory;
52+
import org.apache.sling.resourceresolver.impl.CommonResourceResolverFactoryImpl;
53+
import org.apache.sling.resourceresolver.impl.ResourceResolverFactoryImpl;
3154
import org.apache.sling.testing.mock.sling.ResourceResolverType;
55+
import org.junit.After;
3256
import org.junit.Before;
3357
import org.junit.Rule;
3458
import org.junit.Test;
3559
import org.mockito.invocation.InvocationOnMock;
3660
import org.mockito.stubbing.Answer;
3761

38-
import javax.jcr.Node;
39-
import javax.jcr.RepositoryException;
40-
import javax.jcr.Session;
41-
import javax.jcr.ValueFactory;
42-
import java.util.Calendar;
43-
import java.util.HashMap;
44-
import java.util.Map;
62+
import com.adobe.acs.commons.testutil.LogTester;
63+
import com.adobe.acs.commons.util.RequireAem;
64+
import com.day.cq.commons.jcr.JcrConstants;
65+
import com.day.cq.dam.api.DamConstants;
4566

46-
import static com.adobe.acs.commons.remoteassets.impl.RemoteAssets.IS_REMOTE_ASSET;
47-
import static com.adobe.acs.commons.remoteassets.impl.RemoteAssetsTestUtil.*;
48-
import static org.junit.Assert.*;
49-
import static org.mockito.ArgumentMatchers.any;
50-
import static org.mockito.Mockito.*;
67+
import io.wcm.testing.mock.aem.junit.AemContext;
5168

5269
public class RemoteAssetDecoratorTest {
5370
private static String TEST_MOCK_SYNC = "mocksync";
@@ -58,6 +75,7 @@ public class RemoteAssetDecoratorTest {
5875

5976
@Rule
6077
public final AemContext context = new AemContext(ResourceResolverType.JCR_MOCK);
78+
private ResourceResolver userResourceResolver = null;
6179

6280
@Before
6381
public void setup() throws Exception {
@@ -77,6 +95,22 @@ public void setup() throws Exception {
7795

7896
remoteAssetDecorator = spy(new RemoteAssetDecorator());
7997
remoteAssetsBinarySync = mock(RemoteAssetsBinarySyncImpl.class);
98+
// workaround for https://issues.apache.org/jira/browse/SLING-11885 to bind the resource decorator
99+
ResourceResolverFactory rrFactory = context.getService(ResourceResolverFactory.class);
100+
if (rrFactory instanceof ResourceResolverFactoryImpl) {
101+
// use reflection to get CommonResourceResolverFactoryImpl
102+
Field crrFactoryField = ResourceResolverFactoryImpl.class.getDeclaredField("commonFactory");
103+
crrFactoryField.setAccessible(true);
104+
CommonResourceResolverFactoryImpl commonFactory = (CommonResourceResolverFactoryImpl) crrFactoryField.get(rrFactory);
105+
commonFactory.getResourceDecoratorTracker().bindResourceDecorator(remoteAssetDecorator, Collections.emptyMap());
106+
}
107+
}
108+
109+
@After
110+
public void tearDown() {
111+
if (userResourceResolver != null) {
112+
userResourceResolver.close();
113+
}
80114
}
81115

82116
private void setupCreateRemoteAsset(Node nodeDam, String damFolder, boolean isRemoteAsset) throws RepositoryException {
@@ -108,12 +142,14 @@ public Boolean answer(InvocationOnMock invocationOnMock) throws Throwable {
108142
context.registerInjectActivateService(new RemoteAssetsConfigImpl(), getRemoteAssetsConfigs());
109143
context.registerInjectActivateService(remoteAssetsBinarySync);
110144
context.registerInjectActivateService(remoteAssetDecorator);
111-
112145
LogTester.reset();
113146
}
114147

115148
private ResourceResolver getUserResourceResolver() {
116-
return getUserResourceResolver("testuser", false);
149+
if (userResourceResolver == null) {
150+
userResourceResolver = getUserResourceResolver("testuser", false);
151+
}
152+
return userResourceResolver;
117153
}
118154

119155
private ResourceResolver getUserResourceResolver(String username, boolean isServiceUser) {
@@ -160,8 +196,9 @@ public void testGetResourceSyncsRemoteAsset() {
160196
@Test
161197
public void testGetResourceSyncsAssetIfUserIsWhitelistedServiceUser() {
162198
setupFinish();
163-
ResourceResolver serviceResourceResolver = getUserResourceResolver(TEST_WHITELISTED_SVC_USER_A, true);
164-
assertResourceSyncs(serviceResourceResolver, TEST_REMOTE_ASSET_CONTENT_PATH);
199+
try (ResourceResolver serviceResourceResolver = getUserResourceResolver(TEST_WHITELISTED_SVC_USER_A, true)) {
200+
assertResourceSyncs(serviceResourceResolver, TEST_REMOTE_ASSET_CONTENT_PATH);
201+
}
165202
}
166203

167204
@Test
@@ -208,9 +245,10 @@ public void testGetResourceDoesNotSyncAssetIfUserIsAdminUser() {
208245
@Test
209246
public void testGetResourceDoesNotSyncAssetIfUserIsServiceUser() {
210247
setupFinish();
211-
ResourceResolver serviceResourceResolver = getUserResourceResolver("serviceuser", true);
212-
assertResourceDoesNotSync(serviceResourceResolver, TEST_REMOTE_ASSET_CONTENT_PATH);
213-
LogTester.assertLogText("Avoiding binary sync b/c this is a non-whitelisted service user: serviceuser");
248+
try (ResourceResolver serviceResourceResolver = getUserResourceResolver("serviceuser", true)) {
249+
assertResourceDoesNotSync(serviceResourceResolver, TEST_REMOTE_ASSET_CONTENT_PATH);
250+
LogTester.assertLogText("Avoiding binary sync b/c this is a non-whitelisted service user: serviceuser");
251+
}
214252
}
215253

216254
@Test

bundle/src/test/java/com/adobe/acs/commons/workflow/impl/WorkflowPackageManagerImplTest.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -211,5 +211,10 @@ public void stopRecording(final String s) {
211211
public String getPath() {
212212
return WORKFLOW_PACKAGE_PATH;
213213
}
214+
215+
@Override
216+
public boolean hasNode(String arg0) {
217+
return false;
218+
}
214219
};
215220
}

oakpal-checks/pom.xml

Lines changed: 1 addition & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@
177177
</goals>
178178
<configuration>
179179
<defaults>
180-
<aemVersion>6.4</aemVersion>
180+
<aemVersion>6.5</aemVersion>
181181
</defaults>
182182
<source>${pom.basedir}/src/main/script/ExtractBundleInfo.groovy</source>
183183
</configuration>
@@ -194,51 +194,6 @@
194194
</plugins>
195195
</build>
196196
</profile>
197-
<profile>
198-
<id>webster-aem64</id>
199-
<!-- to be able to execute oakpal:webster with this profile, first create a profile with the same name in
200-
your settings.xml file that sets a "webster.repositoryHome" property with an absolute path to the
201-
crx-quickstart/repository directory of a locally-installed AEM 6.4 server. -->
202-
<build>
203-
<plugins>
204-
<plugin>
205-
<groupId>net.adamcin.oakpal</groupId>
206-
<artifactId>oakpal-maven-plugin</artifactId>
207-
<configuration>
208-
<websterTargets>
209-
<checklist>
210-
<file>src/main/resources/OAKPAL-INF/checklist/content-class-aem64.json</file>
211-
<config>
212-
<jcrNamespaces>
213-
<namespace>
214-
<prefix>granite</prefix>
215-
<uri>http://www.adobe.com/jcr/granite/1.0</uri>
216-
</namespace>
217-
</jcrNamespaces>
218-
<selectNodeTypes>
219-
<type>granite:PublicArea</type>
220-
<type>granite:FinalArea</type>
221-
<type>granite:InternalArea</type>
222-
<type>granite:AbstractArea</type>
223-
</selectNodeTypes>
224-
<nodeTypeFilters>
225-
<filter>
226-
<type>exclude</type>
227-
<pattern>nt:file</pattern>
228-
</filter>
229-
<filter>
230-
<type>exclude</type>
231-
<pattern>nt:resource</pattern>
232-
</filter>
233-
</nodeTypeFilters>
234-
</config>
235-
</checklist>
236-
</websterTargets>
237-
</configuration>
238-
</plugin>
239-
</plugins>
240-
</build>
241-
</profile>
242197
<profile>
243198
<id>webster-aem65</id>
244199
<!-- to be able to execute oakpal:webster with this profile, first create a profile with the same name in
@@ -294,7 +249,6 @@
294249
<dependency>
295250
<groupId>org.jetbrains</groupId>
296251
<artifactId>annotations</artifactId>
297-
<version>18.0.0</version>
298252
<scope>provided</scope>
299253
</dependency>
300254
<dependency>

0 commit comments

Comments
 (0)