This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<cfcomponent extends="mxunit.framework.TestCase"> | |
<cffunction name="setUp" returntype="void" access="public" hint="put things here that you want to run before each test"> | |
</cffunction> | |
<cffunction name="tearDown" returntype="void" access="public" hint="put things here that you want to run after each test"> | |
</cffunction> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<cfcomponent hint="A really stupid component"> | |
<cffunction name="echo"> | |
<cfargument name="arg" /> | |
<cfreturn arguments.arg /> | |
</cffunction> | |
</cfcomponent> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<cfcomponent extends="mxunit.framework.TestCase"> | |
<cfscript> | |
function setUp(){ | |
plainOldComponent = createObject("component" ,"PlainOldStupidAssCFC"); | |
assertSame(plainOldComponent,plainOldComponent); | |
} | |
... | |
</cfscript> | |
</cfcomponent> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function uselessUltraRedundantCallbackForMorons(){ | |
var callBackFunc = plainOldComponent.echo( plainOldComponent.echo(plainOldComponent.echo) ); | |
assertEquals('I LIKE spam.', callBackFunc('I LIKE spam.') ); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function freakinIdioticInvocationUsingPageContextAndRequestScope(){ | |
var localFunc = 'localFunc'; | |
var page = getPageContext().getRequest().setAttribute( localFunc , plainOldComponent.echo ); | |
assertEquals('Hey, let''s hang out at BestBuy and give the computer staff shit.', request.localFunc('Hey, let''s hang out at BestBuy and give the computer staff shit.') ); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function loserJavaWeanieInvocationUsingCfJspPage(){ | |
var page = getPageContext().getPage(); | |
var actual = page.createObject('java','java.lang.String').init(chr(0)); | |
var args = ['hey, loser, you suck.']; | |
actual = createObject('java' ,'coldfusion.runtime.CfJspPage')._invokeUDF(page._get('plainOldComponent.echo'), 'echo', page, args); | |
debug(actual); | |
assertEquals( 'hey, loser, you suck.', actual ); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function boneheadedTimeWasterWalkingAroundInCirclesLikeADoucheBag(){ | |
var actual = getPageContext().getFusionContext().parent.plainOldComponent.echo('Now this is a fucking waste of time'); | |
assertEquals('Now this is a fucking waste of time', actual); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function two_Totally_DumbAssWaysOfInvokingFunctionsUsingFusionContextAndCFCProxy(){ | |
var ctx = getPageContext().getFusionContext(); | |
var stupidCfcPath = ctx.parent.getDirectoryFromPath(ctx.getPagePath()) & 'PlainOldStupidAssCFC.cfc'; | |
var cfcproxy = CreateObject("java", "coldfusion.cfc.CFCProxy").init(stupidCfcPath); | |
var args = ['dumb ass puke breath punk']; | |
var alias = cfcproxy.getMethod('echo'); | |
assertEquals( args[1] , alias('dumb ass puke breath punk') ); | |
assertEquals( args[1] , cfcproxy.invoke('echo', args) ); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function wasteMoreTimeYouTurdSuckingMongralFromAnotherPlanet(){ | |
var args = ['Yow! Am I having fun yet?']; | |
var ctx = getPageContext().getFusionContext(); | |
var actual = ctx.parent._invoke( ctx.parent.createObject('component','PlainOldStupidAssCFC'), 'echo', args ); | |
debug(actual); | |
assertEquals( args[1] , actual ); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function getAFuckingLifeYouAsshatMonkeyShitHurler() { | |
var null = ''; | |
var methodProxy = javacast('null',chr(0)); | |
var args = {1='scum sucking asshat-wearing Neanderfuck'}; | |
var ctx = getPageContext().getFusionContext(); | |
ctx.parent._set('methodProxy', ctx.parent.createObject('java','coldfusion.runtime.java.JavaProxy').init( ctx.parent._autoscalarize( ctx.parent._get('plainOldComponent').echo )) ); | |
actual = methodProxy.invoke(null, null, ctx.parent, args); | |
debug(actual); | |
assertEquals( 'scum sucking asshat-wearing Neanderfuck' , actual ); | |
} |
OlderNewer