<commit_before>package org.codehaus.groovy.grails.web.sitemesh;

import java.io.StringReader;

import junit.framework.TestCase;

import org.springframework.mock.web.MockHttpServletRequest;

import com.opensymphony.module.sitemesh.Decorator;
import com.opensymphony.module.sitemesh.Page;
import com.opensymphony.module.sitemesh.parser.FastPageParser;

public class GrailsLayoutDecoratorMapperTests extends TestCase {

	/*
	 * Test method for 'org.codehaus.groovy.grails.web.sitemesh.GrailsLayoutDecoratorMapper.getDecorator(HttpServletRequest, Page)'
	 */
	public void testGetDecoratorHttpServletRequestPage() {
		MockHttpServletRequest request = new MockHttpServletRequest("GET", "orders/list");
		GrailsLayoutDecoratorMapper m = new GrailsLayoutDecoratorMapper();
		FastPageParser parser = new FastPageParser();
		String html = "<html><head><title>Test title</title><meta name=\"layout\" content=\"test\"></meta></head><body>here is the body</body></html>";
		
		
		Page page = parser.parse( new StringReader(html) ); 
		Decorator d = m.getDecorator(request, page);
		
		assertEquals("/WEB-INF/grails-app/views/layouts/test.gsp", d.getPage());
		assertEquals("test", d.getName());
		
	}

}<commit_msg>fixed test case following change to mapper<commit_after>package org.codehaus.groovy.grails.web.sitemesh;

import java.io.StringReader;

import junit.framework.TestCase;

import org.springframework.mock.web.MockHttpServletRequest;

import com.opensymphony.module.sitemesh.Decorator;
import com.opensymphony.module.sitemesh.Page;
import com.opensymphony.module.sitemesh.parser.FastPageParser;

public class GrailsLayoutDecoratorMapperTests extends TestCase {

	/*
	 * Test method for 'org.codehaus.groovy.grails.web.sitemesh.GrailsLayoutDecoratorMapper.getDecorator(HttpServletRequest, Page)'
	 */
	public void testGetDecoratorHttpServletRequestPage() {
		MockHttpServletRequest request = new MockHttpServletRequest("GET", "orders/list");
		GrailsLayoutDecoratorMapper m = new GrailsLayoutDecoratorMapper();
		FastPageParser parser = new FastPageParser();
		String html = "<html><head><title>Test title</title><meta name=\"layout\" content=\"test\"></meta></head><body>here is the body</body></html>";
		
		
		Page page = parser.parse( new StringReader(html) ); 
		Decorator d = m.getDecorator(request, page);
		
		assertEquals("/WEB-INF/grails-app/views/layouts/test.gsp", d.getURIPath());
		assertEquals("test", d.getName());
		
	}

}
{'fraction_non_alphanumeric': 0.1272577996715928, 'fraction_numerical': 0.0, 'mean_word_length': 5.826330532212885, 'pattern_counts': {'":': 0, '<': 23, '<?xml version=': 0, '>': 23, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6082284', 'n_tokens_mistral': 795, 'n_tokens_neox': 744, 'n_words': 130}