• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Sidebar >> OOCalculator >> Setting up JUnit

 
Junilu Lacar
Bartender
Posts: 7600
53
Android Eclipse IDE IntelliJ IDE Java Linux Mac Scala Spring Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sidebar to this thread
Reply here to discuss any JUnit-related questions.
 
Dirk Schreckmann
Sheriff
Posts: 7023
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,
It looks like I'm going to have to stop hiding behind my IDE that takes care of path considerations for me all by itself.
What is the best or easiest setup to use with WinXP for setting up JUnit? Do I really want to add JUnit as a permanent path member in my system settings or what about just setting up a batch file to use with JUnit? What exactly would that batch file look like?
I thank you for your advice.
-Dirk Schreckmann
 
jason adam
Chicken Farmer ()
Ranch Hand
Posts: 1932
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey Junilu, if you want, would glad to have an influx of JUnit questions come over to the IDE forum. Besides, might attract some other attention from people who don't normally read the OO forum. If you want, we can move this there.
Otherwise, I'll be following along with the rest of the crowd, this sounds like a very exciting project!
 
Junilu Lacar
Bartender
Posts: 7600
53
Android Eclipse IDE IntelliJ IDE Java Linux Mac Scala Spring Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dirk,
I'm assuming your PATH variable is already properly set such that you can run java.
I prefer using the Swing version of TestRunner because then I can just keep JUnit up and keep editing and recompiling classes. Each time I hit the Run button in JUnit it uses the newly compiled versions of the classes. Same thing goes if you use a batch file.
If you want to use a batch file, this is the command you need:
java junit.swingui.TestRunner -cp .;($JUNIT)\junit.jar TestClass
where
($JUNIT) is the path to junit.jar and TestClass is the fully qualified name of the TestCase you want to run. You can substitute this with a command line parameter too if you want.
I'm using TextPad and setting it up is easy. I just add a new Tool Macro and configure it like so:
Command: ($JAVA)\bin\java.exe
Parameters: junit.swingui.TestRunner -cp .;d:\junit\junit.jar $Sel.$BaseName
Initial Folder: $FileDir
Where ($JAVA) would be the path to bin\java.exe. The $Sel macro parameter allows me to simply highlight the package name of the TestCase before running the Tool macro.
HTH,
Junilu
[ March 11, 2002: Message edited by: Junilu Lacar ]
 
Junilu Lacar
Bartender
Posts: 7600
53
Android Eclipse IDE IntelliJ IDE Java Linux Mac Scala Spring Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Jason,
Yes, I suppose the IDE forum is where this thread should really be. We'll need some help from Sandeep or a sheriff to move it there.
Junilu
 
Dirk Schreckmann
Sheriff
Posts: 7023
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,
Java plays no part in my system path settings, not as an Environment Variable nor as a path setting in autoexec.bat (it is not setup so that I can run java.exe from anywhere). My IDE takes care of it for me (I hate the command line - it brings back nightmares from the Days of Dos).
It's been a while since I've significantly used the command prompt (my therapist put me through an intensive withdrawal session soon after Win98SE came out) and I'd appreciate any advice on setting every detail up (especially advice about how to never have to use the command prompt).
In the mean time, I'll be stumbling around trying to figure it out and all of the newbies will miss out on my made up advice.
[ March 11, 2002: Message edited by: Dirk Schreckmann ]
 
Junilu Lacar
Bartender
Posts: 7600
53
Android Eclipse IDE IntelliJ IDE Java Linux Mac Scala Spring Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
:roll: OK Dirk, the Command Prompt-Challenged Thread Hijacker, what's your IDE?
 
Dirk Schreckmann
Sheriff
Posts: 7023
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It's JCreator. It's fast, small and lightweight.
Though I'm considering using JBuilder (for this project) because it is supposed to provide some sort of integration with JUnit. I'll have to look into it a bit more to see if any benefits derived from this integration outweigh the fantastically slow performance (on my machine) of the fantastically bloated JBuilder (which also has no support for the wheel on my mouse - What's up with that? Don't they know how lazy I am?).
Thank you for any advice.
 
jason adam
Chicken Farmer ()
Ranch Hand
Posts: 1932
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I use JCreator LE, also. We can also set up user tools like Junilu described. Under configure->options->tools, you can do basically what she mentioned. That way you avoid the command-line, and get to use the environment you are used to.
 
Junilu Lacar
Bartender
Posts: 7600
53
Android Eclipse IDE IntelliJ IDE Java Linux Mac Scala Spring Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
..she mentioned
And just to save ourselves some embarassment in the future, I'm a he.
Junilu
 
jason adam
Chicken Farmer ()
Ranch Hand
Posts: 1932
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
DOH!!!
 
Matt Horton
Ranch Hand
Posts: 107
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
lol, and you were about to get a billion proposals of marriage for being such a badarse.
Thanks, btw Junilu, this will be very fun.
 
Edward Valdemar
Greenhorn
Posts: 2
Eclipse IDE Java Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,
This thread didn't help me in getting JUnit installed.
I just put the junit.jar in the appropriate place and edited the classpath to point at it and away I went.
 
Dirk Schreckmann
Sheriff
Posts: 7023
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to JavaRanch, Edward!
I'm glad you got JUnit working, and that you were able to resurrect an old thread from back when I didn't even know what the CLASSPATH was.
For future lurkers, Edwards suggestion of specifying the location of junit.jar in the system CLASSPATH setting is the the way to do it.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic