org.apache.tapestry5.ioc.test
Class IOCTestCase

java.lang.Object
  extended by org.testng.Assert
      extended by org.apache.tapestry5.ioc.test.TestUtils
          extended by org.apache.tapestry5.ioc.test.TestBase
              extended by org.apache.tapestry5.ioc.test.IOCTestCase
Direct Known Subclasses:
TapestryTestCase

public class IOCTestCase
extends TestBase

Add factory and trainer methods for the public interfaces of Tapestry IOC.


Constructor Summary
IOCTestCase()
           
 
Method Summary
protected  Registry buildRegistry(Class... moduleClasses)
          Builds a Registry for the provided modules; caller should shutdown the Registry when done.
protected  Method findMethod(Class clazz, String methodName)
           
protected  Method findMethod(Object subject, String methodName)
           
protected  Method findMethod(String methodName)
           
protected  String join(String... lines)
          Combines a series of lines by forming a string with a line separator after each line.
protected  AdvisorDef mockAdvisorDef()
           
protected  AdvisorDef2 mockAdvisorDef2()
           
protected  AnnotationProvider mockAnnotationProvider()
           
protected  ClassPropertyAdapter mockClassPropertyAdapter()
           
protected
<T> Configuration<T>
mockConfiguration()
           
protected  ContributionDef mockContributionDef()
           
protected  DecoratorDef mockDecoratorDef()
           
protected  DecoratorDef2 mockDecoratorDef2()
           
protected  Location mockLocation()
           
protected  org.slf4j.Logger mockLogger()
           
protected
<K,V> MappedConfiguration<K,V>
mockMappedConfiguration()
           
protected  MasterObjectProvider mockMasterObjectProvider()
           
protected  MessageFormatter mockMessageFormatter()
           
protected  Messages mockMessages()
           
protected  ModuleDef mockModuleDef()
           
protected  ModuleDef2 mockModuleDef2()
           
protected  ObjectCreator mockObjectCreator()
           
protected  ObjectLocator mockObjectLocator()
           
protected  ObjectProvider mockObjectProvider()
           
protected
<T> OrderedConfiguration<T>
mockOrderedConfiguration()
           
protected  PerthreadManager mockPerthreadManager()
           
protected  PropertyAccess mockPropertyAccess()
           
protected  PropertyAdapter mockPropertyAdapter()
           
protected  Resource mockResource()
           
protected  Runnable mockRunnable()
          Frequently used as a placeholder for an arbitrary service (but its nice and simple).
protected  ServiceBuilderResources mockServiceBuilderResources()
           
protected  ServiceBuilderResources mockServiceBuilderResources(OperationTracker tracker)
           
protected  ServiceDecorator mockServiceDecorator()
           
protected  ServiceDef mockServiceDef()
           
protected  ServiceResources mockServiceResources()
           
protected  ServiceResources mockServiceResources(OperationTracker tracker)
           
protected  SymbolSource mockSymbolSource()
           
protected  ThreadLocale mockThreadLocale()
           
protected  TypeCoercer mockTypeCoercer()
           
protected  IntermediateType newIntermediateType()
           
protected  void stub_contains(Messages messages, boolean contained)
           
protected  void stub_isDebugEnabled(org.slf4j.Logger logger, boolean enabled)
           
protected  void touch(File f)
          Touches the file, changing the last modified time to the current time.
protected
<T> void
train_autobuild(ObjectLocator locator, Class<T> beanClass, T instance)
           
protected
<S,T> void
train_coerce(TypeCoercer coercer, S input, Class<T> expectedType, T coercedValue)
           
protected  void train_contains(Messages messages, String key, boolean result)
           
protected  void train_createInterceptor(ServiceDecorator decorator, Object coreObject, Object interceptor)
           
protected  void train_createObject(ObjectCreator creator, Object service)
           
protected  void train_expandSymbols(SymbolSource source, String input)
           
protected  void train_expandSymbols(SymbolSource source, String input, String expanded)
           
protected  void train_forFile(Resource resource, String relativePath, Resource file)
           
protected  void train_forLocale(Resource base, Locale locale, Resource resource)
           
protected  void train_format(MessageFormatter formatter, String result, Object... arguments)
          Have to put the result before the varargs.
protected  void train_get(Messages messages, String key, String message)
           
protected
<T extends Annotation>
void
train_getAnnotation(AnnotationProvider annotationProvider, Class<T> annotationClass, T annotation)
           
protected  void train_getLocale(ThreadLocale threadLocale, Locale locale)
           
protected  void train_getLogger(LoggerSource source, String serviceId, org.slf4j.Logger logger)
           
protected  void train_getLogger(ServiceResources resources, org.slf4j.Logger log)
           
protected  void train_getMessageFormatter(Messages messages, String key, MessageFormatter formatter)
           
protected  void train_getPath(Resource r, String path)
           
protected
<T> void
train_getService(ObjectLocator locator, Class<T> serviceInterface, T service)
           
protected
<T> void
train_getService(ObjectLocator locator, String serviceId, Class<T> serviceInterface, T service)
           
protected  void train_getServiceId(ServiceDef def, String serviceId)
           
protected  void train_getServiceId(ServiceResources resources, String serviceId)
           
protected  void train_getServiceInterface(ServiceDef def, Class serviceInterface)
           
protected  void train_getServiceInterface(ServiceResources resources, Class serviceInterface)
           
protected  void train_getTracker(ServiceResources resources, OperationTracker tracker)
           
protected  void train_isDebugEnabled(org.slf4j.Logger log, boolean debugEnabled)
           
protected  void train_isTraceEnabled(org.slf4j.Logger log, boolean traceEnabled)
           
protected  void train_matches(AdvisorDef advisorDef, ServiceDef serviceDef, boolean matches)
           
protected  void train_matches(DecoratorDef decoratorDef, ServiceDef serviceDef, boolean matches)
           
protected
<T> void
train_provide(ObjectProvider provider, Class<T> objectType, AnnotationProvider annotationProvider, ObjectLocator locator, T object)
           
protected  void train_toURL(Resource resource, URL url)
           
protected  void train_value(IntermediateType it, Class value)
           
protected  void train_valueForSymbol(SymbolSource symbolSource, String symbolName, String value)
           
 
Methods inherited from class org.apache.tapestry5.ioc.test.TestBase
discardMockControl, expect, getMocksControl, newCapture, newMock, replay, setAnswer, setThrowable, verify
 
Methods inherited from class org.apache.tapestry5.ioc.test.TestUtils
assertArraysEqual, assertListsEquals, assertListsEquals, assertMessageContains, create, get, set, showLists, unreachable
 
Methods inherited from class org.testng.Assert
assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEqualsNoOrder, assertEqualsNoOrder, assertFalse, assertFalse, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, fail, fail, fail
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IOCTestCase

public IOCTestCase()
Method Detail

buildRegistry

protected final Registry buildRegistry(Class... moduleClasses)
Builds a Registry for the provided modules; caller should shutdown the Registry when done.


findMethod

protected final Method findMethod(Class clazz,
                                  String methodName)

findMethod

protected final Method findMethod(Object subject,
                                  String methodName)

findMethod

protected final Method findMethod(String methodName)

join

protected final String join(String... lines)
Combines a series of lines by forming a string with a line separator after each line.


mockAnnotationProvider

protected final AnnotationProvider mockAnnotationProvider()

mockConfiguration

protected final <T> Configuration<T> mockConfiguration()

mockContributionDef

protected final ContributionDef mockContributionDef()

mockDecoratorDef

protected final DecoratorDef mockDecoratorDef()

mockDecoratorDef2

protected final DecoratorDef2 mockDecoratorDef2()

mockAdvisorDef

protected final AdvisorDef mockAdvisorDef()

mockAdvisorDef2

protected final AdvisorDef2 mockAdvisorDef2()

mockLocation

protected final Location mockLocation()

mockLogger

protected final org.slf4j.Logger mockLogger()

stub_isDebugEnabled

protected final void stub_isDebugEnabled(org.slf4j.Logger logger,
                                         boolean enabled)

mockMappedConfiguration

protected final <K,V> MappedConfiguration<K,V> mockMappedConfiguration()

mockMessageFormatter

protected final MessageFormatter mockMessageFormatter()

mockMessages

protected final Messages mockMessages()

mockModuleDef

protected final ModuleDef mockModuleDef()

mockModuleDef2

protected final ModuleDef2 mockModuleDef2()

mockObjectCreator

protected final ObjectCreator mockObjectCreator()

mockObjectProvider

protected final ObjectProvider mockObjectProvider()

mockOrderedConfiguration

protected final <T> OrderedConfiguration<T> mockOrderedConfiguration()

mockResource

protected final Resource mockResource()

mockRunnable

protected final Runnable mockRunnable()
Frequently used as a placeholder for an arbitrary service (but its nice and simple).


mockServiceBuilderResources

protected final ServiceBuilderResources mockServiceBuilderResources()

mockServiceDecorator

protected final ServiceDecorator mockServiceDecorator()

mockServiceDef

protected final ServiceDef mockServiceDef()

mockObjectLocator

protected final ObjectLocator mockObjectLocator()

mockServiceResources

protected final ServiceResources mockServiceResources()

mockSymbolSource

protected final SymbolSource mockSymbolSource()

mockThreadLocale

protected final ThreadLocale mockThreadLocale()

mockTypeCoercer

protected final TypeCoercer mockTypeCoercer()

stub_contains

protected final void stub_contains(Messages messages,
                                   boolean contained)

train_coerce

protected <S,T> void train_coerce(TypeCoercer coercer,
                                  S input,
                                  Class<T> expectedType,
                                  T coercedValue)

train_contains

protected final void train_contains(Messages messages,
                                    String key,
                                    boolean result)

train_createInterceptor

protected final void train_createInterceptor(ServiceDecorator decorator,
                                             Object coreObject,
                                             Object interceptor)

train_createObject

protected final void train_createObject(ObjectCreator creator,
                                        Object service)

train_expandSymbols

protected final void train_expandSymbols(SymbolSource source,
                                         String input)

train_expandSymbols

protected final void train_expandSymbols(SymbolSource source,
                                         String input,
                                         String expanded)

train_forFile

protected final void train_forFile(Resource resource,
                                   String relativePath,
                                   Resource file)

train_forLocale

protected final void train_forLocale(Resource base,
                                     Locale locale,
                                     Resource resource)

train_format

protected void train_format(MessageFormatter formatter,
                            String result,
                            Object... arguments)
Have to put the result before the varargs.


train_get

protected final void train_get(Messages messages,
                               String key,
                               String message)

train_getLocale

protected final void train_getLocale(ThreadLocale threadLocale,
                                     Locale locale)

train_getLogger

protected final void train_getLogger(LoggerSource source,
                                     String serviceId,
                                     org.slf4j.Logger logger)

train_getMessageFormatter

protected final void train_getMessageFormatter(Messages messages,
                                               String key,
                                               MessageFormatter formatter)

train_getPath

protected final void train_getPath(Resource r,
                                   String path)

train_getService

protected final <T> void train_getService(ObjectLocator locator,
                                          Class<T> serviceInterface,
                                          T service)

train_getService

protected final <T> void train_getService(ObjectLocator locator,
                                          String serviceId,
                                          Class<T> serviceInterface,
                                          T service)

train_getServiceId

protected final void train_getServiceId(ServiceDef def,
                                        String serviceId)

train_getServiceId

protected final void train_getServiceId(ServiceResources resources,
                                        String serviceId)

train_getServiceInterface

protected final void train_getServiceInterface(ServiceDef def,
                                               Class serviceInterface)

train_getServiceInterface

protected final void train_getServiceInterface(ServiceResources resources,
                                               Class serviceInterface)

train_getLogger

protected final void train_getLogger(ServiceResources resources,
                                     org.slf4j.Logger log)

train_isDebugEnabled

protected final void train_isDebugEnabled(org.slf4j.Logger log,
                                          boolean debugEnabled)

train_isTraceEnabled

protected final void train_isTraceEnabled(org.slf4j.Logger log,
                                          boolean traceEnabled)

train_matches

protected final void train_matches(DecoratorDef decoratorDef,
                                   ServiceDef serviceDef,
                                   boolean matches)

train_matches

protected final void train_matches(AdvisorDef advisorDef,
                                   ServiceDef serviceDef,
                                   boolean matches)

train_provide

protected final <T> void train_provide(ObjectProvider provider,
                                       Class<T> objectType,
                                       AnnotationProvider annotationProvider,
                                       ObjectLocator locator,
                                       T object)

train_toURL

protected final void train_toURL(Resource resource,
                                 URL url)

train_getAnnotation

protected final <T extends Annotation> void train_getAnnotation(AnnotationProvider annotationProvider,
                                                                Class<T> annotationClass,
                                                                T annotation)

mockMasterObjectProvider

protected final MasterObjectProvider mockMasterObjectProvider()

train_value

protected final void train_value(IntermediateType it,
                                 Class value)

newIntermediateType

protected final IntermediateType newIntermediateType()

mockPropertyAdapter

protected final PropertyAdapter mockPropertyAdapter()

mockClassPropertyAdapter

protected final ClassPropertyAdapter mockClassPropertyAdapter()

mockPropertyAccess

protected final PropertyAccess mockPropertyAccess()

train_autobuild

protected final <T> void train_autobuild(ObjectLocator locator,
                                         Class<T> beanClass,
                                         T instance)

mockPerthreadManager

protected final PerthreadManager mockPerthreadManager()

mockServiceResources

protected final ServiceResources mockServiceResources(OperationTracker tracker)

train_getTracker

protected final void train_getTracker(ServiceResources resources,
                                      OperationTracker tracker)

mockServiceBuilderResources

protected final ServiceBuilderResources mockServiceBuilderResources(OperationTracker tracker)

train_valueForSymbol

protected final void train_valueForSymbol(SymbolSource symbolSource,
                                          String symbolName,
                                          String value)

touch

protected final void touch(File f)
                    throws Exception
Touches the file, changing the last modified time to the current time. Does not return until the last modified time for the file actually changes (how long that takes is JDK, OS and file system dependent).

Throws:
Exception


Copyright © 2003-2012 The Apache Software Foundation.