diff --git a/tests/functions/S3Copy.cfc b/tests/functions/S3Copy.cfc index 7d9f408..57f3aff 100644 --- a/tests/functions/S3Copy.cfc +++ b/tests/functions/S3Copy.cfc @@ -2,7 +2,6 @@ component extends="org.lucee.cfml.test.LuceeTestCase" labels="s3" { function run( testResults , testBox ) { describe( title="Test suite for S3Copy()", body=function() { it(title="check with blackbaze",skip=Util::isBackBlazeNotSupported(), body = function( currentSpec ) { - throw "#structKeyList(arguments)#"; testit(Util::getBackBlazeCredentials(),"us-east-005"); }); diff --git a/tests/general/LoadTest.cfc b/tests/general/LoadTest.cfc new file mode 100644 index 0000000..ff61a0f --- /dev/null +++ b/tests/general/LoadTest.cfc @@ -0,0 +1,41 @@ +component extends="org.lucee.cfml.test.LuceeTestCase" { + + function run( testResults , testBox ) { + describe( "Loud test", function() { + it( 'make a load test', parallel); + }); + + } + + private function parallel() threadCount=10 repetitition=2 { + var udfs=getPageContext().getUDFs(); + var meta=getMetadata(udfs[len(udfs)]); + + if(meta.threadcount<1 || meta.threadcount>1000) { + throw "thread count need to be a number between 1 and 1000, now it is [#meta.threadcount#]"; + } + if(meta.repetitition<1 || meta.repetitition>1000) { + throw "repetitition need to be a number between 1 and 1000, now it is [#meta.repetitition#]"; + } + if(meta.threadcount==1 || meta.repetitition==1) { + throw "repetitition or thread count need to be bigger than 1"; + + var names = []; + for (var i = 1; i <= arguments.repetitition; i++) { + for (var y = 1; y <= arguments.threadcount; y++) { + var name="testThread:#i#:#y#"; + arrayAppend(names, name); + thread action="run" name=name udf=code args=arguments { + udf(argumentCollection:args); + } + } + } + thread action="join" name=arrayToList(names); + + } + + private function code() { + systemOutput("execute the code",1,1); + } + +} \ No newline at end of file