Java Code Examples for org.springframework.test.context.ContextConfigurationAttributes#setLocations()

The following examples show how to use org.springframework.test.context.ContextConfigurationAttributes#setLocations() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: AbstractContextLoader.java    From spring-analysis-note with MIT License 3 votes vote down vote up
/**
 * For backwards compatibility with the {@link ContextLoader} SPI, the
 * default implementation simply delegates to {@link #processLocations(Class, String...)},
 * passing it the {@link ContextConfigurationAttributes#getDeclaringClass()
 * declaring class} and {@link ContextConfigurationAttributes#getLocations()
 * resource locations} retrieved from the supplied
 * {@link ContextConfigurationAttributes configuration attributes}. The
 * processed locations are then
 * {@link ContextConfigurationAttributes#setLocations(String[]) set} in
 * the supplied configuration attributes.
 * <p>Can be overridden in subclasses &mdash; for example, to process
 * annotated classes instead of resource locations.
 * @since 3.1
 * @see #processLocations(Class, String...)
 */
@Override
public void processContextConfiguration(ContextConfigurationAttributes configAttributes) {
	String[] processedLocations =
			processLocations(configAttributes.getDeclaringClass(), configAttributes.getLocations());
	configAttributes.setLocations(processedLocations);
}
 
Example 2
Source File: AbstractContextLoader.java    From java-technology-stack with MIT License 3 votes vote down vote up
/**
 * For backwards compatibility with the {@link ContextLoader} SPI, the
 * default implementation simply delegates to {@link #processLocations(Class, String...)},
 * passing it the {@link ContextConfigurationAttributes#getDeclaringClass()
 * declaring class} and {@link ContextConfigurationAttributes#getLocations()
 * resource locations} retrieved from the supplied
 * {@link ContextConfigurationAttributes configuration attributes}. The
 * processed locations are then
 * {@link ContextConfigurationAttributes#setLocations(String[]) set} in
 * the supplied configuration attributes.
 * <p>Can be overridden in subclasses &mdash; for example, to process
 * annotated classes instead of resource locations.
 * @since 3.1
 * @see #processLocations(Class, String...)
 */
@Override
public void processContextConfiguration(ContextConfigurationAttributes configAttributes) {
	String[] processedLocations =
			processLocations(configAttributes.getDeclaringClass(), configAttributes.getLocations());
	configAttributes.setLocations(processedLocations);
}
 
Example 3
Source File: AbstractContextLoader.java    From spring4-understanding with Apache License 2.0 3 votes vote down vote up
/**
 * For backwards compatibility with the {@link ContextLoader} SPI, the
 * default implementation simply delegates to {@link #processLocations(Class, String...)},
 * passing it the {@link ContextConfigurationAttributes#getDeclaringClass()
 * declaring class} and {@link ContextConfigurationAttributes#getLocations()
 * resource locations} retrieved from the supplied
 * {@link ContextConfigurationAttributes configuration attributes}. The
 * processed locations are then
 * {@link ContextConfigurationAttributes#setLocations(String[]) set} in
 * the supplied configuration attributes.
 * <p>Can be overridden in subclasses &mdash; for example, to process
 * annotated classes instead of resource locations.
 * @since 3.1
 * @see #processLocations(Class, String...)
 */
@Override
public void processContextConfiguration(ContextConfigurationAttributes configAttributes) {
	String[] processedLocations = processLocations(configAttributes.getDeclaringClass(),
		configAttributes.getLocations());
	configAttributes.setLocations(processedLocations);
}