• Home
  • RSS Feed
  • Log in

Archive for the ‘TDD’ Category

Middleware integration testing with JUnit, Maven and VMware, part 3 (of 3)
Posted by Vincent Partington in the wee hours: January 7th, 2010

Last year, before the Christmas holidays ;-) , I described how we do middleware integration testing at XebiaLabs and I described the way we deploy test servlets by wrapping them in WAR and EAR files that get generated on the fly. There is only one thing left to explain; how do we integrate these tests into a continuous build using Maven and VMware?

Running the middleware integration tests

So let's start with the Maven configuration. As I mentioned in the first blog of this series, the integration tests are recognizable by the fact that the classnames end in Itest. That means they won't get picked up by the default configuration of the Maven Surefire plugin. And that is fortunate because we don't always want to run these tests. Firstly they require a very specific test setup (the application server configurations should be in an expected state, see below) and secondly they can take a long time to complete and that would get in the way of the quick turnaround we want from commit builds in our continuous integration system.
(more...)

  • Share/Bookmark

Filed under Deployment, JBoss, Java, Maven, Middleware, TDD, Testing, Virtualization, Xebia Labs | 2 Comments »

Middleware integration testing with JUnit, Maven and VMware, part 2 (of 3)
Posted by Vincent Partington at around evening time: December 14th, 2009

Last week I wrote about the approach we use at XebiaLabs to test the integrations with the different middleware products our Java EE deployment automation product Deployit supports.

The blog finished with the promise that I would discuss how to test that an application can really use the configurations that our middleware integrations (a.k.a. steps) create. But before we delve into that, let us first answer the question as to why we need this. If the code can configure a datasource without the application server, it must be OK for an application to use it, right? Well, not always. While WebSphere and WebLogic contain some functionality to test the connection to the database and thereby verify whether the datasource has been configured correctly, this functionality is not available for other configurations such as JMS settings. And JBoss has no such functionality at all. So the question is: how can we prove that an application can really work with the configurations created by our steps?
(more...)

  • Share/Bookmark

Filed under Deployment, Java, Maven, Middleware, TDD, Testing, Virtualization, Xebia Labs | No Comments »

Middleware integration testing with JUnit, Maven and VMware, part 1 (of 3)
Posted by Vincent Partington at around evening time: December 7th, 2009

For Deployit, XebiaLabs' automated deployment product for Java EE applications, we are always building and modifying integrations with middleware systems such as IBM WebSphere, Oracle WebLogic and the JBoss application server. These integrations are small enough so that they can be rearranged to get many different deployment scenarios. A typical step, as we call these integrations, would be "Create WebSphere datasource" or "Restart WebLogic Server". So how do the test that code?

We've had some success using FitNesse and VMware to do integration tests on our deployment scenarios. But there were a few problems with this apporach:

  • We could only test complete deployment scenarios in this way. If we wanted to test just a single step, we had to make a deployment scenario that used that step just to be able to test it.
  • Because FitNesse does not provide any feedback while a test is running and the steps, let alone the deployment scenarios, can sometimes take a while to execute, there was little feedback on the progress.
  • While it is possible to debug a FitNesse Fixture using Eclipse the process is not very convenient when debugging a technical component such as this step.
  • To verify that a deployment scenario has executed succesfully we had to extend our FitNesse Fixture often. And while debugging code under test in FitNesse is complicated enough, debugging a Fixture is even harder!

Clearly we needed a different approach if we wanted to develop new steps easily.
(more...)

  • Share/Bookmark

Filed under Deployment, Java, Maven, Middleware, TDD, Testing, Virtualization, Xebia Labs, websphere | 3 Comments »

Mocking the ‘unmockable’: too much of a good thing?
Posted by Andrew Phillips mid-morning: December 6th, 2009

Static calls, final classes, objects created in test code: there are few things some of the current mocking frameworks cannot handle. Using powerful approaches like bytecode instrumentation or custom class loaders, these libraries make code that was previously a 'no go' area amenable to unit testing. This, moreover, in an elegant and convenient manner that will feel familiar to developers used to 'standard' mocking frameworks.
The question is: does such power perhaps come with hidden dangers? Might it be possible that the ability to test more could actually result in less code quality?
(more...)

  • Share/Bookmark

Tags: mocking, testability
Filed under Java, TDD, Testing | 5 Comments »

Testing the testers: code samples from a TDD framework comparison
Posted by Andrew Phillips around lunchtime: November 26th, 2009

Some while back I was preparing a presentation on mocking and testing frameworks for Java. As part of the aim was to demonstrate some real, running code, I ended up spending quite some time copying, pasting, extending and correcting various examples gleaned from readmes, Javadoc, Wiki pages and blog posts. Since then, this codebase has been extended with various new features I've come across, and I've often referred to it for experiments, as a helpful reference, and suchlike.

I imagine this kind of "live" reference could also be useful to others, so I thought I'd share it. (more...)

  • Share/Bookmark

Filed under Frameworks, Java, TDD, Testing | 13 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 »

JEE to PHPEE
Posted by Saket Vishal in the early morning: December 22nd, 2008

PHP is becoming better day by day. As I proceed in my path of catching up with recent developments in PHP, I see more and more of adaption in PHP from JEE(Java Enterprise Edition) world. To begin with, I stumbled upon the unit testing framework PHPUnit. The amount of familiarity with the J2EE world is simply amazing.
(more...)

  • Share/Bookmark

Tags: PHP, TDD
Filed under PHP, TDD, Testing | 3 Comments »

Flex Testing Toolkit
Posted by Abhishek Agrawal in the late evening: November 19th, 2008

My recent assignment at Albumprinter gave an opportunity to play with flex testing tools available out there. Coming back to serious flex development after more than a year was a pleasant surprise. The state of flex when I last did something on it was for sure not “mature”. There weren’t many frameworks around.

But things have changed a great deal since then. Not only do we have frameworks implementing MVC (Cairngorm) but also some standard extensions (UM extensions) to those frameworks, we also have spring like IOC frameworks (Prana) for Flex.
(more...)

  • Share/Bookmark

Tags: Flex, Testing, Tools
Filed under Flex, General, TDD, Testing, Tools | 7 Comments »

TDD vs good design/architecture principles
Posted by ShriKant Vashishtha mid-afternoon: May 1st, 2008

Sometimes back there was an interesting debate between Agile manifesto founder member Bob Martin and renowned Jim Coplien about the relevance of good design principles in TDD based development.

Jim had very thought provoking views about what people do in the name of TDD and when it leads to something where it's just impossible to do any kind of refactoring further as there was no overall sound design/architecture base.

It leads to following questions:

  • While practicing TDD and Scrum, is it really possible to focus on a good design considering we just focus on the prioritized list of requirements and don’t really see their interactions with other user stories to begin with?
  • Without having a big picture in shape of logical diagram, class diagrams (read UML), deployment diagrams, is it really possible to create a good architecture/design? May be it’s possible in small scale projects where the level of complexity in terms of business logic is not too high. But the question is more relevant for big projects (1-2 million LOC).

There were some interesting follow up in this respect from various people in Xebia. I thought it'll be a good idea to combine all those thoughts through this blog.

(more...)

  • Share/Bookmark

Filed under Agile, Architecture, TDD | 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

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