|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.springframework.test.context.ContextConfigurationAttributes
public class ContextConfigurationAttributes
ContextConfigurationAttributes encapsulates the context
configuration attributes declared on a test class via
@ContextConfiguration.
ContextConfiguration,
SmartContextLoader.processContextConfiguration(ContextConfigurationAttributes),
MergedContextConfiguration| Constructor Summary | |
|---|---|
ContextConfigurationAttributes(Class<?> declaringClass,
ContextConfiguration contextConfiguration)
Construct a new ContextConfigurationAttributes instance for the
supplied @ContextConfiguration annotation and
the test class that declared it. |
|
ContextConfigurationAttributes(Class<?> declaringClass,
String[] locations,
Class<?>[] classes,
boolean inheritLocations,
Class<? extends ContextLoader> contextLoaderClass)
Construct a new ContextConfigurationAttributes instance for the
test class that declared the
@ContextConfiguration annotation and its
corresponding attributes. |
|
| Method Summary | |
|---|---|
Class<?>[] |
getClasses()
Get the configuration classes that were declared via @ContextConfiguration. |
Class<? extends ContextLoader> |
getContextLoaderClass()
Get the ContextLoader class that was declared via
@ContextConfiguration. |
Class<?> |
getDeclaringClass()
Get the class that declared the
@ContextConfiguration annotation. |
String[] |
getLocations()
Get the resource locations that were declared via @ContextConfiguration. |
boolean |
hasClasses()
Determine if this ContextConfigurationAttributes instance has
class-based resources. |
boolean |
hasLocations()
Determine if this ContextConfigurationAttributes instance has
path-based resource locations. |
boolean |
hasResources()
Determine if this ContextConfigurationAttributes instance has
either path-based resource locations or class-based resources. |
boolean |
isInheritLocations()
Get the inheritLocations flag that was declared via
@ContextConfiguration. |
void |
setClasses(Class<?>[] classes)
Set the processed configuration classes, effectively overriding the original value declared via @ContextConfiguration. |
void |
setLocations(String[] locations)
Set the processed resource locations, effectively overriding the original value declared via @ContextConfiguration. |
String |
toString()
Provide a String representation of the context configuration attributes and declaring class. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public ContextConfigurationAttributes(Class<?> declaringClass,
ContextConfiguration contextConfiguration)
ContextConfigurationAttributes instance for the
supplied @ContextConfiguration annotation and
the test class that declared it.
declaringClass - the test class that declared @ContextConfigurationcontextConfiguration - the annotation from which to retrieve the attributes
public ContextConfigurationAttributes(Class<?> declaringClass,
String[] locations,
Class<?>[] classes,
boolean inheritLocations,
Class<? extends ContextLoader> contextLoaderClass)
ContextConfigurationAttributes instance for the
test class that declared the
@ContextConfiguration annotation and its
corresponding attributes.
declaringClass - the test class that declared @ContextConfigurationlocations - the resource locations declared via @ContextConfigurationclasses - the configuration classes declared via @ContextConfigurationinheritLocations - the inheritLocations flag declared via @ContextConfigurationcontextLoaderClass - the ContextLoader class declared via @ContextConfiguration
IllegalArgumentException - if the declaringClass or contextLoaderClass is
null, or if the locations and classes are both non-empty| Method Detail |
|---|
public Class<?> getDeclaringClass()
class that declared the
@ContextConfiguration annotation.
nullpublic String[] getLocations()
@ContextConfiguration.
Note: this is a mutable property. The returned value may therefore
represent a processed value that does not match the original value
declared via @ContextConfiguration.
null or emptyContextConfiguration.value(),
ContextConfiguration.locations(),
#setLocations()public void setLocations(String[] locations)
@ContextConfiguration.
getLocations()public Class<?>[] getClasses()
@ContextConfiguration.
Note: this is a mutable property. The returned value may therefore
represent a processed value that does not match the original value
declared via @ContextConfiguration.
null or emptyContextConfiguration.classes(),
#setClasses()public void setClasses(Class<?>[] classes)
@ContextConfiguration.
getClasses()public boolean hasLocations()
ContextConfigurationAttributes instance has
path-based resource locations.
true if the locations array is not emptyhasResources(),
hasClasses()public boolean hasClasses()
ContextConfigurationAttributes instance has
class-based resources.
true if the classes array is not emptyhasResources(),
hasLocations()public boolean hasResources()
ContextConfigurationAttributes instance has
either path-based resource locations or class-based resources.
true if either the locations
or the classes array is not emptyhasLocations(),
hasClasses()public boolean isInheritLocations()
inheritLocations flag that was declared via
@ContextConfiguration.
inheritLocations flagContextConfiguration.inheritLocations()public Class<? extends ContextLoader> getContextLoaderClass()
ContextLoader class that was declared via
@ContextConfiguration.
ContextLoader classContextConfiguration.loader()public String toString()
toString in class Object
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||