Grails Integration Tests : Access your application path

1 min read
Share:

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

comments ( 6 )

  1. 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. 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 *