Groovy Documentation

org.codehaus.groovy.grails.support
[Java] Class MockStringResourceLoader

java.lang.Object
  org.springframework.core.io.DefaultResourceLoader
      org.codehaus.groovy.grails.support.MockResourceLoader
          org.codehaus.groovy.grails.support.MockStringResourceLoader

public class MockStringResourceLoader
extends MockResourceLoader

Loads Resources from Strings that are registered as Mock resources.

Authors:
Graeme Rocher
Since:
0.4


Method Summary
Resource getResource(java.lang.String location)

void registerMockResource(java.lang.String location, java.lang.String contents)

Registers a mock resource with the first argument as the location and the second as the contents of the resource.

void registerMockResource(java.lang.String location, byte[] contents)

Registers a mock resource with the first argument as the location and the second as the contents of the resource.

 
Methods inherited from class MockResourceLoader
getResource
 

Method Detail

getResource

@Override
public Resource getResource(java.lang.String location)


registerMockResource

public void registerMockResource(java.lang.String location, java.lang.String contents)
Registers a mock resource with the first argument as the location and the second as the contents of the resource.
Parameters:
location - The location
contents - The contents of the resource


registerMockResource

public void registerMockResource(java.lang.String location, byte[] contents)
Registers a mock resource with the first argument as the location and the second as the contents of the resource.
Parameters:
location - The location
contents - The contents of the resource


 

Groovy Documentation