1
1
/*
2
- * Copyright 2002-2020 the original author or authors.
2
+ * Copyright 2002-2022 the original author or authors.
3
3
*
4
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
5
* you may not use this file except in compliance with the License.
58
58
* @since 12.08.2003
59
59
* @see org.springframework.web.context.support.Spr8510Tests
60
60
*/
61
- public class ContextLoaderTests {
61
+ class ContextLoaderTests {
62
62
63
63
@ Test
64
- public void testContextLoaderListenerWithDefaultContext () {
64
+ void contextLoaderListenerWithDefaultContext () {
65
65
MockServletContext sc = new MockServletContext ("" );
66
66
sc .addInitParameter (ContextLoader .CONFIG_LOCATION_PARAM ,
67
67
"/org/springframework/web/context/WEB-INF/applicationContext.xml " +
@@ -95,7 +95,7 @@ public void testContextLoaderListenerWithDefaultContext() {
95
95
* context before calling refresh in ContextLoaders</em>.
96
96
*/
97
97
@ Test
98
- public void testContextLoaderListenerWithCustomizedContextLoader () {
98
+ void contextLoaderListenerWithCustomizedContextLoader () {
99
99
final StringBuffer buffer = new StringBuffer ();
100
100
final String expectedContents = "customizeContext() was called" ;
101
101
final MockServletContext sc = new MockServletContext ("" );
@@ -115,7 +115,7 @@ protected void customizeContext(ServletContext sc, ConfigurableWebApplicationCon
115
115
}
116
116
117
117
@ Test
118
- public void testContextLoaderListenerWithLocalContextInitializers () {
118
+ void contextLoaderListenerWithLocalContextInitializers () {
119
119
MockServletContext sc = new MockServletContext ("" );
120
120
sc .addInitParameter (ContextLoader .CONFIG_LOCATION_PARAM ,
121
121
"org/springframework/web/context/WEB-INF/ContextLoaderTests-acc-context.xml" );
@@ -130,7 +130,7 @@ public void testContextLoaderListenerWithLocalContextInitializers() {
130
130
}
131
131
132
132
@ Test
133
- public void testContextLoaderListenerWithGlobalContextInitializers () {
133
+ void contextLoaderListenerWithGlobalContextInitializers () {
134
134
MockServletContext sc = new MockServletContext ("" );
135
135
sc .addInitParameter (ContextLoader .CONFIG_LOCATION_PARAM ,
136
136
"org/springframework/web/context/WEB-INF/ContextLoaderTests-acc-context.xml" );
@@ -145,7 +145,7 @@ public void testContextLoaderListenerWithGlobalContextInitializers() {
145
145
}
146
146
147
147
@ Test
148
- public void testContextLoaderListenerWithMixedContextInitializers () {
148
+ void contextLoaderListenerWithMixedContextInitializers () {
149
149
MockServletContext sc = new MockServletContext ("" );
150
150
sc .addInitParameter (ContextLoader .CONFIG_LOCATION_PARAM ,
151
151
"org/springframework/web/context/WEB-INF/ContextLoaderTests-acc-context.xml" );
@@ -160,7 +160,7 @@ public void testContextLoaderListenerWithMixedContextInitializers() {
160
160
}
161
161
162
162
@ Test
163
- public void testContextLoaderListenerWithProgrammaticInitializers () {
163
+ void contextLoaderListenerWithProgrammaticInitializers () {
164
164
MockServletContext sc = new MockServletContext ("" );
165
165
sc .addInitParameter (ContextLoader .CONFIG_LOCATION_PARAM ,
166
166
"org/springframework/web/context/WEB-INF/ContextLoaderTests-acc-context.xml" );
@@ -174,7 +174,7 @@ public void testContextLoaderListenerWithProgrammaticInitializers() {
174
174
}
175
175
176
176
@ Test
177
- public void testContextLoaderListenerWithProgrammaticAndLocalInitializers () {
177
+ void contextLoaderListenerWithProgrammaticAndLocalInitializers () {
178
178
MockServletContext sc = new MockServletContext ("" );
179
179
sc .addInitParameter (ContextLoader .CONFIG_LOCATION_PARAM ,
180
180
"org/springframework/web/context/WEB-INF/ContextLoaderTests-acc-context.xml" );
@@ -189,7 +189,7 @@ public void testContextLoaderListenerWithProgrammaticAndLocalInitializers() {
189
189
}
190
190
191
191
@ Test
192
- public void testContextLoaderListenerWithProgrammaticAndGlobalInitializers () {
192
+ void contextLoaderListenerWithProgrammaticAndGlobalInitializers () {
193
193
MockServletContext sc = new MockServletContext ("" );
194
194
sc .addInitParameter (ContextLoader .CONFIG_LOCATION_PARAM ,
195
195
"org/springframework/web/context/WEB-INF/ContextLoaderTests-acc-context.xml" );
@@ -204,7 +204,7 @@ public void testContextLoaderListenerWithProgrammaticAndGlobalInitializers() {
204
204
}
205
205
206
206
@ Test
207
- public void testRegisteredContextInitializerCanAccessServletContextParamsViaEnvironment () {
207
+ void registeredContextInitializerCanAccessServletContextParamsViaEnvironment () {
208
208
MockServletContext sc = new MockServletContext ("" );
209
209
// config file doesn't matter - just a placeholder
210
210
sc .addInitParameter (ContextLoader .CONFIG_LOCATION_PARAM ,
@@ -218,7 +218,7 @@ public void testRegisteredContextInitializerCanAccessServletContextParamsViaEnvi
218
218
}
219
219
220
220
@ Test
221
- public void testContextLoaderListenerWithUnknownContextInitializer () {
221
+ void contextLoaderListenerWithUnknownContextInitializer () {
222
222
MockServletContext sc = new MockServletContext ("" );
223
223
// config file doesn't matter. just a placeholder
224
224
sc .addInitParameter (ContextLoader .CONFIG_LOCATION_PARAM ,
@@ -232,7 +232,7 @@ public void testContextLoaderListenerWithUnknownContextInitializer() {
232
232
}
233
233
234
234
@ Test
235
- public void testContextLoaderWithCustomContext () throws Exception {
235
+ void contextLoaderWithCustomContext () throws Exception {
236
236
MockServletContext sc = new MockServletContext ("" );
237
237
sc .addInitParameter (ContextLoader .CONTEXT_CLASS_PARAM ,
238
238
"org.springframework.web.servlet.SimpleWebApplicationContext" );
@@ -246,7 +246,7 @@ public void testContextLoaderWithCustomContext() throws Exception {
246
246
}
247
247
248
248
@ Test
249
- public void testContextLoaderWithInvalidLocation () throws Exception {
249
+ void contextLoaderWithInvalidLocation () throws Exception {
250
250
MockServletContext sc = new MockServletContext ("" );
251
251
sc .addInitParameter (ContextLoader .CONFIG_LOCATION_PARAM , "/WEB-INF/myContext.xml" );
252
252
ServletContextListener listener = new ContextLoaderListener ();
@@ -257,7 +257,7 @@ public void testContextLoaderWithInvalidLocation() throws Exception {
257
257
}
258
258
259
259
@ Test
260
- public void testContextLoaderWithInvalidContext () throws Exception {
260
+ void contextLoaderWithInvalidContext () throws Exception {
261
261
MockServletContext sc = new MockServletContext ("" );
262
262
sc .addInitParameter (ContextLoader .CONTEXT_CLASS_PARAM ,
263
263
"org.springframework.web.context.support.InvalidWebApplicationContext" );
@@ -269,7 +269,7 @@ public void testContextLoaderWithInvalidContext() throws Exception {
269
269
}
270
270
271
271
@ Test
272
- public void testContextLoaderWithDefaultLocation () throws Exception {
272
+ void contextLoaderWithDefaultLocation () throws Exception {
273
273
MockServletContext sc = new MockServletContext ("" );
274
274
ServletContextListener listener = new ContextLoaderListener ();
275
275
ServletContextEvent event = new ServletContextEvent (sc );
@@ -281,7 +281,7 @@ public void testContextLoaderWithDefaultLocation() throws Exception {
281
281
}
282
282
283
283
@ Test
284
- public void testFrameworkServletWithDefaultLocation () throws Exception {
284
+ void frameworkServletWithDefaultLocation () throws Exception {
285
285
DispatcherServlet servlet = new DispatcherServlet ();
286
286
servlet .setContextClass (XmlWebApplicationContext .class );
287
287
assertThatExceptionOfType (BeanDefinitionStoreException .class )
@@ -292,7 +292,7 @@ public void testFrameworkServletWithDefaultLocation() throws Exception {
292
292
}
293
293
294
294
@ Test
295
- public void testFrameworkServletWithCustomLocation () throws Exception {
295
+ void frameworkServletWithCustomLocation () throws Exception {
296
296
DispatcherServlet servlet = new DispatcherServlet ();
297
297
servlet .setContextConfigLocation ("/org/springframework/web/context/WEB-INF/testNamespace.xml "
298
298
+ "/org/springframework/web/context/WEB-INF/context-addition.xml" );
@@ -303,7 +303,7 @@ public void testFrameworkServletWithCustomLocation() throws Exception {
303
303
304
304
@ Test
305
305
@ SuppressWarnings ("resource" )
306
- public void testClassPathXmlApplicationContext () throws IOException {
306
+ void classPathXmlApplicationContext () throws IOException {
307
307
ApplicationContext context = new ClassPathXmlApplicationContext (
308
308
"/org/springframework/web/context/WEB-INF/applicationContext.xml" );
309
309
assertThat (context .containsBean ("father" )).as ("Has father" ).isTrue ();
@@ -322,7 +322,7 @@ public void testClassPathXmlApplicationContext() throws IOException {
322
322
323
323
@ Test
324
324
@ SuppressWarnings ("resource" )
325
- public void testSingletonDestructionOnStartupFailure () throws IOException {
325
+ void singletonDestructionOnStartupFailure () throws IOException {
326
326
assertThatExceptionOfType (BeanCreationException .class ).isThrownBy (() ->
327
327
new ClassPathXmlApplicationContext (new String [] {
328
328
"/org/springframework/web/context/WEB-INF/applicationContext.xml" ,
0 commit comments