org.jboss.aop.eclipsesupport
Class EclipseTestTransformer

java.lang.Object
  extended by org.jboss.aop.eclipsesupport.EclipseTestTransformer
All Implemented Interfaces:
ClassFileTransformer

public class EclipseTestTransformer
extends Object
implements ClassFileTransformer

A transformer to weave the main method of the org.eclipse.jdt.internal.junit.runner.RemoteTestRunner, so that we can deploy the correct -aop.xml files before the test case class itself is loaded when running within Eclipse FIXME SecurityManager - privileged blocks

Version:
$Revision: 44099 $
Author:
Bill Burke

Field Summary
static String CLASSLOADER_DEPLOYED_XML
          If running from within Eclipse with the -javaagent:eclipse-agent.jar switch set, the EclipseTestTransformer weaves the org.eclipse.jdt.internal.junit.runner.RemoteTestRunner class to set this system property to the name of the test class run.
 
Constructor Summary
EclipseTestTransformer()
           
 
Method Summary
static void deployXmlForEclipse(String testClass)
          This will be initiated from the woven RemoteTestRunner classs to deploy the xml for the testcase UNLESS the jboss.aop.path system property has been set.
static void recordClassNameAndDeployXml(String[] args)
           
 byte[] transform(ClassLoader loader, String className, Class<?> classBeingRedefined, ProtectionDomain protectionDomain, byte[] classfileBuffer)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CLASSLOADER_DEPLOYED_XML

public static final String CLASSLOADER_DEPLOYED_XML
If running from within Eclipse with the -javaagent:eclipse-agent.jar switch set, the EclipseTestTransformer weaves the org.eclipse.jdt.internal.junit.runner.RemoteTestRunner class to set this system property to the name of the test class run.

See Also:
Constant Field Values
Constructor Detail

EclipseTestTransformer

public EclipseTestTransformer()
Method Detail

transform

public byte[] transform(ClassLoader loader,
                        String className,
                        Class<?> classBeingRedefined,
                        ProtectionDomain protectionDomain,
                        byte[] classfileBuffer)
                 throws IllegalClassFormatException
Specified by:
transform in interface ClassFileTransformer
Throws:
IllegalClassFormatException

recordClassNameAndDeployXml

public static void recordClassNameAndDeployXml(String[] args)
                                        throws Exception
Throws:
Exception

deployXmlForEclipse

public static void deployXmlForEclipse(String testClass)
                                throws Exception
This will be initiated from the woven RemoteTestRunner classs to deploy the xml for the testcase UNLESS the jboss.aop.path system property has been set.

Throws:
Exception


Copyright © 2008 JBoss, a division of Red Hat, Inc.. All Rights Reserved.