Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.mockito.internal.configuration
Class ClassPathLoader

    java.lang.Object
      org.mockito.internal.configuration.ClassPathLoader

    public class ClassPathLoader

extends java.lang.Object

Loads configuration or extension points available in the classpath.

- Can load the mockito configuration. The user who want to provide his own mockito configuration should write the class `org.mockito.configuration.MockitoConfiguration` that implements `IMockitoConfiguration`. For example :

       package org.mockito.configuration;

       //...

       public class MockitoConfiguration implements IMockitoConfiguration {
           boolean enableClassCache() { return false; }

           // ...
       }

- Can load available mockito extensions. Currently Mockito only have one extension point the `MockMaker`. This extension point allows a user to provide his own bytecode engine to build mocks.
  Suppose you wrote an extension to create mocks with some Awesome library, in order to tell Mockito to use it you need to put in your classpath
  1. The implementation itself, for example `org.awesome.mockito.AwesomeMockMaker`.
  2. A file named `org.mockito.plugins.MockMaker` in a folder named `mockito-extensions`, the content of this file need to have one line with the qualified name `org.awesome.mockito.AwesomeMockMaker`.

Field Summary
`static java.lang.String` | `MOCKITO_CONFIGURATION_CLASS_NAME`

Constructor Summary
`ClassPathLoader()`

Method Summary
`static MockMaker` | `getMockMaker()` Returns the implementation of the mock maker available for the current runtime.
`static StackTraceCleanerProvider` | `getStackTraceCleanerProvider()`
`IMockitoConfiguration` | `loadConfiguration()`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### MOCKITO_CONFIGURATION_CLASS_NAME

    public static final java.lang.String MOCKITO_CONFIGURATION_CLASS_NAME

See Also:
  Constant Field Values

Constructor Detail

### ClassPathLoader

    public ClassPathLoader()

Method Detail

### loadConfiguration

    public IMockitoConfiguration loadConfiguration()

  Returns:
    configuration loaded from classpath or null

### getMockMaker

    public static MockMaker getMockMaker()

  Returns the implementation of the mock maker available for the current runtime.

  Returns `CglibMockMaker` if no `MockMaker` extension exists or is visible in the current classpath.

### getStackTraceCleanerProvider

    public static StackTraceCleanerProvider getStackTraceCleanerProvider()

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD