JUnit - SPLessons

JUnit Extension

Chapter 15

SPLessons 5 Steps, 3 Clicks
5 Steps - 3 Clicks

JUnit Extension

JUnit Extension

shape Introduction

This chapter demonstrate the some more JUnit Extension and describing more JUnit test features which also shows some useful tools and frame works to extend features of JUnit. Following are the concepts covered.

  • Different types of JUnit Extension?
  • Continuous Testing
  • Integration Testing
  • Selenium

Different types of JUnit Extension?

shape Description

In order to run the test in JUnit user neede to make use of some extensions, these extensions can be downloaded and added to be JUnit and following are the some JUnit Extension.

Continuous Testing

shape Description

Continuous testing is a tool to monitor the source code. If any changes are made to the source code it detects the changes and automatically runs JUnit tests that are associated with the code. The following image demonstrate the Continuous Testing.

User need to download Continuous tool from the official page and add Eclipse in order to run this tool which runs automatically  when the changes are done by the User. Get the tool from official page of JUnit.org.

Continuous test will run continuously while doing the project and indicate the test is performance by displaying execution of the test.

Integration Testing

shape Description

JUnit also useful integration level testing.To do these testing make sure that SUT is using dependencies because user need to test everything work together and can make use of JUnit to do the integration tests. The image below demonstrate the integration testing.

SMS Notifier

shape Description

The user can create an integration test for tracking service by creating a real implementation for the notifier interface. By which implementation will create a send notification through SMS when goal is reached. The Java library used to check and send SMS through the Google voice. The test code will call the tracking service to send the SMS notifier, now test code will call Google voice itself to verify the message by itself and The test code have another part to clean the messages as shown in below image.


shape Description

JUnit is very useful way to create selenium test which can automate a web browser to create tests that operate at the same level as a real user which is a useful source tool for automating web browsers.

User need to download from the official page of the Selenium and add the file to eclipse.


shape Key Points

  • JUnit Extension – Continuous Testing tool will monitor the source code and it will run automatically.
  • SMS Notifier will use Java library to check and send the messages.
  • Selenium is useful open source tool for automating web browser.