org.powermock.core.classloader.annotations
Annotation Type PowerMockIgnore


@Target(value={TYPE,METHOD})
@Retention(value=RUNTIME)
@Documented
@Inherited
public @interface PowerMockIgnore

This annotation tells PowerMock to defer the loading of classes with the names supplied to value() to the system classloader.

For example suppose you'd like to defer the loading of all classes in the org.myproject package and all its sub-packages but you still like to prepare "MyClass" for test. Then you do like this:

 @PowerMockIgnore("org.myproject.*")
 @PrepareForTest(MyClass.class)
 @RunWith(PowerMockRunner.class)
 public class MyTest {
 ...
 }
 
 
This is useful in situations when you have e.g. a test/assertion utility framework (such as something similar to Hamcrest) whose classes must be loaded by the same classloader as EasyMock, JUnit and PowerMock etc.

Note that the PrepareForTest and PrepareOnlyThisForTest will have precedence over this annotation. This annotation will have precedence over the PrepareEverythingForTest annotation.


Optional Element Summary
 java.lang.String[] value
           
 

value

public abstract java.lang.String[] value
Default:
""


Copyright © 2007-2012. All Rights Reserved.