tags:

views:

60

answers:

2

Hi

Coming from a Java background, learning Groovy seems a not-very-radical way to learn many concepts inherent to dynamic languages.

I am planning to start learning Groovy via

  1. Unit testing my existing Java code with Groovy ( There are many articles on www for it, but what are the cons ? )

  2. Automation Testing via Geb ( Using Spock with Geb )

Are there any problems with this approach ? Better ways to learn groovy and apply as well ? Are there issues with using Spock with Geb ?

A: 

The way I learned Groovy might be a bit old-fashioned but I just picked up a book and read it. I highly recommend:

Programming Groovy: Dynamic Productivity for the Java Developer by Venkat Subramaniam http://www.pragprog.com/titles/vslg/programming-groovy

It's a very quick, easy and purposeful read. After I read the book I just began coding in Groovy and learned more and more from there.

stan229
"The way I learned Groovy might be a bit old-fashioned..." -> :)
Icarus
A: 

As the author of Spock I might be biased, but

  1. Spock was specifically designed to work great for testing Java code. Cons of testing Java code with Groovy: Second language adds some complexity (although the payoff is big), no other language on the JVM matches Java's tooling (although Groovy probably comes closest; for example, cross-language refactoring in IDEA works very well).
  2. Geb is "just" a library and thus works well with any testing framework (even if no integration is available). How well does it work with Spock? Well, I guess it suffices to say that Luke Daley, the author of Geb, is a Spock committer and uses Spock whenever he can. :-)
Peter Niederwieser