Skip to content

Commit

Permalink
synching version 2.02 from SVN
Browse files Browse the repository at this point in the history
  • Loading branch information
bill shelton committed Jan 16, 2011
1 parent 87026bc commit 34debd4
Show file tree
Hide file tree
Showing 18 changed files with 335 additions and 212 deletions.
22 changes: 10 additions & 12 deletions PluginDemoTests/HodgePodgeTest.cfc
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,8 @@
<cfset MyStruct = StructNew()>
<cfset MyStruct.SomeData = "blahhhhhhh wahahahaha">


<cffunction name="setUp" output="false" access="public" returntype="void" hint="">

</cffunction>

<cffunction name="tearDown" output="false" access="public" returntype="void" hint="">
Expand All @@ -23,42 +22,41 @@
<cfset QuerySetCell(q,"two","two")>
<cfdump var="#q#">
<cfset addTrace("Hi mom")>

</cffunction>

<cffunction name="testDoSomething">
<cfset debug("inside testDoSomething")>
<cfset obj = createObject("component","SomeObject")>
<cfset obj.doSomething()>
</cffunction>
<cffunction name="testRequestDotDebug">

<cffunction name="testRequestDotDebug">
<cfset obj = createObject("component","SomeObject")>
<cfset debug("before the object calls request.debug")>
<cfset obj.thisWillOnlyWorkInThePlugin()>
<cfset debug("after a function that called request.debug")>
</cffunction>

<cffunction name="testRequestDotDebug_WillShowUpWithoutDebugBeingCalledFirst">
<cfset obj = createObject("component","SomeObject")>
<cfset obj.thisWillOnlyWorkInThePlugin()>
</cffunction>
<cffunction name="testRequestDotDebug_WillPassInBothPluginAndWeb">

<cffunction name="testRequestDotDebug_WillPassInBothPluginAndWeb">
<cfset createRequestScopeDebug()>
<cfset obj = createObject("component","SomeObject")>
<cfset debug("before the object calls request.debug")>
<cfset obj.thisWillOnlyWorkInThePlugin()><!--- only work in plugin.... unless we explictly enable it in the test!!! --->
<cfset debug("after a function that called request.debug")>
<cfset stopRequestScopeDebug()>
</cffunction>

<cffunction name="testDoSomethingThenExitToGetDump">
<cfset obj = createObject("component","SomeObject")>
<cfset obj.doSomethingThenExitToGetDump()>
</cffunction>



<cffunction name="testFail" returntype="void" hint="">
<cfoutput>wooopity doo!</cfoutput>
Expand Down
13 changes: 13 additions & 0 deletions README.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
MXUnit is a unit test framework for CFML.

Main website: http://mxunit.org

Docs, etc: http://wiki.mxunit.org

Bugs and enhancements: http://jira.mxunit.org

SVN: http://mxunit.googlecode.com/svn/mxunit/trunk

MXUnit Google Group (to get help): http://groups.google.com/group/mxunit

Version Info: This is release build 2.0.2, built on 11/19/2010
34 changes: 23 additions & 11 deletions build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -35,18 +35,18 @@
- tag the version in svn
=================================
-->
<target name="publish" depends="incrementVersion,runTests,statSVN,package,upload,updatewebsite,publishTestResults,publishStats,tagVersion" description="--> packages into a zip and uploads to google code" />
<target name="publish" depends="runTests,incrementVersion,package,upload,updatewebsite,publishTestResults,publishStats,tagVersion" description="--> packages into a zip and uploads to google code" />

<!--
=================================
Target: package
Generates the zip archive
=================================
-->
<target name="package" depends="clean,version" description="--> packages the appropriate files into the deployment-ready zip file. use this for testing; otherwise, use publish">
<target name="package" depends="clean,version,genApiDocs" description="--> packages the appropriate files into the deployment-ready zip file. use this for testing; otherwise, use publish">
<echo message="building ${zipfile}. basedir is ${basedir}" />
<zip destfile="${zipfile}" casesensitive="false">
<zipfileset dir="${basedir}" includes="*.*,ant/,buildprops/,eclipse/,doc/,framework/,generator/,images/,PluginDemoTests/,resources/,runner/,samples/,tests/,lib/ant-contrib**" excludes=".gitignore,MXUnitInstallTest.cfc,**/testresults/,**/stats/,**/junithtml/,.project,.deployment,**/unames.properties,tests/tmp/,ftp.listing,**/*.db,**/copysnippets.properties,**/copydictionary**,**/*.bak,buildprops/nightlyversion.properties,settings.xml" prefix="mxunit" casesensitive="false" />
<zipfileset dir="${basedir}" includes="*.*,ant/,buildprops/,eclipse/,doc/,framework/,generator/,images/,PluginDemoTests/,resources/,runner/,samples/,tests/,lib/ant-contrib**" excludes=".gitignore,MXUnitInstallTest.cfc,**/testresults/,**/stats/,**/junithtml/,.project,.deployment,**/unames.properties,tests/tmp/,ftp.listing,**/*.db,**/copysnippets.properties,**/copydictionary**,**/*.bak,buildprops/nightlyversion.properties,settings.xml,README.html,README.textile,README-toc.xml" prefix="mxunit" casesensitive="false" />
</zip>
</target>

Expand All @@ -59,14 +59,18 @@
<target name="packageNightly" depends="package">
<move file="${zipfile}" tofile="${nightlyfile}" overwrite="true"/>
<copy file="${version.file}" tofile="${version.nightlyfile}" overwrite="true"/>
<copy file="${readme.file}" tofile="${readme.nightlyfile}" overwrite="true"/>
<propertyfile file="${version.nightlyfile}" comment="Build version info">
<entry key="build.date" type="date" value="now" pattern="MM/dd/yyyy" />
<entry key="build.versiondescription" operation="=" value="Nightly Build" />
<entry key="build.buildnum" type="int" operation="+" value="1" />
</propertyfile>
<replaceregexp file="${readme.nightlyfile}" match="Version Info:(.*)" replace="Version Info: This is nightly build version ${build.version}, built on ${nightlydate}" />
<zip file="${nightlyfile}" update="true">
<zipfileset dir="." includes="${version.nightlyfile}" fullpath="mxunit/buildprops/version.properties"/>
<zipfileset dir="." includes="${readme.nightlyfile}" fullpath="mxunit/README.txt"/>
</zip>
<delete file="${readme.nightlyfile}"/>
</target>

<!--
Expand Down Expand Up @@ -116,18 +120,18 @@
=================================
-->
<target name="init">

<!-- user property file for instance specific settings -->
<property file="${unames.file}" />

<tstamp>
<format pattern="MM_dd_yyyy" property="nightlystamp" />
<format pattern="MM/dd/yyyy" property="nightlydate" />
</tstamp>

<property name="dist" location="dist" />
<property name="nightlyfile" location="dist/mxunit-nightly-${nightlystamp}.zip" />
<property name="unames.file" value="buildprops/unames.properties" />
<property name="version.file" value="buildprops/version.properties" />
<property name="version.nightlyfile" value="buildprops/nightlyversion.properties" />
<property name="readme.file" value="README.txt" />
<property name="readme.nightlyfile" value="README.nightly" />
<property name="antrunner.file" value="buildprops/antrunner.properties" />
<property name="statsvn.file" value="buildprops/statsvn.properties" />
<property name="testmailmessage.file" value="buildprops/testresultsmail.html" />
Expand All @@ -143,8 +147,8 @@
<property name="output.dir" value="${junit.out.dir.xml}/tmp" />
<property name="style.dir" value="ant/xsl/" />



<!-- user property file for instance specific settings -->
<property file="${unames.file}" />


<path id="project.classpath">
Expand All @@ -156,6 +160,7 @@
<taskdef name="mxunittask" classname="org.mxunit.ant.MXUnitAntTask" classpath="${mxunit.jar}" />
<typedef resource="org/tigris/subversion/svnant/svnantlib.xml" classpathref="project.classpath" />
<taskdef resource="net/sf/antcontrib/antcontrib.properties" classpathref="project.classpath" />

</target>

<!--
Expand Down Expand Up @@ -218,7 +223,9 @@
<property name="build.version" value="${build.major}.${build.minor}.${build.buildnum}${build.notation}" />
<property name="zipfile" location="${dist}${file.separator}mxunit-${build.version}.zip" />

<echo message="build.version is ${build.version} -- zipfile is ${zipfile}" />
<echo message="build.version is ${build.version} -- zipfile is ${zipfile}" />

<replaceregexp file="${readme.file}" match="Version Info:(.*)" replace="Version Info: This is release build ${build.version}, built on ${build.date}" />
</target>

<!--
Expand Down Expand Up @@ -361,9 +368,14 @@
-->
<target name="genApiDocs" depends="init">
<property file="${antrunner.file}" />

<delete dir="doc/api" failonerror="false"/>
<mkdir dir="doc/api" />

<script language="javascript" src="buildprops/scripts/http_doc_gen.js" />

<delete dir="doc/api" includes="**/*.svn/"></delete>
</target>



<!--
Expand Down
6 changes: 3 additions & 3 deletions buildprops/version.properties
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#Build version info
#Sun Sep 26 17:02:25 EDT 2010
build.buildnum=1
#Fri Nov 19 07:35:15 EST 2010
build.minor=0
build.buildnum=2
build.versiondescription=Release
build.notation=
build.date=09/26/2010
build.date=11/19/2010
build.major=2
18 changes: 9 additions & 9 deletions doc/build.cfm
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@

<cfscript>
/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*
* CF9/ColdDoc script for generating static html MXUnit api docs.
*
* CF9/ColdDoc script for generating static html MXUnit api docs.
* ColdDoc is by Mark Mandel and is included in this MXUnit distribtion.
*
*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
Expand All @@ -19,7 +19,7 @@ context = getDirectoryFromPath(expandPath(pathBase));
fileSep = createObject('java','java.lang.System').getProperty('file.separator');
//sanity check (guard condition)
mxunit.assert( ls( context & 'doc/api', '*.html').recordCount > 0, 'Ruh-roh, Raggy. Should be something in ./api! WTF?');
//mxunit.assert( ls( context & 'doc/api', '*.html').recordCount > 0, 'Ruh-roh, Raggy. Should be something in ./api! WTF?');
//Info to print in the docs
Expand All @@ -45,7 +45,7 @@ each({
});
generateDocs( packages, destination, title );
/* just print some shit ... */
out.println( '<title>MXUnit API DocGen</h1>' );
out.println( '<h1>MXUnit #version# API Docs Generated!</h1>' );
Expand Down Expand Up @@ -89,20 +89,20 @@ function getVersion(){
function each(struct properties){
//set defaults
//set defaults
var dir = ( structKeyexists(properties,'dir') )? properties.dir : _throw('''each'' needs a directory') ;
var apply = ( structKeyexists(properties,'apply') )? properties.apply : _throw('Yo, gimme d''func to <em>apply</em> to <em>each</em> file.') ;
var filter = ( structKeyexists(properties,'filter') )? properties.filter : '*' ;
var recurse = ( structKeyexists(properties,'recurse') )? properties.recurse : true ;
var type = ( structKeyexists(properties,'type') )? properties.type : 'file' ;
var files = '';
var file = 0;
files = ls( dir, filter, recurse, type );
for(file=0; file < files.recordCount; file++){
// apply for each file, which is a row, but we can get an array of objects
// that specify the properties in cfdirectory:name,dir,dlm,mode,size, etc.
// that specify the properties in cfdirectory:name,dir,dlm,mode,size, etc.
apply( files.getRow(file).getRowData() );
}
} //end each()
Expand All @@ -117,7 +117,7 @@ function each(struct properties){
<cfargument name="type" required="false" default="file" />
<cfdirectory action="list"
directory="#arguments.dir#"
filter="#arguments.filter#"
filter="#arguments.filter#"
recurse="#arguments.recurse#"
type="#arguments.type#"
name="dir_list" />
Expand Down
4 changes: 2 additions & 2 deletions eclipse/copysnippets.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<project name="copysnippets" basedir="." default="hereToLocalSnippets">

<!--
INSTRUCTIONS:
INSTRUCTIONS:
This ant file is designed to help you easily copy the mxunit cfeclipse snippets
from this distribution into your own snippets directory. In addition, it will
Expand All @@ -15,7 +15,7 @@
The paths must be forward slashes!
On my computer, the path is:
snipdir.options=C:/Users/Marc/EclipseWorkspaces/MyCFWorkspace/.metadata/.plugins/org.cfeclipse.cfml/snippets
snipdir.options=C:/Users/Marc/Documents/My Dropbox/CFEclipseSnippets
note: this can be a comma-separated list, too, just in case you have multiple snippets locations
Expand Down
5 changes: 3 additions & 2 deletions framework/Assert.cfc
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<!---
@file Assert.cfc
@description Main component for performing assertions.
Assert.cfc
Main component for performing assertions.
--->
<cfcomponent displayname="Assert"
Expand Down
20 changes: 17 additions & 3 deletions framework/ComponentBlender.cfc
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,21 @@
<cfset variables[propertyName] = property>
<cfset this[propertyName] = property>
</cffunction>


<cffunction name="_copyToNewName" output="false" access="public" returntype="any" hint="">
<cfargument name="propertyName" type="string" required="true"/>
<cfargument name="newPropertyName" type="string" required="true"/>
<cfargument name="ignoreIfExisting" type="boolean" required="false" default="true">

<cfif ignoreIfExisting AND structKeyExists( variables, newPropertyName )>
<cfreturn>
</cfif>
<cfif structKeyExists( variables, propertyName )>
<cfset variables[newPropertyName] = variables[propertyName]>
</cfif>
</cffunction>


<cffunction name="_MixinProperty" access="public">
<cfargument name="propertyName" type="string" required="true">
<cfargument name="property" type="any" required="true">
Expand All @@ -41,7 +55,7 @@
<cfelse>
<cfset _mixin(propertyName,property,false)>
</cfif>

</cffunction>

<cffunction name="_CopyToThisScope" access="public">
Expand All @@ -63,7 +77,7 @@
<cfargument name="varname" type="string" required="true">
<cfreturn variables[varname]>
</cffunction>

<cffunction name="_getComponentVariables" access="public" returntype="struct">
<cfreturn variables>
</cffunction>
Expand Down
2 changes: 1 addition & 1 deletion framework/ComponentUtils.cfc
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<cffunction name="isFrameworkTemplate" returntype="boolean" hint="whether the passed in template is part of the mxunit framework">
<cfargument name="template" type="string" required="true" />
<!--- braindead simple.... is anything more than this necessary? --->
<cfreturn refindNoCase("mxunit(.*)[/\\](trunk[/\\])?(framework)",template) and not refindNoCase("tests[/\\]",template) />
<cfreturn refindNoCase("mxunit(.*?)[/\\](trunk[/\\])?framework",template) />
</cffunction>


Expand Down
Loading

0 comments on commit 34debd4

Please sign in to comment.