Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

IntelliJ 4.0, Ant and JUnit

 
Jessica Sant
Sheriff
Posts: 4313
Android IntelliJ IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So, I'm running my JUnit tests via Ant inside IntelliJ IDEA 4.0.

Two things are bothering me:

1- when I run the script it executes each of the targets and lists them in the ant window (all fine and good). The problem is, it lists all the targets collapsed, and I'd like to see the results of the Junit tests. So, by default, I'd like it to expand the "test-junit" target.

2- if the junit tests fail, it should say the build failed too -- but it doesn't! It says "build successful" and because of problem #1, I don't know that the build really failed until I click on the "test-junit" target.

 
Ernest Friedman-Hill
author and iconoclast
Marshal
Pie
Posts: 24211
35
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why are you doing this instead of using the nifty built-in graphical TestRunner, which presents a live-updated results window with timings, error messages, etc, and clickable stack traces, even?
 
Jessica Sant
Sheriff
Posts: 4313
Android IntelliJ IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
umm cause the other guys on my team all use Eclipse so to make it so everyone can build and test stuff, everything goes in the ant scripts

But -- you're the 2nd person who's said that to me, so -- looks like I'll need to use the nifty built-in junit runner if I want what I said...
 
Ernest Friedman-Hill
author and iconoclast
Marshal
Pie
Posts: 24211
35
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Our project is Makefile-driven; we have makefiles that build everything and run tests. They're used by the nightly builds, and I'll occasionally use them myself. But when I'm testing in IDEA, I just use the native JUnit runner. So we have both, too. Never been a problem.
 
Dirk Schreckmann
Sheriff
Posts: 7023
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Jess,

Out of curiousity, what does your Ant task that runs the JUnit tests look like?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic