From 5f2e4be642068886c9e2e15ee21ed9cc6637fc0d Mon Sep 17 00:00:00 2001 From: Thomas Mortagne Date: Tue, 16 Jul 2024 11:21:51 +0200 Subject: [PATCH] XCOMMONS-3088: Extensions with dependencies that have a classifier cannot be installed anymore * add a unit test --- .../job/internal/InstallJobTest.java | 15 +++++++ .../version/classifierdependency-version.pom | 39 +++++++++++++++++++ .../version/classifierdependency-version.test | 1 + .../classifierid-version-classifier.test | 1 + .../version/classifierid-version.pom | 31 +++++++++++++++ .../version/classifierid-version.test | 1 + 6 files changed, 88 insertions(+) create mode 100644 xwiki-commons-core/xwiki-commons-extension/xwiki-commons-extension-repositories/xwiki-commons-extension-repository-maven/src/test/resources/repository/maven/groupid/classifierdependency/version/classifierdependency-version.pom create mode 100644 xwiki-commons-core/xwiki-commons-extension/xwiki-commons-extension-repositories/xwiki-commons-extension-repository-maven/src/test/resources/repository/maven/groupid/classifierdependency/version/classifierdependency-version.test create mode 100644 xwiki-commons-core/xwiki-commons-extension/xwiki-commons-extension-repositories/xwiki-commons-extension-repository-maven/src/test/resources/repository/maven/groupid/classifierid/version/classifierid-version-classifier.test create mode 100644 xwiki-commons-core/xwiki-commons-extension/xwiki-commons-extension-repositories/xwiki-commons-extension-repository-maven/src/test/resources/repository/maven/groupid/classifierid/version/classifierid-version.pom create mode 100644 xwiki-commons-core/xwiki-commons-extension/xwiki-commons-extension-repositories/xwiki-commons-extension-repository-maven/src/test/resources/repository/maven/groupid/classifierid/version/classifierid-version.test diff --git a/xwiki-commons-core/xwiki-commons-extension/xwiki-commons-extension-repositories/xwiki-commons-extension-repository-maven/src/test/java/org/xwiki/extension/job/internal/InstallJobTest.java b/xwiki-commons-core/xwiki-commons-extension/xwiki-commons-extension-repositories/xwiki-commons-extension-repository-maven/src/test/java/org/xwiki/extension/job/internal/InstallJobTest.java index 88c8f316c8..e696e6ce33 100644 --- a/xwiki-commons-core/xwiki-commons-extension/xwiki-commons-extension-repositories/xwiki-commons-extension-repository-maven/src/test/java/org/xwiki/extension/job/internal/InstallJobTest.java +++ b/xwiki-commons-core/xwiki-commons-extension/xwiki-commons-extension-repositories/xwiki-commons-extension-repository-maven/src/test/java/org/xwiki/extension/job/internal/InstallJobTest.java @@ -51,6 +51,21 @@ public void setUp() throws Exception this.handler = this.componentManager.getInstance(ExtensionHandler.class, "test"); } + @Test + public void testInstallWithClassifierDependency() throws Throwable + { + ExtensionId extensionId = new ExtensionId("groupid:classifierdependency", "version"); + + install(extensionId, LogLevel.ERROR); + + // Is extension installed + InstalledExtension installedExtension = + this.installedExtensionRepository.getInstalledExtension(extensionId.getId(), null); + assertNotNull(installedExtension); + assertTrue(installedExtension.isValid(null)); + assertTrue(this.handler.getExtensions().get(null).contains(installedExtension)); + } + @Test void testInstallOnRootWithNonDefaultTypeDependency() throws Throwable { diff --git a/xwiki-commons-core/xwiki-commons-extension/xwiki-commons-extension-repositories/xwiki-commons-extension-repository-maven/src/test/resources/repository/maven/groupid/classifierdependency/version/classifierdependency-version.pom b/xwiki-commons-core/xwiki-commons-extension/xwiki-commons-extension-repositories/xwiki-commons-extension-repository-maven/src/test/resources/repository/maven/groupid/classifierdependency/version/classifierdependency-version.pom new file mode 100644 index 0000000000..a2edc80d9d --- /dev/null +++ b/xwiki-commons-core/xwiki-commons-extension/xwiki-commons-extension-repositories/xwiki-commons-extension-repository-maven/src/test/resources/repository/maven/groupid/classifierdependency/version/classifierdependency-version.pom @@ -0,0 +1,39 @@ + + + + + + 4.0.0 + groupid + classifierdependency + version + test + + + groupid + classifierid + classifier + version + test + + + diff --git a/xwiki-commons-core/xwiki-commons-extension/xwiki-commons-extension-repositories/xwiki-commons-extension-repository-maven/src/test/resources/repository/maven/groupid/classifierdependency/version/classifierdependency-version.test b/xwiki-commons-core/xwiki-commons-extension/xwiki-commons-extension-repositories/xwiki-commons-extension-repository-maven/src/test/resources/repository/maven/groupid/classifierdependency/version/classifierdependency-version.test new file mode 100644 index 0000000000..6b584e8ece --- /dev/null +++ b/xwiki-commons-core/xwiki-commons-extension/xwiki-commons-extension-repositories/xwiki-commons-extension-repository-maven/src/test/resources/repository/maven/groupid/classifierdependency/version/classifierdependency-version.test @@ -0,0 +1 @@ +content \ No newline at end of file diff --git a/xwiki-commons-core/xwiki-commons-extension/xwiki-commons-extension-repositories/xwiki-commons-extension-repository-maven/src/test/resources/repository/maven/groupid/classifierid/version/classifierid-version-classifier.test b/xwiki-commons-core/xwiki-commons-extension/xwiki-commons-extension-repositories/xwiki-commons-extension-repository-maven/src/test/resources/repository/maven/groupid/classifierid/version/classifierid-version-classifier.test new file mode 100644 index 0000000000..dc92d94c98 --- /dev/null +++ b/xwiki-commons-core/xwiki-commons-extension/xwiki-commons-extension-repositories/xwiki-commons-extension-repository-maven/src/test/resources/repository/maven/groupid/classifierid/version/classifierid-version-classifier.test @@ -0,0 +1 @@ +classifier content \ No newline at end of file diff --git a/xwiki-commons-core/xwiki-commons-extension/xwiki-commons-extension-repositories/xwiki-commons-extension-repository-maven/src/test/resources/repository/maven/groupid/classifierid/version/classifierid-version.pom b/xwiki-commons-core/xwiki-commons-extension/xwiki-commons-extension-repositories/xwiki-commons-extension-repository-maven/src/test/resources/repository/maven/groupid/classifierid/version/classifierid-version.pom new file mode 100644 index 0000000000..9997462306 --- /dev/null +++ b/xwiki-commons-core/xwiki-commons-extension/xwiki-commons-extension-repositories/xwiki-commons-extension-repository-maven/src/test/resources/repository/maven/groupid/classifierid/version/classifierid-version.pom @@ -0,0 +1,31 @@ + + + + + + 4.0.0 + groupid + classifierid + name + version + test + diff --git a/xwiki-commons-core/xwiki-commons-extension/xwiki-commons-extension-repositories/xwiki-commons-extension-repository-maven/src/test/resources/repository/maven/groupid/classifierid/version/classifierid-version.test b/xwiki-commons-core/xwiki-commons-extension/xwiki-commons-extension-repositories/xwiki-commons-extension-repository-maven/src/test/resources/repository/maven/groupid/classifierid/version/classifierid-version.test new file mode 100644 index 0000000000..6b584e8ece --- /dev/null +++ b/xwiki-commons-core/xwiki-commons-extension/xwiki-commons-extension-repositories/xwiki-commons-extension-repository-maven/src/test/resources/repository/maven/groupid/classifierid/version/classifierid-version.test @@ -0,0 +1 @@ +content \ No newline at end of file