Approval Test Button

Add this URL to your Eclipse Installation to reach this solution's update site.

2026-03 (4.39), 2025-12 (4.38), 2025-09 (4.37), 2025-06 (4.36), 2025-03 (4.35), 2024-12 (4.34), 2024-09 (4.33), 2024-06 (4.32), 2024-03 (4.31), 2023-12 (4.30), 2023-09 (4.29), 2023-06 (4.28), 2023-03 (4.27), 2022-12 (4.26), 2022-09 (4.25), 2022-06 (4.24), 2022-03 (4.23), 2021-12 (4.22), 2021-09 (4.21), 2021-06 (4.20), 2021-03 (4.19), 2020-12 (4.18), 2020-09 (4.17), 2020-06 (4.16)

https://csorbazoli.github.io/approvaltestbutton-updatesite/

Learn more...
Solution Description

Displays a toolbar button on the JUnit results view to accept the results by overwriting the file containing the expected output.
This fits the approval test methodology. The logic works by default with the approvaltests library, which produces an AssertionError with the 'received' and 'approved' file path.
But it also works with other test failures, where the error messages clearly reference the output file.
It's worth using a custom JUnit reporter with the approval tests to leverage the built-in support for comparison view and avoid popping up external diff tools.
 

public enum CustomJunit4Reporter implements ApprovalFailureReporter
{
    INSTANCE;
    @Override
    public boolean report(String received, String approved) {
        String actual = FileUtils.readFile(received);
		File approvedFile = new File(approved);
		String expected = approvedFile.canRead() ? FileUtils.readFile(approved) : "";
		Assert.assertEquals("Actual result does not match content of " + approvedFile.getAbsolutePath(), expected, actual);
		return true;
	}
}

 

Then use it in the tests like

Approvals.verify(actual, new Options(CustomJunit4Reporter.INSTANCE));

The plugin supports the default verify failures, assuming the default file names.

Shortcuts make it really easy to open the diff view (Ctrl+D) or view the test resource (Ctrl+V) if needed.

Categories: Testing

Additional Details

Eclipse Versions: 2026-03 (4.39), 2025-12 (4.38), 2025-09 (4.37), 2025-06 (4.36), 2025-03 (4.35), 2024-12 (4.34), 2024-09 (4.33), 2024-06 (4.32), 2024-03 (4.31), 2023-12 (4.30), 2023-09 (4.29), 2023-06 (4.28), 2023-03 (4.27), 2022-12 (4.26), 2022-09 (4.25), 2022-06 (4.24), 2022-03 (4.23), 2021-12 (4.22), 2021-09 (4.21), 2021-06 (4.20), 2021-03 (4.19), 2020-12 (4.18), 2020-09 (4.17), 2020-06 (4.16)

Platform Support: Windows, Linux/GTK

Organization Name: csorbazoli

Development Status: Production/Stable

Date Created: Wednesday, March 4, 2026 - 07:00

License: Apache 2.0

Date Updated: Friday, March 13, 2026 - 02:37

Submitted by: Zoltán Csorba

Screenshot
Date Ranking Installs Clickthroughs
June 2026 0/0 0 0
May 2026 481/559 2 25
April 2026 514/612 2 35
March 2026 501/627 3 35
February 2026 0/0 0 0
January 2026 0/0 0 0
December 2025 0/0 0 0
November 2025 0/0 0 0
October 2025 0/0 0 0
September 2025 0/0 0 0
August 2025 0/0 0 0
July 2025 0/0 0 0
June 2025 0/0 0 0
View Data for all Listings

Unsuccessful Installs

Unsuccessful Installs in the last 7 Days: 0

Download last 500 errors (CSV)

Marketplace Drag to Install Button

By adding the following code below to your website you will be able to add an install button for Approval Test Button.

HTML Code:

Markdown Syntax:

Output:

Drag to your running Eclipse* workspace. *Requires Eclipse Marketplace Client