title: Try catch in a JUnit test
body: <p>I'm writing unit tests for an application that already exists for a long time. Some of the methods I need to test are build like this:</p>
  
  <pre><code>public void someMethod() throws Exception { 
     //do something 
  }
  </code></pre>
  
  <p>If I want to test these methods I have to write something like this in my unit test:</p>
  
  <pre><code>@Test
  public void someTest() {
     try {
        someMethod();
     }
     catch (Exception e) {
        e.printStackTrace();
     }
  }
  </code></pre>
  
  <p>Is it a good practice to do this? Or is there an other way to test these methods?</p>
  
  <p>I did some research on the internet and I found a few solutions with the <code>@Rule</code> annotation and <code>@Test(expected=Exception.class)</code>, but that's not working (Eclipse keeps showing the <code>someMethod()</code> line in the test as wrong).
  I don't know if these are good solutions, because I'm pretty new to the whole unit testing story.</p>
  
  <p>If someone who knows a lot about this could help me out, I would be really thankful.</p>