<commit_before>import  org.codehaus.groovy.grails.commons.test.*
import org.codehaus.groovy.grails.plugins.*

class GrailsPluginManagerDescriptorTests extends AbstractGrailsMockTests {
	
	void testDoWithWebDescriptor() {
		def i18nPlugin = gcl.loadClass("org.codehaus.groovy.grails.i18n.plugins.I18nGrailsPlugin")		
		def controllersPlugin = gcl.loadClass("org.codehaus.groovy.grails.web.plugins.ControllersGrailsPlugin")
		def manager = new DefaultGrailsPluginManager([i18nPlugin, controllersPlugin] as Class[],ga);
		manager.loadPlugins()
		def webxml = getResources("org/codehaus/groovy/grails/commons/test-web.xml")[0]
		
		def sw = new StringWriter()		                                                                             
		manager.doWebDescriptor(webxml, sw)
		
		def text = sw.toString()

		def xml = new XmlSlurper().parseText(text)
				
	}
	
	void testDevelopmentDescriptor() {
		try {
			System.setProperty("grails.env", "development")
			def i18nPlugin = gcl.loadClass("org.codehaus.groovy.grails.i18n.plugins.I18nGrailsPlugin")		
			def controllersPlugin = gcl.loadClass("org.codehaus.groovy.grails.web.plugins.ControllersGrailsPlugin")
			def manager = new DefaultGrailsPluginManager([i18nPlugin, controllersPlugin] as Class[],ga);
			manager.loadPlugins()
			def webxml = getResources("org/codehaus/groovy/grails/commons/test-web.xml")[0]
			
			def sw = new StringWriter()		                                                                             
			manager.doWebDescriptor(webxml, sw)
			
			def text = sw.toString()
			def xml = new XmlSlurper().parseText(text)		
			def filters = xml.'**'.findAll { it.name() == 'filter' }
			def reloadClass = filters.find{ it.'filter-name' == 'reloadFilter'}.'filter-class'.text()
			assertEquals "org.codehaus.groovy.grails.web.servlet.filter.GrailsReloadServletFilter", reloadClass

		}
		finally {
			System.setProperty("grails.env", "")
		}
		
	}
}<commit_msg>GRAILS-971: Moved plugins from org.codehaus.groovy.grails.<pluginname>.plugins to org.codehaus.groovy.grails.plugins<commit_after>import  org.codehaus.groovy.grails.commons.test.*
import org.codehaus.groovy.grails.plugins.*

class GrailsPluginManagerDescriptorTests extends AbstractGrailsMockTests {
	
	void testDoWithWebDescriptor() {
		def i18nPlugin = gcl.loadClass("org.codehaus.groovy.grails.plugins.I18nGrailsPlugin")		
		def controllersPlugin = gcl.loadClass("org.codehaus.groovy.grails.plugins.ControllersGrailsPlugin")
		def manager = new DefaultGrailsPluginManager([i18nPlugin, controllersPlugin] as Class[],ga);
		manager.loadPlugins()
		def webxml = getResources("org/codehaus/groovy/grails/commons/test-web.xml")[0]
		
		def sw = new StringWriter()		                                                                             
		manager.doWebDescriptor(webxml, sw)
		
		def text = sw.toString()

		def xml = new XmlSlurper().parseText(text)
				
	}
	
	void testDevelopmentDescriptor() {
		try {
			System.setProperty("grails.env", "development")
			def i18nPlugin = gcl.loadClass("org.codehaus.groovy.grails.plugins.I18nGrailsPlugin")		
			def controllersPlugin = gcl.loadClass("org.codehaus.groovy.grails.plugins.ControllersGrailsPlugin")
			def manager = new DefaultGrailsPluginManager([i18nPlugin, controllersPlugin] as Class[],ga);
			manager.loadPlugins()
			def webxml = getResources("org/codehaus/groovy/grails/commons/test-web.xml")[0]
			
			def sw = new StringWriter()		                                                                             
			manager.doWebDescriptor(webxml, sw)
			
			def text = sw.toString()
			def xml = new XmlSlurper().parseText(text)		
			def filters = xml.'**'.findAll { it.name() == 'filter' }
			def reloadClass = filters.find{ it.'filter-name' == 'reloadFilter'}.'filter-class'.text()
			assertEquals "org.codehaus.groovy.grails.web.servlet.filter.GrailsReloadServletFilter", reloadClass

		}
		finally {
			System.setProperty("grails.env", "")
		}
		
	}
}
{'fraction_non_alphanumeric': 0.11837769328263625, 'fraction_numerical': 0.008871989860583017, 'mean_word_length': 3.166842661034847, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 4, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 18}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 14, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '423780', 'n_tokens_mistral': 1401, 'n_tokens_neox': 1190, 'n_words': 186}