Skip to content

Commit

Permalink
Add skeleton tests for extension descriptor
Browse files Browse the repository at this point in the history
I've also corrected (because the tests caught it, yay!) a missing brace on one of the "please don't complain" properties.

I haven't tested the bootstrap extension descriptor since it is deprecated, but we could copy things across fairly easily if we think it's worthwhile.

I also haven't tested everything the descriptor does, but now that we have a skeleton which drives the mojo, we can add new tests more easily.
  • Loading branch information
holly-cummins authored and igorregis committed Oct 16, 2022
1 parent 7a20626 commit fa41bf2
Show file tree
Hide file tree
Showing 10 changed files with 712 additions and 7 deletions.
24 changes: 24 additions & 0 deletions independent-projects/bootstrap/bom-test/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,30 @@
<scope>test</scope>
<version>${shrinkwrap-depchain.version}</version>
</dependency>
<dependency>
<groupId>org.apache.maven.plugin-testing</groupId>
<artifactId>maven-plugin-testing-harness</artifactId>
<version>3.3.0</version>
<scope>test</scope>
<exclusions>
<!-- let's prefer the plexus-utils pulled by maven-resolver-provider -->
<exclusion>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-utils</artifactId>
</exclusion>
<exclusion>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<!-- maven compat is needed because the maven testing harness still uses maven 2 APIs -->
<groupId>org.apache.maven</groupId>
<artifactId>maven-compat</artifactId>
<version>${maven.version}</version>
<scope>test</scope>
</dependency>
</dependencies>
</dependencyManagement>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ public static class RemovedResources {
@Parameter(required = false, defaultValue = "${skipExtensionValidation}")
private boolean skipExtensionValidation;

@Parameter(required = false, defaultValue = "${ignoreNotDetectedQuarkusCoreVersion")
@Parameter(required = false, defaultValue = "${ignoreNotDetectedQuarkusCoreVersion}")
boolean ignoreNotDetectedQuarkusCoreVersion;

@Parameter
Expand Down
51 changes: 51 additions & 0 deletions independent-projects/extension-maven-plugin/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,12 @@
<junit.jupiter.version>5.9.0</junit.jupiter.version>
</properties>
<build>
<testResources>
<testResource>
<directory>src/test/resources</directory>
<filtering>true</filtering>
</testResource>
</testResources>
<pluginManagement>
<plugins>
<plugin>
Expand All @@ -48,6 +54,20 @@
<doclint>none</doclint>
</configuration>
</plugin>
<plugin>
<!-- The tests cause generated files to appear in the test-data projects, so clean them up when we clean -->
<artifactId>maven-clean-plugin</artifactId>
<configuration>
<filesets>
<fileset>
<directory>src/test/resources</directory>
<includes>
<include>**/target/**</include>
</includes>
</fileset>
</filesets>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-enforcer-plugin</artifactId>
Expand Down Expand Up @@ -188,6 +208,13 @@
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-bootstrap-bom-test</artifactId>
<version>${project.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<!-- Jackson dependencies, imported as a BOM -->
<dependency>
<groupId>com.fasterxml.jackson</groupId>
Expand All @@ -196,6 +223,7 @@
<scope>import</scope>
<type>pom</type>
</dependency>

</dependencies>
</dependencyManagement>

Expand Down Expand Up @@ -238,6 +266,29 @@
<version>${junit.jupiter.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.maven.plugin-testing</groupId>
<artifactId>maven-plugin-testing-harness</artifactId>
<scope>test</scope>
</dependency>
<!-- maven compat is needed because the maven testing harness still uses maven 2 APIs -->
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-compat</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.maven.shared</groupId>
<artifactId>maven-invoker</artifactId>
<version>3.2.0</version>
<scope>test</scope>
<exclusions>
<exclusion>
<groupId>javax.inject</groupId>
<artifactId>javax.inject</artifactId>
</exclusion>
</exclusions>
</dependency>
</dependencies>

<distributionManagement>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ public static class RemovedResources {
* @component
*/
@Component
private RepositorySystem repoSystem;
RepositorySystem repoSystem;

@Component
RemoteRepositoryManager remoteRepoManager;
Expand All @@ -121,7 +121,7 @@ public static class RemovedResources {
* @readonly
*/
@Parameter(defaultValue = "${repositorySystemSession}", readonly = true)
private RepositorySystemSession repoSession;
RepositorySystemSession repoSession;

/**
* The project's remote repositories to use for the resolution of artifacts and
Expand Down Expand Up @@ -213,7 +213,7 @@ public static class RemovedResources {
* Whether to ignore failure detecting the Quarkus core version used to build the extension,
* which would be recorded in the extension's metadata.
*/
@Parameter(required = false, defaultValue = "${ignoreNotDetectedQuarkusCoreVersion")
@Parameter(required = false, defaultValue = "${ignoreNotDetectedQuarkusCoreVersion}")
boolean ignoreNotDetectedQuarkusCoreVersion;

/**
Expand Down
Loading

0 comments on commit fa41bf2

Please sign in to comment.