Mar 17th, 2011, 01:56 PM
JUnit - Absolute path of test resources
I'm writing a JUnit class where I need to pass the absolute path of a document file to the actual method. I'm thinking of placing this document file in test resources folder and use it for JUnit. Can someone please help me with some pointers on how to get the absolute path of a test resources? The following are the other details.
Spring version - 3.0
Build - Maven
Document is placed under test/resources/ folder
Mar 19th, 2011, 01:56 PM
You can use org.springframework.core.ClassPathResource for this.
Tags for this Thread