❯ Guillaume Laforge

Posts

A bit of functional tests and concurrency for Gaelyk

Along with the release of Gaelyk 1.2, I’d like to share two interesting links about running functional tests with Geb, and concurrency / parallelism with GPars on Gaelyk.
Gaelyk functional testing with Geb

In the Groovy ecosystem, we’re all aware of the Spock testing framework. On top of Spock, you can use the Geb browser automation library, to easily create functional tests for your web applications, in a nice, readable and expressive fashion.

Thanks to Marcin Erdmann, the Gradle GAE plugin (used by the Gaelyk template project) has been enhanced with support for running functional tests with Spock and Geb. Marcin (who’s blog is actually a fork of my Bloogaey app) has written a small tutorial on how to get started.

Read more...

Release candidate of Groovy 2.0 available

This is with great pleasure that the development team announces the release candidate of Groovy 2.0.

For the impatient among you, you can download Groovy 2.0 RC-1 in the download area of the Groovy website. And read the JIRA changelog.

The big change in this release candidate is the modularity aspect. We’ve now fully switched to Gradle, as our build tool, to build a more modular Groovy. You still have a big “all” JAR, but if you’re interested in just picking the core JAR and the needed modules for your project, you can now do so.

Read more...

Gaelyk 1.2 is out!

I’m very pleased to announce the release of Gaelyk 1.2!

For the impatient, you’ll be able to find the new JAR and Template Project here, as well as the changelog: http://gaelyk.appspot.com/download

You’ll notice that the new template project uses Twitter Bootstrap now, to make it a bit fancier and nicer on the eye!

We also upgraded to the latest and greatest of Groovy and App Engine’s SDK.

In terms of new features, I’d like to particularly highlight:

Read more...

Why coming to #GR8Conf?

I was reading MrHaki’s interview on the GR8Conf website this morning, and he had some nice words and good points about why it’s important to attend the conference. You get to meet the creators and developers of the projects you’re interested in and have great content (emphasis mine):

I am looking forward to meeting all the great people that make up the Groovy ecosystem. Everybody is always nice, friendly and ready to help. The atmosphere is always nice and laid back.

Read more...

Vert.x 1.0 released with its Groovy support

Tim Fox yesterday announced the release of Vert.x 1.0.

Vert.x is a kind ofasynchronous application development environment and server. It works on the JVM, with JDK 7, and supports several languages like Java, Groovy, Ruby or JavaScript.

As the website puts it, vert.x can be defined along the following axis:

  • polyglot: supporting Java, Groovy, Ruby and JavaScript or a mix and match of any of these even in a single application
  • simplicity: just a few lines of code to create your servers and components, without any XML configuration or anything like that, without being too simplistic
  • scalability: with Netty under the hood, with a message passing approach, it’s taking full advantage of the cores of your CPU(s)
  • concurrency: vert.x provides a simple concurrency-model so you don’t mess with traditional multithreaded programming

Vert.x competes directly with Node.js here, and Tim also positions it against the Play! 2 / Akka combo.

Read more...

Run a Groovy script in Vi

In the Vi vs Emacs war, I’m in the Vi camp. I’m using Vim on the command-line to quickly edit files, and I’m also using MacVim on my Mac as my text editor. When I’m not using an IDE or the Groovy Console, I also want to be able to edit and run my Groovy scripts in my text editor. It’s not too difficult to run a Groovy script from Vi, you can simply do:

Read more...

Come to GR8Conf for half the price!

This is this time of the year where all the Groovy hackers and fans are meeting together in Denmark, Copenhagen, for the GR8Conf conference. A conference dedicated to Groovy, Grails, Gradle, Griffon, Spock, GPars and all the Groovy ecosystem. If you’re interested in these technologies or are already using them, this is the opportunity you shouldn’t miss.

Also, you’re pretty lucky, because I have a ticket for half the price to offer you! But there’s just one seat I can offer at that price. So if you’re interested, please add a nice comment to this post, that may be fun, or explaining why you’d like to come, and in a few weeks, I’ll tell you who deserves to win this prize!

Read more...

bash tip: find and grep through files

It happens once in a while that I want to find all files containing a certain string. I know command-line tools such as grep, cat, and find, but I never remember the right combination to achieve that task. So as to remember and reference it later, I write this small blog post to remind me how to do it:

find . -type f -exec grep YOURSTRING /dev/null {} \;

The find . part will search from the current directory (and all its subdirectories), - type f to search for files (not directories or links, etc), -exec to use the grep command to find through the files, with YOURSTRING as query string, /dev/null to throw away the errors you don’t care about, and {} is the current file to search into with grep.

Read more...

Incomplete string regex matching

Once in a while, I stumble upon the need of being able to tell whether a string could match a certain regular expression pattern, if it were given some more characters.

For example, a user is typing a time in an input field, following the pattern of 2 digits, a colon, and 2 other digits. He enters the first two digits and the colon, and we’re wondering if the time could be valid if he entered some more keystrokes.

Read more...

Speaking of Groovy 2.0 at 33rd Degree, in Poland

Tomorrow I’m flying to Krakow, in Poland, to speak about the upcoming Groovy 2.0 release, at the 33rd Degree conference. I’m looking forward to meeting some of you there!
Here’s my abstract for What’s new in Groovy 2.0?

After a quick look at the key features of Groovy 1.8, including more readable Domain-Specific Languages, concurrency capabilities with the GPars library, and built-in JSON support, we’ll dive right into the most important features of Groovy 2.0!
A lot of the Groovy users are using the language as a Java scripting language, or sometimes as a better Java. First of all, not all of them need the dynamic capabilities, nor do they need all the library improvements provided by Groovy. For the latter, Groovy becomes more modular with smaller core modules that you can compose. For the former, in addition to its usual dynamic features, Groovy 2.0 adds static type checking, allowing you to ensure the correctness of your code before it ships and quickly spot early errors at compile time.
Also, not everybody needs dynamic features at all times, and the natural extension to static type checking is static compilation. With static compilation, Groovy 2.0 generates fast and performant bytecode like Java, and shields key parts of your code base from possible interferences of dynamic features, making critical paths both faster and immune to monkey patching. But when you need fast and performant dynamic logic, Groovy 2.0 also features the integration of the “invoke dynamic” support coming up with JDK 7 and beyond.

Read more...