Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

junit not using the newest file

Tags:

java

junit

I use junit automatically installed by maven. When I run the maven test my tests work fine. But when I call the Eclipse JUnit test it doesn't use the current version of the test class.

E.g. if I change a assertTrue() into a assertFalse() I get the same result. This is driving me crazy.

Automatic build for the project is on. Why does JUnit use some old crap?

Thanks for the help. A maven clean and a eclipse clean fixed the problem. Weird...

like image 595
Franz Kafka Avatar asked May 28 '11 11:05

Franz Kafka


2 Answers

Most possibly Maven compiles to ./target/classes while Eclipse usually compiles to ./bin/classes.

You should try the http://m2eclipse.sonatype.org/ plugin for Eclipse that helps out easing the differences between Maven and Eclipse.

like image 51
Karl-Bjørnar Øie Avatar answered Oct 31 '22 03:10

Karl-Bjørnar Øie


So, go to directory in which maven copied junit file from junit repository, then check the junit version. so after thath, right click on your project under eclipse than select "Buildpath"> "add library" then select "Junit" next select "junit version" tehn continue. after clean your project, build it, finally launch it.

like image 33
onepseudoxy Avatar answered Oct 31 '22 04:10

onepseudoxy