File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Beginning Java and the fly likes Test Class Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Test Class" Watch "Test Class" New topic

Test Class

Rupinder Bains
Ranch Hand

Joined: Jul 23, 2002
Posts: 65
Hiya Everyone,
You all must know that I am useless at Java by now. :roll:
BUT... How do you test a class using a console display. BUT CANNOT inplement a GUI.
Thank You
Donald R. Cossitt
Ranch Hand

Joined: Jan 31, 2003
Posts: 401
The simplest way is from a command line in your DOS console make sure you change directory to the directory your class / java files are in then type: java whatevereFileName <enter>.
EG. C:\javaProjects\Testing> java myTestFile <enter>
Case is important.
Are you familiar with DOS 'cd' command?

subhit chauhan
Ranch Hand

Joined: Jun 20, 2002
Posts: 40
put system.out.println() where ever you want to debug you java class....
Francis Siu
Ranch Hand

Joined: Jan 04, 2003
Posts: 867
hi Rupinder
Which Operating System you use?
If you use Unix system, you can choose the console to display the statement which you use the System.out.println("") to print it out.
And I agree subhit that can use it to debug in some situations.
System.out.println("") default output is in console

Francis Siu
subhit chauhan
Ranch Hand

Joined: Jun 20, 2002
Posts: 40
For application prog. its command prompt in windows... but for applets its java console..
No idea about Unix
I agree. Here's the link:
subject: Test Class
It's not a secret anymore!