- Timestamp:
- 09/02/08 18:56:20 (4 months ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
coldbox/trunk/system/cache/util/cacheStats.cfc
r1647 r1757 34 34 35 35 <!------------------------------------------- PUBLIC -------------------------------------------> 36 37 <!--- getAssociatedCacheManager ---> 38 <cffunction name="getAssociatedCacheManager" output="false" access="public" returntype="coldbox.system.cache.cacheManager" hint="Get the associated Cache Manager for this stats object"> 39 <cfreturn instance.cacheManager> 40 </cffunction> 36 41 37 42 <!--- Get Cache Performance ---> coldbox/trunk/testing/tests/cases/plugins/beanfactoryTest.cfc
r1542 r1757 43 43 </cffunction> 44 44 45 <cffunction name="testPopulat ions" access="public" returntype="void" output="false">45 <cffunction name="testPopulateFromStruct" access="public" returntype="void" output="false"> 46 46 <!--- Now test some events ---> 47 47 <cfscript> … … 49 49 var local = structnew(); 50 50 var event = getRequestContext(); 51 52 stime = getTickCount(); 51 53 52 54 /* We are using the formBean object: fname,lname,email,initDate */ … … 57 59 local.myStruct.fname = "Luis"; 58 60 local.myStruct.lname = "Majano"; 59 local.myStruct.email = " lmajano@coldboxframework.com";61 local.myStruct.email = "test@coldboxframework.com"; 60 62 local.myStruct.initDate = now(); 61 63 62 /* JSON Packet */63 local.myJSON = getController().getPlugin("json").encode(local.myStruct);64 64 65 65 /* Populate RC */ … … 71 71 local.obj = plugin.populateFromStruct(local.obj,local.myStruct); 72 72 local.objInstance = local.obj.getInstance(); 73 debug("Timer: #getTickCount()-stime#"); 73 74 /* Assert Population */ 74 75 for( local.key in local.objInstance ){ 75 76 AssertEquals(local.objInstance[local.key], local.myStruct[local.key], "Asserting #local.key# From Struct" ); 76 77 } 78 79 80 81 </cfscript> 82 </cffunction> 83 84 <!--- testpopulateFromJSON ---> 85 <cffunction name="testpopulateFromJSON" output="false" access="public" returntype="any" hint=""> 86 <cfscript> 87 var plugin = getController().getPlugin("beanFactory"); 88 var local = structnew(); 89 /* We are using the formBean object: fname,lname,email,initDate */ 90 local.obj = plugin.create('coldbox.testing.testmodel.formBean'); 91 92 /* Struct */ 93 local.myStruct = structnew(); 94 local.myStruct.fname = "Luis"; 95 local.myStruct.lname = "Majano"; 96 local.myStruct.email = "test@coldboxframework.com"; 97 local.myStruct.initDate = now(); 98 /* JSON Packet */ 99 local.myJSON = getController().getPlugin("json").encode(local.myStruct); 77 100 78 101 /* Populate From JSON */ … … 82 105 for( local.key in local.objInstance ){ 83 106 AssertEquals(local.objInstance[local.key], local.myStruct[local.key], "Asserting #local.key# From JSON" ); 84 } 85 86 /* Populate From JSON */ 87 local.obj = plugin.populateBean(local.obj); 88 local.objInstance = local.obj.getInstance(); 89 /* Assert Population */ 90 for( local.key in local.objInstance ){ 91 AssertEquals(local.objInstance[local.key], local.myStruct[local.key], "Asserting #local.key# From Request Collection" ); 92 } 93 107 } 94 108 </cfscript> 95 109 </cffunction>
