• Home
  • RSS Feed
  • Log in

Author Archive

Speed up your dev cycle with git
Posted by Iwein Fuld at around evening time: February 28th, 2010

Git has made me more productive, and I will explain in a few words why that is. I could almost do it with twitter, but I like to take a little more time to make my point. The main benefit that git has given me can be found in performance of certain things I want to do when I am managing changes in my code base. The performance improvements of some critical parts of it are even so profound that they have changed the way I am working. In particular the fact that I can skip builds for most of my commits is a big time saver.

There have been many things said about git already and I suggest you use your favorite search index to bring yourself up to speed if you need to. Git is a simple distributed versioning system that is challenging many assumptions I had about development. Let's go over these assumptions. I'll show you my (svn based) assumption and why it doesn't hold if you're using git.
(more...)

  • Share/Bookmark

Filed under GIT, Java, Tools | 4 Comments »

Latching and mocking in concurrent tests
Posted by Iwein Fuld mid-afternoon: November 3rd, 2009

Concurrent testing is hard, but not as hard as you think. If you use the right tricks it can be done. This blog shows you one particular trick that uses a latch and a mock to ensure a test scenario is completed before running the verifications.

While working on Spring Integration in Action, I experimented with a neat solution for concurrent tests. When I showed it to some colleagues I was pleasantly surprised by the reaction that I got. Judge for yourself if it's worth the blog.

The main idea is to use a latch and let your mock count it down. It sounds trivial (and to be honest it is).
(more...)

  • Share/Bookmark

Filed under Java, Opensource, Spring, TDD | 4 Comments »

Improved Spring Integration test support with Mockito and Hamcrest
Posted by Iwein Fuld in the early morning: August 3rd, 2009

Last week I've added a new test bundle to Spring Integration. This bundle contains matchers to help writing tests for Spring Integration configurations. It builds on JUnit 4, Hamcrest and Mockito. Even if you're not a user of Spring Integration, I will make sure that this post gives you a few ideas for using matchers to write more readable tests.

First a few pointers to Spring Integration to give you some background.

Spring Integration is a framework that aims to implement Enterprise Integration Patterns as described in the book by Hohpe and Woolf. The book is nice, but using those patterns will require some boilerplate and plumbing that is a good match for a framework, hence Spring Integration. JUnit 4 you should know about already, but a feature that was added recently deserves another mention. In the latest versions of JUnit you can use the assertThat(T actual, Matcher<T> matcher), which builds on Hamcrest matchers. This already makes your assertions much more readable, but combined with Mockito, test cases become poetry. I will assume for now that I don't need to tell you about all this, but if you have no clue what I'm talking about you should really enlighten yourself.

EIP frequently involves asynchronous handoff, also it involves wrapping object payloads in messages. Both of these can be in the way when writing tests. Luckily we can easily abstract this boilerplate away. Today I've committed the solution for the unwrapping problem, I'll talk about a solution to the second problem another time.

Unwrapping messages requires some boilerplate that makes the test harder to read. The following snippet from the Spring Integration's AggregatorEndpointTests clearly shows both problems.

@Test
public void testCompleteGroupWithinTimeoutWithSameId() throws Exception {
//...
Message<?> reply = replyChannel.receive(500);
assertNotNull(reply);
assertEquals("123456789", reply.getPayload());
}

In a few seconds it's clear what we're trying to do here, but it doesn't look very elegant to me. With the new test project we aim to make this type of code more readable. To do this we've created some utility classes. (more...)

  • Share/Bookmark

Filed under Java | No Comments »

Deployment automation for Java application running on Websphere, WebLogic and JBoss

Archives

  • March 2010
  • February 2010
  • January 2010
  • December 2009
  • November 2009
  • October 2009
  • September 2009
  • August 2009
  • July 2009
  • June 2009
  • May 2009
  • April 2009

Xebia Sites

  • Xebia Corporate
  • Xebia France
  • Xebia India

Categories

  • Java (282)
  • Agile (109)
  • General (50)
  • Testing (42)
  • Performance (42)
  • Hibernate (36)
  • Scrum (33)
  • Podcast (31)
  • Architecture (31)
  • Spring (28)
  • SOA (24)
  • Maven (22)
  • Project Management (22)
  • Middleware (23)
    • Deployment (14)
  • Flex (17)
  • JPA (17)
  • Eclipse (15)
  • Xebia Labs (15)
  • Quality Assurance (14)

Tag Cloud

    Closures esb Maven Introduction to Agile Ajax Poppendieck XML Java Semantic Web IntelliJ product owner Agile Xebia JavaOne Agile Awareness Workshop Grails Architecture Lean Scrum Groovy Performance Hibernate Functional Programming Seam qcon fitnesse Spring Scala SOA Testing