use of org.powermock.core.transformers.impl.InterfaceMockTransformer in project powermock by powermock.
the class PowerMockClassloaderExecutor method forClass.
public static SingleClassloaderExecutor forClass(Class<?> testClass, MockPolicyInitializer mockPolicyInitializer) {
List<MockTransformer> mockTransformerChain = new ArrayList<MockTransformer>();
mockTransformerChain.add(new ClassMockTransformer());
mockTransformerChain.add(new InterfaceMockTransformer());
MockClassLoader mockLoader = new MockClassLoader(new String[0], new String[0]);
mockLoader.setMockTransformerChain(mockTransformerChain);
mockLoader.addIgnorePackage(new PowerMockIgnorePackagesExtractorImpl().getPackagesToIgnore(testClass));
mockLoader.addClassesToModify(new PrepareForTestExtractorImpl().getTestClasses(testClass));
mockLoader.addClassesToModify(new StaticConstructorSuppressExtractorImpl().getTestClasses(testClass));
mockPolicyInitializer.initialize(mockLoader);
return new SingleClassloaderExecutor(mockLoader);
}
use of org.powermock.core.transformers.impl.InterfaceMockTransformer in project powermock by powermock.
the class ClassLoaderFactory method getMockTransformers.
private List<MockTransformer> getMockTransformers() {
List<MockTransformer> mockTransformerChain = new ArrayList<MockTransformer>();
mockTransformerChain.add(new ClassMockTransformer());
mockTransformerChain.add(new InterfaceMockTransformer());
return mockTransformerChain;
}
use of org.powermock.core.transformers.impl.InterfaceMockTransformer in project powermock by powermock.
the class MockClassLoaderFactory method getMockTransformers.
protected List<MockTransformer> getMockTransformers(MockTransformer[] extraMockTransformers) {
List<MockTransformer> mockTransformerChain = new ArrayList<MockTransformer>();
mockTransformerChain.add(new ClassMockTransformer());
mockTransformerChain.add(new InterfaceMockTransformer());
Collections.addAll(mockTransformerChain, extraMockTransformers);
return mockTransformerChain;
}
Aggregations