Unit Testing Java using Groovy and Mock Objects

This presentation will show how the use of the Groovy language and its mock object library makes unit testing Java code much easier. The Groovy standard library includes classes to simplify the process of writing unit tests, including tests using mock objects. Almost all of this benefit applies to testing Java code as well. This presentation will also cover TestNG integration. (The Groovy standard library focuses on JUnit 3.). The final demo will integrate Java, Maven 2, Groovy, and TestNG.


    This talk makes two assumptions:
  • Most shops do not do enough unit testing.
  • Making unit testing easier significantly encourages more and better unit testing.


Speaker: Walker Hale

Walker Hale obtained a bachelor's degree in Physics and Math Science from Rice University. He then migrated into programming, especially for support of biology labs. He currently works with the Human Genome Sequencing Center at Baylor College of Medicine. His current favorite languages are Groovy, Python, and Java.


Please RSVP

RSVP by going to http://hjug02252009.eventbrite.com/ We will need an accurate head count in order to know how much pizza to order. 

Meeting Location: PROS Pricing

3100 Main
10th floor
Houston, TX 77002


Suggested Parking:

Park across the street in the parking garage on Elgin on the 3rd or 4th floor in the Visitor designated spots. Walk across the skybridge on the 3rd floor and take the elevators on the right side of the elevator lobby to the 10th floor.


Meeting Sponsor: Triad Resources

Sponsor Website: http://www.triadresources.com

Company Background
Triad Resources provides direct hire staffing, managed contract servics and comprehensive training solutions. Specializing in information technology, our innovative services bring people, technology, and opportunities together, enabling businesses to meet agressive goals and candidates to find roles that fit both their skills and individual goals.


Door Prizes and Giveaways!

  • JetBrains has donated one IntelliJ licenses to be raffled off at this HJUG meeting


Name Sales End Price
free Ended Free

On the Web

Mock Objects

... stubbing out the Java Servlet API for testing a web ... saw it only as a technique for speeding up unit ... When developers are using mock objects ...


Test Infected: Mocking Groovy Objects with EasyMock in Java

14.01.2008 · I mentioned before that I needed to do some unit testing of a class that I was targeting in Groovy with come unit tests in Java. In Java, I am using ...


Subclass Mock Objects - Jenkov

Java Unit Testing: 2: A Simple Unit Test: 3: Assert Methods: 4: ... using a proxy object; Create a subclass mock of the MyDependency class, and override the callOne() ...


Mockito: Java Unit Testing with Mock Objects - Developer.com

Mockito: Java Unit Testing with Mock Objects. ... using intuitive Mockito methods ... importance of unit testing (and being able to use mock objects to ...


Mock « Testing « Java Products - Programming tutorials ...

Mock « Testing « Java ... jMock is a library for testing Java code using mock objects1. Mock objects help ... Mockrunner is a lightweight framework for unit testing ...


Random Thoughts: Unit Testing Java and Groovy with JUnit

04.03.2009 · Unit Testing Java and Groovy with JUnit ... (Mock Objects for example). ... Serializing Domain Objects To XML Using Groovy;


Using mock objects for complex unit tests

Most Java programmers know about JUnit and have probably used it at least once. ... I hope that you see the benefits of using mock objects in unit testing.


Java unit testing with mock objects using frameworks like ...

Java unit testing with mock objects using frameworks like ... The purpose of this is to demonstrate the power of using mock objects via frameworks like Mockito.


Pragmatic Unit Testing

Pragmatic Unit Testing in Java with JUnit ... Using Mock Objects The objective of unit testing is to exercise just one method at a time, ...


Unit Test More Efficiently with Mock Object Alternatives

The mock-object testing pattern has commonly ... Learn how to streamline your unit-testing using stubs and ... The examples in this article are provided in Java, ...


Writing unit tests using Groovy | Groovy Zone

Groovy can greatly decrease the level of work involved in creating unit tests for your Java code. ... Using Groovy I can ... Next is to replay the mock object ...


python, Unit testing - Using Java Mock Objects in Python?

> Is it possible to combine the Java Mock objects with Python using Jython?


Testing Guide - The Groovy programming language

When using Java, dynamic mocking ... One strategy for doing that is to replace the collaborator instances with simplified mock objects to ... (typically unit) testing ...


Project Darkstar, Unit Testing and Mock objects

... which is only by using the DataManager they provide, ... Unit Testing and Mock objects. ... java, ...


groovy | Software Testing Tutorials and Videos - Part 2

Grails eXchange 2007: Unit Testing and Mock Objects with Groovy. Published August 11th, 2008 Under Software Testing, Unit Testing | Comments Off


Unit Testing Tools - Java, Javascript, .NET, PHP, Python ...

Unit Testing and Mocking Tools: C/C++, Java, ... Mock Objects Generic unit testing framework and ... a new approach to java software testing using mock objects.


Using mock objects from the Course Unit Testing with PHPUnit

Taught by Kristian Secor as part of the Unit Testing with PHPUnit. Skip ... Using mock objects ... imagine if it were a Java Script object notation or a XML feed ...


Unit Test .NET Business Objects Using Nmock Library

... Virtual Machines Usher In a New Era Java ... and configure them for unit testing. Developers can overcome these issues by using mock test objects.


g&g unit testing | Groovy Guts and Clojure Cuts

Posts about g&g unit testing written ... We can simply replace it, by using meta object ... Replacing the object’s message source by our mock object follows ...


Endo-Testing: Unit Testing with Mock Objects

Using Mock Objects for unit testing improves both ... VisualAge for Java, one of which generates template classes. This tool should not write a new