|
44 | 44 | import com.google.common.collect.ImmutableMap; |
45 | 45 | import com.google.common.collect.ImmutableSet; |
46 | 46 |
|
| 47 | +import io.wcm.devops.conga.plugins.aem.maven.AutoDependenciesMode; |
47 | 48 | import io.wcm.devops.conga.plugins.aem.maven.model.ContentPackageFile; |
48 | 49 | import io.wcm.devops.conga.plugins.aem.maven.model.ModelParser; |
49 | 50 |
|
@@ -128,12 +129,12 @@ void testBuild(Set<String> cloudManagerTarget, List<String> runmodeSuffixes) thr |
128 | 129 |
|
129 | 130 | @ParameterizedTest |
130 | 131 | @MethodSource("cloudManagerTargetVariants") |
131 | | - void testBuildWithAutoDependencies(Set<String> cloudManagerTarget, List<String> runmodeSuffixes) throws Exception { |
| 132 | + void testBuil_IMMUTABLE_MUTABLE_COMBINED(Set<String> cloudManagerTarget, List<String> runmodeSuffixes) throws Exception { |
132 | 133 | List<ContentPackageFile> contentPackages = new ModelParser().getContentPackagesForNode(nodeDir); |
133 | 134 | File targetFile = new File(targetDir, "all.zip"); |
134 | 135 |
|
135 | 136 | AllPackageBuilder builder = new AllPackageBuilder(targetFile, "test-group", "test-pkg") |
136 | | - .autoDependencies(true); |
| 137 | + .autoDependenciesMode(AutoDependenciesMode.IMMUTABLE_MUTABLE_COMBINED); |
137 | 138 | assertTrue(builder.build(contentPackages, cloudManagerTarget, null)); |
138 | 139 |
|
139 | 140 | ZipUtil.unpack(targetFile, targetUnpackDir); |
@@ -186,13 +187,12 @@ void testBuildWithAutoDependencies(Set<String> cloudManagerTarget, List<String> |
186 | 187 |
|
187 | 188 | @ParameterizedTest |
188 | 189 | @MethodSource("cloudManagerTargetVariants") |
189 | | - void testBuildWithAutoDependenciesSeparateMutable(Set<String> cloudManagerTarget, List<String> runmodeSuffixes) throws Exception { |
| 190 | + void testBuild_IMMUTABLE_MUTABLE_SEPARATE(Set<String> cloudManagerTarget, List<String> runmodeSuffixes) throws Exception { |
190 | 191 | List<ContentPackageFile> contentPackages = new ModelParser().getContentPackagesForNode(nodeDir); |
191 | 192 | File targetFile = new File(targetDir, "all.zip"); |
192 | 193 |
|
193 | 194 | AllPackageBuilder builder = new AllPackageBuilder(targetFile, "test-group", "test-pkg") |
194 | | - .autoDependencies(true) |
195 | | - .autoDependenciesSeparateMutable(true); |
| 195 | + .autoDependenciesMode(AutoDependenciesMode.IMMUTABLE_MUTABLE_SEPARATE); |
196 | 196 | assertTrue(builder.build(contentPackages, cloudManagerTarget, null)); |
197 | 197 |
|
198 | 198 | ZipUtil.unpack(targetFile, targetUnpackDir); |
@@ -242,6 +242,62 @@ void testBuildWithAutoDependenciesSeparateMutable(Set<String> cloudManagerTarget |
242 | 242 | } |
243 | 243 | } |
244 | 244 |
|
| 245 | + @ParameterizedTest |
| 246 | + @MethodSource("cloudManagerTargetVariants") |
| 247 | + void testBuild_IMMUTABLE_ONLY(Set<String> cloudManagerTarget, List<String> runmodeSuffixes) throws Exception { |
| 248 | + List<ContentPackageFile> contentPackages = new ModelParser().getContentPackagesForNode(nodeDir); |
| 249 | + File targetFile = new File(targetDir, "all.zip"); |
| 250 | + |
| 251 | + AllPackageBuilder builder = new AllPackageBuilder(targetFile, "test-group", "test-pkg") |
| 252 | + .autoDependenciesMode(AutoDependenciesMode.IMMUTABLE_ONLY); |
| 253 | + assertTrue(builder.build(contentPackages, cloudManagerTarget, null)); |
| 254 | + |
| 255 | + ZipUtil.unpack(targetFile, targetUnpackDir); |
| 256 | + |
| 257 | + File appsDir = new File(targetUnpackDir, "jcr_root/apps/test-group-test-pkg-packages"); |
| 258 | + assertFiles(appsDir, "application", "content", "container"); |
| 259 | + |
| 260 | + File applicationDir = new File(appsDir, "application"); |
| 261 | + assertFiles(applicationDir, toInstallFolderNames("install", runmodeSuffixes)); |
| 262 | + |
| 263 | + for (String runmodeSuffix : runmodeSuffixes) { |
| 264 | + File applicationInstallDir = new File(applicationDir, "install" + runmodeSuffix); |
| 265 | + assertFiles(applicationInstallDir, "aem-cms-system-config" + runmodeSuffix + ".zip"); |
| 266 | + assertNameDependencies(applicationInstallDir, "aem-cms-system-config" + runmodeSuffix + ".zip", |
| 267 | + "aem-cms-system-config" + runmodeSuffix, |
| 268 | + "day/cq60/product:cq-ui-wcm-editor-content:1.1.224", |
| 269 | + "adobe/cq/product:cq-remotedam-client-ui-components:1.1.6"); |
| 270 | + } |
| 271 | + |
| 272 | + File contentDir = new File(appsDir, "content"); |
| 273 | + assertFiles(contentDir, toInstallFolderNames("install", runmodeSuffixes)); |
| 274 | + |
| 275 | + for (String runmodeSuffix : runmodeSuffixes) { |
| 276 | + File contentInstallDir = new File(contentDir, "install" + runmodeSuffix); |
| 277 | + assertFiles(contentInstallDir, "aem-cms-author-replicationagents" + runmodeSuffix + ".zip", |
| 278 | + "wcm-io-samples-sample-content" + runmodeSuffix + "-1.3.1-SNAPSHOT.zip"); |
| 279 | + assertNameDependencies(contentInstallDir, "aem-cms-author-replicationagents" + runmodeSuffix + ".zip", |
| 280 | + "aem-cms-author-replicationagents" + runmodeSuffix); |
| 281 | + assertNameDependencies(contentInstallDir, "wcm-io-samples-sample-content" + runmodeSuffix + "-1.3.1-SNAPSHOT.zip", |
| 282 | + "wcm-io-samples-sample-content" + runmodeSuffix); |
| 283 | + } |
| 284 | + |
| 285 | + File containerDir = new File(appsDir, "container"); |
| 286 | + assertFiles(containerDir, toInstallFolderNames("install", runmodeSuffixes)); |
| 287 | + |
| 288 | + for (String runmodeSuffix : runmodeSuffixes) { |
| 289 | + File containerInstallDir = new File(containerDir, "install" + runmodeSuffix); |
| 290 | + assertFiles(containerInstallDir, "wcm-io-samples-aem-cms-config" + runmodeSuffix + ".zip", |
| 291 | + "wcm-io-samples-complete" + runmodeSuffix + "-1.3.1-SNAPSHOT.zip"); |
| 292 | + assertNameDependencies(containerInstallDir, "wcm-io-samples-aem-cms-config" + runmodeSuffix + ".zip", |
| 293 | + "wcm-io-samples-aem-cms-config" + runmodeSuffix, |
| 294 | + "wcm-io-samples:aem-cms-system-config" + runmodeSuffix + ":1.3.1-SNAPSHOT"); |
| 295 | + assertNameDependencies(containerInstallDir, "wcm-io-samples-complete" + runmodeSuffix + "-1.3.1-SNAPSHOT.zip", |
| 296 | + "wcm-io-samples-complete" + runmodeSuffix, |
| 297 | + "wcm-io-samples:wcm-io-samples-aem-cms-config" + runmodeSuffix + ":1.3.1-SNAPSHOT"); |
| 298 | + } |
| 299 | + } |
| 300 | + |
245 | 301 | private void assertFiles(File dir, String... fileNames) { |
246 | 302 | assertTrue(dir.exists(), "file exists: " + dir.getPath()); |
247 | 303 | assertTrue(dir.isDirectory(), "is directory: " + dir.getPath()); |
|
0 commit comments