org.sourceforge.jemm.weaver.transformation
Class MethodProxyTransformationTest

java.lang.Object
  extended by org.sourceforge.jemm.weaver.DefaultTestCase
      extended by org.sourceforge.jemm.weaver.transformation.MethodProxyTransformationTest

public class MethodProxyTransformationTest
extends DefaultTestCase

Test for the Method proxy mechanism which adds proxying behaviour as well as distributed locking calls.

Author:
Paul Keeble

Constructor Summary
MethodProxyTransformationTest()
           
 
Method Summary
 void dependencies()
           
 void execution()
          Test to ensure that the transformation not only runs but also that the resulting methods execute and do what was intended.
 void setUp()
          Creates and executes the initial transformations that the MethodProxy transformation requires to be run before it will work.
 void tearDown()
          Unit test tear down.
 void transform()
          Simple test to make sure the transformation runs without errors
 
Methods inherited from class org.sourceforge.jemm.weaver.DefaultTestCase
checkedExceptionThrowingConstructorClass, childDummyClass, cleanupClassPool, containedDummyClass, emptyClass, exceptionThrowingConstructorClass, hackClassPath, initialiseClass, initialiseSession, loadClass, methodClass, methodJEMMObjectAccess, referenceArrayClass, referenceClass, synchronizedBlockDummyClass, unconvertedContainedDummyClass, unloadClass, unsupportedDummyClass
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MethodProxyTransformationTest

public MethodProxyTransformationTest()
Method Detail

setUp

public void setUp()
           throws javassist.NotFoundException
Creates and executes the initial transformations that the MethodProxy transformation requires to be run before it will work. Also initialises the Store so that a Life Cycle Mock object can be inserted into the JEMM Session to listen to all the calls.

Throws:
javassist.NotFoundException

tearDown

public void tearDown()
Unit test tear down.


dependencies

public void dependencies()

transform

public void transform()
               throws javassist.NotFoundException
Simple test to make sure the transformation runs without errors

Throws:
javassist.NotFoundException

execution

public void execution()
               throws java.lang.Exception
Test to ensure that the transformation not only runs but also that the resulting methods execute and do what was intended. Implemented by creating an instance of the transformed class which is called MPTDummy. This instances methods are then executed in turn and the order of the expected method calls is then confirmed for both synchronized and normal methods. Also tests the special empty method code to ensure that the appropriate calls are still inserted despite the method doing absolutely nothing.

Throws:
java.lang.Exception


Copyright © 2009. All Rights Reserved.