Description
Jason Novak opened SPR-5916 and commented
TestContext supports inheritance of @ContextConfiguration
's "locations", but not "loader". This is unfortunate because I use a special ContextLoader to override bean definitions.
Suppose I have 2 test classes:
@ContextConfiguration
(loader = FooContextLoader.class, locations = { "Parent.xml" })
public abstract class AbstractParentTest { ... };
@ContextConfiguration
// implicitly loads default location.
public class ConcreteChildTest extends AbstractParentTest { ... };
I want ConcreteChildTest to load beans from both Parent.xml and the default location(s), and inherit the ContextLoader from AbstractParentTest.
If I specify a custom loader in AbstractParentTest, it only takes effect if I remove the @ContextConfiguration
attribute from ConcreteChildTest.
But if I remove the @ContextConfiguration
attribute from ConcreteChildTest, Spring will only load beans from Parent.xml, ignoring the child's default location. =)
Affects: 2.5.6