org.powermock.modules.agent
Class PowerMockAgent

java.lang.Object
  extended by org.powermock.modules.agent.PowerMockAgent

public final class PowerMockAgent
extends Object

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:
premain(String, Instrumentation)

Method Summary
static void agentmain(String agentArgs, Instrumentation inst)
           
static org.powermock.modules.agent.PowerMockClassTransformer getClasstransformer()
           
static boolean initializeIfNeeded()
           
static void initializeIfPossible()
           
static Instrumentation instrumentation()
           
static boolean isJava6OrLater()
           
static void premain(String agentArgs, Instrumentation inst)
          This method must only be called by the JVM, to provide the instrumentation object.
static void verifyInitialization()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

isJava6OrLater

public static boolean isJava6OrLater()

premain

public static void premain(String agentArgs,
                           Instrumentation inst)
                    throws Exception
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

public static void agentmain(String agentArgs,
                             Instrumentation inst)
                      throws Exception
Throws:
Exception

getClasstransformer

public static org.powermock.modules.agent.PowerMockClassTransformer getClasstransformer()

instrumentation

public static Instrumentation instrumentation()

verifyInitialization

public static void verifyInitialization()

initializeIfNeeded

public static boolean initializeIfNeeded()

initializeIfPossible

public static void initializeIfPossible()


Copyright © 2007-2014. All Rights Reserved.