Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Tree: 749e500f09
Fetching contributors…

Cannot retrieve contributors at this time

35 lines (23 sloc) 1.22 kB
<cfcomponent extends="BaseTestCase">
<cffunction name="setUp" returntype="void" access="public" hint="put things here that you want to run before each test">
<cfset variables.rootURL = "http://" & cgi.SERVER_NAME & ":" & cgi.SERVER_PORT & "/cfmongodb/examples/">
<cfset debug(cgi)>
<cfset paths = ["gettingstarted.cfm", "aggregation/group.cfm", "aggregation/mapReduce.cfm", "geospatial/geo.cfm", "PeopleList/index.cfm"]>
<cfset useJavaLoader = variables.factoryType eq "cfmongodb.core.JavaLoaderFactory" ? true : false>
<cffunction name="all_examples_should_work" returntype="void" access="public">
<cfset var httpResult = "">
<cfset var path = "">
<cfset var currentURL = "">
<!---<cfset debug(factoryType)>
<cfset debug(useJavaLoader)>--->
<cfloop array="#paths#" index="path">
<cfset currentURL = variables.rootURL & path>
<cfhttp method="get" url="#currentURL#?reload=true&useJavaLoader=#useJavaLoader#" result="httpResult">
<cfif httpResult.statusCode neq "200 OK">
<cfset debug(httpResult.fileContent)>
<cfset fail("For #currentURL#, path Expected 200 OK but received #httpResult.statusCode#.")>
Jump to Line
Something went wrong with that request. Please try again.