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

adoroszlai pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/ozone.git


The following commit(s) were added to refs/heads/master by this push:
     new 6ae9fff505 HDDS-9492. Ban import of JUnit4 classes in modules already 
migrated to JUnit5 (#5508)
6ae9fff505 is described below

commit 6ae9fff50596cd3582a222285801b173c6950e32
Author: Doroszlai, Attila <[email protected]>
AuthorDate: Mon Oct 30 21:23:09 2023 +0100

    HDDS-9492. Ban import of JUnit4 classes in modules already migrated to 
JUnit5 (#5508)
---
 hadoop-hdds/erasurecode/pom.xml               |  4 ++++
 hadoop-hdds/rocks-native/pom.xml              |  2 ++
 hadoop-hdds/rocksdb-checkpoint-differ/pom.xml |  4 ++++
 hadoop-ozone/common/pom.xml                   |  4 ++++
 hadoop-ozone/s3-secret-store/pom.xml          |  1 +
 pom.xml                                       | 21 +++++++++++++++++++++
 6 files changed, 36 insertions(+)

diff --git a/hadoop-hdds/erasurecode/pom.xml b/hadoop-hdds/erasurecode/pom.xml
index df282a0a55..cb95483dc2 100644
--- a/hadoop-hdds/erasurecode/pom.xml
+++ b/hadoop-hdds/erasurecode/pom.xml
@@ -29,6 +29,10 @@ https://maven.apache.org/xsd/maven-4.0.0.xsd";>
   <name>Apache Ozone HDDS Erasurecode</name>
   <packaging>jar</packaging>
 
+  <properties>
+    <allow.junit4>false</allow.junit4>
+  </properties>
+
   <dependencies>
 
     <dependency>
diff --git a/hadoop-hdds/rocks-native/pom.xml b/hadoop-hdds/rocks-native/pom.xml
index 6866890d81..34b3df4961 100644
--- a/hadoop-hdds/rocks-native/pom.xml
+++ b/hadoop-hdds/rocks-native/pom.xml
@@ -64,6 +64,8 @@
         </dependency>
     </dependencies>
     <properties>
+        <allow.junit4>false</allow.junit4>
+
         <maven.compiler.source>8</maven.compiler.source>
         <maven.compiler.target>8</maven.compiler.target>
     </properties>
diff --git a/hadoop-hdds/rocksdb-checkpoint-differ/pom.xml 
b/hadoop-hdds/rocksdb-checkpoint-differ/pom.xml
index 930b670e1c..51cdfe07dc 100644
--- a/hadoop-hdds/rocksdb-checkpoint-differ/pom.xml
+++ b/hadoop-hdds/rocksdb-checkpoint-differ/pom.xml
@@ -29,6 +29,10 @@ https://maven.apache.org/xsd/maven-4.0.0.xsd";>
   <name>RocksDB Checkpoint Differ</name>
   <packaging>jar</packaging>
 
+  <properties>
+    <allow.junit4>false</allow.junit4>
+  </properties>
+
   <dependencies>
     <dependency>
       <groupId>org.rocksdb</groupId>
diff --git a/hadoop-ozone/common/pom.xml b/hadoop-ozone/common/pom.xml
index 0199d7809a..e5448f6c39 100644
--- a/hadoop-ozone/common/pom.xml
+++ b/hadoop-ozone/common/pom.xml
@@ -28,6 +28,10 @@ https://maven.apache.org/xsd/maven-4.0.0.xsd";>
   <name>Apache Ozone Common</name>
   <packaging>jar</packaging>
 
+  <properties>
+    <allow.junit4>false</allow.junit4>
+  </properties>
+
   <dependencies>
 
     <dependency>
diff --git a/hadoop-ozone/s3-secret-store/pom.xml 
b/hadoop-ozone/s3-secret-store/pom.xml
index 57bfd6e863..d45aadfa79 100644
--- a/hadoop-ozone/s3-secret-store/pom.xml
+++ b/hadoop-ozone/s3-secret-store/pom.xml
@@ -28,6 +28,7 @@
   <properties>
     <file.encoding>UTF-8</file.encoding>
     <downloadSources>true</downloadSources>
+    <allow.junit4>false</allow.junit4>
   </properties>
 
   <dependencies>
diff --git a/pom.xml b/pom.xml
index 3079b6de04..ba0da21ded 100644
--- a/pom.xml
+++ b/pom.xml
@@ -252,6 +252,7 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
http://maven.apache.org/xs
     -->
     <enforced.java.version>[${javac.version},)</enforced.java.version>
     <enforced.maven.version>[3.3.0,)</enforced.maven.version>
+    <allow.junit4>true</allow.junit4>
 
     <!-- Plugin versions and config -->
     <maven-surefire-plugin.argLine>-Xmx4096m 
-XX:+HeapDumpOnOutOfMemoryError</maven-surefire-plugin.argLine>
@@ -1832,6 +1833,26 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
http://maven.apache.org/xs
                 </rules>
               </configuration>
             </execution>
+            <execution>
+              <id>ban-junit4-imports</id>
+              <phase>process-sources</phase>
+              <goals>
+                <goal>enforce</goal>
+              </goals>
+              <configuration>
+                <skip>${allow.junit4}</skip>
+                <rules>
+                  <restrictImports>
+                    <includeTestCode>true</includeTestCode>
+                    <reason>Use JUnit5</reason>
+                    <bannedImports>
+                      <bannedImport>org.junit.*</bannedImport>
+                      <bannedImport>static org.junit.*.*</bannedImport>
+                    </bannedImports>
+                  </restrictImports>
+                </rules>
+              </configuration>
+            </execution>
           </executions>
         </plugin>
         <plugin>


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to