@ObjectFactory public IObjectFactory getObjectFactory(ITestContext context) throws Exception { Class<?> clazz = Class.forName("org.activejpa.enhancer.ActiveJpaAgentLoaderImpl"); Method method = clazz.getMethod("loadAgent"); method.invoke(null); return new ObjectFactoryImpl(); }
/** * Note: Kind of hack to ensure that ActiveJPAAgent instruments all the models before they are loaded. * * @param context * @return * @throws Exception */ @ObjectFactory public IObjectFactory getObjectFactory(ITestContext context) throws Exception { ActiveJpaAgentLoader.instance().loadAgent(); return new ObjectFactoryImpl(); }