Skip to content

Instantly share code, notes, and snippets.

@roryl
Last active April 5, 2016 12:32
Show Gist options
  • Save roryl/2f2a68e2198d7401dd00 to your computer and use it in GitHub Desktop.
Save roryl/2f2a68e2198d7401dd00 to your computer and use it in GitHub Desktop.
Lucee - Reflection Capabilities
component {
public function myFunc(){
}
public function myOtherFunc(){
}
}
<cfscript>
BasicComponent = new basicComponent();
metaData = getMetaData(BasicComponent);
dump(metaData);
</cfscript>
<cfscript>
getComponentMetaData("basicComponent");
dump(metaData);
</cfscript>
/**
* 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