Netbeans and creating JUnit tests -
i using netbeans 7.0.1 web project have imported existing sources. have added junit library project. in netbeans tutorials online version < 7 says create junit test given existing class righ-clicking on source file in project, select menu "tools" , there should option create junit test. option not appear me. there seem bean old bug report/request functionality, describing not seem have been resolved mentioned late 2011-05-09 on netbeans bugzilla list (link related on bugzilla). on bugzilla suggested explicitly create folder /test/unit/src
in project, still after when try create junit test existing class rightclick project -> new -> other -> junit, "no tests root folder found in selected project" (i tried changing foldername tests well). can explicitly set location in configuration file , there way of getting expected functionality allowing me righclick source file , select "junit test" create junit stub selected class ?
if right click on project , pick "properties" should see "sources" on left. select , click "add folder..." under "test package folders" section. add new test directory. if have existing one, delete first (just make sure test sources saved somewhere else) , add new one.
Comments
Post a Comment