org.picocontainer.adapters
Class InstanceAdapterTestCase

java.lang.Object
  extended by org.picocontainer.tck.AbstractComponentAdapterTest
      extended by org.picocontainer.adapters.InstanceAdapterTestCase

public final class InstanceAdapterTestCase
extends AbstractComponentAdapterTest

Test the InstanceAdapter.

Author:
Jörg Schaible

Nested Class Summary
 
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
InstanceAdapterTestCase()
           
 
Method Summary
protected  int getComponentAdapterNature()
          
protected  Class getComponentAdapterType()
          
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 prepSER_isSerializable(MutablePicoContainer picoContainer)
          Prepare the test isSerializable.
protected  ComponentAdapter prepSER_isXStreamSerializable(MutablePicoContainer picoContainer)
          Prepare the test isXStreamSerializable.
 void testComponentAdapterCanIgnoreLifecycle()
           
 void testComponentAdapterReturnsSame()
           
 void testCustomLifecycleCanBeInjected()
           
 void testDefaultLifecycleStrategy()
           
 void testFindAdapterOfType()
           
 void testGuardAgainstNullInstance()
           
 
Methods inherited from class org.picocontainer.tck.AbstractComponentAdapterTest
createDefaultComponentFactory, prepDEF_isAbleToTakeParameters, prepINS_createsNewInstances, prepINS_errorIsRethrown, prepINS_normalExceptionIsRethrownInsidePicoInitializationException, prepINS_runtimeExceptionIsRethrown, prepRES_dependenciesAreResolved, prepRES_failingInstantiationWithCyclicDependencyException, prepRES_failingVerificationWithCyclicDependencyException, prepVER_verificationFails, 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

InstanceAdapterTestCase

public InstanceAdapterTestCase()
Method Detail

testComponentAdapterReturnsSame

public void testComponentAdapterReturnsSame()

testDefaultLifecycleStrategy

public void testDefaultLifecycleStrategy()

testCustomLifecycleCanBeInjected

public void testCustomLifecycleCanBeInjected()

testComponentAdapterCanIgnoreLifecycle

public void testComponentAdapterCanIgnoreLifecycle()

testGuardAgainstNullInstance

public void testGuardAgainstNullInstance()

testFindAdapterOfType

public void testFindAdapterOfType()

getComponentAdapterType

protected Class getComponentAdapterType()

Specified by:
getComponentAdapterType in class AbstractComponentAdapterTest
See Also:
tck.AbstractComponentAdapterTestCase

getComponentAdapterNature

protected int getComponentAdapterNature()

Overrides:
getComponentAdapterNature in class AbstractComponentAdapterTest
See Also:
tck.AbstractComponentAdapterTestCase

prepDEF_verifyWithoutDependencyWorks

protected ComponentAdapter prepDEF_verifyWithoutDependencyWorks(MutablePicoContainer picoContainer)
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.
See Also:
tck.AbstractComponentAdapterTestCase

prepDEF_verifyDoesNotInstantiate

protected ComponentAdapter prepDEF_verifyDoesNotInstantiate(MutablePicoContainer picoContainer)
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.
See Also:
tck.AbstractComponentAdapterTestCase

prepDEF_visitable

protected ComponentAdapter prepDEF_visitable()
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.
See Also:
tck.AbstractComponentAdapterTestCase

prepSER_isSerializable

protected ComponentAdapter prepSER_isSerializable(MutablePicoContainer picoContainer)
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.
See Also:
tck.AbstractComponentAdapterTestCase

prepSER_isXStreamSerializable

protected ComponentAdapter prepSER_isXStreamSerializable(MutablePicoContainer picoContainer)
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.
See Also:
tck.AbstractComponentAdapterTestCase


Copyright © 2003-2010 Codehaus. All Rights Reserved.