1
1
/*
2
- * Copyright 2002-2009 the original author or authors.
2
+ * Copyright 2002-2011 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.
16
16
17
17
package org .springframework .web .servlet .view ;
18
18
19
- import static org .junit .Assert .assertEquals ;
20
- import static org .junit .Assert .assertNull ;
21
- import static org .junit .Assert .assertSame ;
22
- import static org .junit .Assert .assertTrue ;
23
- import static org .junit .Assert .fail ;
24
-
25
19
import java .util .HashMap ;
26
20
import java .util .Locale ;
27
21
import java .util .Map ;
28
22
import java .util .Properties ;
29
23
import java .util .concurrent .atomic .AtomicInteger ;
30
-
31
24
import javax .servlet .RequestDispatcher ;
32
25
import javax .servlet .ServletContext ;
33
26
import javax .servlet .ServletException ;
39
32
import javax .servlet .jsp .jstl .fmt .LocalizationContext ;
40
33
41
34
import org .junit .Test ;
35
+
42
36
import org .springframework .beans .MutablePropertyValues ;
43
37
import org .springframework .beans .PropertyValue ;
44
38
import org .springframework .beans .TestBean ;
59
53
import org .springframework .web .servlet .support .RequestContext ;
60
54
import org .springframework .web .servlet .theme .FixedThemeResolver ;
61
55
56
+ import static org .junit .Assert .*;
57
+
62
58
/**
63
59
* @author Juergen Hoeller
64
60
* @author Chris Beams
@@ -499,7 +495,7 @@ public void testCacheRemoval() throws Exception {
499
495
vr .removeFromCache ("example1" , Locale .getDefault ());
500
496
cached = vr .resolveViewName ("example1" , Locale .getDefault ());
501
497
if (view == cached ) {
502
- // the chance of having the same reference (hashCode) twice if negligable ).
498
+ // the chance of having the same reference (hashCode) twice if negligible ).
503
499
fail ("View wasn't removed from cache" );
504
500
}
505
501
}
@@ -526,10 +522,14 @@ protected View loadView(String viewName, Locale locale) throws Exception {
526
522
527
523
viewResolver .resolveViewName ("view" , Locale .getDefault ());
528
524
viewResolver .resolveViewName ("view" , Locale .getDefault ());
529
-
530
- assertEquals (2 , count .intValue ());
525
+ viewResolver .resolveViewName ("view" , Locale .getDefault ());
526
+ viewResolver .resolveViewName ("view" , Locale .getDefault ());
527
+ viewResolver .resolveViewName ("view" , Locale .getDefault ());
528
+
529
+ assertEquals (3 , count .intValue ());
531
530
}
532
531
532
+
533
533
public static class TestView extends InternalResourceView {
534
534
535
535
public void setLocation (Resource location ) {
0 commit comments