Skip to content

Commit

Permalink
add migration cleanup from junit 4 to junit 5 (#110)
Browse files Browse the repository at this point in the history
* add first implementations of some annotation processing

* RunWith implemented

* first implementation of Assertions

* cover more assertions in the implementation

* implement static imports of assertion methods

* fix bug in import that causes static and normal import to be added

* consider 4 parameter case

* fix explicit static import case

* Update .classpath

* fill out preview

* add skeleton for rule test

* add stub

* implement Rule TemporaryFolder

* add some fixes but ExternalResource still not working

* fix spotbugs issue

* add rtstubs18

* add ExtensionContext

* more fixes to ExternalResource

* cleanup code

* more cleanup

* only formatting

* pull methods up

* use toString()

* add test for already junit5 case

* Add support for Assume

* add support for super calls

* add context to super call

* mostly formatting and a test

* fix jface migration

* extract some constants, formatting

* aggregate on AbstractTool

* simplify junit test setup

* fix spotbugs error

* refactor to use public instead of protected for before and after

* Support for assertSame and assertNotSame

* fix length of preview issue

* add more testcases

* Dont create change on empty ExternalResource derived class

* Add assumeThat support

* Add Assert.assertThat support

* test updating orbit target

* test changing junit dependency

* add junit to product

* remove junit from xml feature

* remove junit

* remove junit

* add some features to target and jupiter features to test commons

* update to 2024-09

* add more plugins to target

* test

* extend list of features in target and product

* add separate constants for each migration piece

* test update 21

* update target and switch on all cleanup parts in tests

* test with base instead of full jre

* test remove justj

* test remove justj complete

* use Java21
  • Loading branch information
carstenartur authored Nov 17, 2024
1 parent 7a377a4 commit 146c0ff
Show file tree
Hide file tree
Showing 124 changed files with 5,519 additions and 1,143 deletions.
6 changes: 6 additions & 0 deletions .github/workflows/codacy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,12 @@ jobs:
name: Codacy Security Scan
runs-on: ubuntu-latest
steps:
- name: Set up JDK 21
uses: actions/setup-java@v4
with:
java-version: '21'
distribution: 'temurin'
cache: maven
- name: Set up Maven
uses: stCarolas/setup-maven@d6af6abeda15e98926a57b5aa970a96bb37f97d1 # v5
with:
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,9 @@ jobs:
- name: Setup Java JDK
uses: actions/setup-java@v4
with:
distribution: 'temurin' # See 'Supported distributions' for available options
java-version: '17'
java-version: '21'
distribution: 'temurin'
cache: maven

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
Expand Down
28 changes: 23 additions & 5 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<groupId>org.sandbox</groupId>
<artifactId>central</artifactId>
<name>Sandbox central</name>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
<packaging>pom</packaging>
<properties>
<tycho-version>4.0.9</tycho-version>
Expand Down Expand Up @@ -44,6 +44,9 @@
<module>sandbox_jface_cleanup</module>
<module>sandbox_jface_cleanup_feature</module>
<module>sandbox_jface_cleanup_test</module>
<module>sandbox_junit_cleanup</module>
<module>sandbox_junit_cleanup_feature</module>
<module>sandbox_junit_cleanup_test</module>
<module>sandbox_usage_view</module>
<module>sandbox_usage_view_feature</module>
<module>sandbox_product</module>
Expand All @@ -57,7 +60,7 @@
<repository>
<id>eclipse</id>
<layout>p2</layout>
<url>https://download.eclipse.org/releases/2024-06</url>
<url>https://download.eclipse.org/releases/2024-09</url>
</repository>
<repository>
<id>babel</id>
Expand All @@ -67,13 +70,13 @@
<repository>
<id>orbit</id>
<layout>p2</layout>
<url>https://download.eclipse.org/tools/orbit/downloads/drops/R20230531010532/repository/</url>
<url>https://download.eclipse.org/tools/orbit/simrel/orbit-aggregation/2024-09/</url>
</repository>
<repository>
<!--<repository>
<id>swtbot</id>
<layout>p2</layout>
<url>https://download.eclipse.org/technology/swtbot/releases/latest/</url>
</repository>
</repository>-->
</repositories>
<build>
<plugins>
Expand Down Expand Up @@ -322,6 +325,21 @@
<artifactId>sandbox_jface_cleanup_test</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.sandbox</groupId>
<artifactId>sandbox_junit_cleanup</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.sandbox</groupId>
<artifactId>sandbox_junit_cleanup_feature</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.sandbox</groupId>
<artifactId>sandbox_junit_cleanup_test</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.sandbox</groupId>
<artifactId>sandbox_usage_view</artifactId>
Expand Down
4 changes: 2 additions & 2 deletions sandbox_cleanup_application/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ Bundle-ManifestVersion: 2
Bundle-Name: sandbox_cleanup_application
Bundle-SymbolicName: sandbox_cleanup_application;singleton:=true
Bundle-Vendor: sandbox
Bundle-Version: 1.1.0.qualifier
Bundle-Version: 1.2.0.qualifier
Automatic-Module-Name: ui.sandbox.fragment
Bundle-RequiredExecutionEnvironment: JavaSE-17
Bundle-RequiredExecutionEnvironment: JavaSE-21
Bundle-ActivationPolicy: lazy
Eclipse-BuddyPolicy: global
Require-Bundle: org.eclipse.core.runtime,
Expand Down
2 changes: 1 addition & 1 deletion sandbox_cleanup_application/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>org.sandbox</groupId>
<artifactId>central</artifactId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
</parent>
<artifactId>sandbox_cleanup_application</artifactId>
<name>Sandbox cleanup application</name>
Expand Down
2 changes: 1 addition & 1 deletion sandbox_cleanup_application_feature/feature.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<feature
id="sandbox_cleanup_application_feature"
label="Sandbox Cleanup application feature"
version="1.1.0.qualifier"
version="1.2.0.qualifier"
provider-name="sandbox">

<description>
Expand Down
2 changes: 1 addition & 1 deletion sandbox_cleanup_application_feature/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>org.sandbox</groupId>
<artifactId>central</artifactId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
</parent>
<artifactId>sandbox_cleanup_application_feature</artifactId>
<name>Sandbox cleanup application Feature</name>
Expand Down
4 changes: 2 additions & 2 deletions sandbox_common/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ Bundle-ManifestVersion: 2
Bundle-Name: sandbox_common
Bundle-SymbolicName: sandbox_common;singleton:=true
Bundle-Vendor: sandbox
Bundle-Version: 1.1.0.qualifier
Bundle-RequiredExecutionEnvironment: JavaSE-17
Bundle-Version: 1.2.0.qualifier
Bundle-RequiredExecutionEnvironment: JavaSE-21
Bundle-ActivationPolicy: lazy
Eclipse-BuddyPolicy: global
Require-Bundle: org.eclipse.core.runtime,
Expand Down
2 changes: 1 addition & 1 deletion sandbox_common/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>org.sandbox</groupId>
<artifactId>central</artifactId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
</parent>
<artifactId>sandbox_common</artifactId>
<name>Sandbox common</name>
Expand Down
Loading

0 comments on commit 146c0ff

Please sign in to comment.