Wednesday, August 01, 2012

Lombok - cool stuff, worth trying!

A friend of mine just shared with me Project Lombok (weird name but I guessed correctly that it's something Thai ;) As I understand the goal of this project is to minimize boilerplate Java code (like getters, setters, constructors, etc.) Very good idea!

The only question that bothers me is if it's easily possible to override any behavior (e.g. setters) without the need of resigning from Lombok auto-generatin for the rest of class' elements...

Anyway - it's really worth trying!

Wednesday, March 07, 2012

Byteman - use it when Mockito can't help

Byteman is a really cool stuff with which you could simulate JVM or OS behavior hardly possible to mock using mocking library (like Mockito). Read the full exaple (really short with no fluff) here: http://theholyjava.wordpress.com/2012/02/25/cool-tools-fault-injection-into-unit-tests-with-jboss-byteman-easier-testing-of-error-handling/

Thursday, January 05, 2012

Errata to Maven2 → Maven3 migration

In the section Cobertura plugin and Maven3 of "Maven2 → Maven3 migration - real life example" article I made a mistake that resulted in reporting a bug that does not exist.


  
    package
    
      clean
      check
    
  

should be changed to:

  
    clean
    clean
    
      clean
    
  
  
    package
    package
    
      check
    
  


Both goals instrument and check must never be in the same execution because check depends on instrument and calls it itself. So, in my example goal instrument was executed twice every time and it cause a lot of problems - many of them are still magic for me e.g. compilation error saying that ...HasBeenInstrumented class cannot be identified blah, blah, blah, even though "buggy" source code was untouched and did not use this Cobertura class. Anyway MCOBERTURA-155 is a non-issue.