Home » Core Java

Core Java

Gradle Wrapper Example

gradle-logo

In this example, we will understand how Gradle can be used to build projects even if the developer machine doesn’t have Gradle installed, by using Gradle Wrapper. This is a best practice to unify the Gradle version used by the entire development team. 1. What’s Gradle Wrapper? Gradle Wrapper is a type batch or shell script that downloads and automatically configures ...

Read More »

Lucene indexwriter example

apache-lucene-logo

In this Example , we are going to learn about Lucene indexwriter class. Here, we go through the simple and fundamental use with the IndexWriter Class. This simple demonstration goes through the indexing, writing, searching and displaying steps for the indexing example.Thus, this post aims to demonstrate you with a simple demonstration for use of IndexWriter class from lucene. The ...

Read More »

Spring JUnit Test Example

junit-logo

1. Introduction Spring has it’s own testing framework for all objects created under it’s IOC container (that we all know is just the JVM instance). Spring has created it’s own paradigm of object creation and destruction and it made sense for it to have it’s own testing framework. The great thing about this is (as being Java) is it can ...

Read More »

Groovy Regex Example

groovy-logo

In this example I will show you how to use regular expressions in Groovy. 1. Groovy and Regular Expressions Groovy is one of the most commonly used JVM languages and regular expressions (or simply regex) as a powerful technique to search and manipulate texts have been around us for more than a half century. As most of the languages Java ...

Read More »

JUnit Report Example

junit-logo

1. Introduction In all the test cases of an application, there is always a way to create a report of it one way or the other. JUnit is not an exception to this and there’s a ton of ways to create reports from it. It can even be incorporated to the maven site and have it part of the overall ...

Read More »

JUnit AssertThat Example

junit-logo

1. Introduction The assertThat is one of the JUnit methods from the Assert object that can be used to check if a specific value match to an expected one. It primarily accepts 2 parameters. First one if the actual value and the second is a matcher object. It will then try to compare this two and returns a boolean result ...

Read More »

JUnit SetUp / TearDown Example

junit-logo

1. Introduction When we create JUnit test cases, we would normally setup our own configuration and data objects that can be used on our test cases. We needed them to be readily available when we create each of the method test cases and mock what was actually being used by the system at runtime. We can prepare this within the ...

Read More »

Gradle OSGi Plugin Example: BNDTools Bundle Integration

gradle-logo

In this example we will talk about how to integrate OSGi frameworks with Gradle build tool. This work consists in build JAR files and customizing Manifest file through Gradle build Script and Deploying them in a OSGi Container like Apache Felix. 1. Introduction to Gradle and OSGi Integration Gradle is an automatic build tool of more use today, so it’s almost necessary ...

Read More »

JUnit assertEquals example

junit-logo

1. Introduction To follow through with my previous post about assertTrue and assertFalse, this post will tackle on checking for an equality of a conditional statement on the test cases. There is a method called assertEquals in the JUnit library that can be used to check if two objects is equally defined or not. It can be used to check if ...

Read More »

JUnit assertFalse example

junit-logo

1. Introduction To follow through with my previous post about assertTrue, this will tackle about the exact opposite of that function. The assertFalse. The assertFalse is basically a function that can be used to check if a specific logic or process will return a false statement. This can be in any conditional or structural logic that will return a boolean ...

Read More »
Want to take your Java Skills to the next level?
Grab our programming books for FREE!
  • Save time by leveraging our field-tested solutions to common problems.
  • The books cover a wide range of topics, from JPA and JUnit, to JMeter and Android.
  • Each book comes as a standalone guide (with source code provided), so that you use it as reference.
Last Step ...

Where should we send the free eBooks?

Good Work!
To download the books, please verify your email address by following the instructions found on the email we just sent you.