Class PowerMockAgent
java.lang.Object
org.powermock.modules.agent.PowerMockAgent
This is the "agent class" that initializes the PowerMock "Java agent". It is not intended for use in client code.
It must be public, however, so the JVM can call the
premain method, which as the name implies is called
before the main method.- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionstatic voidagentmain(String agentArgs, Instrumentation inst) static org.powermock.modules.agent.PowerMockClassTransformerstatic booleanstatic voidstatic Instrumentationstatic voidpremain(String agentArgs, Instrumentation inst) This method must only be called by the JVM, to provide the instrumentation object.static void
-
Method Details
-
premain
This method must only be called by the JVM, to provide the instrumentation object. In order for this to occur, the JVM must be started with "-javaagent:powermock-module-javaagent-nnn.jar" as a command line parameter (assuming the jar file is in the current directory).- Throws:
Exception
-
agentmain
- Throws:
Exception
-
getClasstransformer
public static org.powermock.modules.agent.PowerMockClassTransformer getClasstransformer() -
instrumentation
-
verifyInitialization
public static void verifyInitialization() -
initializeIfNeeded
public static boolean initializeIfNeeded() -
initializeIfPossible
public static void initializeIfPossible()
-