Most interesting links of February ’12

Recommended Readings List of open source projects at Twitter including e.g. their scala_school – Lessons in the Fundamentals of Scala and effectivescala – Twitter’s Effective Scala Guide M. Fowler & P. Sadalage: Introduction into NoSQL and Polyglot Persistence (pdf, 11 slides) – what RDBMS offer and why it sometimes isn’t enough, what the different NoSQLContinue reading “Most interesting links of February ’12”

Cool Tools: Fault Injection into Unit Tests with JBoss Byteman – Easier Testing of Error Handling

How do you test error handling in your application? Do you? Is it at all possible to simulate SocketTimeoutException, SQLException? Normally the answer would be that it isn’t possible or very difficult, requiring a complicated setup. Not anymore – with JBoss Byteman you can easily inject whatever code – e.g. throw new SocketTimeoutException() – inContinue reading “Cool Tools: Fault Injection into Unit Tests with JBoss Byteman – Easier Testing of Error Handling”

Profiling Tomcat Webapp with VisualVM and NetBeans – Pitfalls

Profiling a webapp running on Tomcat with VisualVM or NetBeans wasn’t as easy as expected, so this is a brief record of what to avoid to succeed. Environment: Mac OS X, Java JDK 1.6.0_29, Netbeans 7.1, VisualVM 1.3.3 (installed separately), Tomcat 6. The Pitfalls: VisualVM VisualVM Sampler and Profiler: To be able to drill downContinue reading “Profiling Tomcat Webapp with VisualVM and NetBeans – Pitfalls”

Release 0.9.9 of Static JSF EL Expression Validator with Annotated Beans Autodetection

I’ve released version 0.9.9 of Static JSF EL Expression Validator (tool to check that EL expressions in JSF pages use only existing beans and properties), available for download from Maven Central. The main addition since the last version is the ability to detect managed beans based on annotations instead of reading them from faces-confix.xml orContinue reading “Release 0.9.9 of Static JSF EL Expression Validator with Annotated Beans Autodetection”

Using Java Compiler Tree API to Extract Generics Types

I was looking for some way to extract information about types of elements in Java collections/maps using generics (List<String>, Map<String, MyBean>) so that the users of the Static JSF Expression Validator wouldn’t need to declare the type of the elements manually. One possible way to get this information is to process the source codes withContinue reading “Using Java Compiler Tree API to Extract Generics Types”

Separating Integration and Unit Tests with Maven, Sonar, Failsafe, and JaCoCo

Goal: Execute the slow integration tests separately from unit tests and show as much information about them as possible in Sonar. The first part – executing IT and UT separately – is achieved by using the maven-failsafe-plugin and by naming the integration tests *IT (so that the unit test running surefire-maven-plugin will ignore them whileContinue reading “Separating Integration and Unit Tests with Maven, Sonar, Failsafe, and JaCoCo”