1 package org
.codehaus
.groovy
.grails
.commons
;
3 import org
.springframework
.core
.io
.*
6 * tests for UrlMappingsArtefactHandler
8 * @author Graeme Rocher
12 * Created: Mar 6, 2007
15 public class UrlMappingsArtefactHandlerTests
extends GroovyTestCase
{
17 def mappingScript
= '''
19 "/$id/$year?/$month?/$day?" {
23 year(matches:/\\d{4}/)
24 month(matches:/\\d{2}/)
29 controller = "product"
35 void testUrlMappingsArtefactHandler() {
36 def gcl
= new GroovyClassLoader()
37 Class mappings
= gcl
.parseClass(new ByteArrayResource(mappingScript
.bytes
).inputStream
, "MyUrlMappings")
38 def handler
= new UrlMappingsArtefactHandler()
40 assert handler
.isArtefactClass(mappings
)
41 assert handler
.newArtefactClass(mappings
)