java - Netbeans: How to alter naming pattern used to identify testSuites -


i have numerous junit testsuites have "tests" suffix. eclipse recognises static suite() method , makes run test option available in package explorer. same not true netbeans gives me default run context menu option. noticed recognize class uses "testsuite" suffix tests suite. new nb 7.0 , unable find out how alter pattern or how make nb work in same way eclipse.

ok, actually, figured out, while digging around trying solve own problem. vanilla netbeans uses ant, question ant question. if in project's directory, see there build.xml file. primary file instructs ant do. if inside file, see it's primary function <import /> nbproject/build-impl.xml file. so, need in here. can use file override functionality of default implementation.

if dig down build-impl.xml file, you'll come upon junit section. section:

<target depends="init,compile-test,-pre-test-run" if="have.tests" name="-do-test-run">     <j2seproject3:junit testincludes="**/*test.java"/> </target> 

this section runs tests, , it's in small block of xml, need, because we're trying override 1 small bit. obvious, can see we're matching (recursively) file names match patter "*test.java". so, in case edit (or add) pattern "testsuite.java". don't add line file though, might hosed, automatically generated file. instead, copy whole bit actual build.xml file, , think needs pasted above <import /> directive take precedence. (maybe not, try below if doesn't work.)

now, here's tricky bit, netbeans has custom junit runner, <j2seproject3:junit /> tag. without digging down further see how pass arguments, don't know how add arguments it, case, fine, don't need add one, can make work editing one.

<target depends="init,compile-test,-pre-test-run" if="have.tests" name="-do-test-run">     <j2seproject3:junit testincludes="**/*test*.java"/> </target> 

this should likely you. match has word test in it, , not stuff ends word test.


Comments

Popular posts from this blog

objective c - Change font of selected text in UITextView -

php - Accessing POST data in Facebook cavas app -

c# - Getting control value when switching a view as part of a multiview -