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 implementsIMockitoConfiguration
. 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- The implementation itself, for example
org.awesome.mockito.AwesomeMockMaker
. - A file named
org.mockito.plugins.MockMaker
in a folder namedmockito-extensions
, the content of this file need to have one line with the qualified nameorg.awesome.mockito.AwesomeMockMaker
.
- The implementation itself, for example
-
Can load the mockito configuration. The user who want to provide his own mockito configuration
should write the class
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
MOCKITO_CONFIGURATION_CLASS_NAME
-
Constructor Summary
Constructors Constructor Description ClassPathLoader()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description IMockitoConfiguration
loadConfiguration()
-
-
-
Field Detail
-
MOCKITO_CONFIGURATION_CLASS_NAME
public static final java.lang.String MOCKITO_CONFIGURATION_CLASS_NAME
- See Also:
- Constant Field Values
-
-
Method Detail
-
loadConfiguration
public IMockitoConfiguration loadConfiguration()
- Returns:
- configuration loaded from classpath or null
-
-