title: Why won't jUnit 4 find my expected Exception?
body: <p>I managed it to understand Junit 3.8 but honestly I have no idea how junit 4 works even after I read documentations for more than 45 minutes. I don't have a problem with the annotations but with <b>running the tests</b>.
  For example junit won't find my expected exception in this little example:</p>
  
  <p>Output:</p>
  
  <pre><code>.E
  Time: 0,011
  There was 1 error:
  1)     testTest(junittests.TestTestCase)java.util.InputMismatchException
  </code></pre>
  
  <p>Main.java</p>
  
  <pre><code>TestRunner.run(TestTestCase.class);
  </code></pre>
  
  <p>DemoClass.java</p>
  
  <pre><code>import java.util.InputMismatchException;
  
  public class DemoClass {
      public void test() {
          throw new InputMismatchException();
      }
  }
  </code></pre>
  
  <p>TestTestCase.java</p>
  
  <pre><code>import junit.framework.TestCase;
  import org.junit.Before;
  
  import java.util.InputMismatchException;
  
  public class TestTestCase extends TestCase {
      private DemoClass inst;
      @Before
      public void setUp() {
          inst = new DemoClass();
      }
      @org.junit.Test(expected = InputMismatchException.class)
      public void testTest() {
          inst.test();
      }
  }
  </code></pre>
  
  <p>I really have no clue how to use it. Thanks a lot in advance!</p>