Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Newcomers » Newcomers » How to test individual methods in a Java program?(Need to debug my code)
How to test individual methods in a Java program? [message #683076] Mon, 13 June 2011 00:39 Go to next message
descartes.holland is currently offline descartes.hollandFriend
Messages: 6
Registered: June 2011
Junior Member
Hello everyone. Is there any way to test my methods individually (without breakpoints) in a Java program? For example, if I have a method that accepts an int and returns a String, I want to put in a number and see if the method works as expected. Thanks.
(no subject) [message #683091 is a reply to message #683076] Mon, 13 June 2011 01:21 Go to previous messageGo to next message
Deepak Azad is currently offline Deepak AzadFriend
Messages: 543
Registered: July 2009
Senior Member
On 6/13/2011 6:09 AM, forums-noreply@eclipse.org wrote:
> Hello everyone. Is there any way to test my methods individually
> (without breakpoints) in a Java program? For example, if I have a method
> that accepts an int and returns a String, I want to put in a number and
> see if the method works as expected. Thanks.

You can write JUnit tests.
(no subject) [message #683665 is a reply to message #683076] Tue, 14 June 2011 07:49 Go to previous message
Eclipse UserFriend
Originally posted by: Wojtek

forums-noreply@eclipse.org wrote :
> Hello everyone. Is there any way to test my methods individually (without
> breakpoints) in a Java program? For example, if I have a method that accepts
> an int and returns a String, I want to put in a number and see if the method
> works as expected. Thanks.

Create a scrapbook page.

File/ New/ Other.../ Java/ Java RunDebug/ Scrapbook Page

You can write just about any Java code in it, then you highlight what
you want to run, and just those lines will be run.

Good for adhoc testing of methods, classes, etc

--
Wojtek :-)
Previous Topic:Can't install Clearcase plugin for Eclipse
Next Topic:which eclipse part belongs java refactoring?
Goto Forum:
  


Current Time: Fri Apr 19 13:42:38 GMT 2024

Powered by FUDForum. Page generated in 0.02900 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top