Home » Core Java (page 20)

Core Java

JUnit Testcase Example

In this example, we shall show users how to use JUnit Testcase. JUnit Testcase example will follow you to the scenarios of how we can use and test our methods with the help of the JUnit Testcase. As a regular reader, you are already familiar with the JUnit and its usage. If you are new to it you are recommend ...

Read More »

Reactive Java (RxJava) Tutorial: Introduction

Reactive Java or RxJava is an implementation and enhancement of the observer pattern. It was intended for use in event driven schemes where nesting synchronous or asynchronous callback methods becomes overly complex. The key addition that RxJava provides in addition to the observer pattern is the ability to determine when event processing is complete or an error has occurred. The ...

Read More »

Java XPath Using SAX Example

1. Introduction XPath is used to retrieve and interpret information represented in XML files using either a DOM or SAX parser. * DOM – Document Object Model – This popular class of parsers read the entire XML file and construct the DOM in memory. Since the DOM is memory resident, evaluation of the XPath expressions is faster. * SAX – ...

Read More »

Junit Test Timeout Example

In this article, we shall show you the working of JUnit timeout. JUnit provides a very good way of testing your methods against the timeout. In JUnit Test Timeout example, we will show how we can test out methods for timeouts. There are times when we want our methods to execute in a specific time. For example, we want a ...

Read More »

JUnit HSQLDB Example

Here is the new JUnit example, but with a difference. In this example we shall show users how they can use JUnit with HSQLDB for testing. In JUnit HSQLDB example, we will try to explain the usage of HSQLDB. Why we are using HSQLDB and not any other DB? We will try to explain the answer to this question in ...

Read More »

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 »