SCJA,SCJP,SCWCD,SCBCD,SCEA I
Java Developer, Thailand
Originally posted by somkiat puisungnoen:
How to use JUnit with Eclipse ?
The soul is dyed the color of its thoughts. Think only on those things that are in line with your principles and can bear the light of day. The content of your character is your choice. Day by day, what you do is who you become. Your integrity is your destiny - it is the light that guides your way. - Heraclitus
Originally posted by Laurent Barbier:
I've found this tutorial about TDD (Test Driven Development) using Junit with Eclipse :
http://www.ammai.com/downloads/TDDEclipse_viewlet_swf.html
I think it might help
SCJA,SCJP,SCWCD,SCBCD,SCEA I
Java Developer, Thailand
Co-author of SCMAD Exam Guide, Author of JMADPlus
SCJP1.2, CCNA, SCWCD1.4, SCBCD1.3, SCMAD1.0, SCJA1.0, SCJP6.0
Originally posted by Ilja Preuss:
What are your doubts?
Generally, there is not much special about using JUnit inside Eclipse. You write your JUnit tests as usual, optionally using Eclipses wizards to do so, and run them using Eclipses inbuild testrunner.
SCJA,SCJP,SCWCD,SCBCD,SCEA I
Java Developer, Thailand
Originally posted by somkiat puisungnoen:
And I have some question:
When i should use JUnit to testing my application ??
Because i never use JUnit for testing application.
Co-author of SCMAD Exam Guide, Author of JMADPlus
SCJP1.2, CCNA, SCWCD1.4, SCBCD1.3, SCMAD1.0, SCJA1.0, SCJP6.0
SCJA,SCJP,SCWCD,SCBCD,SCEA I
Java Developer, Thailand
Tony Yan<br /> <br />IBM Certified Developer XML and Related Technology<br />Sun Certified Web Component Developer For J2EE Platform<br />Sun Certified Programmer For Java 2 Platform
Originally posted by Tony Yan:
Why not Ant?
Author of Test Driven (2007) and Effective Unit Testing (2013) [Blog] [HowToAskQuestionsOnJavaRanch]
Originally posted by Tony Yan:
Why not Ant?
The soul is dyed the color of its thoughts. Think only on those things that are in line with your principles and can bear the light of day. The content of your character is your choice. Day by day, what you do is who you become. Your integrity is your destiny - it is the light that guides your way. - Heraclitus
[OCP 17 book] | [OCP 11 book] | [OCA 8 book] [OCP 8 book] [Practice tests book] [Blog] [JavaRanch FAQ] [How To Ask Questions] [Book Promos]
Other Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, TOGAF part 1 and part 2
Originally posted by Jeanne Boyarsky:
The junit wizard assumes you have a class to test (the class doesn't need to have any methods in it, it just needs to exist.)
There is also a wizard that creates a test suite (to run some subset of your test classes.)
The soul is dyed the color of its thoughts. Think only on those things that are in line with your principles and can bear the light of day. The content of your character is your choice. Day by day, what you do is who you become. Your integrity is your destiny - it is the light that guides your way. - Heraclitus
Originally posted by Jeanne Boyarsky:
Somkiat,
The junit wizard assumes you have a class to test (the class doesn't need to have any methods in it, it just needs to exist.) The test case wizard lets you select what folder you want to put the test class in and if you want a custom superclass. You can choose to have it create setUp()/tearDown() methods and the type of test runner. (The test runner choice isn't as useful as you will probably want to use the Eclipse runner.) If your class has any methods, you can have the wizard create test method stubs for you.
There is also a wizard that creates a test suite (to run some subset of your test classes.)
SCJA,SCJP,SCWCD,SCBCD,SCEA I
Java Developer, Thailand
It doesn't even need to exist - it's optional! So you can easily use it in a test-first style.
And don't forget the "recreate test suite" command from the context menu on a test suite. Very usefull!
[OCP 17 book] | [OCP 11 book] | [OCA 8 book] [OCP 8 book] [Practice tests book] [Blog] [JavaRanch FAQ] [How To Ask Questions] [Book Promos]
Other Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, TOGAF part 1 and part 2
Originally posted by Tony Yan:
Why not Ant?
SCJA,SCJP,SCWCD,SCBCD,SCEA I
Java Developer, Thailand