Monthly Archive: August 2013

JUnit Basics

Unit tests are written to ensure that small units of code function as intended. When it comes to Unit tests, the higher your code coverage, the higher your confidence when refactoring and/or extending code functions and features. Unit tests play an incredibly important role when it comes to sustaining and maintaining code. JUnit is a simple, yet powerful unit test framework for Java. JUnit enables you to construct test cases...

How to programmatically set Java Logging defaults and override these defaults using logging.properties

The Java Logging APIs provide a number of properties for create and configuring  Java loggers.  If you plan to create a new Java Logger for your project, it may be very desirable to define a default configuration you logger and handlers. It is also desirable to enable users to override these defaults using the JVM logging.properties file. Why is this desirable? The JVM logging.properties ships with a default configuration. This...

Interfaces and JAX-B

I’ve been working with JAX-B and JAX-RS to create a RESTful service. This service interacts with another RESTful service. In terms of design, the two services share an interface, however the implementation of this interface is very different between the two services. As an experienced Java developer, naturally, I create a common API. In this case, it is essentially a set of interfaces that ship with both services. My plan...

Java Core Dump/Thread Analysis (IBM JVM)

1. Java Core analysis is an incredibly useful tool to have in your toolbox. A customer running your Java application may encounter poor performance. Reproducing a performance issue, at times, can be very difficult due to the vast number of circumstances and environmental factors at play. Java core dump and thread analysis will prove useful when identifying bottlenecks, deadlocks, and resource contention. 1.1. Where do we start? We start with...

Java Logging using the Java Logging APIs

In this post, we will provide an overview of the Java Logging APIs along with some simple usage examples. On tap: 1. Java Logging APIs Overview     1.1. Log Levels     1.2. Loggers     1.3. Handlers     1.4. Formatters     1.5. Filters 2. The Configuration File     2.1. Default Configuration 1 Java Logging APIs Overview The Java Development Kit (JDK) provides a simple logging...

Follow

Get every new post on this blog delivered to your Inbox.

Join other followers: