Home About Courses Schedule Services Webinars Contact Search

Introduction to Groovy for Developers


Duration: 4 Days

Method: Instructor led, Hands-on workshops

Price: $2750.00

Course Code: GG1000


Java developers required to write programs in Groovy that simplify, enhance, and expand their existing knowledge.


Groovy seamlessly integrates with existing Java code, and extends familiar classes like Strings, Lists, and Maps in a powerful yet natural way. We will examine these as well as the File I/O, XML manipulation, database integration, and networking capabilities of Groovy that dramatically reduce the amount of code that you need to write.


Upon successful completion of this course, the student will be able to:

  • Describe the significance of Groovy over other scripting languages
  • Setup and configure the Groovy environment
  • Write a simple Groovy “Hello World” application
  • Use Groovy as an alternative to typical System Administration scripting languages
  • Perform File processing with Groovy
  • Understand the importance of Mopping and Metaprogramming
  • List and describe multiple methodologies within XML
  • Understand Groovy as it pertains to Databases
  • Test your Groovy scripts with JUnit
  • Conceptualize on testing around Groovy


All attendees should have a good knowledge of Java techniques.


  • I. Getting Started with Groovy
    • Installing Groovy
    • Compiling Groovy
    • The Groovy Shell and Console
    • Creating your first Groovlet
  • II. New to Groovy
    • Groovy and Java
    • Harnessing the power of Groovy
    • Groovy syntax (Imports, semicolons, parenthesis, returns, etc)
    • Datatypes, Operator overloading, and Collections
    • Closures
  • III. Java and Groovy Integration
    • GroovyBeans (or POGOs)
    • Autogeneration of getters and setters
    • Constructors, optional method parameters, etc.
    • Calling Java from Groovy and Groovy from Java
  • IV. Groovy from the Command-line
    • Groovy as a operating systems scripting language
    • Running uncompiled Groovy scripts
    • Working with command line arguments
  • V. File I/O
    • Working with Files in Groovy
    • Groovy extensions to java.io
    • Creating archives
    • Integrating with ANT
  • VI. Mopping and MetaProgramming
    • Groovy Objects
    • Querying Methods
    • Interceptions
    • Categories
    • ExpandoMetaClasses
    • Mixins
    • Dynamic Classes and Objects
    • Compile Time Programming Metaprogramming
  • VII. Working with XML
    • Review of XML concepts
    • Parsing XML with XmlParser
    • Slurping XML with XmlSlurper
    • GPath vs. XPath
    • Generating XML
    • Generating XML with MarkupBuilder
    • Generating XML with StreamingMarkupBuilder
    • Writing XML to a file
  • VIII. Network and Web Services Programming with Groovy
    • Review of network programming concepts, IP addresses, and DNS
    • Creating a RESTful web service client
    • Working with SOAP, XML-RPC, Atom and RSS feeds
  • IX. Database Development
    • Using Groovy to query databases
    • Exporting Database content using Groovy and XML
    • Object-rational database development
  • X. Testing
    • Review of JUnit and testing concepts
    • Integrating Groovy with JUnit
    • Determining code coverage with Cobertura
    • Working with Mock Objects
    • Mocking with Maps, Expando, Groovy Mock Library, Categories, and Expando
    • Testing with Spock