{"id":349,"date":"2010-01-21T16:02:21","date_gmt":"2010-01-21T10:32:21","guid":{"rendered":"http:\/\/www.tothenew.com\/blog\/?p=349"},"modified":"2022-01-13T14:09:07","modified_gmt":"2022-01-13T08:39:07","slug":"grails-integration-test-access-application-path","status":"publish","type":"post","link":"https:\/\/www.tothenew.com\/blog\/grails-integration-test-access-application-path\/","title":{"rendered":"Grails Integration Tests : Access your application path"},"content":{"rendered":"<p>Hi Friends,<\/p>\n<p>Recently I needed to access my grails application&#8217;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.<\/p>\n<blockquote>\n<div class=\"code\">\n<pre lang=\"groovy\">\r\nSystem.properties['base.dir']\r\n<\/pre>\n<\/div>\n<\/blockquote>\n<p>Cheers!<br \/>\n~~Amit Jain~~<br \/>\namit@intelligrape.com<br \/>\nIntelliGrape Softwares<\/p>\n<blockquote class=\"wp-embedded-content\" data-secret=\"7Qmp5NgHyT\"><p><a href=\"https:\/\/www.tothenew.com\/blog\/\">Home<\/a><\/p><\/blockquote>\n<p><iframe class=\"wp-embedded-content\" sandbox=\"allow-scripts\" security=\"restricted\" style=\"position: absolute; clip: rect(1px, 1px, 1px, 1px);\" title=\"&#8220;Home&#8221; &#8212; TO THE NEW Blog\" src=\"https:\/\/www.tothenew.com\/blog\/embed\/#?secret=7Qmp5NgHyT\" data-secret=\"7Qmp5NgHyT\" width=\"600\" height=\"338\" frameborder=\"0\" marginwidth=\"0\" marginheight=\"0\" scrolling=\"no\"><\/iframe><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Hi Friends, Recently I needed to access my grails application&#8217;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[&#8216;base.dir&#8217;] Cheers! ~~Amit Jain~~ amit@intelligrape.com IntelliGrape Softwares Home<\/p>\n","protected":false},"author":7,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"iawp_total_views":3},"categories":[7],"tags":[4840,142],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts\/349"}],"collection":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/users\/7"}],"replies":[{"embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/comments?post=349"}],"version-history":[{"count":1,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts\/349\/revisions"}],"predecessor-version":[{"id":54645,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts\/349\/revisions\/54645"}],"wp:attachment":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/media?parent=349"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/categories?post=349"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/tags?post=349"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}