Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,11 @@ jobs:
box server start serverConfigFile="server-${{ matrix.cfengine }}.json" --noSaveSettings --debug
curl http://127.0.0.1:60299

- name: Run Adobe Full Null Regression
if: ${{ matrix.cfengine == 'adobe@2023' }}
run: |
curl --fail-with-body http://127.0.0.1:60299/tests/full-null/loader.cfm

- name: Run Tests
run: |
mkdir -p test-harness/tests/results
Expand Down
4 changes: 2 additions & 2 deletions models/javaloader/JavaLoader.cfc
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@

loadClasses();

if ( structKeyExists( arguments, "sourceDirectories" ) AND arrayLen( arguments.sourceDirectories ) ) {
if ( !isNull( arguments.sourceDirectories ) AND arrayLen( arguments.sourceDirectories ) ) {
setJavaCompiler( createObject( "component", "JavaCompiler" ).init( arguments.compileDirectory ) );
setSourceDirectories( arguments.sourceDirectories );
setCompileDirectory( arguments.compileDirectory );
Expand Down Expand Up @@ -567,7 +567,7 @@
name ="initUseJavaProxyCFC"
hint ="initialise whether or not to use the JavaProxy CFC instead of the coldfusion java object"
access ="private"
returntype="string"
returntype="void"
output ="false"
>
<cfscript>
Expand Down
11 changes: 11 additions & 0 deletions test-harness/tests/full-null/Application.cfc
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
component {

moduleRoot = createObject( "java", "java.io.File" )
.init( getDirectoryFromPath( getCurrentTemplatePath() ) & "../../../" )
.getCanonicalPath();

this.name = "cbjavaloader-full-null-regression-#hash( moduleRoot )#";
this.enableNullSupport = true;
this.mappings[ "/cbjavaloader" ] = moduleRoot;

}
9 changes: 9 additions & 0 deletions test-harness/tests/full-null/loader.cfm
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<cfscript>
loader = new cbjavaloader.models.javaloader.JavaLoader().init();

if ( !isArray( loader.getClassLoadPaths() ) || !isInstanceOf( loader.getURLClassLoader(), "java.lang.ClassLoader" ) ) {
throw( type = "RegressionFailure", message = "The public loader did not initialize." );
}

writeOutput( "PASS" );
</cfscript>
8 changes: 8 additions & 0 deletions test-harness/tests/specs/LoaderTest.cfc
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,14 @@ component extends="coldbox.system.testing.BaseTestCase" appMapping="/root" {
expect( loader ).toBeComponent();
} );

it( "should initialize the public loader API with full null support", function(){
var loader = new cbjavaloader.models.javaloader.JavaLoader().init();

expect( loader ).toBeComponent();
expect( loader.getClassLoadPaths() ).toBeArray().toBeEmpty();
expect( loader.getURLClassLoader() ).toBeInstanceOf( "java.lang.ClassLoader" );
} );

it( "should class load jar files", function(){
var event = execute( "main.index" );
var prc = event.getCollection( private = true );
Expand Down
Loading