title: Java/Eclipse: How to configure Run Configuration's Classpath for JUnit test?
body: <p>I have an Eclipse project with the following directory structure:</p>
  
  <pre><code>MyProj/
      src/main/java/
          com.me.myproject.widgets
              Widget.java
      src/main/config
          widget-config.xml
      src/test/java
          com.me.myproject.widgets
              WidgetTest.java
      src/test/config
          widget-test-config.xml
  </code></pre>
  
  <p>The <code>Widget</code> class reads its config (XML) file in from anywhere on the classpath and uses it to configure its properties.</p>
  
  <p>I am trying to just get <code>WidgetTest</code>'s test cases (all written with JUnit) to run inside Eclipse when I right-click the file and go to <code>Run As &gt;&gt; JUnit Test</code>. I assume I'll have to actually run it as a customized <em>Run Configuration</em> with its own configured classpath, but I'm not sure about that as I've never done this before.</p>
  
  <p>Does anybody know how I can get a custom Run Configuration to run <code>WidgetTest.java</code> as a JUnit test, and successfully place <code>src/test/config/widget-test-config.xml</code> on the classpath? Thanks in advance!</p>
  
  <p>Please note, this question is <strong>not</strong> about how to read a resource from the runtime classpath, its about how to get it on Eclipse's JUnit Run Config classpath in the first place!</p>