use of org.springframework.core.io.DefaultResourceLoader in project spring-framework by spring-projects.
the class CallbacksSecurityTests method setUp.
@Before
public void setUp() throws Exception {
final ProtectionDomain empty = new ProtectionDomain(null, new Permissions());
provider = new SecurityContextProvider() {
private final AccessControlContext acc = new AccessControlContext(new ProtectionDomain[] { empty });
@Override
public AccessControlContext getAccessControlContext() {
return acc;
}
};
DefaultResourceLoader drl = new DefaultResourceLoader();
Resource config = drl.getResource("/org/springframework/beans/factory/support/security/callbacks.xml");
beanFactory = new DefaultListableBeanFactory();
new XmlBeanDefinitionReader(beanFactory).loadBeanDefinitions(config);
beanFactory.setSecurityContextProvider(provider);
}
use of org.springframework.core.io.DefaultResourceLoader in project spring-boot by spring-projects.
the class SpringApplicationBuilderTests method parentContextWithClassLoader.
@Test
public void parentContextWithClassLoader() throws Exception {
SpringApplicationBuilder application = new SpringApplicationBuilder(ChildConfig.class).contextClass(SpyApplicationContext.class);
ClassLoader classLoader = new URLClassLoader(new URL[0], getClass().getClassLoader());
application.resourceLoader(new DefaultResourceLoader(classLoader));
application.parent(ExampleConfig.class);
this.context = application.run();
assertThat(((SpyApplicationContext) this.context).getResourceLoader().getClassLoader()).isEqualTo(classLoader);
}
use of org.springframework.core.io.DefaultResourceLoader in project spring-boot by spring-projects.
the class AutoConfigurationImportSelectorTests method setup.
@Before
public void setup() {
MockitoAnnotations.initMocks(this);
this.importSelector.setBeanFactory(this.beanFactory);
this.importSelector.setEnvironment(this.environment);
this.importSelector.setResourceLoader(new DefaultResourceLoader());
}
use of org.springframework.core.io.DefaultResourceLoader in project spring-boot by spring-projects.
the class ImportAutoConfigurationImportSelectorTests method setup.
@Before
public void setup() {
MockitoAnnotations.initMocks(this);
this.importSelector.setBeanFactory(this.beanFactory);
this.importSelector.setEnvironment(this.environment);
this.importSelector.setResourceLoader(new DefaultResourceLoader());
}
use of org.springframework.core.io.DefaultResourceLoader in project spring-framework by spring-projects.
the class DefaultPersistenceUnitManagerTests method defaultDomainWithScan.
@Test
public void defaultDomainWithScan() {
this.manager.setPackagesToScan("org.springframework.orm.jpa.domain");
this.manager.setResourceLoader(new DefaultResourceLoader(CandidateComponentsTestClassLoader.disableIndex(getClass().getClassLoader())));
testDefaultDomain();
}
Aggregations