You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by mt...@apache.org on 2021/09/29 07:20:45 UTC
[maven-gpg-plugin] branch
MGPG-44-gpg-sign-remove-target-prefix-in-output-directory created (now
829971c)
This is an automated email from the ASF dual-hosted git repository.
mthmulders pushed a change to branch MGPG-44-gpg-sign-remove-target-prefix-in-output-directory
in repository https://gitbox.apache.org/repos/asf/maven-gpg-plugin.git.
at 829971c [MGPG-44] Format test and improve readability
This branch includes the following new commits:
new 44d5502 [MGPG-44] Make it-test order agnostic
new 829971c [MGPG-44] Format test and improve readability
The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
[maven-gpg-plugin] 02/02: [MGPG-44] Format test and improve
readability
Posted by mt...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
mthmulders pushed a commit to branch MGPG-44-gpg-sign-remove-target-prefix-in-output-directory
in repository https://gitbox.apache.org/repos/asf/maven-gpg-plugin.git
commit 829971c330a5e6126ee608578178a8b3b27675f8
Author: Giovanni van der Schelde <gv...@gmail.com>
AuthorDate: Fri Sep 10 00:02:08 2021 +0200
[MGPG-44] Format test and improve readability
Submitted by: Giovanni van der Schelde
- Format the test file
- Decrease the length of the test data to increase readability
---
.../maven/plugins/gpg/it/GpgSignArtifactIT.java | 30 +++++++++++++---------
.../pom.xml | 3 ++-
.../pom.xml | 3 ++-
.../pom.xml | 3 ++-
.../pom.xml | 3 ++-
5 files changed, 26 insertions(+), 16 deletions(-)
diff --git a/src/test/java/org/apache/maven/plugins/gpg/it/GpgSignArtifactIT.java b/src/test/java/org/apache/maven/plugins/gpg/it/GpgSignArtifactIT.java
index 704df50..0cd72de 100644
--- a/src/test/java/org/apache/maven/plugins/gpg/it/GpgSignArtifactIT.java
+++ b/src/test/java/org/apache/maven/plugins/gpg/it/GpgSignArtifactIT.java
@@ -31,7 +31,8 @@ import java.util.Collection;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.arrayContainingInAnyOrder;
import static org.hamcrest.Matchers.equalTo;
-import static org.junit.runners.Parameterized.*;
+import static org.junit.runners.Parameterized.Parameter;
+import static org.junit.runners.Parameterized.Parameters;
@RunWith( Parameterized.class )
public class GpgSignArtifactIT
@@ -50,20 +51,25 @@ public class GpgSignArtifactIT
}
@Parameters
- public static Collection<Object[]> data() {
- return Arrays.asList(new Object[][] {
- { "/it/sign-release-with-artifact/pom.xml", "/target/gpg/tarballs/", new String[]{ "sign-release-with-artifact-1.0-jar-with-dependencies.jar.asc" } },
- { "/it/sign-release-with-artifact-and-output-directory/pom.xml", "/target/signed-files/tarballs/", new String[]{ "sign-release-with-artifact-and-output-directory-1.0-jar-with-dependencies.jar.asc" } },
- { "/it/sign-release-with-artifact-and-output-directory-root/pom.xml", "/signed-files/tarballs/", new String[]{ "sign-release-with-artifact-and-output-directory-root-1.0-jar-with-dependencies.jar.asc" } },
- { "/it/sign-release-with-artifact-same-directory/pom.xml", "/target/tarballs/", new String[]{ "sign-release-with-artifact-same-directory-1.0-jar-with-dependencies.jar", "sign-release-with-artifact-same-directory-1.0-jar-with-dependencies.jar.asc" } },
- });
+ public static Collection<Object[]> data()
+ {
+ return Arrays.asList( new Object[][] {
+ { "/it/sign-release-in-default-dir/pom.xml", "/target/gpg/tarballs/",
+ new String[] { "sign-release-in-default-dir-1.0.jar.asc" }},
+ { "/it/sign-release-in-output-dir/pom.xml", "/target/signed-files/tarballs/",
+ new String[] { "sign-release-in-output-dir-1.0.jar.asc" }},
+ { "/it/sign-release-in-root-dir/pom.xml", "/signed-files/tarballs/",
+ new String[] { "sign-release-in-root-dir-1.0.jar.asc" }},
+ { "/it/sign-release-in-same-dir/pom.xml", "/target/tarballs/",
+ new String[] { "sign-release-in-same-dir-1.0.jar", "sign-release-in-same-dir-1.0.jar.asc" }},
+ } );
}
@Parameter
public String pomPath;
- @Parameter(1)
+ @Parameter( 1 )
public String expectedFileLocation;
- @Parameter(2)
+ @Parameter( 2 )
public String[] expectedFiles;
@Test
@@ -72,8 +78,8 @@ public class GpgSignArtifactIT
// given
final File pomFile = InvokerTestUtils.getTestResource( pomPath );
final InvocationRequest request = InvokerTestUtils.createRequest( pomFile, mavenUserSettings, gpgHome );
- final File integrationTestRootDirectory = new File( pomFile.getParent());
- final File expectedOutputDirectory = new File (integrationTestRootDirectory + expectedFileLocation );
+ final File integrationTestRootDirectory = new File( pomFile.getParent() );
+ final File expectedOutputDirectory = new File( integrationTestRootDirectory + expectedFileLocation );
// when
InvokerTestUtils.executeRequest( request, mavenHome, localRepository );
diff --git a/src/test/resources/it/sign-release-with-artifact/pom.xml b/src/test/resources/it/sign-release-in-default-dir/pom.xml
similarity index 97%
rename from src/test/resources/it/sign-release-with-artifact/pom.xml
rename to src/test/resources/it/sign-release-in-default-dir/pom.xml
index 7973641..da1d947 100644
--- a/src/test/resources/it/sign-release-with-artifact/pom.xml
+++ b/src/test/resources/it/sign-release-in-default-dir/pom.xml
@@ -24,7 +24,7 @@ under the License.
<modelVersion>4.0.0</modelVersion>
<groupId>org.apache.maven.its.gpg.srwopi</groupId>
- <artifactId>sign-release-with-artifact</artifactId>
+ <artifactId>sign-release-in-default-dir</artifactId>
<version>1.0</version>
<packaging>jar</packaging>
@@ -57,6 +57,7 @@ under the License.
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
<outputDirectory>target/tarballs</outputDirectory>
+ <appendAssemblyId>false</appendAssemblyId>
</configuration>
<executions>
<execution>
diff --git a/src/test/resources/it/sign-release-with-artifact-and-output-directory/pom.xml b/src/test/resources/it/sign-release-in-output-dir/pom.xml
similarity index 97%
rename from src/test/resources/it/sign-release-with-artifact-and-output-directory/pom.xml
rename to src/test/resources/it/sign-release-in-output-dir/pom.xml
index bce1506..ab51394 100644
--- a/src/test/resources/it/sign-release-with-artifact-and-output-directory/pom.xml
+++ b/src/test/resources/it/sign-release-in-output-dir/pom.xml
@@ -24,7 +24,7 @@ under the License.
<modelVersion>4.0.0</modelVersion>
<groupId>org.apache.maven.its.gpg.srwopi</groupId>
- <artifactId>sign-release-with-artifact-and-output-directory</artifactId>
+ <artifactId>sign-release-in-output-dir</artifactId>
<version>1.0</version>
<packaging>jar</packaging>
@@ -60,6 +60,7 @@ under the License.
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
<outputDirectory>target/tarballs</outputDirectory>
+ <appendAssemblyId>false</appendAssemblyId>
</configuration>
<executions>
<execution>
diff --git a/src/test/resources/it/sign-release-with-artifact-and-output-directory-root/pom.xml b/src/test/resources/it/sign-release-in-root-dir/pom.xml
similarity index 97%
rename from src/test/resources/it/sign-release-with-artifact-and-output-directory-root/pom.xml
rename to src/test/resources/it/sign-release-in-root-dir/pom.xml
index a8792f4..d4c231c 100644
--- a/src/test/resources/it/sign-release-with-artifact-and-output-directory-root/pom.xml
+++ b/src/test/resources/it/sign-release-in-root-dir/pom.xml
@@ -24,7 +24,7 @@ under the License.
<modelVersion>4.0.0</modelVersion>
<groupId>org.apache.maven.its.gpg.srwopi</groupId>
- <artifactId>sign-release-with-artifact-and-output-directory-root</artifactId>
+ <artifactId>sign-release-in-root-dir</artifactId>
<version>1.0</version>
<packaging>jar</packaging>
@@ -60,6 +60,7 @@ under the License.
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
<outputDirectory>target/tarballs</outputDirectory>
+ <appendAssemblyId>false</appendAssemblyId>
</configuration>
<executions>
<execution>
diff --git a/src/test/resources/it/sign-release-with-artifact-same-directory/pom.xml b/src/test/resources/it/sign-release-in-same-dir/pom.xml
similarity index 97%
rename from src/test/resources/it/sign-release-with-artifact-same-directory/pom.xml
rename to src/test/resources/it/sign-release-in-same-dir/pom.xml
index 6a55215..77f4c98 100644
--- a/src/test/resources/it/sign-release-with-artifact-same-directory/pom.xml
+++ b/src/test/resources/it/sign-release-in-same-dir/pom.xml
@@ -24,7 +24,7 @@ under the License.
<modelVersion>4.0.0</modelVersion>
<groupId>org.apache.maven.its.gpg.srwopi</groupId>
- <artifactId>sign-release-with-artifact-same-directory</artifactId>
+ <artifactId>sign-release-in-same-dir</artifactId>
<version>1.0</version>
<packaging>jar</packaging>
@@ -61,6 +61,7 @@ under the License.
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
<outputDirectory>target/tarballs</outputDirectory>
+ <appendAssemblyId>false</appendAssemblyId>
</configuration>
<executions>
<execution>
[maven-gpg-plugin] 01/02: [MGPG-44] Make it-test order agnostic
Posted by mt...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
mthmulders pushed a commit to branch MGPG-44-gpg-sign-remove-target-prefix-in-output-directory
in repository https://gitbox.apache.org/repos/asf/maven-gpg-plugin.git
commit 44d55021b9bcf2488809139890705ca14ec2aef3
Author: Giovanni van der Schelde <gv...@gmail.com>
AuthorDate: Tue Sep 7 22:01:43 2021 +0200
[MGPG-44] Make it-test order agnostic
Submitted by: Giovanni van der Schelde
The integration test for the folder structure was flaky due to
Files.list() returning the items in no particular order.
---
.../java/org/apache/maven/plugins/gpg/it/GpgSignArtifactIT.java | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/src/test/java/org/apache/maven/plugins/gpg/it/GpgSignArtifactIT.java b/src/test/java/org/apache/maven/plugins/gpg/it/GpgSignArtifactIT.java
index 19da0cb..704df50 100644
--- a/src/test/java/org/apache/maven/plugins/gpg/it/GpgSignArtifactIT.java
+++ b/src/test/java/org/apache/maven/plugins/gpg/it/GpgSignArtifactIT.java
@@ -29,6 +29,7 @@ import java.util.Arrays;
import java.util.Collection;
import static org.hamcrest.MatcherAssert.assertThat;
+import static org.hamcrest.Matchers.arrayContainingInAnyOrder;
import static org.hamcrest.Matchers.equalTo;
import static org.junit.runners.Parameterized.*;
@@ -66,20 +67,20 @@ public class GpgSignArtifactIT
public String[] expectedFiles;
@Test
- public void testFolderStructureWithArtifactAndDefaultOutputDirectory() throws Exception
+ public void testPlacementOfArtifactInOutputDirectory() throws Exception
{
// given
final File pomFile = InvokerTestUtils.getTestResource( pomPath );
final InvocationRequest request = InvokerTestUtils.createRequest( pomFile, mavenUserSettings, gpgHome );
final File integrationTestRootDirectory = new File( pomFile.getParent());
- final File expectedOutputDirectory = new File (integrationTestRootDirectory + expectedFileLocation );
+ final File expectedOutputDirectory = new File (integrationTestRootDirectory + expectedFileLocation );
// when
InvokerTestUtils.executeRequest( request, mavenHome, localRepository );
// then
assertThat( expectedOutputDirectory.exists(), equalTo( true ) );
- assertThat( expectedOutputDirectory.list(), equalTo( expectedFiles ) );
+ assertThat( expectedOutputDirectory.list(), arrayContainingInAnyOrder( expectedFiles ) );
}
}