Skip to content

Commit

Permalink
LDEV-5206 testcase
Browse files Browse the repository at this point in the history
  • Loading branch information
zspitzer committed Dec 17, 2024
1 parent 9b3b2d1 commit ab1ae3c
Show file tree
Hide file tree
Showing 4 changed files with 62 additions and 0 deletions.
47 changes: 47 additions & 0 deletions test/tickets/LDEV5206.cfc
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
component extends = "org.lucee.cfml.test.LuceeTestCase" {

function beforeAll(){
variables.uri = createURI("LDEV5206");
disableExecutionLog();
};

function afterAll(){
disableExecutionLog();
};

function run( testResults, testBox ){
describe( "LDEV-5206 execution logs", function(){

it( "test ConsoleExecutionLog", function(){
enableExecutionLog("lucee.runtime.engine.ConsoleExecutionLog",{
"stream-type": "out",
"unit": "milli",
"min-time": 100,
"snippet": true
});
local.result = _InternalRequest(
template : "#uri#/ldev5206.cfm"
);
});

});
}

private string function createURI(string calledName){
var baseURI="/test/#listLast(getDirectoryFromPath(getCurrentTemplatePath()),"\/")#/";
return baseURI&""&calledName;
}

private function enableExecutionLog(class, args){
admin action="UpdateExecutionLog" type="server" password="#request.SERVERADMINPASSWORD#"
class="#arguments.class#" enabled= true
arguments=arguments.args;
admin action="updateDebug" type="server" password="#request.SERVERADMINPASSWORD#" debug="true";
}
private function disableExecutionLog(class="lucee.runtime.engine.ConsoleExecutionLog"){
admin action="updateDebug" type="server" password="#request.SERVERADMINPASSWORD#" debug="false";

admin action="UpdateExecutionLog" type="server" password="#request.SERVERADMINPASSWORD#" arguments={}
class="#arguments.class#" enabled=false;
}
}
3 changes: 3 additions & 0 deletions test/tickets/LDEV5206/Application.cfc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
component {
this.name='LDEV-5206';
}
6 changes: 6 additions & 0 deletions test/tickets/LDEV5206/ldev5206.cfc
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
component {
this.name='LDEV-5206';
function sleep(){
sleep(5);
}
}
6 changes: 6 additions & 0 deletions test/tickets/LDEV5206/ldev5206.cfm
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<cfscript>
sleep(5);
echo("back from sleep");
cfc = new ldev5206();
cfc.sleep();
</cfscript>

0 comments on commit ab1ae3c

Please sign in to comment.