|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.springframework.test.context.MergedContextConfiguration
public class MergedContextConfiguration
MergedContextConfiguration
encapsulates the merged
context configuration declared on a test class and all of its superclasses
via @ContextConfiguration
and
@ActiveProfiles
.
Merged resource locations, configuration classes, and active profiles
represent all declared values in the test class hierarchy taking into
consideration the semantics of the
inheritLocations
and
inheritProfiles
flags in
@ContextConfiguration
and @ActiveProfiles
, respectively.
A SmartContextLoader
uses MergedContextConfiguration
to load an ApplicationContext
.
MergedContextConfiguration
is also used by the TestContext
as the context cache key for caching an
ApplicationContext
that was loaded using properties of this MergedContextConfiguration
.
ContextConfiguration
,
ActiveProfiles
,
ContextConfigurationAttributes
,
SmartContextLoader.loadContext(MergedContextConfiguration)
,
Serialized FormField Summary | |
---|---|
private java.lang.String[] |
activeProfiles
|
private java.lang.Class<?>[] |
classes
|
private ContextLoader |
contextLoader
|
private static java.lang.Class<?>[] |
EMPTY_CLASS_ARRAY
|
private static java.lang.String[] |
EMPTY_STRING_ARRAY
|
private java.lang.String[] |
locations
|
private static long |
serialVersionUID
|
private java.lang.Class<?> |
testClass
|
Constructor Summary | |
---|---|
MergedContextConfiguration(java.lang.Class<?> testClass,
java.lang.String[] locations,
java.lang.Class<?>[] classes,
java.lang.String[] activeProfiles,
ContextLoader contextLoader)
Create a new MergedContextConfiguration instance for the
supplied test class , resource locations, configuration
classes, active profiles, and ContextLoader . |
Method Summary | |
---|---|
boolean |
equals(java.lang.Object obj)
Determine if the supplied object is equal to this MergedContextConfiguration
instance by comparing both object's locations ,
configuration classes , active profiles , and the fully qualified names of their
ContextLoaders . |
java.lang.String[] |
getActiveProfiles()
Get the merged active bean definition profiles for the test class . |
java.lang.Class<?>[] |
getClasses()
Get the merged configuration classes for the test class . |
ContextLoader |
getContextLoader()
Get the resolved ContextLoader for the
test class . |
java.lang.String[] |
getLocations()
Get the merged resource locations for the test class . |
java.lang.Class<?> |
getTestClass()
Get the test class associated with this
MergedContextConfiguration . |
int |
hashCode()
Generate a unique hash code for all properties of this MergedContextConfiguration excluding the
test class . |
private static java.lang.String |
nullSafeToString(ContextLoader contextLoader)
Generate a null-safe String representation of the supplied
ContextLoader based solely on the fully qualified name of the
loader or "null" if the supplied loaded is null . |
private static java.lang.String[] |
processActiveProfiles(java.lang.String[] activeProfiles)
|
private static java.lang.Class<?>[] |
processClasses(java.lang.Class<?>[] classes)
|
private static java.lang.String[] |
processLocations(java.lang.String[] locations)
|
java.lang.String |
toString()
Provide a String representation of the test class ,
locations , configuration classes ,
active profiles , and the name of the
ContextLoader . |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
private static final long serialVersionUID
private static final java.lang.String[] EMPTY_STRING_ARRAY
private static final java.lang.Class<?>[] EMPTY_CLASS_ARRAY
private final java.lang.Class<?> testClass
private final java.lang.String[] locations
private final java.lang.Class<?>[] classes
private final java.lang.String[] activeProfiles
private final ContextLoader contextLoader
Constructor Detail |
---|
public MergedContextConfiguration(java.lang.Class<?> testClass, java.lang.String[] locations, java.lang.Class<?>[] classes, java.lang.String[] activeProfiles, ContextLoader contextLoader)
MergedContextConfiguration
instance for the
supplied test class
, resource locations, configuration
classes, active profiles, and ContextLoader
.
If a null
value is supplied for locations
,
classes
, or activeProfiles
an empty array will
be stored instead. Furthermore, active profiles will be sorted, and duplicate
profiles will be removed.
testClass
- the test class for which the configuration was mergedlocations
- the merged resource locationsclasses
- the merged configuration classesactiveProfiles
- the merged active bean definition profilescontextLoader
- the resolved ContextLoader
Method Detail |
---|
private static java.lang.String[] processLocations(java.lang.String[] locations)
private static java.lang.Class<?>[] processClasses(java.lang.Class<?>[] classes)
private static java.lang.String[] processActiveProfiles(java.lang.String[] activeProfiles)
private static java.lang.String nullSafeToString(ContextLoader contextLoader)
String
representation of the supplied
ContextLoader
based solely on the fully qualified name of the
loader or "null" if the supplied loaded is null
.
public java.lang.Class<?> getTestClass()
test class
associated with this
MergedContextConfiguration
.
public java.lang.String[] getLocations()
test class
.
public java.lang.Class<?>[] getClasses()
test class
.
public java.lang.String[] getActiveProfiles()
test class
.
public ContextLoader getContextLoader()
ContextLoader
for the
test class
.
public int hashCode()
MergedContextConfiguration
excluding the
test class
.
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object obj)
MergedContextConfiguration
instance by comparing both object's locations
,
configuration classes
, active profiles
, and the fully qualified names of their
ContextLoaders
.
equals
in class java.lang.Object
public java.lang.String toString()
test class
,
locations
, configuration classes
,
active profiles
, and the name of the
ContextLoader
.
toString
in class java.lang.Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |