title: mvn unit test common resource folder and read file functionality
body: <p>I have the following directory structure for tests</p>
  
  <pre><code>test
   /java
     /com.mycompany
       test1Test
       test2Test
   /resources
    /jsonFiles
      file1.json
      file2.json
  </code></pre>
  
  <p>Then in each of my tests I read from a corresponding input json file:</p>
  
  <pre><code>@Test
  public void testFile1()
  {
     // read a file from the resources directory
     myobj = new myObject();
     myobj.setFileContentsAsString(test1Test.class.getResourcesAsStream("/jsonFiles/file1.json");
  }
  </code></pre>
  
  <p>My question is two part:</p>
  
  <p>1) What is a better way to read in the file contents w/o having to specify the className.getResourceAsStream() being since it will be used in multiple test cases for each test class.  Seems I reuse something better?</p>
  
  <p>2) Where can I put the path to look for the file resources instead of having to hard code "jsonFiles" as a prefix to the actual file?i would rather call something as absolute as ("file1.json"); </p>