<commit_before><cfcomponent>    
  
	<cfset variables.requestScopeDebuggingEnabled = false />


  <cffunction name="setDataProviderHandler">         
    <cfargument name="dph" />
    <cfset variables.dataProviderHandler = arguments.dph />
  </cffunction>
  

  <cffunction name="setMockingFramework">         
     <cfargument name="mf" />
     <cfset variables.mockingFramework = arguments.mf />
  </cffunction>              

	<cffunction name="enableRequestScopeDebugging">
		<!--- TODO: Add a test for request scope debugging or get rid of it. --->
		<cfset variables.requestScopeDebuggingEnabled = true />
	</cffunction>

	<cffunction name="run" returntype="WEB-INF.cftags.component" access="public" output="true" hint="Primary method for running TestSuites and individual tests.">
		<cfargument name="allSuites" hint="a structure corresponding to the key/componentName"/>
		<cfargument name="results" hint="The TestResult collecting parameter." required="no" type="TestResult" default="#createObject("component","TestResult").TestResult()#" />
		<cfargument name="testMethod" hint="A single test method to run." type="string" required="no" default="">
		
		<cfset var testCase = "">
		<cfset var methodIndex = 1>
		<cfset var currentTestSuiteName = "" />
		<cfset var currentSuite = "" />
		
		<cfloop collection="#allSuites#" item="currentTestSuiteName">
			<cfset currentSuite = allSuites[currentTestSuiteName] />
			
			<cfset testCase = createTestCaseFromComponentOrComponentName(currentSuite.ComponentObject) />
			
			<!--- set the MockingFramework if one has been set for the TestSuite --->
			<cfif len(variables.MockingFramework)>
				<cfset testCase.setMockingFramework(variables.MockingFramework) />
			</cfif>
			
			<!--- Invoke prior to tests. Class-level setUp --->
			<cfset testCase.beforeTests() />
			
			<cfif len(arguments.testMethod)>
				<cfset runTestMethod(testCase, testMethod, results, currentTestSuiteName) />
			<cfelse>
				<cfloop from="1" to="#arrayLen(currentSuite.methods)#" index="methodIndex">
					<cfset runTestMethod(testCase, currentSuite.methods[methodIndex], results, currentTestSuiteName) />
				</cfloop>
			</cfif>
			
			<!--- Invoke after tests. Class-level tearDown --->
			<cfset testCase.afterTests()>
		</cfloop>
		
		<cfset results.closeResults() /><!--- Get correct time run for suite --->
		
		<cfreturn results />
	</cffunction>
	
	<cffunction name="createTestCaseFromComponentOrComponentName">
		<cfargument name="componentObject"/>
		<cfif isSimpleValue(componentObject)>
			<cfreturn createObject("component", currentTestSuiteName).TestCase(componentObject) />
		<cfelse>
			<cfreturn componentObject.TestCase(componentObject) />
		</cfif>
	</cffunction>

	<cffunction name="runTestMethod" access="private">
		<cfargument name="testCase" />
		<cfargument name="methodName" /> 
		<cfargument name="results" />
		<cfargument name="currentTestSuiteName"/> 
		
		<cfset var tickCountAtStart = getTickCount() />
		<cfset var outputOfTest = "" />
		
		<cfset testCase.expectedExceptionType = testCase.getAnnotation(methodName,"expectedException") />
		<cfset testCase.expectedExceptionMessage = '' />
		
		<cftry>
			<cfset results.startTest(methodName,currentTestSuiteName) />
			
			<cfset testCase.clearClassVariables() />
			<cfset testCase.initDebug() /><commit_msg>Switching the logic around for getting the expected exception so that it will fail the test gracefully if the assertion cannot be found or is not supported.<commit_after><cfcomponent>    
  
	<cfset variables.requestScopeDebuggingEnabled = false />


  <cffunction name="setDataProviderHandler">         
    <cfargument name="dph" />
    <cfset variables.dataProviderHandler = arguments.dph />
  </cffunction>
  

  <cffunction name="setMockingFramework">         
     <cfargument name="mf" />
     <cfset variables.mockingFramework = arguments.mf />
  </cffunction>              

	<cffunction name="enableRequestScopeDebugging">
		<!--- TODO: Add a test for request scope debugging or get rid of it. --->
		<cfset variables.requestScopeDebuggingEnabled = true />
	</cffunction>

	<cffunction name="run" returntype="WEB-INF.cftags.component" access="public" output="true" hint="Primary method for running TestSuites and individual tests.">
		<cfargument name="allSuites" hint="a structure corresponding to the key/componentName"/>
		<cfargument name="results" hint="The TestResult collecting parameter." required="no" type="TestResult" default="#createObject("component","TestResult").TestResult()#" />
		<cfargument name="testMethod" hint="A single test method to run." type="string" required="no" default="">
		
		<cfset var testCase = "">
		<cfset var methodIndex = 1>
		<cfset var currentTestSuiteName = "" />
		<cfset var currentSuite = "" />
		
		<cfloop collection="#allSuites#" item="currentTestSuiteName">
			<cfset currentSuite = allSuites[currentTestSuiteName] />
			
			<cfset testCase = createTestCaseFromComponentOrComponentName(currentSuite.ComponentObject) />
			
			<!--- set the MockingFramework if one has been set for the TestSuite --->
			<cfif len(variables.MockingFramework)>
				<cfset testCase.setMockingFramework(variables.MockingFramework) />
			</cfif>
			
			<!--- Invoke prior to tests. Class-level setUp --->
			<cfset testCase.beforeTests() />
			
			<cfif len(arguments.testMethod)>
				<cfset runTestMethod(testCase, testMethod, results, currentTestSuiteName) />
			<cfelse>
				<cfloop from="1" to="#arrayLen(currentSuite.methods)#" index="methodIndex">
					<cfset runTestMethod(testCase, currentSuite.methods[methodIndex], results, currentTestSuiteName) />
				</cfloop>
			</cfif>
			
			<!--- Invoke after tests. Class-level tearDown --->
			<cfset testCase.afterTests()>
		</cfloop>
		
		<cfset results.closeResults() /><!--- Get correct time run for suite --->
		
		<cfreturn results />
	</cffunction>
	
	<cffunction name="createTestCaseFromComponentOrComponentName">
		<cfargument name="componentObject"/>
		<cfif isSimpleValue(componentObject)>
			<cfreturn createObject("component", currentTestSuiteName).TestCase(componentObject) />
		<cfelse>
			<cfreturn componentObject.TestCase(componentObject) />
		</cfif>
	</cffunction>

	<cffunction name="runTestMethod" access="private">
		<cfargument name="testCase" />
		<cfargument name="methodName" /> 
		<cfargument name="results" />
		<cfargument name="currentTestSuiteName"/> 
		
		<cfset var tickCountAtStart = getTickCount() />
		<cfset var outputOfTest = "" />
		
		<cfset testCase.expectedExceptionType = '' />
		<cfset testCase.expectedExceptionMessage = '' />
		
		<cftry>
			<cfset testCase.expectedExceptionType = testCase.getAnnotation(methodName,"expectedException") />
			
			<cfset results.startTest(methodName,currentTestSuiteName) />
			
			<cfset testCase.clearClassVariables() />
			<cfset testCase.initDebug() />
{'fraction_non_alphanumeric': 0.13214702450408403, 'fraction_numerical': 0.0005834305717619603, 'mean_word_length': 4.282742681047766, 'pattern_counts': {'":': 0, '<': 136, '<?xml version=': 0, '>': 136, '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': '3718621', 'n_tokens_mistral': 2258, 'n_tokens_neox': 1998, 'n_words': 445}