33 */
44component extends = " BaseAsyncSpec" {
55
6+ variables .javaMajorVersion = createObject ( " java" , " java.lang.System" ).getProperty ( " java.version" ).listFirst ( " ." )
7+
68 function run ( testResults , testBox ){
79 // all your suites go here.
810 describe ( " ColdBox Async Executor Services" , function (){
@@ -15,55 +17,64 @@ component extends="BaseAsyncSpec" {
1517 var executor = asyncManager .newExecutor ( " unitTest" );
1618 expect ( executor .getName () ).toBe ( " unitTest" );
1719 expect ( executor .getCorePoolSize () ).toBe ( 20 );
20+ debug ( executor .getStats () );
1821 expect ( executor .getStats () ).toBeStruct ();
1922 } );
2023 it ( " can create the default fixed executor with custom threads" , function (){
2124 var executor = asyncManager .newExecutor ( name : " unitTest" , threads : 100 );
2225 expect ( executor .getName () ).toBe ( " unitTest" );
2326 expect ( executor .getCorePoolSize () ).toBe ( 100 );
27+ debug ( executor .getStats () );
2428 expect ( executor .getStats () ).toBeStruct ();
2529 } );
2630 it ( " can create the a single executor" , function (){
2731 var executor = asyncManager .newExecutor ( name : " unitTest" , type : " single" );
2832 expect ( executor .getName () ).toBe ( " unitTest" );
2933 expect ( executor .getCorePoolSize () ).toBe ( 1 );
34+ debug ( executor .getStats () );
3035 expect ( executor .getStats () ).toBeStruct ();
3136 } );
3237 it ( " can create the a cached executor" , function (){
3338 var executor = asyncManager .newExecutor ( name : " unitTest" , type : " cached" );
3439 expect ( executor .getName () ).toBe ( " unitTest" );
3540 expect ( executor .getPoolSize () ).toBe ( 0 );
41+ debug ( executor .getStats () );
3642 expect ( executor .getStats () ).toBeStruct ();
3743 } );
3844 it ( " can create a fork_join executor" , function (){
3945 var executor = asyncManager .newExecutor ( name : " fork_join" , type : " fork_join" );
4046 expect ( executor .getName () ).toBe ( " fork_join" );
4147 expect ( executor .getPoolSize () ).toBe ( 0 );
48+ debug ( executor .getStats () );
4249 expect ( executor .getStats () ).toBeStruct ();
4350 } );
4451 it ( " can create a work_stealing executor" , function (){
4552 var executor = asyncManager .newExecutor ( name : " work_stealing" , type : " work_stealing" );
4653 expect ( executor .getName () ).toBe ( " work_stealing" );
4754 expect ( executor .getPoolSize () ).toBe ( 0 );
55+ debug ( executor .getStats () );
4856 expect ( executor .getStats () ).toBeStruct ();
4957 } );
5058 it ( " can create a scheduled executor" , function (){
5159 var executor = asyncManager .newExecutor ( name : " unitTest" , type : " scheduled" );
5260 expect ( executor .getName () ).toBe ( " unitTest" );
5361 expect ( executor .getCorePoolSize () ).toBe ( 20 );
5462 expect ( executor .getNative ().toString () ).toInclude ( " ScheduledThreadPoolExecutor" );
63+ debug ( executor .getStats () );
5564 expect ( executor .getStats () ).toBeStruct ();
5665 } );
5766 // Skip on Adobe as their dumb reflection does not support virtual threads
5867 it (
5968 title : " can create a virtual thread executor" ,
6069 skip : (
61- server .keyExists ( " coldfusion" ) && server .coldfusion .productName .findNoCase ( " ColdFusion" )
70+ ( server .keyExists ( " coldfusion" ) && server .coldfusion .productName .findNoCase ( " ColdFusion" ) ) ||
71+ ( variables .javaMajorVersion < 21 )
6272 ),
6373 body : function (){
6474 var executor = asyncManager .newExecutor ( name : " virtual" , type : " virtual" );
6575 expect ( executor .getName () ).toBe ( " virtual" );
6676 expect ( executor .getPoolSize () ).toBe ( 0 );
77+ debug ( executor .getStats () );
6778 expect ( executor .getStats () ).toBeStruct ();
6879 }
6980 );
0 commit comments