Home » Tag Archives: Testing (page 20)

Tag Archives: Testing

Hamcrest Containing Matchers

hamcrest-logo

The Hamcrest 1.3 Javadoc documentation for the Matchers class adds more documentation for several of that class’s methods than were available in Hamcrest 1.2. For example, the four overloaded contains methods have more descriptive Javadoc documentation as shown in the two comparison screen snapshots shown next.               Although one can figure out how the ...

Read More »

Spring Selenium Tests With Annotations

selenium-logo

This post describes how to implement Selenium tests in Java. It is inspired from the post by Alex Collins, with annotations. The code is available on GitHub in the Spring-Selenium-Test directory. Some alternative and much lighter techniques are available to unit test a Spring MVC application. To unit test services, see here.               Page, ...

Read More »

The Differences Between Test-First Programming and Test-Driven Development

software-development-2-logo

There seems to be some confusion between Test-First Programming and Test-Driven Development (TDD). This post explains that merely writing the tests before the code doesn’t necessarily make it TDD.             Similarities Between Test-First Programming and Test-Driven Development It’s not hard to see why people would confuse the two, since they have many things in common. ...

Read More »

Waiting for the right moment – in integration testing

java-interview-questions-answers

When you have to test multi-threaded programs, there is always the need to wait until the system arrives at a particular state, at which point the test can verify that the proper state has been reached. The usual way to do it is to insert a ‘probe’ in the system which will signal a synchronization primitive (like a Semaphore) and ...

Read More »

A Selenium/WebDriver example in Java

selenium-logo

A couple of years back, I was pitching for some work and the client wanted to see how I would tackle a real world problem. They asked me to automate some tasks on the woot.com web site. The task was to go to various woot web sites and to read the product name and price of the offer of the ...

Read More »

How cool is integration testing with Spring and Hibernate

jboss-hibernate-logo

I am guilty of not writing integration testing (At least for database related transactions) up until now. So in order to eradicate the guilt i read up on how one can achieve this with minimal effort during the weekend. Came up with a small example depicting how to achieve this with ease using Spring and Hibernate. With integration testing, you ...

Read More »

Running HTTP/REST Integration Tests efficiently in Eclipse

eclipse-logo

Lately I had a chance to use the OSGi-JAX-RS-Connector library written by my dear fellow Holger Staudacher. The connector enables you to publish resources easily by registering @Path annotated types as OSGi services – which actually works quite nicely. While it is natural for me to write the service classes test driven using plain JUnit tests it is also very ...

Read More »

On Measuring Code Coverage

software-development-2-logo

In a previous post, I explained how to visualize what part of your code is covered by your tests. This post explores two questions that are perhaps more important: why and what code coverage to measure. Why We Measure Code Coverage What does it mean for a statement to be covered by tests? Well, it means that the statement was ...

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.