Permalink
Browse files

whitespace, cleanup

  • Loading branch information...
1 parent bf73db7 commit 0d6d250981952499b7284086403f75ccdd450f94 Burt Beckwith committed Apr 29, 2012
View
@@ -1,3 +1 @@
-#Grails Metadata file
-#Mon Feb 13 14:30:13 CST 2012
app.grails.version=2.0.0
@@ -9,12 +9,12 @@ class DemoController {
grailsCacheAdminService.clearBlocksCache()
render "cleared blocks cache"
}
-
+
def clearTemplatesCache() {
grailsCacheAdminService.clearTemplatesCache()
render "cleared templates cache"
}
-
+
def basicCachingServiceInvocationCount() {
render "Basic Caching Service Invocation Count Is ${basicCachingService.invocationCounter}."
}
@@ -36,7 +36,7 @@ class DemoController {
def blockCache(int counter) {
[counter: counter]
}
-
+
def renderTag(int counter) {
[counter: counter]
}
@@ -22,8 +22,7 @@ class GrailsCacheAdminService {
@CacheEvict(value="grailsBlocksCache", allEntries=true)
def clearBlocksCache() {}
-
+
@CacheEvict(value="grailsTemplatesCache", allEntries=true)
def clearTemplatesCache() {}
}
-
@@ -23,7 +23,7 @@ class CacheTagLib {
/**
* Renders a block of markup and caches the result so the next time the same block
* is rendered, it does not need to be evaluated again.
- *
+ *
* @attr key An optional cache key allowing the same block to be cached with different content
*/
def block = { attrs, body ->
@@ -45,9 +45,9 @@ class CacheTagLib {
}
/**
- * Renders a GSP template and caches the result so the next time the same template
+ * Renders a GSP template and caches the result so the next time the same template
* is rendered, it does not need to be evaluated again.
- *
+ *
* @attr template REQUIRED The name of the template to apply
* @attr key An optional cache key allowing the same template to be cached with different content
* @attr contextPath the context path to use (relative to the application context path). Defaults to "" or path to the plugin for a plugin view or template.
@@ -60,7 +60,7 @@ class CacheTagLib {
def render = { attrs ->
// TODO using attrs.template is not adequate here, we need the full path to the template
def key = attrs.template
-
+
if(attrs.key) {
key = key + ':' + attrs.key
}
@@ -4,14 +4,14 @@ There are methods in GrailsCacheAdminService for clearing the caches used by the
class ReportingController {
def grailsCacheAdminService
-
+
def report() {
// clear the cache used by the blocks tag...
grailsCacheAdminService.clearBlocksCache()
-
+
// clear the cache used by the render tag...
grailsCacheAdminService.clearTemplatesCache()
-
+
...
}
}
@@ -56,7 +56,8 @@
private static final long serialVersionUID = 1;
- protected final SimpleDateFormat httpDateFormat;
+ protected final SimpleDateFormat httpDateFormat = new SimpleDateFormat(
+ "EEE, dd MMM yyyy HH:mm:ss z", Locale.US);
/**
* Constructs a new formatter.
@@ -66,7 +67,6 @@
* this class.
*/
public HttpDateFormatter() {
- httpDateFormat = new SimpleDateFormat("EEE, dd MMM yyyy HH:mm:ss z", Locale.US);
httpDateFormat.setTimeZone(TimeZone.getTimeZone("GMT"));
}
@@ -22,7 +22,7 @@
import org.springframework.cache.concurrent.ConcurrentMapCacheManager;
/**
- * Ehcache-based implementation of PageFragmentCachingFilter.
+ * In-memory-based implementation of PageFragmentCachingFilter.
*
* @author Burt Beckwith
*/
@@ -8,7 +8,7 @@ class CacheTagFunctionalTests extends functionaltestplugin.FunctionalTestCase {
assertContentContains 'First block counter 6'
assertContentContains 'Second block counter 7'
assertContentContains 'Third block counter 8'
-
+
get '/demo/blockCache?counter=42'
assertStatus 200
assertContentContains 'First block counter 6'
@@ -20,44 +20,44 @@ class CacheTagFunctionalTests extends functionaltestplugin.FunctionalTestCase {
get '/demo/clearBlocksCache'
assertStatus 200
assertContentContains 'cleared blocks cache'
-
+
get '/demo/blockCache?counter=100'
assertStatus 200
assertContentContains 'First block counter 101'
assertContentContains 'Second block counter 102'
assertContentContains 'Third block counter 103'
-
+
get '/demo/blockCache?counter=42'
assertStatus 200
assertContentContains 'First block counter 101'
assertContentContains 'Second block counter 102'
assertContentContains 'Third block counter 103'
-
+
get '/demo/clearBlocksCache'
assertStatus 200
assertContentContains 'cleared blocks cache'
-
+
get '/demo/blockCache?counter=50'
assertStatus 200
assertContentContains 'First block counter 51'
assertContentContains 'Second block counter 52'
assertContentContains 'Third block counter 53'
-
+
get '/demo/blockCache?counter=150'
assertStatus 200
assertContentContains 'First block counter 51'
assertContentContains 'Second block counter 52'
assertContentContains 'Third block counter 53'
}
-
+
void testRenderTag() {
get '/demo/clearTemplatesCache'
assertStatus 200
assertContentContains 'cleared templates cache'
-
+
get '/demo/renderTag?counter=1'
assertStatus 200
-
+
assertContentContains 'First invocation: Counter value: 1'
assertContentContains 'Second invocation: Counter value: 1'
assertContentContains 'Third invocation: Counter value: 3'
@@ -66,7 +66,7 @@ class CacheTagFunctionalTests extends functionaltestplugin.FunctionalTestCase {
get '/demo/renderTag?counter=5'
assertStatus 200
-
+
assertContentContains 'First invocation: Counter value: 1'
assertContentContains 'Second invocation: Counter value: 1'
assertContentContains 'Third invocation: Counter value: 3'
@@ -76,10 +76,10 @@ class CacheTagFunctionalTests extends functionaltestplugin.FunctionalTestCase {
get '/demo/clearTemplatesCache'
assertStatus 200
assertContentContains 'cleared templates cache'
-
+
get '/demo/renderTag?counter=5'
assertStatus 200
-
+
assertContentContains 'First invocation: Counter value: 5'
assertContentContains 'Second invocation: Counter value: 5'
assertContentContains 'Third invocation: Counter value: 7'
@@ -88,7 +88,7 @@ class CacheTagFunctionalTests extends functionaltestplugin.FunctionalTestCase {
get '/demo/renderTag?counter=1'
assertStatus 200
-
+
assertContentContains 'First invocation: Counter value: 5'
assertContentContains 'Second invocation: Counter value: 5'
assertContentContains 'Third invocation: Counter value: 7'

0 comments on commit 0d6d250

Please sign in to comment.