1 16 17 package org.springframework.test.jpa; 18 19 import org.aspectj.weaver.loadtime.ClassPreProcessorAgentAdapter; 20 21 import org.springframework.instrument.classloading.ResourceOverridingShadowingClassLoader; 22 23 32 public abstract class AbstractAspectjJpaTests extends AbstractJpaTests { 33 34 38 public static final String DEFAULT_AOP_XML_LOCATION = "META-INF/aop.xml"; 39 40 41 @Override 42 protected void customizeResourceOverridingShadowingClassLoader(ClassLoader shadowingClassLoader) { 43 ResourceOverridingShadowingClassLoader orxl = (ResourceOverridingShadowingClassLoader) shadowingClassLoader; 44 orxl.override(DEFAULT_AOP_XML_LOCATION, getActualAopXmlLocation()); 45 orxl.addTransformer(new ClassPreProcessorAgentAdapter()); 46 } 47 48 55 protected String getActualAopXmlLocation() { 56 return DEFAULT_AOP_XML_LOCATION; 57 } 58 59 } 60 | Popular Tags |