Home » Core Java

Core Java

JUnit HttpUnit Example

Hello, in this example we shall show you how you can make a use of the JUnit HTTUnit to test web applications. In this example, we will build a small web application and test it using HTTPUnit. This example will show you how you can achieve a browser specific behaviour with HTTPUnit library like sending requests to the server and receiving ...

Read More »

Java XPathFactory Example

In this example, we will see what is java XPathFactory and its usage with example. Before we start with this article, it is expected that we have a basic understanding of XML. XML stands for eXtensible Markup Language, which is designed to store and transport data. It is both human and machine readable. 1. Introduction XPathFactory is an abstract class in java ...

Read More »

Java Nio Delete File Example

If developers are working on a Java Swing or a desktop application then it may be required that sometimes developers need to delete a file from the file system. This tutorial is to learn about handling the files using the Java Nio package and shows how to delete a file in Java using the Nio package. 1. Introduction Java Nio ...

Read More »

JUnit Selenium Grid Example

1. Introduction In this example, we will explore the functionality of Selenium Grid and we will understand it’s significance. We will create a Page Object and then we will access that page object from test cases using JUnit. The example will cover the gmail login where we will be invoking the url in node and hub using test cases in ...

Read More »

Java Nio Scatter/Gather Example

In Java Nio, the channel provides an important capability known as scatter/gather or vectored I/O in some circles. Scatter/gather is a simple yet powerful concept and this tutorial explains how scatter/gather can be really useful in situations where developers need to separate work with the various parts of the transmitted data. Table Of Contents 1. Introduction 1.1 Java Nio Scatter/Gather ...

Read More »

Java Nio Channels Example

Channels are the second major innovation of the Java Nio after buffers. In Java Nio, channels are used for the input-output transfers and this tutorial explains how the Java Nio Channels are used to open the network connections and connections to the files. 1. Introduction Java Nio was developed to allow the Java programmers implement the high-speed I/O operations without ...

Read More »

Java Nio BufferOverflowException Example

Exceptions are the unwanted or the unexpected events that occur during the execution of programs that disrupt the normal flow of the instructions. In this tutorial, we will learn about the BufferOverflowException which is very common in the Java Nio package. But before moving ahead let’s take a look and understand the basics of the Java Nio package. 1. Introduction ...

Read More »

Java Nio SocketChannel Example

SocketChannel is a selectable channel belonging to the java.nio.channels package and is used for reading or writing the stream-oriented data. In this tutorial, we learn how to use the SocketChannel and how it is used for reading or writing the stream-oriented data by using the TCP based protocol. 1. Introduction Java Nio was developed to allow the Java programmers implement ...

Read More »

Java Nio Download File From Url Example

Java NIO (i.e. new I/O) is an interesting file input-output mechanism introduced in Java 5 and provides the different way of working with the input-output operations than the standard input-output API’s. Java NIO supports a buffer-oriented, channel-based approach for the I/O operations and with the introduction of Java 7, the NIO system has expanded thereby providing the enhanced support for ...

Read More »

Java Nio Create Directory Example

Java NIO (i.e. new I/O) is an interesting file input-output mechanism introduced in Java 5 and provides the different way of working with the input-output operations than the standard input-output API’s. Java NIO supports a buffer-oriented, channel-based approach for the I/O operations and with the introduction of Java 7, the NIO system has expanded thereby providing the enhanced support for ...

Read More »