Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Source code of the exercises from "Practical Unit Testing with TestNG and Mockito"
branch: master

This branch is even with tomekkaczanowski:master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
chp_03_fahrenheit/src
chp_03_string_reversal/src/main/java/com/practicalunittesting
chp_05_race_results/src
chp_05_user_service/src/main/java/com/practicalunittesting
chp_06_custom_matcher/src
chp_06_id_generator/src
chp_06_test_collections/src/main/java/com/practicalunittesting
chp_06_time_testing/src/main/java/com/practicalunittesting
chp_07_legacy_code/src/main/java/com/practicalunittesting
chp_08_csv_reporter_log
chp_08_custom_test_listener/src/test/java/com/practicalunittesting
chp_09_test_data_builder/src/main/java/com/practicalunittesting
chp_09_test_fixture/src/test/java/com/practicalunittesting
chp_10_sports_car/src/main/java/com/practicalunittesting
chp_11_clean_this_mess/src
gradle/wrapper
README.asciidoc
build.gradle
gradlew
gradlew.bat
settings.gradle

README.asciidoc

Basic Info

This project contains all the source code of exercises for "Practical Unit Testing with TestNG and Mockito".

See the book’s website: http://practicalunittesting.com

Import project to your IDE

Eclipse

First you need to generate Eclipse project files. If you have Gradle installed then type

gradle eclipse

In other cases (this will take some time - first Gradle will be downloaded):

./gradlew eclipse

After this you can import this project to Eclipse as any other project (File / Import / General / Existing Project into Workspace). As far as I know (not being an Eclipse guru!) you need to import each project individually.

IntelliJ IDEA

You can import files by choosing:

  • File / New Project / Import project from external module

  • select Gradle

  • and then select build.gradle file

Content

For your convenience all exercises are kept in separate dirs with names like "chp_X_exercise_name" where X is the chapter number:

  • Chapter 3 "Unit Tests with no Collaborators"

  • Chapter 4 "Test Driven Development"

  • Chapter 5 "Mocks, Stubs, Test Spies"

  • Chapter 6 "Things You Should Know"

  • Chapter 7 "Points of Controversy"

  • Chapter 8 "Getting Feedback"

  • Chapter 9 "Organization of Tests"

  • Chapter 10 "Maintainable Tests"

  • Chapter 11 "Test Quality"

Something went wrong with that request. Please try again.