Blog Archives

02: jvisualvm to detect memory leak – a quick tutorial style Java demo

This is a companion post to 8 Java Memory Management Interview Q&A demonstrating a memory leak scenario step by step with jvisualvm, which is a free profiling tool that gets shipped with JDK. Step 1: Code that causes memory leak Here is a sample code that causes memory leak. It

Read more ›

Posted in jvisualvm profiling, JVM, Memory Management

01: jvisualvm to sample Java heap memory

Java does not have a sizeof operator like C++ does. Java uses automatic memory management known as the Garbage Collection, hence it is not that important to evaluate size of various objects. But, for the purpose of learning & fixing any potential memory issues, I have used “jvisualvm”, which is

Read more ›

Posted in jvisualvm profiling, JVM, Memory Management

Jacoco for unit test coverage with SonarQube tutorial

This tutorial extends SonarQube with Maven Tutorial – Code Quality for Java developers to use Jacoco for tracking unit test coverage. Jacoco is the default code coverage tool that gets shipped with SonarQube. SonarQube can also be configured to use Cobertura as the code coverage tool. This assumes that Java

Read more ›

Posted in Code Coverage

JUnit with Hamcrest

Q1. What is Hamcrest, and what is its purpose? A1. HAMCREST is an anagram for MATCHER. The purpose is to match the assertions the BDD (Behavior Driven Development) style. In short, reads better like English statements. So, Instead of:

with Hamcrest, reads better

where “is(…)” needs a static

Read more ›

Posted in Unit Testing Q&A

Integration Unit testing Spring Transaction Management

This is an integration testing that tests Spring transaction through service, and DAO layers all the way up to the embedded database like HSQLDB or H2. After commit or rollback, the number of records in the table are verified. The service layer defines the transactional boundaries with the “@Transactional” annotation.…...

Members Only Content

This content is for the members with any one of the following paid subscriptions:

30-Day-Java-JEE-Career-Training, 90-Day-Java-JEE-Career-Training, 180-Day-Java-JEE-Career-Training, 365-Day-Java-JEE-Career-Training, 60-Day-Java-JEE-Career-Training and 2-Year-Java-JEE-Career-Training

Want to evaluate the quality of the contents to see if they will add value to you?

Click Here and check the contents with Try.

Log In | Register
Posted in member-paid, Testing Spring TXN Mgr

Unit testing Spring Transaction Management

Unit testing Spring transaction management –> i.e. commit & rollback scenarios as shown below. On a separate post, will do an integration test for the Spring transaction manager. The test class defines the transactional boundaries. Transaction Commit scenario

Transaction Rolback scenario

...

Members Only Content

This content is for the members with any one of the following paid subscriptions:

30-Day-Java-JEE-Career-Training, 90-Day-Java-JEE-Career-Training, 180-Day-Java-JEE-Career-Training, 365-Day-Java-JEE-Career-Training, 60-Day-Java-JEE-Career-Training and 2-Year-Java-JEE-Career-Training

Want to evaluate the quality of the contents to see if they will add value to you?

Click Here and check the contents with Try.

Log In | Register
Posted in member-paid, Testing Spring TXN Mgr

Spring Boot in unit testing – 6 things you must know

Q1. What are some of the libraries required for unit testing Spring based Java applications? A1. Spring Test — integration test support for Spring applications. 1. JUnit — for unit testing Java applications. 2. Hamcrest — is a library of matcher objects (aka known as constraints or predicates) allowing assertThat…...

Members Only Content

This content is for the members with any one of the following paid subscriptions:

30-Day-Java-JEE-Career-Training, 90-Day-Java-JEE-Career-Training, 180-Day-Java-JEE-Career-Training, 365-Day-Java-JEE-Career-Training, 60-Day-Java-JEE-Career-Training and 2-Year-Java-JEE-Career-Training

Want to evaluate the quality of the contents to see if they will add value to you?

Click Here and check the contents with Try.

Log In | Register
Posted in member-paid, Unit Testing Q&A

Maven and Cobertura Tutorial

Cobertura is a free code coverage tool, which calculates the percentage of Java code accessed by unit tests. Step 1: The pom.xml file with the relevant reporting plugins. The properties also shown to set the coverage percentage and to skip code coverage or not.

Step 2: Run the maven

Read more ›

Posted in Code Coverage, Productivity Tools Tutorial
Page 1 of 41234
1100+ paid subscribers. Reviews | Free Contents. Monthly 260K+ views & 40k+ visitors. 9 tips to earn more.

Java Developer Training – 800+ Q&As ♥Free|♦FAQ (Mouse Hover for Tooltip)

open all | close all

200+ Java Developer Job Interview FAQs

open all | close all

16 Java Programmer Key Areas to be a top-notch

open all | close all

80+ Java Tutorials – Step by step

open all | close all

100+ Java Developer Coding Exercises

open all | close all

How good are your …..Java job hunting & career fast-tracking skills?

open all | close all