Tip:
Highlight text to annotate it
X
Welcome. I will now demonstrate how to use JUnit library from Eclipse
Lets check first if we have JUnit currently installed
Choose 'Help' > 'About Eclipse'. We''ll check if JUnit plug-in is available
JUnit is on the board
If we didn't have it, we go to 'Help' > 'Install new software'
We choose path to eclipse plug-in repository which is apprioprate to our Eclipse version
We must be connected with internet
For me it would be Galileo, for my clipse version
Next we should filter list, find JUnit plug-in and install it
Now we create a new project
We have to add to the project a separate source folder for tests
It is a practice, which enables us easy testin of protected and package access methods
Next in folder...
In source and test folders we create packages with identical names
For every new class
we can create classes with testing methods
Testing methods in JUnit 4, used here
doesn't return any results
The only requirement is that they have @Test annotation
imported from junit package
Then JUnit framework will recognize that this is a testing method
Now we try to run such testing method
Of course, the test passed, because it wasn't actually checking anything
Now we can start writing tests and implementing our classes
Thank you