You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by kh...@apache.org on 2020/04/20 19:51:36 UTC

[maven-ear-plugin] 01/02: Improved test code.

This is an automated email from the ASF dual-hosted git repository.

khmarbaise pushed a commit to branch itf-extension
in repository https://gitbox.apache.org/repos/asf/maven-ear-plugin.git

commit 2237f7e702ec67a250e50e839f089e99bd1b37d3
Author: Karl Heinz Marbaise <kh...@apache.org>
AuthorDate: Sun Apr 19 22:31:09 2020 +0200

    Improved test code.
---
 .../apache/maven/plugins/ear/it/EARInvokerIT.java  |  55 ++++++++++-----------
 .../jar-sample-one-1.0-20150825.210557-91.jar      | Bin 0 -> 296 bytes
 .../jar-sample-one-1.0-20150825.210557-91.jar.sha1 |   1 +
 .../jar-sample-one-1.0-20150825.210557-91.pom      |  29 +++++++++++
 .../jar-sample-one-1.0-20150825.210557-91.pom.sha1 |   1 +
 .../jar-sample-one/1.0-SNAPSHOT/maven-metadata.xml |  45 +++++++++++++++++
 6 files changed, 101 insertions(+), 30 deletions(-)

diff --git a/src/test/java/org/apache/maven/plugins/ear/it/EARInvokerIT.java b/src/test/java/org/apache/maven/plugins/ear/it/EARInvokerIT.java
index f3a8865..1125d1f 100644
--- a/src/test/java/org/apache/maven/plugins/ear/it/EARInvokerIT.java
+++ b/src/test/java/org/apache/maven/plugins/ear/it/EARInvokerIT.java
@@ -23,6 +23,7 @@ import static com.soebes.itf.extension.assertj.MavenITAssertions.assertThat;
 
 import com.soebes.itf.jupiter.extension.MavenIT;
 import com.soebes.itf.jupiter.extension.MavenOptions;
+import com.soebes.itf.jupiter.extension.MavenPredefinedRepository;
 import com.soebes.itf.jupiter.extension.MavenTest;
 import com.soebes.itf.jupiter.maven.MavenExecutionResult;
 import com.soebes.itf.jupiter.maven.MavenLog;
@@ -51,7 +52,7 @@ class EARInvokerIT
 {
 
   @MavenTest
-  void basic( MavenExecutionResult result, MavenProjectResult project) {
+  void basic( MavenExecutionResult result) {
     assertThat(result).isSuccessful().project()
         .hasTarget()
         .withEarFile()
@@ -78,8 +79,7 @@ Archive:  test-1.0.ear
   testing: META-INF/maven/org.apache.maven.its.ear.jboss/test/pom.properties   OK
  */
   @MavenTest
-  void jboss(MavenExecutionResult result, MavenLog log) {
-    assertThat(log).isSuccessful();
+  void jboss(MavenExecutionResult result) {
     assertThat(result).isSuccessful().project()
         .hasTarget()
         .withEarFile()
@@ -87,17 +87,15 @@ Archive:  test-1.0.ear
   }
 
   @MavenTest
-  void mear_243_skinny_wars_provided(MavenExecutionResult result, MavenLog log) {
-    assertThat(log).isSuccessful();
+  void mear_243_skinny_wars_provided(MavenExecutionResult result) {
     assertThat(result).isSuccessful().project()
       .hasModule("ear-module")
       .hasModule("war-module");
   }
 
   @MavenTest(goals = {"clean", "package"})
-  void mear_198(MavenExecutionResult result, MavenLog log) {
+  void mear_198(MavenExecutionResult result) {
     assertThat(result).isSuccessful().project().hasTarget();
-    assertThat(log).isSuccessful();
   }
 
   @MavenTest
@@ -120,34 +118,31 @@ Archive:  test-1.0.ear
 
   @MavenTest
   @DisplayName("Filtering of a custom directory (likely wrong!)")
-  void resource_custom_directory(MavenExecutionResult result, MavenLog log) {
-    assertThat(log).isSuccessful();
+  void resource_custom_directory(MavenExecutionResult result) {
     assertThat(result).project().hasTarget()
         .withEarFile()
         .containsOnlyOnce("META-INF/application.xml", "APP-INF/classes/foo.properties");
   }
 
   @MavenTest(options = {MavenOptions.NO_TRANSFER_PROGRESS, MavenOptions.DEBUG})
-  void same_artifactId(MavenExecutionResult result, MavenProjectResult project, MavenLog log) {
-    assertThat(result).isSuccessful();
-    assertThat(log).isSuccessful();
-    assertThat(project).hasModule("war-module");
-    assertThat(project).hasModule("ear-module");
+  void same_artifactId(MavenExecutionResult result) {
+    assertThat(result).isSuccessful().project()
+      .hasModule("war-module")
+      .hasModule("ear-module");
   }
 
   @MavenTest
-  void skinny_wars(MavenExecutionResult result, MavenProjectResult project, MavenLog log) {
-    assertThat(result).isSuccessful();
-    assertThat(log).isSuccessful();
-    assertThat(project).hasModule("war-module");
-    assertThat(project).hasModule("ear-module");
+  void skinny_wars(MavenExecutionResult result, MavenProjectResult project) {
+    assertThat(result).isSuccessful().project()
+      .hasModule("war-module")
+      .hasModule("ear-module");
   }
 
   @MavenTest
   void skinny_wars_filenamemapping_full(MavenExecutionResult result) {
-    assertThat(result).isSuccessful();
-    assertThat(result).project().hasModule("war-module");
-    assertThat(result).project().hasModule("ear-module");
+    assertThat(result).isSuccessful().project()
+      .hasModule("war-module")
+      .hasModule("ear-module");
     //    //FIXME: The following checking is not correct:
     //    //File jarFile = new File( basedir, "ear-module/target/ear-module-1.0/war-module.war" );
     //    assertThat(result).project()
@@ -185,13 +180,14 @@ Archive:  test-1.0.ear
   }
 
   @MavenTest
-  void skinny_wars_javaee5(MavenExecutionResult result, MavenProjectResult project) {
-    assertThat(result).isSuccessful();
-    assertThat(project).hasModule("war-module");
-    assertThat(project).hasModule("ear-module");
+  void skinny_wars_javaee5(MavenExecutionResult result) {
+    assertThat(result).isSuccessful().project()
+      .hasModule("war-module")
+      .hasModule("ear-module");
   }
 
   @MavenTest
+  @MavenPredefinedRepository
   void skinny_wars_timestamp(MavenExecutionResult result, MavenProjectResult project) {
     assertThat(result).isSuccessful();
     assertThat(project).hasModule("war-module");
@@ -199,10 +195,9 @@ Archive:  test-1.0.ear
   }
 
   @MavenTest
-  void transitive_excludes(MavenExecutionResult result, MavenProjectResult project, MavenLog log) {
-    assertThat(result).isSuccessful();
-    assertThat(log).isSuccessful();
-    assertThat(project).hasTarget()
+  void transitive_excludes(MavenExecutionResult result) {
+    assertThat(result).isSuccessful().project()
+        .hasTarget()
         .withEarFile()
         .containsOnlyOnce("org.apache.maven-maven-core-3.0.jar", "META-INF/application.xml");
   }
diff --git a/src/test/resources-its/org/apache/maven/plugins/ear/it/EARInvokerIT/skinny_wars_timestamp/.predefined-repo/eartest/jar-sample-one/1.0-SNAPSHOT/jar-sample-one-1.0-20150825.210557-91.jar b/src/test/resources-its/org/apache/maven/plugins/ear/it/EARInvokerIT/skinny_wars_timestamp/.predefined-repo/eartest/jar-sample-one/1.0-SNAPSHOT/jar-sample-one-1.0-20150825.210557-91.jar
new file mode 100644
index 0000000..6f4e212
Binary files /dev/null and b/src/test/resources-its/org/apache/maven/plugins/ear/it/EARInvokerIT/skinny_wars_timestamp/.predefined-repo/eartest/jar-sample-one/1.0-SNAPSHOT/jar-sample-one-1.0-20150825.210557-91.jar differ
diff --git a/src/test/resources-its/org/apache/maven/plugins/ear/it/EARInvokerIT/skinny_wars_timestamp/.predefined-repo/eartest/jar-sample-one/1.0-SNAPSHOT/jar-sample-one-1.0-20150825.210557-91.jar.sha1 b/src/test/resources-its/org/apache/maven/plugins/ear/it/EARInvokerIT/skinny_wars_timestamp/.predefined-repo/eartest/jar-sample-one/1.0-SNAPSHOT/jar-sample-one-1.0-20150825.210557-91.jar.sha1
new file mode 100644
index 0000000..e7da63d
--- /dev/null
+++ b/src/test/resources-its/org/apache/maven/plugins/ear/it/EARInvokerIT/skinny_wars_timestamp/.predefined-repo/eartest/jar-sample-one/1.0-SNAPSHOT/jar-sample-one-1.0-20150825.210557-91.jar.sha1
@@ -0,0 +1 @@
+21F2D328DEC02E1AB9F623412502D5126231ABCC
\ No newline at end of file
diff --git a/src/test/resources-its/org/apache/maven/plugins/ear/it/EARInvokerIT/skinny_wars_timestamp/.predefined-repo/eartest/jar-sample-one/1.0-SNAPSHOT/jar-sample-one-1.0-20150825.210557-91.pom b/src/test/resources-its/org/apache/maven/plugins/ear/it/EARInvokerIT/skinny_wars_timestamp/.predefined-repo/eartest/jar-sample-one/1.0-SNAPSHOT/jar-sample-one-1.0-20150825.210557-91.pom
new file mode 100644
index 0000000..b1ee9d0
--- /dev/null
+++ b/src/test/resources-its/org/apache/maven/plugins/ear/it/EARInvokerIT/skinny_wars_timestamp/.predefined-repo/eartest/jar-sample-one/1.0-SNAPSHOT/jar-sample-one-1.0-20150825.210557-91.pom
@@ -0,0 +1,29 @@
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+    http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
+<project>
+  <modelVersion>4.0.0</modelVersion>
+  <groupId>eartest</groupId>
+  <artifactId>jar-sample-one</artifactId>
+  <packaging>jar</packaging>
+  <version>1.0-SNAPSHOT</version>
+  <distributionManagement>
+    <status>verified</status>
+  </distributionManagement>
+</project>
diff --git a/src/test/resources-its/org/apache/maven/plugins/ear/it/EARInvokerIT/skinny_wars_timestamp/.predefined-repo/eartest/jar-sample-one/1.0-SNAPSHOT/jar-sample-one-1.0-20150825.210557-91.pom.sha1 b/src/test/resources-its/org/apache/maven/plugins/ear/it/EARInvokerIT/skinny_wars_timestamp/.predefined-repo/eartest/jar-sample-one/1.0-SNAPSHOT/jar-sample-one-1.0-20150825.210557-91.pom.sha1
new file mode 100644
index 0000000..0ff3288
--- /dev/null
+++ b/src/test/resources-its/org/apache/maven/plugins/ear/it/EARInvokerIT/skinny_wars_timestamp/.predefined-repo/eartest/jar-sample-one/1.0-SNAPSHOT/jar-sample-one-1.0-20150825.210557-91.pom.sha1
@@ -0,0 +1 @@
+FB180EB8CE6EB7E52D96FD6584A82D23120942FB
\ No newline at end of file
diff --git a/src/test/resources-its/org/apache/maven/plugins/ear/it/EARInvokerIT/skinny_wars_timestamp/.predefined-repo/eartest/jar-sample-one/1.0-SNAPSHOT/maven-metadata.xml b/src/test/resources-its/org/apache/maven/plugins/ear/it/EARInvokerIT/skinny_wars_timestamp/.predefined-repo/eartest/jar-sample-one/1.0-SNAPSHOT/maven-metadata.xml
new file mode 100644
index 0000000..b93c1b3
--- /dev/null
+++ b/src/test/resources-its/org/apache/maven/plugins/ear/it/EARInvokerIT/skinny_wars_timestamp/.predefined-repo/eartest/jar-sample-one/1.0-SNAPSHOT/maven-metadata.xml
@@ -0,0 +1,45 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+    http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
+<metadata modelVersion="1.1.0">
+  <groupId>eartest</groupId>
+  <artifactId>jar-sample-one</artifactId>
+  <version>1.0-SNAPSHOT</version>
+  <versioning>
+    <snapshot>
+      <timestamp>20150825.210813</timestamp>
+      <buildNumber>92</buildNumber>
+    </snapshot>
+    <lastUpdated>20150825210813</lastUpdated>
+    <snapshotVersions>
+      <snapshotVersion>
+        <extension>jar</extension>
+        <value>1.0-20150825.210557-91</value>
+        <updated>20150825210813</updated>
+      </snapshotVersion>
+      <snapshotVersion>
+        <extension>pom</extension>
+        <value>1.0-20150825.210557-91</value>
+        <updated>20150825210813</updated>
+      </snapshotVersion>
+    </snapshotVersions>
+  </versioning>
+</metadata>