=== modified file 'rules/annotations/annotations.xml'
--- rules/annotations/annotations.xml	2022-04-20 19:02:14 +0000
+++ rules/annotations/annotations.xml	2022-09-05 21:48:35 +0000
@@ -261,6 +261,7 @@
 **     AL2 20220324          Store the "poly" functions (the ones which return a value from dynamic-function.
 **     CA  202200420         REST services written directly in Java can be configured via the 'rest-service'
 **                           element.
+**     VVT 20220906          OEUnit support: annotations/oeunit added. See #6237.
 */
  -->
  
@@ -674,6 +675,7 @@
    <rule-set name="annotations/method_defs" />
    <rule-set name="annotations/procedures" />
    <rule-set name="annotations/legacy_services" />
+   <rule-set name="annotations/oeunit" />
    <rule-set name="annotations/case_statements" />
    <rule-set name="annotations/input_output" />
    <rule-set name="annotations/assignment_style_stmt_rewriting" />

=== modified file 'rules/annotations/legacy_services.rules'
--- rules/annotations/legacy_services.rules	2021-10-12 08:35:45 +0000
+++ rules/annotations/legacy_services.rules	2022-09-05 22:10:06 +0000
@@ -5,7 +5,7 @@
 ** Module   : legacy_services.rules
 ** Abstract : handle legacy services (REST, WS) preparation
 **
-** Copyright (c) 2019-2021, Golden Code Development Corporation.
+** Copyright (c) 2019-2022, Golden Code Development Corporation.
 **
 ** _#_ _I_ __Date__ ______________________________________Description_______________________________________
 ** 001 CA  20190606 Created initial version.
@@ -18,6 +18,7 @@
 **                  services.
 **     CA  20211012 Fixed generated WSDL and reworked SOAP support to rely on namespace, when resolving an
 **                  operation.
+** 005 VVT 20220906 OEUnit support: code removing all annotations removed. See #6237.
 */
  -->
  
@@ -303,7 +304,9 @@
             <rule>keep
                <action>hasSrvs = true</action>
                
-               <action on="false">ref.remove()</action>
+               <!-- Do NOT remove everything blindly! We still need some annotations for other
+                    purposes like OEUnit -->
+               <!-- <action on="false">ref.remove()</action> -->
             </rule>
          </while>
       </function>

=== added file 'rules/annotations/oeunit.rules'
--- rules/annotations/oeunit.rules	1970-01-01 00:00:00 +0000
+++ rules/annotations/oeunit.rules	2022-09-05 22:12:33 +0000
@@ -0,0 +1,96 @@
+<?xml version="1.0"?>
+<!-- 
+/*
+** Module   : oeunit.rules
+** Abstract : rewrite 4gl OEUnit annotations to JUnit 5 annotations
+**
+** Copyright (c) 2022, Golden Code Development Corporation.
+**
+** _#_ _I_ __Date__  ___________________________Description____________________________
+** 001 VVT 20220906  Initial version
+*/
+ -->
+<!--
+** This program is free software: you can redistribute it and/or modify
+** it under the terms of the GNU Affero General Public License as
+** published by the Free Software Foundation, either version 3 of the
+** License, or (at your option) any later version.
+**
+** This program 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 Affero General Public License for more details.
+**
+** You may find a copy of the GNU Affero GPL version 3 at the following
+** location: https://www.gnu.org/licenses/agpl-3.0.en.html
+** 
+** Additional terms under GNU Affero GPL version 3 section 7:
+** 
+**   Under Section 7 of the GNU Affero GPL version 3, the following additional
+**   terms apply to the works covered under the License.  These additional terms
+**   are non-permissive additional terms allowed under Section 7 of the GNU
+**   Affero GPL version 3 and may not be removed by you.
+** 
+**   0. Attribution Requirement.
+** 
+**     You must preserve all legal notices or author attributions in the covered
+**     work or Appropriate Legal Notices displayed by works containing the covered
+**     work.  You may not remove from the covered work any author or developer
+**     credit already included within the covered work.
+** 
+**   1. No License To Use Trademarks.
+** 
+**     This license does not grant any license or rights to use the trademarks
+**     Golden Code, FWD, any Golden Code or FWD logo, or any other trademarks
+**     of Golden Code Development Corporation. You are not authorized to use the
+**     name Golden Code, FWD, or the names of any author or contributor, for
+**     publicity purposes without written authorization.
+** 
+**   2. No Misrepresentation of Affiliation.
+** 
+**     You may not represent yourself as Golden Code Development Corporation or FWD.
+** 
+**     You may not represent yourself for publicity purposes as associated with
+**     Golden Code Development Corporation, FWD, or any author or contributor to
+**     the covered work, without written authorization.
+** 
+**   3. No Misrepresentation of Source or Origin.
+** 
+**     You may not represent the covered work as solely your work.  All modified
+**     versions of the covered work must be marked in a reasonable way to make it
+**     clear that the modified work is not originating from Golden Code Development
+**     Corporation or FWD.  All modified versions must contain the notices of
+**     attribution required in this license.
+-->
+<rule-set>
+   <worker class="com.goldencode.p2j.uast.ProgressPatternWorker" namespace="prog" />
+   <walk-rules>
+      <rule>this.type == prog.annotation
+            and parent.type == prog.method_def
+         <!-- Get initial annotation name -->
+         <variable name="annoName" type="java.lang.String" />
+         <action>annoName = this.getAnnotation("javaname")</action>
+
+         <!-- Replace OEUnit annotation names (made after JUnit 4) by JUnit 5 names -->
+         <rule>annoName == "Before"
+            <action>annoName = "org.junit.jupiter.api.BeforeEach"</action>
+         <rule on="false">annoName == "After"
+            <action>annoName = "org.junit.jupiter.api.AfterEach"</action>
+         <rule on="false">annoName == "BeforeClass"
+            <action>annoName = "org.junit.jupiter.api.BeforeAll"</action>
+         <rule on="false">annoName == "AfterClass"
+            <action>annoName = "org.junit.jupiter.api.AfterAll"</action>
+         <rule on="false">annoName == "Ignore"
+            <action>annoName = "org.junit.jupiter.api.Disabled"</action>
+         </rule>
+         </rule>
+         </rule>
+         </rule>
+         </rule>
+
+         <!-- Write it back -->
+         <action>copy.putAnnotation("javaname", annoName)</action>
+      </rule>
+      
+   </walk-rules>
+</rule-set>

=== modified file 'rules/convert/core_conversion.xml'
--- rules/convert/core_conversion.xml	2021-02-04 09:51:08 +0000
+++ rules/convert/core_conversion.xml	2022-09-05 21:47:55 +0000
@@ -5,7 +5,7 @@
 ** Module   : core_conversion.xml
 ** Abstract : primary "driver" for code conversion
 **
-** Copyright (c) 2005-2021, Golden Code Development Corporation.
+** Copyright (c) 2005-2022, Golden Code Development Corporation.
 **
 ** _#_ _I_ __Date__ __JPRM__ ____________________________Description_____________________________
 ** 001 GES 20050719   @21720 This version supports the conversion of most
@@ -68,6 +68,7 @@
 **     CA  20210203          Fixed conversion issues with OUTPUT/INPUT-OUTPUT for extent or scalar parameters,
 **                           involved in dynamic or static OO calls, functions or procedure calls.  This 
 **                           includes mostly cases for OO properties/variables (static and non-static).
+** 026 VVT 20220906          OEUnit support: convert/oeunit added. See #6237.
 */
  -->
  
@@ -181,6 +182,7 @@
         Progress source constructs into the equivalent Java constructs
         rooted in the Java AST -->
    <rule-set honor-hidden="true" input="tree" load-condition="runtime-query">
+      <rule-set name="convert/oeunit" />
       <rule-set name="convert/variable_definitions" />
       <!-- the order of the following rules is important - method_definitions' ascent-rules will
            emit the signature's parameter annotations -->

=== added file 'rules/convert/oeunit.rules'
--- rules/convert/oeunit.rules	1970-01-01 00:00:00 +0000
+++ rules/convert/oeunit.rules	2022-09-05 22:17:08 +0000
@@ -0,0 +1,95 @@
+<?xml version="1.0"?>
+<!-- 
+/*
+** Module   : oeunit.rules
+** Abstract : Java OEUnit Java annotation references beautifier
+**
+** Copyright (c) 2022, Golden Code Development Corporation.
+**
+** _#_ _I_ __Date__  ___________________________Description____________________________
+** 001 VVT 20220906  Initial version
+*/
+ -->
+<!--
+** This program is free software: you can redistribute it and/or modify
+** it under the terms of the GNU Affero General Public License as
+** published by the Free Software Foundation, either version 3 of the
+** License, or (at your option) any later version.
+**
+** This program 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 Affero General Public License for more details.
+**
+** You may find a copy of the GNU Affero GPL version 3 at the following
+** location: https://www.gnu.org/licenses/agpl-3.0.en.html
+** 
+** Additional terms under GNU Affero GPL version 3 section 7:
+** 
+**   Under Section 7 of the GNU Affero GPL version 3, the following additional
+**   terms apply to the works covered under the License.  These additional terms
+**   are non-permissive additional terms allowed under Section 7 of the GNU
+**   Affero GPL version 3 and may not be removed by you.
+** 
+**   0. Attribution Requirement.
+** 
+**     You must preserve all legal notices or author attributions in the covered
+**     work or Appropriate Legal Notices displayed by works containing the covered
+**     work.  You may not remove from the covered work any author or developer
+**     credit already included within the covered work.
+** 
+**   1. No License To Use Trademarks.
+** 
+**     This license does not grant any license or rights to use the trademarks
+**     Golden Code, FWD, any Golden Code or FWD logo, or any other trademarks
+**     of Golden Code Development Corporation. You are not authorized to use the
+**     name Golden Code, FWD, or the names of any author or contributor, for
+**     publicity purposes without written authorization.
+** 
+**   2. No Misrepresentation of Affiliation.
+** 
+**     You may not represent yourself as Golden Code Development Corporation or FWD.
+** 
+**     You may not represent yourself for publicity purposes as associated with
+**     Golden Code Development Corporation, FWD, or any author or contributor to
+**     the covered work, without written authorization.
+** 
+**   3. No Misrepresentation of Source or Origin.
+** 
+**     You may not represent the covered work as solely your work.  All modified
+**     versions of the covered work must be marked in a reasonable way to make it
+**     clear that the modified work is not originating from Golden Code Development
+**     Corporation or FWD.  All modified versions must contain the notices of
+**     attribution required in this license.
+-->
+<rule-set>
+   <worker class="com.goldencode.p2j.convert.ConverterHelper" namespace="help" />
+   <worker class="com.goldencode.p2j.uast.ProgressPatternWorker" namespace="prog" />
+   <variable name="hasJUnit5Annotations" type="java.lang.Boolean"/>
+
+   <!-- Detect if any of JUnit 5 annotations exist in the tree -->
+   <walk-rules>
+      <rule>this.type == prog.annotation
+            and parent.type == prog.method_def
+         <variable name="annoName" type="java.lang.String" />
+         <action>annoName = this.getAnnotation("javaname")</action>
+         <rule>
+            annoName == "org.junit.jupiter.api.BeforeEach" or
+            annoName == "org.junit.jupiter.api.AfterEach"  or
+            annoName == "org.junit.jupiter.api.BeforeAll"  or
+            annoName == "org.junit.jupiter.api.AfterAll"   or
+            annoName == "org.junit.jupiter.api.Disabled"
+            <!-- Replace fully-qualified name by simple name -->
+            <action>copy.putAnnotation("javaname", annoName.substring(22))</action>
+            <action>hasJUnit5Annotations = true</action>
+         </rule>
+      </rule>
+   </walk-rules>
+   <post-rules>
+      <rule>hasJUnit5Annotations == true
+         <action>help.createImport("org.junit.jupiter.api.*")</action>
+         <action>hasJUnit5Annotations = false</action>
+      </rule>
+   </post-rules>
+   
+</rule-set>

