1 /* Copyright 2004-2005 Graeme Rocher
3 * Licensed under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License.
5 * You may obtain a copy of the License at
7 * http://www.apache.org/licenses/LICENSE-2.0
9 * Unless required by applicable law or agreed to in writing, software
10 * distributed under the License is distributed on an "AS IS" BASIS,
11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 * See the License for the specific language governing permissions and
13 * limitations under the License.
15 package org
.codehaus
.groovy
.grails
.support
;
17 import groovy
.lang
.GroovyClassLoader
;
18 import junit
.framework
.TestCase
;
19 import org
.codehaus
.groovy
.grails
.commons
.DefaultGrailsApplication
;
22 * @author Graeme Rocher
25 * Created: Jan 30, 2008
27 public class DevelopmentResourceLoaderTests
extends TestCase
{
29 public void testDevelopmentResourceLoaderNoSlash() {
30 DevelopmentResourceLoader resourceLoader
= new DevelopmentResourceLoader(new DefaultGrailsApplication(new Class
[0], new GroovyClassLoader()));
32 assertEquals("file:./grails-app/i18n", resourceLoader
.getRealLocationInProject("WEB-INF/grails-app/i18n"));
36 public void testDevelopmentResourceLoader() {
37 DevelopmentResourceLoader resourceLoader
= new DevelopmentResourceLoader(new DefaultGrailsApplication(new Class
[0], new GroovyClassLoader()));
39 assertEquals("file:./grails-app/i18n", resourceLoader
.getRealLocationInProject("/WEB-INF/grails-app/i18n"));
42 public void testDevelopmentResourceLoaderAndBaseLoc() {
43 DevelopmentResourceLoader resourceLoader
= new DevelopmentResourceLoader(new DefaultGrailsApplication(new Class
[0], new GroovyClassLoader()), "/home");
45 assertEquals("file:/home/grails-app/i18n", resourceLoader
.getRealLocationInProject("/WEB-INF/grails-app/i18n"));