Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » Java Development Tools (JDT) » Modify the Java Code Template in Wizard "New JUnit Test Case"(Question about how to change the Java code template in the wizard New JUnit Test Case)
Modify the Java Code Template in Wizard "New JUnit Test Case" [message #1822117] Thu, 27 February 2020 14:52 Go to next message
Michael Benz is currently offline Michael BenzFriend
Messages: 1
Registered: February 2020
Junior Member
Hi all,

today after a JUnit5 meeting I was wondering if it was possible to modify the Java template for the wizard "Java - JUnit - JUnit Test Case"

Since we use a packaged Eclipse archive that is deployed to our developers machines it would be awesome to be able to customize the template or code for the template to suit our needs without having to write a new template / wizard on my own.

Basically I just want to add a custom header and replace the static import for the Assertions with one that uses assertj like I already do in most of our own code templates.

Are there any pointers towards the plugin or package that contains the default Java wizards?

index.php/fa/37471/0/

The eclipse version is 2019-06 (4.12.0) in the packaged Eclipse IDE for Java Developers
Re: Modify the Java Code Template in Wizard "New JUnit Test Case" [message #1826134 is a reply to message #1822117] Mon, 20 April 2020 07:10 Go to previous message
Noopur Gupta is currently offline Noopur GuptaFriend
Messages: 58
Registered: December 2012
Member
You can try to extend "org.eclipse.jdt.junit.wizards.NewTestCaseWizardPageOne" in org.eclipse.jdt.junit plug-in from eclipse.jdt.ui repository for your use case.

Hint: You can press Alt+Shift+F1 (Plug-in Selection Spy) on any Eclipse element e.g. New JUnit Test Case wizard to see its implementation class and other details.
Previous Topic:I have question about "root elements"!
Next Topic:Clickable error messages to console from my program
Goto Forum:
  


Current Time: Fri Apr 26 20:30:16 GMT 2024

Powered by FUDForum. Page generated in 0.02852 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top