Home » Core Java

Core Java

JUnit Report Generation Example

In this example we shall show users how we can generate reports using the Maven and JUnit. JUnit Report Generation example demonstrates the basic usage of the reporting functionality of JUnit tests. As you already know, JUnit is the basic unit test framework for the Java programmers. This example focuses more on generating the report. Let’s start by analyzing the ...

Read More »

JUnit Cucumber Example

In this example we shall show users the usage of Cucumber with JUnit. JUnit Cucumber example will follow a brief introduction about the relation they share and how we can use both with each other. This is a very basic example and users are recommended to test their own scenarios after reading this example. After going through example you will ...

Read More »

JUnit Hamcrest Example

In this example we shall show users the usage of Hamcrest. Through JUnit Hamcrest Example we will show users what is hamcrest, where it is used, why it is used, when it is used and how to use it on your applications. If you are a regular user of my JUnit series then you are already familiar with the JUnit. ...

Read More »

JUnit Mockito When thenReturn Example

In this example we will show you the usage of JUnit Mockito When thenReturn method. JUnit has many capabilities for testing the unit test cases for Java. But sometimes it lacks some of the common functionalities. Where it lacks and how we can complete, we will be showing in this example. First of all, we have to be aware of ...

Read More »

JUnit Quickcheck Example

In this example we shall show users the usage of property based testing. JUnit quickcheck example will demonstrates the way to test the methods with the help of property based testing. There are cases when you want to test your methods with some constraints and with random parameter values. We can achieve the same with manual process also, but in ...

Read More »

JUnit RunListener Example

In JUnit RunListener Example, we shall show users how they can add RunListener to the test cases. There are cases when we want to respond to the events during a test case run. Here we can extend the RunListener class and override the methods according to our implementation. The JUnit RunListener can listen to the events of the JUnit lifecycle. ...

Read More »

JUnit Group Tests Example

In this example we shall show users, how they can group and run their JUnit test cases. JUnit group tests example, will try to resolve issue of running multiple group tests all together. This is not a big deal in JUnit. This can be achieved in different ways in JUnit. It’s wide API, helps developers all around the world to ...

Read More »

JUnit MultiThreaded Test Example

In this post we shall show users how to test the multi threaded java application with the help of JUnit. JUnit MultiThread example clears users mind to understand the basic usage of testing the multi threading application. Users are advised to visit the JUnit Hello World example for basic understanding of the JUnit. For testing the methods by passing value ...

Read More »

JUnit Keyboard Input Example

In this post we shall show users the usage of JUnit keyboard input working. This example is very useful in case users want to enter data from keyboard for testing of their methods. Do not worry, we will the same in the post. Users are advised to see the JUnit Hello World example where they can see the basic usage ...

Read More »

JUnit FixMethodOrder Example

With this example, we are going to demonstrate users when, how and why JUnit FixMethodOrder annotation is used. In previous example JUnit Hello World, users have seen how they can start using JUnit. Users are advised to see the setup of project in JUnit Hello World example, if they want to continue with Maven. This example is useful in cases ...

Read More »

Want to take your Java skills to the next level?

Grab our programming books for FREE!

Here are some of the eBooks you will get:

  • Spring Interview QnA
  • Multithreading & Concurrency QnA
  • JPA Minibook
  • JVM Troubleshooting Guide
  • Advanced Java
  • Java Interview QnA
  • Java Design Patterns