Skip to content

Commit

Permalink
XCOMMONS-3088: Extensions with dependencies that have a classifier ca…
Browse files Browse the repository at this point in the history
…nnot be installed anymore

* add a unit test
  • Loading branch information
tmortagne committed Jul 16, 2024
1 parent 06aa3d0 commit 5f2e4be
Show file tree
Hide file tree
Showing 6 changed files with 88 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
<?xml version="1.0" encoding="UTF-8"?>

<!--
* See the NOTICE file distributed with this work for additional
* information regarding copyright ownership.
*
* This 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 2.1 of
* the License, or (at your option) any later version.
*
* This software 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 this software; if not, write to the Free
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-->

<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/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>groupid</groupId>
<artifactId>classifierdependency</artifactId>
<version>version</version>
<packaging>test</packaging>
<dependencies>
<dependency>
<groupId>groupid</groupId>
<artifactId>classifierid</artifactId>
<classifier>classifier</classifier>
<version>version</version>
<type>test</type>
</dependency>
</dependencies>
</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
content
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
classifier content
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<?xml version="1.0" encoding="UTF-8"?>

<!--
* See the NOTICE file distributed with this work for additional
* information regarding copyright ownership.
*
* This 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 2.1 of
* the License, or (at your option) any later version.
*
* This software 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 this software; if not, write to the Free
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-->

<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/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>groupid</groupId>
<artifactId>classifierid</artifactId>
<name>name</name>
<version>version</version>
<packaging>test</packaging>
</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
content

0 comments on commit 5f2e4be

Please sign in to comment.