Skip to content

Commit b2c723a

Browse files
committed
[SPR-5916] polishing.
1 parent fc79d98 commit b2c723a

File tree

1 file changed

+9
-11
lines changed
  • org.springframework.test/src/main/java/org/springframework/test/context

1 file changed

+9
-11
lines changed

org.springframework.test/src/main/java/org/springframework/test/context/TestContext.java

+9-11
Original file line numberDiff line numberDiff line change
@@ -141,11 +141,10 @@ public class TestContext extends AttributeAccessorSupport {
141141
* <li>If a <code>loader</code> class is not specified, the class hierarchy
142142
* will be traversed to find a parent class annotated with
143143
* <code>&#064;ContextConfiguration</code>; go to step #1.</li>
144+
* <li>If no explicit <code>loader</code> class is found after traversing
145+
* the class hierarchy, an attempt will be made to load and return the class
146+
* with the supplied <code>defaultContextLoaderClassName</code>.</li>
144147
* </ol>
145-
* <p>
146-
* If no explicit <code>loader</code> class is found after traversing the
147-
* class hierarchy, an attempt will be made to load and return the class
148-
* with the supplied <code>defaultContextLoaderClassName</code>.
149148
*
150149
* @param clazz the class for which to retrieve <code>ContextLoader</code>
151150
* class; must not be <code>null</code>
@@ -270,16 +269,16 @@ else if (!ObjectUtils.isEmpty(valueLocations)) {
270269
}
271270

272271
/**
273-
* Build an ApplicationContext for this test context using the configured
274-
* ContextLoader and resource locations.
272+
* Load an <code>ApplicationContext</code> for this test context using the
273+
* configured <code>ContextLoader</code> and resource locations.
275274
*
276-
* @throws Exception if an error occurs while building the application
275+
* @throws Exception if an error occurs while loading the application
277276
* context
278277
*/
279278
private ApplicationContext loadApplicationContext() throws Exception {
280-
Assert.notNull(this.contextLoader, "Can not build an ApplicationContext with a NULL 'contextLoader'. "
279+
Assert.notNull(this.contextLoader, "Can not load an ApplicationContext with a NULL 'contextLoader'. "
281280
+ "Consider annotating your test class with @ContextConfiguration.");
282-
Assert.notNull(this.locations, "Can not build an ApplicationContext with a NULL 'locations' array. "
281+
Assert.notNull(this.locations, "Can not load an ApplicationContext with a NULL 'locations' array. "
283282
+ "Consider annotating your test class with @ContextConfiguration.");
284283
return this.contextLoader.loadContext(this.locations);
285284
}
@@ -296,8 +295,7 @@ private String contextKeyString(Serializable key) {
296295
* Get the {@link ApplicationContext application context} for this test
297296
* context, possibly cached.
298297
*
299-
* @return the application context; may be <code>null</code> if the current
300-
* test context is not configured to use an application context
298+
* @return the application context
301299
* @throws IllegalStateException if an error occurs while retrieving the
302300
* application context
303301
*/

0 commit comments

Comments
 (0)