After I reinstalled Eclipse and upgraded all the tools, plugs, and dependencies, for some reason, load-time weaving in collaboration with `@Configurable' no longer works for me.
This is my test class:
This is `ConfigurableTest-context.xml':Code:@RunWith(SpringJUnit4ClassRunner.class) @ContextConfiguration public class ConfigurableTest { @Configurable public static class MyConfigurable { @Resource ApplicationContext context; } @Test public void testConfigurable() { MyConfigurable conf = new MyConfigurable(); assertThat(conf.context, not(nil())); } }
JVM args when running the test are `-javaagent:spring-instrument-3.1.1.RELEASE.jar'. In addition, I use AspectJ version 1.6.12.Code:<beans xmlns="http://www.springframework.org/schema/beans" xmlns:aop="http://www.springframework.org/schema/aop" xmlns:context="http://www.springframework.org/schema/context" xmlns:tx="http://www.springframework.org/schema/tx" xmlns:util="http://www.springframework.org/schema/util" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.5.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-2.5.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.5.xsd http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-2.0.xsd"> <context:load-time-weaver/> <context:spring-configured/> </beans>
The test fails---`conf.context' remains `null'.
So what am I missing?
Regards,
Phil


Reply With Quote