开发者

Add 'Test Packages' folder in Netbeans

开发者 https://www.devze.com 2023-03-27 22:49 出处:网络
I\'ve created a new Netbeans project and noticed that unlike my previous project it\'s mising the \'Test Packages\' folder. This might seem like an 开发者_Python百科easy question, but how can I add th

I've created a new Netbeans project and noticed that unlike my previous project it's mising the 'Test Packages' folder. This might seem like an 开发者_Python百科easy question, but how can I add this folder?

Here is a screenshot of my 'Projects' window:

Add 'Test Packages' folder in Netbeans


Assuming it's a Java project:

  1. Create a new folder: right click the project under "Projects" tab, go to "New" --> "Other.." --> "Other" --> "Folder"

  2. Edit project properties: right click on the project, this time select "Properties"

  3. Under "Project Properties" select category "Sources"

  4. Notice the section "Test Package Folders" --> click "Add Folder"


Right click on Source Packages, select New > JUnit Test.... Follow the wizard to create the unit test. The Test Packages folder will be created automatically and your unit test will be placed inside. (Verified in NetBeans 8.)


Just add a folder called "test" in the root (Project) folder and reload the project by right clicking on the project. This worked for me.

0

精彩评论

暂无评论...
验证码 换一张
取 消