<commit_before>/*
 * Copyright 2004-2005 the original author or authors.
 * 
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * 
 *      http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * Gant script that executes Grails using an embedded Jetty server
 * 
 * @author <NAME>
 *
 * @since 0.4
 */

import org.codehaus.groovy.grails.commons.GrailsClassUtils as GCU
import org.mortbay.jetty.*
import org.mortbay.http.*


Ant.property(environment:"env")                             
grailsHome = Ant.antProject.properties."env.GRAILS_HOME"  

includeTargets << new File ( "${grailsHome}/scripts/RunApp.groovy" )  

task ('default': "Run's all of the Web tests against a Grails application") { 
	depends( runApp )
	println "Running WebTest!"
	try {
	    runWebTest()
    }
    finally {
        stopServer()
    }
}                 
task ( runWebTest : "Main implementation that executes a Grails' Web tests") {
	depends( classpath )
	
    def rootLoader = getClass().classLoader.rootLoader

    rootLoader.addURL(new File("${basedir}/webtest/tests").toURL())
    rootLoader.addURL(new File("${grailsHome}/downloads/webtest/lib").toURL())
    resolver.getResources("file:${grailsHome}/downloads/webtest/lib/*.jar").URL.each {
        rootLoader.addURL(it)
    }

    def testRunner = new GroovyClassLoader().parseClass(new File("${basedir}/webtest/tests/TestSuite.groovy")).newInstance()

    testRunner.runTests()
}<commit_msg>Webtest was executing run-app before classpath. GRAILS-738<commit_after>/*
 * Copyright 2004-2005 the original author or authors.
 * 
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * 
 *      http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * Gant script that executes Grails using an embedded Jetty server
 * 
 * @author <NAME>
 *
 * @since 0.4
 */

import org.codehaus.groovy.grails.commons.GrailsClassUtils as GCU
import org.mortbay.jetty.*
import org.mortbay.http.*


Ant.property(environment:"env")                             
grailsHome = Ant.antProject.properties."env.GRAILS_HOME"  

includeTargets << new File ( "${grailsHome}/scripts/RunApp.groovy" )  

task ('default': "Run's all of the Web tests against a Grails application") { 
	depends( classpath )
	println "Running WebTest!"
	try {
	    runWebTest()
    }
    finally {
        stopServer()
    }
}                 
task ( runWebTest : "Main implementation that executes a Grails' Web tests") {
	depends( runApp )
	
    def rootLoader = getClass().classLoader.rootLoader

    rootLoader.addURL(new File("${basedir}/webtest/tests").toURL())
    rootLoader.addURL(new File("${grailsHome}/downloads/webtest/lib").toURL())
    resolver.getResources("file:${grailsHome}/downloads/webtest/lib/*.jar").URL.each {
        rootLoader.addURL(it)
    }

    def classLoader = new GroovyClassLoader(parentLoader,compConfig,true)
    def testRunner = classLoader.parseClass(new File("${basedir}/webtest/tests/TestSuite.groovy")).newInstance()

    testRunner.runTests()
}
{'fraction_non_alphanumeric': 0.11165675885241665, 'fraction_numerical': 0.008012406306539157, 'mean_word_length': 3.468822170900693, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5686827', 'n_tokens_mistral': 1183, 'n_tokens_neox': 1113, 'n_words': 335}