Help coderanch get a
new server
by contributing to the fundraiser
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

why does JUnit build every time?

 
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm using WSAD 5.1, and the Junit plugin 3.8.1.

I have a JUnit that is in the same project as the code it is testing. Is this bad? I'm wondering if that is part of the problem. The problem is that every time I try to run this JUnit, it builds or rebuilds the project, and all the other projects that are somehow tied to the JUnit or the project it's in.

I usually build the projects myself after I've made a change and before I try to run the JUnit, so in my mind, all the classes should already be there for the JUnit to use.

I've gone into the Classpath tab of the Run box and removed the other projects, and it still builds them all.

What's going on? This is making the JUnit test anything but simple and a major pain.
 
author & internet detective
Posts: 41936
911
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
"briforge",
We're pleased to have you here with us in the WebSphere forum, but there are a few rules that need to be followed, and one is that proper names are required. Please take a look at the JavaRanch Naming Policy and adjust your display name to match it.

In particular, your display name must be a first and a last name separated by a space character, and must not be obviously fictitious.

Note that some people (myself included) will not answer questions until you fix the display name.

Thanks,
Jeanne
Forum Bartender
 
Bob Peterson
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Ok, thanks for the info, I've changed my display name. Does this mean I'll have to re-post the question?
 
Ranch Hand
Posts: 1071
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Your JUnit task probably 'depends' on a build task. So when you call the JUnit task it first looks to see what it depends on and runs that first rebuilding your project.
 
Jeanne Boyarsky
author & internet detective
Posts: 41936
911
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Brian,
No, you don't have to repost the question.

Another possiblity besides the one Steven posted is that you have the auto-compile setting off in your workspace preferences. If this is the case, WSAD sees the classes as being stale and rebuilds before running.
 
Bob Peterson
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for the replies. So how can I see what JUnit depends on?
 
Bob Peterson
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I do have the auto-compile option turned off in my preferences, but as I said in my original post, I always manually rebuild the project, so why would WSAD see the classes as stale?

The only thing I can think of is that there are 2 locations where the compiled classes go, and these are different locations from the Rebuild Project option and the JUnit compilation.
 
Steven Bell
Ranch Hand
Posts: 1071
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If it's the depends that is the problem you would look in your ant file and see a line something like:

< target name="run_junit" depends="stampversion"...

all the depends targets (and whatever they depend on) are run before the target you call.

You also might look for an

< antcall target=""

this runs the target in quotes.
[ June 08, 2005: Message edited by: Steven Bell ]
 
Tell me how it all turns out. Here is a tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/t/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic