diff --git a/HISTORY b/HISTORY
index 46b0ba98..610db740 100644
--- a/HISTORY
+++ b/HISTORY
@@ -1,3 +1,9 @@
+2023-02-23 6.2.1
+ - Upgrade of Orbinson Groovy Console to version 19.0.3 (#205, #208)
+ - New filter method: filterByNodeRootPaths() (#204)
+ - AecuService: added new execute(String path, String data) method which accepts a JSON data string to be used within scipts (#204)
+ - JMX: added that execute(String path, String data) method (#204)
+
2023-01-27 6.2.0
- Use Orbinson Groovy Console instead of CID15 one
@@ -156,4 +162,3 @@
2018-07-19 0.9
- initial release
-
\ No newline at end of file
diff --git a/Readme.md b/Readme.md
index 0523d2d8..cc59ea7f 100644
--- a/Readme.md
+++ b/Readme.md
@@ -404,12 +404,15 @@ Nodes can also be filtered by their path using a regular expression.
* filterByPathRegex(String regex): process nodes whose path matches the given regular expression
* filterByNotPathRegex(String regex): process nodes whose path does not match the given regular expression
+* filterByNodeRootPaths: filters resources that do not meet the given list of root paths.
+
```java
aecu.contentUpgradeBuilder()
.forChildResourcesOf("/content/we-retail/ca/en")
.filterByPathRegex(".*/jcr:content/.*")
.filterByNotPathRegex(".*/jcr:content/.*")
+ .filterByNodeRootPaths(Arrays.asList("/content/we-retail/ca/en", "/content/we-retail/be/nl"))
.doSetProperty("name", "value")
.run()
```
@@ -1046,6 +1049,23 @@ Parameters:
* Start index: starts with 0 (= latest history entry)
* Count: number of entries to print
+## Execute with data
+
+Executes a single file or all files of a folder structure. Additionally, you can pass json data for the script context.
+
+Parameters:
+* Path: path of script/folder
+* Data: Json object string
+
+Example json:
+``` json
+{
+ "rootPaths": [
+ "/content/we-retail"
+ ]
+}
+```
+
## GetFiles
This will print all files that are executable for a given path. You can use this to check which scripts of a given folder would be executed.
diff --git a/api/pom.xml b/api/pom.xml
index f02d0ed0..52902982 100644
--- a/api/pom.xml
+++ b/api/pom.xml
@@ -4,9 +4,9 @@
de.valtech.aecu
aecu
- 6.2.0
+ 6.3.0
-
+
aecu.api
bundle
AECU - API
@@ -74,7 +74,7 @@
org.owasp
dependency-check-maven
-
+
@@ -116,8 +116,8 @@
commons-lang3
- org.codehaus.groovy
- groovy-all
+ org.apache.groovy
+ groovy
org.junit.jupiter
diff --git a/api/src/main/java/de/valtech/aecu/api/groovy/console/bindings/ContentUpgrade.java b/api/src/main/java/de/valtech/aecu/api/groovy/console/bindings/ContentUpgrade.java
index af25176c..83773db6 100644
--- a/api/src/main/java/de/valtech/aecu/api/groovy/console/bindings/ContentUpgrade.java
+++ b/api/src/main/java/de/valtech/aecu/api/groovy/console/bindings/ContentUpgrade.java
@@ -18,6 +18,7 @@
*/
package de.valtech.aecu.api.groovy.console.bindings;
+import java.util.List;
import java.util.Map;
import org.apache.sling.api.resource.PersistenceException;
@@ -79,7 +80,7 @@ public interface ContentUpgrade {
/**
* Loops over resources found by the SQL2 query generated by the path and properties and the
* default node type "nt:base".
- *
+ *
* @param path search path
* @param conditionProperties properties to generate AND conditions (values containing % will be
* matched using LIKE)
@@ -89,7 +90,7 @@ public interface ContentUpgrade {
/**
* Loops over resources found by the SQL2 query generated by the nodeType, path and properties.
- *
+ *
* @param path search path
* @param conditionProperties properties to generate AND conditions (values containing % will be
* matched using LIKE)
@@ -268,6 +269,14 @@ public interface ContentUpgrade {
*/
ContentUpgrade filterByNotPathRegex(String regex);
+ /**
+ * Filters by matching the resource path with the rootpaths
+ *
+ * @param rootPaths List of rootPaths to be matched
+ * @return upgrade object
+ */
+ ContentUpgrade filterByNodeRootPaths(List rootPaths);
+
/**
* Filters by matching the given filter.
*
diff --git a/api/src/main/java/de/valtech/aecu/api/groovy/console/bindings/filters/FilterByNodeRootPaths.java b/api/src/main/java/de/valtech/aecu/api/groovy/console/bindings/filters/FilterByNodeRootPaths.java
new file mode 100644
index 00000000..977fb65a
--- /dev/null
+++ b/api/src/main/java/de/valtech/aecu/api/groovy/console/bindings/filters/FilterByNodeRootPaths.java
@@ -0,0 +1,33 @@
+package de.valtech.aecu.api.groovy.console.bindings.filters;
+
+import org.apache.sling.api.resource.Resource;
+
+import javax.annotation.Nonnull;
+import java.util.List;
+
+/**
+ * Filters resources by node root paths. Only resource matching or starting with the root paths are accepted
+ *
+ * @author Dries Vanbilloen
+ */
+public class FilterByNodeRootPaths implements FilterBy {
+
+ private List rootPaths;
+
+ /**
+ * Constructor
+ *
+ * @param rootPaths list of root paths
+ */
+ public FilterByNodeRootPaths(List rootPaths) {
+ this.rootPaths = rootPaths;
+ }
+
+ @Override
+ public boolean filter(@Nonnull Resource resource, @Nonnull StringBuilder output) {
+ final String currentPath = resource.getPath();
+ return rootPaths.stream()
+ .anyMatch(rootPath -> rootPath.equals(currentPath) || (currentPath + "/").startsWith(rootPath));
+ }
+
+}
diff --git a/api/src/main/java/de/valtech/aecu/api/groovy/console/bindings/filters/package-info.java b/api/src/main/java/de/valtech/aecu/api/groovy/console/bindings/filters/package-info.java
index f239716c..5d0a9d63 100644
--- a/api/src/main/java/de/valtech/aecu/api/groovy/console/bindings/filters/package-info.java
+++ b/api/src/main/java/de/valtech/aecu/api/groovy/console/bindings/filters/package-info.java
@@ -19,10 +19,10 @@
/**
* Filters are used in AECU Groovy Console binding to filter matching nodes.
- *
+ *
* @author Roxana Muresan
*/
-@Version("3.1.0")
+@Version("3.2.0")
package de.valtech.aecu.api.groovy.console.bindings.filters;
import org.osgi.annotation.versioning.Version;
diff --git a/api/src/main/java/de/valtech/aecu/api/groovy/console/bindings/package-info.java b/api/src/main/java/de/valtech/aecu/api/groovy/console/bindings/package-info.java
index 43135670..09601dda 100644
--- a/api/src/main/java/de/valtech/aecu/api/groovy/console/bindings/package-info.java
+++ b/api/src/main/java/de/valtech/aecu/api/groovy/console/bindings/package-info.java
@@ -19,10 +19,10 @@
/**
* Contains the classes for the Groovy binding "aecu".
- *
+ *
* @author Roxana Muresan
*/
-@Version("4.8.0")
+@Version("4.9.0")
package de.valtech.aecu.api.groovy.console.bindings;
import org.osgi.annotation.versioning.Version;
diff --git a/api/src/main/java/de/valtech/aecu/api/service/AecuService.java b/api/src/main/java/de/valtech/aecu/api/service/AecuService.java
index 5eab937b..6edc5390 100644
--- a/api/src/main/java/de/valtech/aecu/api/service/AecuService.java
+++ b/api/src/main/java/de/valtech/aecu/api/service/AecuService.java
@@ -100,6 +100,16 @@ public interface AecuService {
*/
ExecutionResult execute(String path) throws AecuException;
+ /**
+ * Executes the script at the given position.
+ *
+ * @param path path of script
+ * @param data json object of script
+ * @return execution result
+ * @throws AecuException error during execution
+ */
+ ExecutionResult execute(String path, String data) throws AecuException;
+
/**
* Starts a new history entry.
*
@@ -146,4 +156,15 @@ public interface AecuService {
*/
HistoryEntry executeWithInstallHookHistory(String path) throws AecuException;
+ /**
+ * Executes the script(s) at the given position and taking install hook history into account.
+ *
+ * @param path path of script/folder
+ * @param data data json string of script
+ * @return execution result
+ * @throws AecuException error during execution
+ */
+ HistoryEntry executeWithInstallHookHistory(String path, String data) throws AecuException;
+
+
}
diff --git a/api/src/main/java/de/valtech/aecu/api/service/package-info.java b/api/src/main/java/de/valtech/aecu/api/service/package-info.java
index a65bd6d7..c4fef360 100644
--- a/api/src/main/java/de/valtech/aecu/api/service/package-info.java
+++ b/api/src/main/java/de/valtech/aecu/api/service/package-info.java
@@ -21,10 +21,10 @@
* This package contains the service API for AEM Easy Content Upgrade (AECU). You can use this to
* integrate AECU into your own software. See {@link de.valtech.aecu.api.service.AecuService} for a
* starting point.
- *
+ *
* @author Roland Gruber
*/
-@Version("3.0.0")
+@Version("3.1.0")
package de.valtech.aecu.api.service;
import org.osgi.annotation.versioning.Version;
diff --git a/api/src/test/java/de/valtech/aecu/api/groovy/console/bindings/filters/FilterByNodeRootPathsTest.java b/api/src/test/java/de/valtech/aecu/api/groovy/console/bindings/filters/FilterByNodeRootPathsTest.java
new file mode 100644
index 00000000..90e232ca
--- /dev/null
+++ b/api/src/test/java/de/valtech/aecu/api/groovy/console/bindings/filters/FilterByNodeRootPathsTest.java
@@ -0,0 +1,44 @@
+package de.valtech.aecu.api.groovy.console.bindings.filters;
+
+import org.apache.sling.api.resource.Resource;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.extension.ExtendWith;
+import org.mockito.Mock;
+import org.mockito.junit.jupiter.MockitoExtension;
+import org.mockito.junit.jupiter.MockitoSettings;
+import org.mockito.quality.Strictness;
+
+import java.util.Arrays;
+
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertTrue;
+import static org.mockito.Mockito.when;
+
+@ExtendWith(MockitoExtension.class)
+@MockitoSettings(strictness = Strictness.LENIENT)
+class FilterByNodeRootPathsTest {
+
+ private static final String TEST_PATH = "/content/my-site/nl/my-page";
+
+ @Mock
+ Resource resource;
+
+ @BeforeEach
+ void setUp() {
+ when(resource.getPath()).thenReturn(TEST_PATH);
+ }
+
+ @Test
+ void test_whenRootPathsMatches_filterAccepts() {
+ boolean accept = new FilterByNodeRootPaths(Arrays.asList("/content/my-site")).filter(resource, new StringBuilder());
+ assertTrue(accept);
+ }
+
+ @Test
+ void test_whenRootPathsDontMatch_filterDenies() {
+ boolean accept = new FilterByNodeRootPaths(Arrays.asList("/content/my-other-site")).filter(resource, new StringBuilder());
+ assertFalse(accept);
+ }
+
+}
\ No newline at end of file
diff --git a/cloud.startup.hook/pom.xml b/cloud.startup.hook/pom.xml
index a16ff5bd..f7c8531b 100644
--- a/cloud.startup.hook/pom.xml
+++ b/cloud.startup.hook/pom.xml
@@ -4,7 +4,7 @@
de.valtech.aecu
aecu
- 6.2.0
+ 6.3.0
aecu.cloud.startup.hook
@@ -30,7 +30,7 @@
javax.annotation;version=0.0.0,
- be.orbinson.aem.groovy.console.*;version="[15.1,19)",
+ be.orbinson.aem.groovy.console.*;version="[19,20)",
*
@@ -76,8 +76,8 @@
${project.version}
- org.codehaus.groovy
- groovy-all
+ org.apache.groovy
+ groovy
be.orbinson.aem
diff --git a/complete-cloud/pom.xml b/complete-cloud/pom.xml
index 67b43244..061b6224 100644
--- a/complete-cloud/pom.xml
+++ b/complete-cloud/pom.xml
@@ -5,7 +5,7 @@
de.valtech.aecu
aecu
- 6.2.0
+ 6.3.0
aecu.complete.cloud
@@ -15,9 +15,9 @@
src/main/content/jcr_root
-
+
-
+
org.apache.jackrabbit
filevault-package-maven-plugin
@@ -119,7 +119,7 @@
-
+
autoInstallPackageCloud
@@ -176,8 +176,8 @@
-
+
-
+
diff --git a/complete/pom.xml b/complete/pom.xml
index 07cdd421..3f38cb5a 100644
--- a/complete/pom.xml
+++ b/complete/pom.xml
@@ -5,7 +5,7 @@
de.valtech.aecu
aecu
- 6.2.0
+ 6.3.0
aecu.complete
@@ -15,7 +15,7 @@
src/main/content/jcr_root
-
+
@@ -117,9 +117,9 @@
${project.version}
-
+
-
+
autoInstallPackage
@@ -176,7 +176,7 @@
-
+
-
+
diff --git a/core/pom.xml b/core/pom.xml
index 5b06cdee..93186c75 100644
--- a/core/pom.xml
+++ b/core/pom.xml
@@ -4,7 +4,7 @@
de.valtech.aecu
aecu
- 6.2.0
+ 6.3.0
aecu.core
@@ -43,7 +43,7 @@
!antlr.*,
javax.annotation;version=0.0.0,
- be.orbinson.aem.groovy.console.*;version="[15.1,19)",
+ be.orbinson.aem.groovy.console.*;version="[19,20)",
*
@@ -89,8 +89,8 @@
${project.version}
- org.codehaus.groovy
- groovy-all
+ org.apache.groovy
+ groovy
be.orbinson.aem
diff --git a/core/src/main/java/de/valtech/aecu/core/groovy/console/bindings/impl/ContentUpgradeImpl.java b/core/src/main/java/de/valtech/aecu/core/groovy/console/bindings/impl/ContentUpgradeImpl.java
index 7403a72d..da876311 100644
--- a/core/src/main/java/de/valtech/aecu/core/groovy/console/bindings/impl/ContentUpgradeImpl.java
+++ b/core/src/main/java/de/valtech/aecu/core/groovy/console/bindings/impl/ContentUpgradeImpl.java
@@ -51,6 +51,7 @@
import de.valtech.aecu.api.groovy.console.bindings.filters.FilterByProperties;
import de.valtech.aecu.api.groovy.console.bindings.filters.FilterByProperty;
import de.valtech.aecu.api.groovy.console.bindings.filters.FilterByPropertyRegex;
+import de.valtech.aecu.api.groovy.console.bindings.filters.FilterByNodeRootPaths;
import de.valtech.aecu.api.groovy.console.bindings.filters.NOTFilter;
import de.valtech.aecu.api.service.AecuException;
import de.valtech.aecu.core.groovy.console.bindings.actions.Action;
@@ -181,7 +182,7 @@ public ContentUpgrade forResourcesByPropertyQuery(@Nonnull String path, Map rootPaths) {
+ addFilter(new FilterByNodeRootPaths(rootPaths));
+ return this;
+ }
+
@Override
public ContentUpgrade filterWith(@Nonnull FilterBy filter) {
addFilter(filter);
@@ -343,7 +350,7 @@ private void addFilter(@Nonnull FilterBy filter) {
/**
* Adds a new NOTFilter based on the given filter.
- *
+ *
* @param filter filter to negate
*/
private void addNotFilter(@Nonnull FilterBy filter) {
diff --git a/core/src/main/java/de/valtech/aecu/core/jmx/AecuServiceMBean.java b/core/src/main/java/de/valtech/aecu/core/jmx/AecuServiceMBean.java
index 46a70f25..284da5b7 100644
--- a/core/src/main/java/de/valtech/aecu/core/jmx/AecuServiceMBean.java
+++ b/core/src/main/java/de/valtech/aecu/core/jmx/AecuServiceMBean.java
@@ -86,4 +86,15 @@ String executeWithHistory(@Name("Path") @Description("Path to file/folder that s
@Description("Returns the last history entries")
String getHistory(@Name("Start index") int start, @Name("Count") int count) throws AecuException;
+ /**
+ * Returns history entries.
+ *
+ * @param path path of script/folder
+ * @param data json data used in the script context
+ * @return history entries
+ * @throws AecuException error reading history
+ */
+ @Description("Executes a single file or all files of a folder structure. Additionally you can pass json data for the script context")
+ String execute(@Name("Path") String path, @Name("Data") String data) throws AecuException;
+
}
diff --git a/core/src/main/java/de/valtech/aecu/core/jmx/AecuServiceMBeanImpl.java b/core/src/main/java/de/valtech/aecu/core/jmx/AecuServiceMBeanImpl.java
index 9b2b00b8..2c94e001 100644
--- a/core/src/main/java/de/valtech/aecu/core/jmx/AecuServiceMBeanImpl.java
+++ b/core/src/main/java/de/valtech/aecu/core/jmx/AecuServiceMBeanImpl.java
@@ -45,7 +45,7 @@ public class AecuServiceMBeanImpl extends AnnotatedStandardMBean implements Aecu
/**
* Constructor
- *
+ *
* @throws NotCompliantMBeanException error setting up mbean
*/
public AecuServiceMBeanImpl() throws NotCompliantMBeanException {
@@ -94,4 +94,10 @@ public String getHistory(int start, int count) throws AecuException {
return output.toString();
}
+ @Override
+ public String execute(String path, String data) throws AecuException {
+ HistoryEntry historyEntry = aecuService.executeWithInstallHookHistory(path, data);
+ return historyEntry.toString();
+ }
+
}
diff --git a/core/src/main/java/de/valtech/aecu/core/service/AecuScriptContext.java b/core/src/main/java/de/valtech/aecu/core/service/AecuScriptContext.java
index d48cd119..c90a03ec 100644
--- a/core/src/main/java/de/valtech/aecu/core/service/AecuScriptContext.java
+++ b/core/src/main/java/de/valtech/aecu/core/service/AecuScriptContext.java
@@ -13,7 +13,7 @@
/**
* Script context to run Groovy Console scripts.
- *
+ *
* @author Roland Gruber
*/
public class AecuScriptContext implements ScriptContext {
@@ -22,22 +22,30 @@ public class AecuScriptContext implements ScriptContext {
private String script;
private ResourceResolver resolver;
+ private String data;
private ByteArrayOutputStream out = new ByteArrayOutputStream();
/**
* Constructor
- *
+ *
+ * @param data json data for scripts
* @param script script content
* @param resolver resolver
*/
- public AecuScriptContext(String script, ResourceResolver resolver) {
+ public AecuScriptContext(String script, ResourceResolver resolver, String data) {
this.script = script;
this.resolver = resolver;
+ this.data = data;
+ }
+
+ public AecuScriptContext(String script, ResourceResolver resolver) {
+ this(script, resolver, null);
}
+
@Override
public String getData() {
- return null;
+ return this.data;
}
@Override
diff --git a/core/src/main/java/de/valtech/aecu/core/service/AecuServiceImpl.java b/core/src/main/java/de/valtech/aecu/core/service/AecuServiceImpl.java
index 42486dd4..0afd0727 100644
--- a/core/src/main/java/de/valtech/aecu/core/service/AecuServiceImpl.java
+++ b/core/src/main/java/de/valtech/aecu/core/service/AecuServiceImpl.java
@@ -172,6 +172,11 @@ public boolean isValidScriptName(String name) {
@Override
public ExecutionResult execute(String path) throws AecuException {
+ return execute(path, null);
+ }
+
+ @Override
+ public ExecutionResult execute(String path, String data) throws AecuException {
try (ResourceResolver resolver = resolverService.getContentMigratorResourceResolver()) {
Resource resource = resolver.getResource(path);
if (resource == null) {
@@ -180,7 +185,7 @@ public ExecutionResult execute(String path) throws AecuException {
if (!isValidScriptName(resource.getName())) {
throw new AecuException("Invalid script name");
}
- return executeScript(resolver, path);
+ return executeScript(resolver, path, data);
} catch (LoginException e) {
throw new AecuException(ERR_NO_RESOLVER, e);
}
@@ -194,18 +199,18 @@ public ExecutionResult execute(String path) throws AecuException {
* @return result execution result
* @throws AecuException error running script
*/
- private ExecutionResult executeScript(ResourceResolver resolver, String path) throws AecuException {
+ private ExecutionResult executeScript(ResourceResolver resolver, String path, String data) throws AecuException {
LOG.info("Executing script {}", path);
String prechecksScript = getPrechecksScript(resolver, path);
if (prechecksScript != null) {
- ExecutionResult prechecksResult = executeScript(resolver, prechecksScript);
+ ExecutionResult prechecksResult = executeScript(resolver, prechecksScript, data);
if (prechecksResult.getState() == ExecutionState.FAILED) {
LOG.info("Skipping {} as prechecks script failed", path);
return new ExecutionResult(ExecutionState.SKIPPED, prechecksResult.getTime(), prechecksResult.getResult(),
prechecksResult.getOutput(), null, path);
}
}
- ScriptContext scriptContext = new AecuScriptContext(loadScript(path, resolver), resolver);
+ ScriptContext scriptContext = new AecuScriptContext(loadScript(path, resolver), resolver, data);
RunScriptResponse response = groovyConsoleService.runScript(scriptContext);
boolean success = StringUtils.isBlank(response.getExceptionStackTrace());
if (success) {
@@ -216,7 +221,7 @@ private ExecutionResult executeScript(ResourceResolver resolver, String path) th
String result = response.getResult();
ExecutionResult fallbackResult = null;
if (!success && (getFallbackScript(resolver, path) != null)) {
- fallbackResult = executeScript(resolver, getFallbackScript(resolver, path));
+ fallbackResult = executeScript(resolver, getFallbackScript(resolver, path), data);
}
ExecutionState state = success ? ExecutionState.SUCCESS : ExecutionState.FAILED;
return new ExecutionResult(state, response.getRunningTime(), result,
@@ -225,7 +230,7 @@ private ExecutionResult executeScript(ResourceResolver resolver, String path) th
/**
* Read script.
- *
+ *
* @param path path
* @param resolver resource resolver
* @return script content
@@ -349,6 +354,11 @@ public List getHistory(int startIndex, int count) throws AecuExcep
@Override
public HistoryEntry executeWithInstallHookHistory(String path) throws AecuException {
+ return executeWithInstallHookHistory(path, null);
+ }
+
+ @Override
+ public HistoryEntry executeWithInstallHookHistory(String path, String data) throws AecuException {
HistoryEntry history = createHistoryEntry();
List files = getFiles(path);
try (ResourceResolver resolver = resolverService.getAdminResourceResolver()) {
@@ -361,7 +371,7 @@ public HistoryEntry executeWithInstallHookHistory(String path) throws AecuExcept
}
ExecutionResult singleResult;
if (!stopExecution) {
- singleResult = execute(file);
+ singleResult = execute(file, data);
} else {
singleResult = new ExecutionResult(ExecutionState.SKIPPED, null, null, null, null, file);
}
@@ -381,7 +391,7 @@ public HistoryEntry executeWithInstallHookHistory(String path) throws AecuExcept
/**
* Creates a hook history entry.
- *
+ *
* @param session session
* @param path script path
* @return history
diff --git a/core/src/test/java/de/valtech/aecu/core/groovy/console/bindings/impl/ValidateAccessRightsImplTest.java b/core/src/test/java/de/valtech/aecu/core/groovy/console/bindings/impl/ValidateAccessRightsImplTest.java
index 9357ebb9..7ac8bddb 100644
--- a/core/src/test/java/de/valtech/aecu/core/groovy/console/bindings/impl/ValidateAccessRightsImplTest.java
+++ b/core/src/test/java/de/valtech/aecu/core/groovy/console/bindings/impl/ValidateAccessRightsImplTest.java
@@ -1,6 +1,7 @@
package de.valtech.aecu.core.groovy.console.bindings.impl;
import static org.junit.jupiter.api.Assertions.assertNotNull;
+import static org.junit.jupiter.api.condition.OS.WINDOWS;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
@@ -25,6 +26,7 @@
import org.apache.sling.api.resource.ResourceResolverFactory;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.condition.DisabledOnOs;
import org.junit.jupiter.api.extension.ExtendWith;
import org.mockito.Mock;
import org.mockito.Mockito;
@@ -38,7 +40,8 @@
/**
* Tests ValidateAccessRightsImpl
- *
+ * Few tests are marked with DisabledOnOs(windows) as they fail because of different linebreak-handling.
+ * Windows Users are encouraged to use WSL.
* @author Roland Gruber
*/
@ExtendWith(MockitoExtension.class)
@@ -124,6 +127,7 @@ public void setup() throws RepositoryException {
}
@Test
+ @DisabledOnOs(WINDOWS)
public void validate() {
validateRights.forPaths(new String[] {TESTPATH});
validateRights.forGroups(new String[] {TESTGROUP});
@@ -136,6 +140,7 @@ public void validate() {
}
@Test
+ @DisabledOnOs(WINDOWS)
public void validate_failedCheck() {
validateRights.forPaths(new String[] {TESTPATH});
validateRights.forGroups(new String[] {TESTGROUP});
@@ -151,6 +156,7 @@ public void validate_failedCheck() {
}
@Test
+ @DisabledOnOs(WINDOWS)
public void simulate() {
assertNotNull(validateRights.cannotRead());
validateRights.simulate();
diff --git a/core/src/test/java/de/valtech/aecu/core/service/AecuServiceImplTest.java b/core/src/test/java/de/valtech/aecu/core/service/AecuServiceImplTest.java
index 1aef79c4..d747fbd5 100644
--- a/core/src/test/java/de/valtech/aecu/core/service/AecuServiceImplTest.java
+++ b/core/src/test/java/de/valtech/aecu/core/service/AecuServiceImplTest.java
@@ -383,7 +383,7 @@ public void execute() throws AecuException, RepositoryException {
public void executeWithInstallHookHistory() throws AecuException, LoginException {
ExecutionResult result = mock(ExecutionResult.class);
when(result.getState()).thenReturn(ExecutionState.SUCCESS);
- doReturn(result).when(service).execute(DIR + "/" + FILE1);
+ doReturn(result).when(service).execute(DIR + "/" + FILE1, null);
when(resolverService.getAdminResourceResolver()).thenReturn(resolver);
when(resolver.adaptTo(Session.class)).thenReturn(session);
doReturn(Arrays.asList(DIR + "/" + FILE1)).when(service).getFiles(DIR);
@@ -397,7 +397,7 @@ public void executeWithInstallHookHistory() throws AecuException, LoginException
verify(resolverService, times(1)).getAdminResourceResolver();
verify(service, times(1)).getFiles(DIR);
verify(service, times(1)).createHistoryEntry();
- verify(service, times(1)).execute(DIR + "/" + FILE1);
+ verify(service, times(1)).execute(DIR + "/" + FILE1, null);
verify(service, times(1)).finishHistoryEntry(Mockito.any());
}
diff --git a/examples-cloud/pom.xml b/examples-cloud/pom.xml
index f2d565ff..9cf97bba 100644
--- a/examples-cloud/pom.xml
+++ b/examples-cloud/pom.xml
@@ -5,7 +5,7 @@
de.valtech.aecu
aecu
- 6.2.0
+ 6.3.0
aecu.examples-cloud
@@ -36,7 +36,7 @@
-
+
installHook
@@ -58,7 +58,7 @@
-
+
autoInstallPackageCloud
@@ -115,7 +115,7 @@
-
+
-
+
diff --git a/examples/pom.xml b/examples/pom.xml
index a110c55d..7dad660c 100644
--- a/examples/pom.xml
+++ b/examples/pom.xml
@@ -5,7 +5,7 @@
de.valtech.aecu
aecu
- 6.2.0
+ 6.3.0
aecu.examples
@@ -42,7 +42,7 @@
-
+
autoInstallPackage
@@ -99,7 +99,7 @@
-
+
-
+
diff --git a/oak.index/pom.xml b/oak.index/pom.xml
index 5e568701..2cb0b7df 100644
--- a/oak.index/pom.xml
+++ b/oak.index/pom.xml
@@ -5,7 +5,7 @@
de.valtech.aecu
aecu
- 6.2.0
+ 6.3.0
aecu.oak.index
@@ -14,7 +14,7 @@
OAK index content package for AECU
-
+
org.apache.jackrabbit
@@ -50,7 +50,7 @@
-
+
autoInstallPackage
@@ -107,7 +107,7 @@
-
+
autoInstallPackageCloud
@@ -164,7 +164,7 @@
-
+
-
+
diff --git a/pom.xml b/pom.xml
index cc2bb135..1125fa20 100644
--- a/pom.xml
+++ b/pom.xml
@@ -4,7 +4,7 @@
de.valtech.aecu
aecu
pom
- 6.2.0
+ 6.3.0
AECU
AEM Easy Content Upgrade
/~https://github.com/valtech/aem-easy-content-upgrade
@@ -117,7 +117,7 @@
true
ossrh
- https://oss.sonatype.org/
+ https://s01.oss.sonatype.org/
true
@@ -527,15 +527,15 @@
provided
- org.codehaus.groovy
- groovy-all
- 2.4.15
+ org.apache.groovy
+ groovy
+ 4.0.9
provided
be.orbinson.aem
aem-groovy-console-api
- 18.0.3
+ 19.0.3
provided
@@ -548,7 +548,7 @@
be.orbinson.aem
aem-groovy-console-all
- 18.0.3
+ 19.0.3
zip
@@ -702,11 +702,11 @@
ossrh
- https://oss.sonatype.org/content/repositories/snapshots
+ https://s01.oss.sonatype.org/content/repositories/snapshots
ossrh
- https://oss.sonatype.org/service/local/staging/deploy/maven2/
+ https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/
diff --git a/sonar-project.properties b/sonar-project.properties
index fb93d3bf..4b8dc60b 100644
--- a/sonar-project.properties
+++ b/sonar-project.properties
@@ -2,8 +2,8 @@
sonar.projectKey=aecu
# this is the name and version displayed in the SonarQube UI. Was mandatory prior to SonarQube 6.1.
sonar.projectName=AEM Easy Content Upgrade
-sonar.projectVersion=6.0.4-SNAPSHOT
-
+sonar.projectVersion=6.3.0-SNAPSHOT
+
# Encoding of the source code. Default is default system encoding
sonar.sourceEncoding=UTF-8
diff --git a/ui.apps.structure/pom.xml b/ui.apps.structure/pom.xml
index ef712b31..c1ed1745 100644
--- a/ui.apps.structure/pom.xml
+++ b/ui.apps.structure/pom.xml
@@ -5,7 +5,7 @@
de.valtech.aecu
aecu
- 6.2.0
+ 6.3.0
aecu.ui.apps.structure
diff --git a/ui.apps/pom.xml b/ui.apps/pom.xml
index fbe8b8ea..feb62881 100644
--- a/ui.apps/pom.xml
+++ b/ui.apps/pom.xml
@@ -5,7 +5,7 @@
de.valtech.aecu
aecu
- 6.2.0
+ 6.3.0
aecu.ui.apps
@@ -14,7 +14,7 @@
UI apps package for AECU
-
+
org.apache.jackrabbit
@@ -48,7 +48,7 @@
-
+
autoInstallPackage
@@ -105,7 +105,7 @@
-
+
autoInstallPackageCloud
@@ -162,7 +162,7 @@
-
+
-
+
diff --git a/ui.content/pom.xml b/ui.content/pom.xml
index 5a66a909..a85a8e7d 100644
--- a/ui.content/pom.xml
+++ b/ui.content/pom.xml
@@ -5,7 +5,7 @@
de.valtech.aecu
aecu
- 6.2.0
+ 6.3.0
aecu.ui.content
@@ -14,7 +14,7 @@
UI content package for AECU
-
+
org.apache.jackrabbit
@@ -42,7 +42,7 @@
-
+
autoInstallPackage
@@ -99,7 +99,7 @@
-
+
autoInstallPackageCloud
@@ -156,7 +156,7 @@
-
+
-
+