org.picocontainer.injectors
Class ConstructorInjectorTestCase

java.lang.Object
  extended by org.picocontainer.tck.AbstractComponentAdapterTest
      extended by org.picocontainer.injectors.ConstructorInjectorTestCase

public class ConstructorInjectorTestCase
extends AbstractComponentAdapterTest


Nested Class Summary
static class ConstructorInjectorTestCase.A
           
static class ConstructorInjectorTestCase.AllConstructorsArePrivate
           
static class ConstructorInjectorTestCase.B
           
static class ConstructorInjectorTestCase.C1
           
static class ConstructorInjectorTestCase.C2
           
static class ConstructorInjectorTestCase.Component201
           
static class ConstructorInjectorTestCase.Erroneous
           
static class ConstructorInjectorTestCase.InstantiationExceptionThrowing
           
static class ConstructorInjectorTestCase.NamedDependsOnTouchable
           
static class ConstructorInjectorTestCase.NormalExceptionThrowing
           
static class ConstructorInjectorTestCase.One
           
static class ConstructorInjectorTestCase.RuntimeThrowing
           
static class ConstructorInjectorTestCase.Two
           
 
Nested classes/interfaces inherited from class org.picocontainer.tck.AbstractComponentAdapterTest
AbstractComponentAdapterTest.CollectingBehavior, AbstractComponentAdapterTest.CycleDetectorBehavior, AbstractComponentAdapterTest.NotInstantiatableBehavior, AbstractComponentAdapterTest.RecordingLifecycleStrategy
 
Field Summary
 
Fields inherited from class org.picocontainer.tck.AbstractComponentAdapterTest
INSTANTIATING, RESOLVING, SERIALIZABLE, VERIFYING
 
Constructor Summary
ConstructorInjectorTestCase()
           
 
Method Summary
protected  Class getComponentAdapterType()
           
protected  ComponentAdapter prepDEF_isAbleToTakeParameters(MutablePicoContainer picoContainer)
          Prepare the test isAbleToTakeParameters.
protected  ComponentAdapter prepDEF_verifyDoesNotInstantiate(MutablePicoContainer picoContainer)
          Prepare the test verifyDoesNotInstantiate.
protected  ComponentAdapter prepDEF_verifyWithoutDependencyWorks(MutablePicoContainer picoContainer)
          Prepare the test verifyWithoutDependencyWorks.
protected  ComponentAdapter prepDEF_visitable()
          Prepare the test visitable.
protected  ComponentAdapter prepINS_createsNewInstances(MutablePicoContainer picoContainer)
          Prepare the test createsNewInstances.
protected  ComponentAdapter prepINS_errorIsRethrown(MutablePicoContainer picoContainer)
          Prepare the test errorIsRethrown.
protected  ComponentAdapter prepINS_normalExceptionIsRethrownInsidePicoInitializationException(MutablePicoContainer picoContainer)
          Prepare the test normalExceptionIsRethrownInsidePicoInvocationTargetInitializationException.
protected  ComponentAdapter prepINS_runtimeExceptionIsRethrown(MutablePicoContainer picoContainer)
          Prepare the test runtimeExceptionIsRethrown.
protected  ComponentAdapter prepRES_dependenciesAreResolved(MutablePicoContainer picoContainer)
          Prepare the test dependenciesAreResolved.
protected  ComponentAdapter prepRES_failingInstantiationWithCyclicDependencyException(MutablePicoContainer picoContainer)
          Prepare the test failingInstantiationWithCyclicDependencyException.
protected  ComponentAdapter prepRES_failingVerificationWithCyclicDependencyException(MutablePicoContainer picoContainer)
          Prepare the test failingVerificationWithCyclicDependencyException.
protected  ComponentAdapter prepSER_isSerializable(MutablePicoContainer picoContainer)
          Prepare the test isSerializable.
protected  ComponentAdapter prepSER_isXStreamSerializable(MutablePicoContainer picoContainer)
          Prepare the test isXStreamSerializable.
protected  ComponentAdapter prepVER_verificationFails(MutablePicoContainer picoContainer)
          Prepare the test verificationFailsWithUnsatisfiedDependency.
 void testInstantiationExceptionThrownInCtorIsRethrownInsideInvocationTargetExeption()
           
 void testMonitoringHappensBeforeAndAfterInstantiation()
           
 void testMonitoringHappensBeforeAndOnFailOfImpossibleComponentsInstantiation()
           
 void testNormalExceptionThrownInCtorIsRethrownInsideInvocationTargetExeption()
           
 void testPicoInitializationExceptionThrownBecauseOfFilteredConstructors()
           
 void testRegisterAbstractShouldFail()
           
 void testRegisterInterfaceShouldFail()
           
 void testShouldNotConsiderNonPublicConstructors()
           
 void testSpeedOfRememberedConstructor()
           
 
Methods inherited from class org.picocontainer.tck.AbstractComponentAdapterTest
createDefaultComponentFactory, getComponentAdapterNature, testDEF_isAbleToTakeParameters, testDEF_verifyDoesNotInstantiate, testDEF_verifyWithoutDependencyWorks, testDEF_visitable, testINS_createsNewInstances, testINS_errorIsRethrown, testINS_normalExceptionIsRethrownInsidePicoInitializationException, testINS_runtimeExceptionIsRethrown, testRES_dependenciesAreResolved, testRES_failingInstantiationWithCyclicDependencyException, testRES_failingVerificationWithCyclicDependencyException, testSER_isSerializable, testSER_isXStreamSerializable, testSER_isXStreamSerializableWithPureReflection, testVER_verificationFails, wrapComponentInstances
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ConstructorInjectorTestCase

public ConstructorInjectorTestCase()
Method Detail

getComponentAdapterType

protected Class getComponentAdapterType()
Specified by:
getComponentAdapterType in class AbstractComponentAdapterTest

prepDEF_verifyWithoutDependencyWorks

protected ComponentAdapter prepDEF_verifyWithoutDependencyWorks(MutablePicoContainer picoContainer)
Description copied from class: AbstractComponentAdapterTest
Prepare the test verifyWithoutDependencyWorks.

Specified by:
prepDEF_verifyWithoutDependencyWorks in class AbstractComponentAdapterTest
Parameters:
picoContainer - container, may probably not be used.
Returns:
a ComponentAdapter of the type to test for a component without dependencies. Registration in the pico is not necessary.

prepDEF_verifyDoesNotInstantiate

protected ComponentAdapter prepDEF_verifyDoesNotInstantiate(MutablePicoContainer picoContainer)
Description copied from class: AbstractComponentAdapterTest
Prepare the test verifyDoesNotInstantiate.

Specified by:
prepDEF_verifyDoesNotInstantiate in class AbstractComponentAdapterTest
Parameters:
picoContainer - container, may probably not be used.
Returns:
a ComponentAdapter of the type to test for a component that may throw on instantiation. Registration in the pico is not necessary.

prepDEF_visitable

protected ComponentAdapter prepDEF_visitable()
Description copied from class: AbstractComponentAdapterTest
Prepare the test visitable.

Specified by:
prepDEF_visitable in class AbstractComponentAdapterTest
Returns:
a ComponentAdapter of the type to test. If the ComponentAdapter supports Parameter, you have to select a component, that have some.

prepDEF_isAbleToTakeParameters

protected ComponentAdapter prepDEF_isAbleToTakeParameters(MutablePicoContainer picoContainer)
Description copied from class: AbstractComponentAdapterTest
Prepare the test isAbleToTakeParameters. Overload this function, if the ComponentAdapter to test supports Parameter.

Overrides:
prepDEF_isAbleToTakeParameters in class AbstractComponentAdapterTest
Parameters:
picoContainer - container, may probably not be used.
Returns:
a ComponentAdapter of the type to test. Select a component, that has some parameters. Registration in the pico is not necessary.

prepSER_isSerializable

protected ComponentAdapter prepSER_isSerializable(MutablePicoContainer picoContainer)
Description copied from class: AbstractComponentAdapterTest
Prepare the test isSerializable. Overload this function, if the ComponentAdapter supports serialization.

Overrides:
prepSER_isSerializable in class AbstractComponentAdapterTest
Parameters:
picoContainer - container, may probably not be used.
Returns:
a ComponentAdapter of the type to test. Registration in the pico is not necessary.

prepSER_isXStreamSerializable

protected ComponentAdapter prepSER_isXStreamSerializable(MutablePicoContainer picoContainer)
Description copied from class: AbstractComponentAdapterTest
Prepare the test isXStreamSerializable. Overload this function, if the ComponentAdapter supports serialization.

Overrides:
prepSER_isXStreamSerializable in class AbstractComponentAdapterTest
Parameters:
picoContainer - container, may probably not be used.
Returns:
a ComponentAdapter of the type to test. Registration in the pico is not necessary.

prepVER_verificationFails

protected ComponentAdapter prepVER_verificationFails(MutablePicoContainer picoContainer)
Description copied from class: AbstractComponentAdapterTest
Prepare the test verificationFailsWithUnsatisfiedDependency. Overload this function, if the ComponentAdapter's verification can fail e.g. due to an unresolved dependency.

Overrides:
prepVER_verificationFails in class AbstractComponentAdapterTest
Parameters:
picoContainer - container, may probably not be used.
Returns:
a ComponentAdapter of the type to test, that fails for the verification, e.g. because of a compoennt with missing dependencies. Registration in the pico is not necessary.

prepINS_createsNewInstances

protected ComponentAdapter prepINS_createsNewInstances(MutablePicoContainer picoContainer)
Description copied from class: AbstractComponentAdapterTest
Prepare the test createsNewInstances. Overload this function, if the ComponentAdapter is instantiating. It should create a new instance with every call.

Overrides:
prepINS_createsNewInstances in class AbstractComponentAdapterTest
Parameters:
picoContainer - container, may probably not be used.
Returns:
a ComponentAdapter of the type to test. Registration in the pico is not necessary.

prepINS_errorIsRethrown

protected ComponentAdapter prepINS_errorIsRethrown(MutablePicoContainer picoContainer)
Description copied from class: AbstractComponentAdapterTest
Prepare the test errorIsRethrown. Overload this function, if the ComponentAdapter is instantiating.

Overrides:
prepINS_errorIsRethrown in class AbstractComponentAdapterTest
Parameters:
picoContainer - container, may probably not be used.
Returns:
a ComponentAdapter of the type to test with a component that fails with an Error at instantiation. Registration in the pico is not necessary.

prepINS_runtimeExceptionIsRethrown

protected ComponentAdapter prepINS_runtimeExceptionIsRethrown(MutablePicoContainer picoContainer)
Description copied from class: AbstractComponentAdapterTest
Prepare the test runtimeExceptionIsRethrown. Overload this function, if the ComponentAdapter is instantiating.

Overrides:
prepINS_runtimeExceptionIsRethrown in class AbstractComponentAdapterTest
Parameters:
picoContainer - container, may probably not be used.
Returns:
a ComponentAdapter of the type to test with a component that fails with a RuntimeException at instantiation. Registration in the pico is not necessary.

prepINS_normalExceptionIsRethrownInsidePicoInitializationException

protected ComponentAdapter prepINS_normalExceptionIsRethrownInsidePicoInitializationException(MutablePicoContainer picoContainer)
Description copied from class: AbstractComponentAdapterTest
Prepare the test normalExceptionIsRethrownInsidePicoInvocationTargetInitializationException. Overload this function, if the ComponentAdapter is instantiating.

Overrides:
prepINS_normalExceptionIsRethrownInsidePicoInitializationException in class AbstractComponentAdapterTest
Parameters:
picoContainer - container, may probably not be used.
Returns:
a ComponentAdapter of the type to test with a component that fails with a PicoCompositionException at instantiation. Registration in the pico is not necessary.

prepRES_dependenciesAreResolved

protected ComponentAdapter prepRES_dependenciesAreResolved(MutablePicoContainer picoContainer)
Description copied from class: AbstractComponentAdapterTest
Prepare the test dependenciesAreResolved. Overload this function, if the ComponentAdapter is resolves dependencies.

Overrides:
prepRES_dependenciesAreResolved in class AbstractComponentAdapterTest
Parameters:
picoContainer - container, used to register dependencies.
Returns:
a ComponentAdapter of the type to test with a component that has dependencies. Registration in the pico is not necessary.

prepRES_failingVerificationWithCyclicDependencyException

protected ComponentAdapter prepRES_failingVerificationWithCyclicDependencyException(MutablePicoContainer picoContainer)
Description copied from class: AbstractComponentAdapterTest
Prepare the test failingVerificationWithCyclicDependencyException. Overload this function, if the ComponentAdapter is resolves dependencies.

Overrides:
prepRES_failingVerificationWithCyclicDependencyException in class AbstractComponentAdapterTest
Parameters:
picoContainer - container, used to register dependencies.
Returns:
a ComponentAdapter of the type to test with a component that has cyclic dependencies. You have to register the component itself in the pico.

prepRES_failingInstantiationWithCyclicDependencyException

protected ComponentAdapter prepRES_failingInstantiationWithCyclicDependencyException(MutablePicoContainer picoContainer)
Description copied from class: AbstractComponentAdapterTest
Prepare the test failingInstantiationWithCyclicDependencyException. Overload this function, if the ComponentAdapter is resolves dependencies.

Overrides:
prepRES_failingInstantiationWithCyclicDependencyException in class AbstractComponentAdapterTest
Parameters:
picoContainer - container, used to register dependencies.
Returns:
a ComponentAdapter of the type to test with a component that has cyclic dependencies. You have to register the component itself in the pico.

testNormalExceptionThrownInCtorIsRethrownInsideInvocationTargetExeption

public void testNormalExceptionThrownInCtorIsRethrownInsideInvocationTargetExeption()

testInstantiationExceptionThrownInCtorIsRethrownInsideInvocationTargetExeption

public void testInstantiationExceptionThrownInCtorIsRethrownInsideInvocationTargetExeption()

testPicoInitializationExceptionThrownBecauseOfFilteredConstructors

public void testPicoInitializationExceptionThrownBecauseOfFilteredConstructors()

testRegisterInterfaceShouldFail

public void testRegisterInterfaceShouldFail()
                                     throws PicoCompositionException
Throws:
PicoCompositionException

testRegisterAbstractShouldFail

public void testRegisterAbstractShouldFail()
                                    throws PicoCompositionException
Throws:
PicoCompositionException

testShouldNotConsiderNonPublicConstructors

public void testShouldNotConsiderNonPublicConstructors()

testMonitoringHappensBeforeAndAfterInstantiation

public void testMonitoringHappensBeforeAndAfterInstantiation()
                                                      throws NoSuchMethodException
Throws:
NoSuchMethodException

testMonitoringHappensBeforeAndOnFailOfImpossibleComponentsInstantiation

public void testMonitoringHappensBeforeAndOnFailOfImpossibleComponentsInstantiation()
                                                                             throws NoSuchMethodException
Throws:
NoSuchMethodException

testSpeedOfRememberedConstructor

public void testSpeedOfRememberedConstructor()


Copyright © 2003-2010 Codehaus. All Rights Reserved.