Grails Integration Tests : Access your application path

21 / Jan / 2010 by Amit Jain 6 comments

Hi Friends,

Recently I needed to access my grails application’s path while writing an integration test. I tried to do it with servlet context, Application Holder and few more options. But none worked. Then I encountered the simplest way as given below, which worked.

System.properties['base.dir']

Cheers!
~~Amit Jain~~
amit@intelligrape.com
IntelliGrape Softwares

Home

FOUND THIS USEFUL? SHARE IT

comments (6)

  1. Kimberly Exum

    I was very happy to find this blog.I wanted to say thanks for this awesome read!! I was definitely enjoying every tiny bit of it and I’ve you bookmarked to check out new stuff you publish.

    Reply
  2. Wanderson Santos

    Unfortunatelly, it only worked with run-app. When I build a WAR, and deployed in Tomcat 6, it doesn’t have this prop. =(

    Reply

Leave a Reply

Your email address will not be published. Required fields are marked *