title: If I @Ignore a test class in JUnit4, does @BeforeClass still run?
body: <p>Quick background: I've been hunting down a Maven / Surefire test-running problem for days now, and I've narrowed it down to a small number suspect of tests.  The behavior I'm seeing is <em>insane</em>.  I start with <code>mvn clean test</code>: 250 tests run, 0 skipped.  Now, I move the suspect test into <code>src/test/java</code> and try again: 146 tests run, 0 skipped!  The output of Maven gives <em>no</em> clue that other tests aren't being run, even with the <code>-X</code> flag.  </p>
  
  <p>That brings me to my question: the reason I call the test 'suspect' is that the whole class is decorated with @Ignore, so I would imagine that including it in my test sources should have <em>no</em> effect at all.  Then it occurred to me -- those classes have @BeforeClass/@AfterClass methods that 
  <a href="https://stackoverflow.com/questions/7422011/can-i-make-surefire-perform-expensive-setup-teardown-only-once">manage a dummy Zookeeper server</a>.  It's resulted in wonky behavior before, which is why we have the tests @Ignored.</p>
  
  <p>If JUnit is running the before/after code but ignoring the tests, I have no idea what might happen (but it'd probably be super bad).  Is this happening?  Is this supposed to happen?  If so, how am I <em>supposed</em> to say "for reference, here's a test that <em>should</em> work but needs fixing" when it includes @BeforeClass / @AfterClass?  Also of substantial interest: what the hell is this doing to Surefire / Maven,  that it causes unrelated tests to <strong><em>fall off the face of the Earth</em></strong>?</p>