org.sourceforge.jemm.weaver.analysis
Class DependencyManagerTest

java.lang.Object
  extended by org.sourceforge.jemm.weaver.DefaultTestCase
      extended by org.sourceforge.jemm.weaver.analysis.DependencyManagerTest

public class DependencyManagerTest
extends DefaultTestCase

Tests the DependencyManager. There are seven combinations of dependency that need to be tested: 1) A single Transformation on its own. 2) A transformation with no dependencies but others in the Manager 3) CT -> CT 4) CT -> CT -> CT 5) CT->CT and then a third Transformation that depends on both 6) Two Transformations that depend on the same Transformation 7) A Transformation with two dependencies

Author:
Paul Keeble

Constructor Summary
DependencyManagerTest()
           
 
Method Summary
 void add()
          Basic test of adding valid transformations.
 void addNull()
          Basic test of adding a null transformation.
 void addSameClassTransform()
          Tests adding the same class transformer type.
 void addSameTransform()
          Tests adding the same transformation twice.
 void addTransformsToManager()
          Utility method to add all of the current transformations to the dependency manager.
 void dependencyTreeNull()
          Tests an invalid argument to DependencyManager.getDependencyTree.
 void executeDependents()
          Cyclic dependency detection - FAILS but I don't care!
 void findClass()
          Tests the find class functionality
 void findClassFail()
          Test the find class functionality with a missing dependency.
 void noDependencyEmptyManager()
          Scenario 1 - noDependencies
 void noDependencyFullManager()
          Scenario 2 - NoDependency with a manger with other dependencies present
 void remove()
          Tests removal of a transformer from the manager.
 void removeSameClass()
          Test removing the same transformation type twice from the manager.
 void setUp()
          Setup code for dependency manager tests.
 void tearDown()
          TearDown code for dependency manager tests.
 void threeNodeDoubleDependency()
          Scenario 5 CT->CT and then a third Transformation that depends on both
 void threeNodeSameTransform()
          Scenario 6 Two Transformations that depend on the same Transformation
 void threeNodeSingleDependency()
          Scenario 4 - CT -> CT -> CT
 void twoDependencies()
          7) A Transformation with two dependencies
 void twoNodeSingleDependency()
          Scenario 3 - CT1 -> CT2
 
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

DependencyManagerTest

public DependencyManagerTest()
Method Detail

setUp

public void setUp()
           throws java.lang.Exception
Setup code for dependency manager tests.

Throws:
java.lang.Exception - On setup error.

tearDown

public void tearDown()
              throws java.lang.Exception
TearDown code for dependency manager tests.

Throws:
java.lang.Exception - On teardown error.

addNull

public void addNull()
Basic test of adding a null transformation.


add

public void add()
         throws java.lang.Exception
Basic test of adding valid transformations.

Throws:
java.lang.Exception - On error.

addSameTransform

public void addSameTransform()
                      throws java.lang.Exception
Tests adding the same transformation twice.

Throws:
java.lang.Exception - On Error.

addSameClassTransform

public void addSameClassTransform()
                           throws java.lang.Exception
Tests adding the same class transformer type.

Throws:
java.lang.Exception - On error.

remove

public void remove()
            throws java.lang.Exception
Tests removal of a transformer from the manager.

Throws:
java.lang.Exception - On error.

removeSameClass

public void removeSameClass()
                     throws java.lang.Exception
Test removing the same transformation type twice from the manager.

Throws:
java.lang.Exception - On error.

dependencyTreeNull

public void dependencyTreeNull()
Tests an invalid argument to DependencyManager.getDependencyTree.


findClass

public void findClass()
Tests the find class functionality


findClassFail

public void findClassFail()
Test the find class functionality with a missing dependency.


noDependencyEmptyManager

public void noDependencyEmptyManager()
Scenario 1 - noDependencies


addTransformsToManager

public void addTransformsToManager()
                            throws javassist.NotFoundException
Utility method to add all of the current transformations to the dependency manager.

Throws:
javassist.NotFoundException - On error.

noDependencyFullManager

public void noDependencyFullManager()
                             throws javassist.NotFoundException
Scenario 2 - NoDependency with a manger with other dependencies present

Throws:
javassist.NotFoundException

twoNodeSingleDependency

public void twoNodeSingleDependency()
Scenario 3 - CT1 -> CT2


threeNodeSingleDependency

public void threeNodeSingleDependency()
Scenario 4 - CT -> CT -> CT


threeNodeDoubleDependency

public void threeNodeDoubleDependency()
Scenario 5 CT->CT and then a third Transformation that depends on both


threeNodeSameTransform

public void threeNodeSameTransform()
Scenario 6 Two Transformations that depend on the same Transformation


twoDependencies

public void twoDependencies()
7) A Transformation with two dependencies


executeDependents

public void executeDependents()
Cyclic dependency detection - FAILS but I don't care!



Copyright © 2009. All Rights Reserved.