[SPR-6184] Work in Progress
This commit is contained in:
parent
fa48a7b3a3
commit
b50338fd32
|
|
@ -48,19 +48,28 @@ public @interface ContextConfiguration {
|
||||||
/**
|
/**
|
||||||
* The resource locations to use for loading an
|
* The resource locations to use for loading an
|
||||||
* {@link org.springframework.context.ApplicationContext ApplicationContext}.
|
* {@link org.springframework.context.ApplicationContext ApplicationContext}.
|
||||||
* <p>Check out {@link org.springframework.test.context.support.AbstractContextLoader#modifyLocations)}'s
|
* <p>Check out the javadoc for {@link org.springframework.test.context.support.AbstractContextLoader#modifyLocations AbstractContextLoader.modifyLocations()}
|
||||||
* javadoc for details on how a location String will be interpreted at runtime,
|
* for details on how a location String will be interpreted at runtime,
|
||||||
* in particular in case of a relative path. Also, check out the documentation on
|
* in particular in case of a relative path. Also, check out the documentation on
|
||||||
* {@link org.springframework.test.context.support.AbstractContextLoader#generateDefaultLocations}
|
* {@link org.springframework.test.context.support.AbstractContextLoader#generateDefaultLocations AbstractContextLoader.generateDefaultLocations()}
|
||||||
* for details on the default locations that are going to be used if none are specified.
|
* for details on the default locations that are going to be used if none are specified.
|
||||||
* <p>Note that the above-mentioned default rules only apply for a standard
|
* <p>Note that the above-mentioned default rules only apply for a standard
|
||||||
* {@link org.springframework.test.context.support.AbstractContextLoader} subclass
|
* {@link org.springframework.test.context.support.AbstractContextLoader AbstractContextLoader} subclass
|
||||||
* such as {@link org.springframework.test.context.support.GenericXmlContextLoader}
|
* such as {@link org.springframework.test.context.support.GenericXmlContextLoader GenericXmlContextLoader}
|
||||||
* which is the effective default implementation used at runtime.
|
* which is the effective default implementation used at runtime.
|
||||||
*/
|
*/
|
||||||
String[] locations() default {};
|
String[] locations() default {};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* TODO Document classes().
|
||||||
|
*
|
||||||
|
* @since 3.1
|
||||||
|
*/
|
||||||
|
Class<?>[] classes() default {};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* TODO Update documentation regarding classes vs. locations.
|
||||||
|
*
|
||||||
* Whether or not {@link #locations() resource locations} from superclasses
|
* Whether or not {@link #locations() resource locations} from superclasses
|
||||||
* should be <em>inherited</em>.
|
* should be <em>inherited</em>.
|
||||||
* <p>The default value is <code>true</code>, which means that an annotated
|
* <p>The default value is <code>true</code>, which means that an annotated
|
||||||
|
|
@ -100,8 +109,8 @@ public @interface ContextConfiguration {
|
||||||
* an explicit loader. If no class in the hierarchy specifies an explicit
|
* an explicit loader. If no class in the hierarchy specifies an explicit
|
||||||
* loader, a default loader will be used instead.
|
* loader, a default loader will be used instead.
|
||||||
* <p>The default concrete implementation chosen at runtime will be
|
* <p>The default concrete implementation chosen at runtime will be
|
||||||
* {@link org.springframework.test.context.support.GenericXmlContextLoader}.
|
* {@link org.springframework.test.context.support.GenericXmlContextLoader GenericXmlContextLoader}.
|
||||||
* Also check out {@link org.springframework.test.context.support.AbstractContextLoader}'s
|
* Also check out {@link org.springframework.test.context.support.AbstractContextLoader AbstractContextLoader}'s
|
||||||
* javadoc for details on the default behavior there.
|
* javadoc for details on the default behavior there.
|
||||||
*/
|
*/
|
||||||
Class<? extends ContextLoader> loader() default ContextLoader.class;
|
Class<? extends ContextLoader> loader() default ContextLoader.class;
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,33 @@
|
||||||
|
/*
|
||||||
|
* Copyright 2011 the original author or authors.
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package org.springframework.test.context.junit4;
|
||||||
|
|
||||||
|
import org.junit.Ignore;
|
||||||
|
import org.springframework.test.context.ContextConfiguration;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* TODO [SPR-6184] Document ConfigurationClassSpringJUnit4ClassRunnerAppCtxTests.
|
||||||
|
*
|
||||||
|
* @author Sam Brannen
|
||||||
|
* @since 3.1
|
||||||
|
*/
|
||||||
|
@Ignore("[SPR-6184] Work in Progress")
|
||||||
|
// TODO [SPR-6184] Set ContextLoader: ConfigurationClassContextLoader.class.
|
||||||
|
@ContextConfiguration(classes = ConfigurationClassSpringJUnit4ClassRunnerAppCtxTestsConfig.class, inheritLocations = false)
|
||||||
|
public class ConfigurationClassSpringJUnit4ClassRunnerAppCtxTests extends SpringJUnit4ClassRunnerAppCtxTests {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,56 @@
|
||||||
|
/*
|
||||||
|
* Copyright 2011 the original author or authors.
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package org.springframework.test.context.junit4;
|
||||||
|
|
||||||
|
import org.springframework.beans.Employee;
|
||||||
|
import org.springframework.context.annotation.Bean;
|
||||||
|
import org.springframework.context.annotation.Configuration;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* TODO [SPR-6184] Document configuration class.
|
||||||
|
*
|
||||||
|
* @author Sam Brannen
|
||||||
|
* @since 3.1
|
||||||
|
*/
|
||||||
|
@Configuration
|
||||||
|
public class ConfigurationClassSpringJUnit4ClassRunnerAppCtxTestsConfig {
|
||||||
|
|
||||||
|
@Bean
|
||||||
|
public Employee employee() {
|
||||||
|
Employee employee = new Employee();
|
||||||
|
employee.setName("John Smith");
|
||||||
|
employee.setAge(42);
|
||||||
|
employee.setCompany("Acme Widgets, Inc.");
|
||||||
|
return employee;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Bean
|
||||||
|
public String foo() {
|
||||||
|
return "Foo";
|
||||||
|
}
|
||||||
|
|
||||||
|
@Bean
|
||||||
|
public String bar() {
|
||||||
|
return "Bar";
|
||||||
|
}
|
||||||
|
|
||||||
|
@Bean
|
||||||
|
public String quux() {
|
||||||
|
return "Quux";
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue