Intellij: Change JUnit Test Class template

风流意气都作罢 提交于 2019-12-21 03:38:27

问题


I would like to customize the JUnit Test class template however I cannot find it anywhere in settings. This guy has the same problem. I can't find anything in File Templates or Live Templates. I'm using Intellij 11.


回答1:


This is now solved in the latest IntelliJ IDEA / Android Studio. Go to:

Settings
-Editor
-File and Code Templates
-Code (tab)
-JUnit4 Test Class 

edit the code in the right window.




回答2:


The link provided by CrazyCoder suggests that this is not directly possible but that I you need to add if statements to the Class File Type template. I will probably split the template in two using a big if-else.



来源:https://stackoverflow.com/questions/14726196/intellij-change-junit-test-class-template

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!