Sign In Start Free Trial
Account

Add to playlist

Create a Playlist

Modal Close icon
You need to login to use this feature.
  • Mastering Gradle
  • Toc
  • feedback
Mastering Gradle

Mastering Gradle

By : Mitra
3 (4)
close
Mastering Gradle

Mastering Gradle

3 (4)
By: Mitra

Overview of this book

If you are a developer with some experience in build tool and want to become an expert in build tool, then this book is for you. Basic knowledge of Gradle or any other build tool is essential.
Table of Contents (12 chapters)
close
11
Index

Testing with Gradle


No piece of software is production ready unless it passes through a proper quality check. It helps to deliver software with minimum defects and saves lots of maintenance effort. However, manual test execution requires lots of time to execute tests and therefore the software release cycle is delayed. Release time and productivity can be improved if tests are automated.

Gradle provides an automated way to execute test code, especially for unit tests. In the following section, we'll explore how to integrate JUnit and TestNG with Gradle.

JUnit

Gradle's Java plugin provides a predefined structure to keep test code and test resources for configuration and execution. As with the source code structure, the default test code location is src/test/java/<test_package>. If you follow this convention, you just need to execute the test task to run the unit test cases as shown in the following command:

$ gradle test
:compileJava
:processResources
:classes
:compileTestJava
:processTestResources...
bookmark search playlist font-size

Change the font size

margin-width

Change margin width

day-mode

Change background colour

Close icon Search
Country selected

Close icon Your notes and bookmarks

Delete Bookmark

Modal Close icon
Are you sure you want to delete it?
Cancel
Yes, Delete