title: Passing command line arguments to JUnit in Eclipse
body: <p>All,</p>
  
  <p>I am currently using JUnit 4 for writing test cases. I am fairly new to JUnit and finding it difficult to test my main class which takes arguments. I have specified the arguments to my JUnit test class by:  </p>
  
  <p>1 > Right click JUnit test class<br>
  2 > Goto Run As -> Run Configurations<br>
  3 > Select the Arguments tab and specify a value (I have entered an invalid argument i.e. the main class expects the command line argument to be converted to an <code>int</code> and I am passing a String value that cannot be converted to <code>int</code>)  </p>
  
  <p>However, the <code>main</code> class that I am testing, if the command line argument cannot be converted to a <code>int</code>, than I throw <code>IllegalArgumentException</code>. However, the JUnit does not show the testMain() method as <code>Error</code> or <code>Failure</code>. I don't think my setup is right for the JUnit class. Can anyone please guide me where I am going wrong</p>