Class ContextLoadException

java.lang.Object
java.lang.Throwable
java.lang.Exception
org.springframework.test.context.ContextLoadException
All Implemented Interfaces:
Serializable

public class ContextLoadException extends Exception
Exception thrown when an error occurs while a SmartContextLoader attempts to load an ApplicationContext.

This exception provides access to the application context that failed to load as well as the exception caught while attempting to load that context.

Since:
6.0
Author:
Sam Brannen
See Also:
  • Constructor Details

    • ContextLoadException

      public ContextLoadException(ApplicationContext applicationContext, Exception cause)
      Create a new ContextLoadException for the supplied ApplicationContext and Exception.
      Parameters:
      applicationContext - the application context that failed to load
      cause - the exception caught while attempting to load that context
  • Method Details

    • getApplicationContext

      public ApplicationContext getApplicationContext()
      Get the ApplicationContext that failed to load.

      Clients must not retain a long-lived reference to the context returned from this method.