java - can't find run as junit test in eclipse -


i created test class in eclipse this

@runwith(springjunit4classrunner.class) @contextconfiguration(locations = { "classpath:applicationcontext.xml" }) @transactionconfiguration @transactional public class teamtest extends abstracttransactionaljunit4springcontexttests {   @test  public void testcreate() {     assert (true);  }} 

however, when click right click on file don't see option run junit!

what wrong?

i using eclipse 3.6

make sure eclipse environment using junit 4. junit 3 doesn't make use of annotations (it uses old extends testcase style)

there few things double check:

window > preferences > java > junit

are seeing junit4 or junit3 imports? if looks good, make sure project using junit4 instead of junit3.

right click on project > properties > java build path > libraries

is junit4 included there? junit related there? if junit3 in there, click on , click remove. click add library... , follow prompts there add junit again.

out of curiosity, junits run outside of eclipse? mvn install or whatever build target have ant that'll run junits


Comments

Popular posts from this blog

java - SNMP4J General Variable Binding Error -

windows - Python Service Installation - "Could not find PythonClass entry" -

Determine if a XmlNode is empty or null in C#? -