Class ResourceCheckerJUnitListener

java.lang.Object
org.junit.runner.notification.RunListener
org.apache.hadoop.hbase.ResourceCheckerJUnitListener

public class ResourceCheckerJUnitListener extends org.junit.runner.notification.RunListener
Listen to the test progress and check the usage of:
  • threads
  • open file descriptor
  • max open file descriptor

When surefire forkMode=once/always/perthread, this code is executed on the forked process.

  • Nested Class Summary

    Nested classes/interfaces inherited from class org.junit.runner.notification.RunListener

    org.junit.runner.notification.RunListener.ThreadSafe
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private final Map<String,ResourceChecker>
     
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected void
    To be implemented by sub classes if they want to add specific ResourceAnalyzer.
    private String
    descriptionToShortTestName(org.junit.runner.Description description)
    Get the test name from the JUnit Description
    private void
    end(String testName)
     
    private void
    start(String testName)
     
    void
    testFinished(org.junit.runner.Description description)
     
    void
    testStarted(org.junit.runner.Description description)
     

    Methods inherited from class org.junit.runner.notification.RunListener

    testAssumptionFailure, testFailure, testIgnored, testRunFinished, testRunStarted, testSuiteFinished, testSuiteStarted

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

  • Constructor Details

  • Method Details

    • addResourceAnalyzer

      protected void addResourceAnalyzer(ResourceChecker rc)
      To be implemented by sub classes if they want to add specific ResourceAnalyzer.
    • start

      private void start(String testName)
    • end

      private void end(String testName)
    • descriptionToShortTestName

      private String descriptionToShortTestName(org.junit.runner.Description description)
      Get the test name from the JUnit Description
      Returns:
      the string for the short test name
    • testStarted

      public void testStarted(org.junit.runner.Description description) throws Exception
      Overrides:
      testStarted in class org.junit.runner.notification.RunListener
      Throws:
      Exception
    • testFinished

      public void testFinished(org.junit.runner.Description description) throws Exception
      Overrides:
      testFinished in class org.junit.runner.notification.RunListener
      Throws:
      Exception