Tag Archive
groovy
Discover 8 stories with “groovy” Tag.

If you have a simple POJO (Plain Old Java Object) or POGO (Plain Old Groovy Object), you can use Groovy's default Map based constructor to convert the JSON string to an Object type. package com.example.groovy import groovy.json.
Read More

Grails is an awesome full stack, web application framework on JVM. It has good documentation but not excellent documentation. I am working on a business project where I am using Grails REST services with MongoDB as the backend. I will
Read More

I wanted to store current date time (in UTC time zone) in ISO format in Mongo with Groovy as the language. It is pretty straightforward with joda time library. First the code and then some explaination. import org.joda.time.
Read More

Spring batch provides an excellent paradigm to retry an operation in case the operation might succeed eventually. It offers couple retry strategies: a. Retry a certain number of times. (Covered below) b. Retry after a certain amount of time. (Will
Read More

It's pretty straightforward due to Groovy awesomeness! Without any further ado: import spock.lang.Specification /** * Created by ravi on 11/14/14. */ class SpockDynamicExceptionTest extends Specification { def "test 1234"() { given: def a = 1 when: exception.newInstance([message]) then: thrown(RuntimeException)
Read More

I learnt by making a mistake and hope to help someone with this post. This weekend I tried to compare Java file I/O with Groovy on two fronts: a. Code bevity. b. Performance (time taken to execute task.) Groovy
Read More

I had the opportunity to be at NFJS from Jul 22-24 sponsored by Griffin Solutions Group. It was my first experience and an experience that is difficult to describe in words. There were so many great sessions, so much to
Read More

Groovy provides Aspect Oriented Programming construct via GroovyInterceptable interface. The concept is as simple as implementing GroovyInterceptable interface and providing a definition for Object invokeMethod(String name, Object args) method as shown below. class GenericService implements GroovyInterceptable { boolean transactional = true
Read More