Download the tools to run the examples for the Unit testing part of the "Software quality and testing" course.
- Coding guideline
- Sample project uCoach
- Use Windows because Linux is not working at the Lab....
Sample environment set-up for ucoach-authentication-api
- Clone project, run command from cmd, or powershell
git clone https://github.com/uCoach/authentication-api.git
- Start IntelliJ and Import project from the directory you've cloned into.
- Click Import Project > "Create Project from existing sources" > Next > Next > Next > Next > Next > Finish
- File > Project Structure > Project SDK. Set it to the installed root directory of your JDK ( 1.8.x mandatory )
- Project language level, set it to "SDK Default"
- Double click on project name > Right-click on 'build.xml', "Add as Ant build file"
- On the Ant Build Window double click "install"
- Install Ivy IDEA and configure
- File > Settings > Plugins > Search in repositories for
IvyIDEA
> Click install and restart. - File > Settings > IvyIDEA > Ivy Settings set to "Use ivy default"
- Right click on "ivy.xml" > IvyIDEA > Resolve for all modules > Open Project settings > Ivy Settings set to "Use ivy default"
- Right click on "ivy.xml" > IvyIDEA > Resolve for authentication-api module
- You can ignore
org.glassfish.ha#ha-api;3.1.9: Unrecognized artifact type: hk2-jar, will not add this as a dependency in IntelliJ.
- You can ignore
- Push
CTRL + F9
to compile and test if dependencies have been resolves
- Add testing foldery to the project
- Right click on project name
authentication-api
> New > Folder > Name itUnitTest
- Right click on
UnitTest
folder > Mark directory as > Test Sources Root - Open src.ucoach.autu.restclient.util.JsonParser
- Click on the classname
JsonParser
> pressALT + ENTER
> Create Test- Testing library JUnit5
- For the first tinme IntelliJ won't find it so click on
Fix
if needed - Check all member functions to generate test functions for
- Click Ok
- Recompile to test if adding the sample test class works.
- If compilation worked, right click on
UnitTest
folder >Run All Tests
- All tests should pass and you should see
Feb 20, 2017 1:18:45 PM org.junit.platform.launcher.core.ServiceLoaderTestEngineRegistry loadTestEngines INFO: Discovered TestEngines with IDs: [junit-jupiter, junit-vintage] Process finished with exit code 0
- Enjoy unit testing.
- Clone/Fork/Download authentication-api
- Sample project introduction
- Simple Unit testing example with refactoring
- Add
ivy.xml
from course_1
- GoTo Folder course_1 and follow the steps there
- Clone/Fork/Download process-centric-service
- Groovy
- Spock if(gradle.works)
- Spock else
- TestNG
- Add
ivy.xml
from course_2
- GoTo Folder course_2 and follow the steps there
- Adam Istvan Szucs
- [email protected] :subject[2016_Software_Testing]