Last active
April 5, 2016 12:32
-
-
Save roryl/2f2a68e2198d7401dd00 to your computer and use it in GitHub Desktop.
Lucee - Reflection Capabilities
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
component { | |
public function myFunc(){ | |
} | |
public function myOtherFunc(){ | |
} | |
} |
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
<cfscript> | |
BasicComponent = new basicComponent(); | |
metaData = getMetaData(BasicComponent); | |
dump(metaData); | |
</cfscript> |
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
<cfscript> | |
getComponentMetaData("basicComponent"); | |
dump(metaData); | |
</cfscript> |
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
/** | |
* My xUnit Test | |
*/ | |
component extends="testbox.system.BaseSpec"{ | |
/*********************************** LIFE CYCLE Methods ***********************************/ | |
// executes before all test cases | |
function beforeTests(){ | |
} | |
// executes after all test cases | |
function afterTests(){ | |
} | |
// executes before every test case | |
function setup( currentMethod ){ | |
} | |
// executes after every test case | |
function teardown( currentMethod ){ | |
} | |
/*********************************** TEST CASES BELOW ***********************************/ | |
// Remember that test cases MUST start or end with the keyword 'test' | |
function reflectionInstantiatedTest(){ | |
include template="reflection_instantiated.cfm"; | |
} | |
function reflectionSourceTest(){ | |
include template="reflection_source.cfm"; | |
} | |
function hundredGetMetaDataTest(){ | |
var MyObj = new basicComponent(); | |
for(var i=1; i LTE 10000; i++){ | |
getMetaData(MyObj); | |
} | |
} | |
function hundredGetComponentMetaDataTest(){ | |
for(var i=1; i LTE 10000; i++){ | |
getComponentMetaData("basicComponent"); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment