Results 1 to 2 of 2

Thread: JUnit - Absolute path of test resources

  1. #1
    Join Date
    Mar 2011
    Posts
    1

    Default JUnit - Absolute path of test resources

    Hi

    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

  2. #2

    Default

    Hi,

    You can use org.springframework.core.ClassPathResource for this.
    Gabriel Axel
    Sparklix | Blog | Twitter | Github

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •