Skip to content

Commit

Permalink
cfformatting rules
Browse files Browse the repository at this point in the history
  • Loading branch information
lmajano committed Mar 9, 2022
1 parent 57fa5ce commit 1575d3b
Show file tree
Hide file tree
Showing 6 changed files with 73 additions and 68 deletions.
8 changes: 7 additions & 1 deletion models/javaloader/JavaCompiler.cfc
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,13 @@
<cfreturn jarPath/>
</cffunction>

<cffunction name="getVersion" hint="returns the version number" access="public" returntype="string" output="false">
<cffunction
name ="getVersion"
hint ="returns the version number"
access ="public"
returntype="string"
output ="false"
>
<cfreturn "0.1.b"/>
</cffunction>

Expand Down
6 changes: 5 additions & 1 deletion models/javaloader/JavaLoader.cfc
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,11 @@
</cfscript>

<cfif isSimpleValue( arguments[ 1 ] )>
<cfinvoke method="#arguments[ 1 ]#" returnvariable="local.return" argumentCollection="#local.funcArgs#"/>
<cfinvoke
method ="#arguments[ 1 ]#"
returnvariable ="local.return"
argumentCollection="#local.funcArgs#"
/>
<cfelseif isCustomFunction( arguments[ 1 ] )>
<cfscript>
func = arguments[ 1 ];
Expand Down
44 changes: 22 additions & 22 deletions models/javaloader/JavaProxy.cfc
Original file line number Diff line number Diff line change
Expand Up @@ -218,28 +218,28 @@
found = true;
} else if ( param.isPrimitive() )
// if it's a primitive, it can be mapped to object primtive classes
{
if ( param.getName() eq "boolean" AND class.getName() eq "java.lang.Boolean" ) {
found = true;
} else if ( param.getName() eq "int" AND class.getName() eq "java.lang.Integer" ) {
found = true;
} else if ( param.getName() eq "long" AND class.getName() eq "java.lang.Long" ) {
found = true;
} else if ( param.getName() eq "float" AND class.getName() eq "java.lang.Float" ) {
found = true;
} else if ( param.getName() eq "double" AND class.getName() eq "java.lang.Double" ) {
found = true;
} else if ( param.getName() eq "char" AND class.getName() eq "java.lang.Character" ) {
found = true;
} else if ( param.getName() eq "byte" AND class.getName() eq "java.lang.Byte" ) {
found = true;
} else if ( param.getName() eq "short" AND class.getName() eq "java.lang.Short" ) {
found = true;
} else {
found = false;
}
}
else {
{
if ( param.getName() eq "boolean" AND class.getName() eq "java.lang.Boolean" ) {
found = true;
} else if ( param.getName() eq "int" AND class.getName() eq "java.lang.Integer" ) {
found = true;
} else if ( param.getName() eq "long" AND class.getName() eq "java.lang.Long" ) {
found = true;
} else if ( param.getName() eq "float" AND class.getName() eq "java.lang.Float" ) {
found = true;
} else if ( param.getName() eq "double" AND class.getName() eq "java.lang.Double" ) {
found = true;
} else if ( param.getName() eq "char" AND class.getName() eq "java.lang.Character" ) {
found = true;
} else if ( param.getName() eq "byte" AND class.getName() eq "java.lang.Byte" ) {
found = true;
} else if ( param.getName() eq "short" AND class.getName() eq "java.lang.Short" ) {
found = true;
} else {
found = false;
}
}
else {
found = false;
}
}
Expand Down
14 changes: 8 additions & 6 deletions test-harness/config/Application.cfc
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
/**
* This is a protection Application cfm for the config file. You do not
* need to modify this file
*/
component{
/**
* This is a protection Application cfm for the config file. You do not
* need to modify this file
*/
component {

abort;
}

}
49 changes: 21 additions & 28 deletions test-harness/config/WireBox.cfc
Original file line number Diff line number Diff line change
@@ -1,46 +1,39 @@
component extends="coldbox.system.ioc.config.Binder"{
component extends="coldbox.system.ioc.config.Binder" {

/**
* Configure WireBox, that's it!
*/
* Configure WireBox, that's it!
*/
function configure(){

// The WireBox configuration structure DSL
wireBox = {
// Scope registration, automatically register a wirebox injector instance on any CF scope
// By default it registeres itself on application scope
scopeRegistration = {
enabled = true,
scope = "application", // server, cluster, session, application
key = "wireBox"
scopeRegistration : {
enabled : true,
scope : "application", // server, cluster, session, application
key : "wireBox"
},

// DSL Namespace registrations
customDSL = {
// namespace = "mapping name"
customDSL : {
// namespace = "mapping name"
},

// Custom Storage Scopes
customScopes = {
// annotationName = "mapping name"
customScopes : {
// annotationName = "mapping name"
},

// Package scan locations
scanLocations = [],

scanLocations : [],
// Stop Recursions
stopRecursions = [],

stopRecursions : [],
// Parent Injector to assign to the configured injector, this must be an object reference
parentInjector = "",

parentInjector : "",
// Register all event listeners here, they are created in the specified order
listeners = [
// { class="", name="", properties={} }
]
listeners : [
// { class="", name="", properties={} }
]
};

// Map Bindings below
}
}

}
}
20 changes: 10 additions & 10 deletions test-harness/tests/specs/LoaderTest.cfc
Original file line number Diff line number Diff line change
Expand Up @@ -6,50 +6,50 @@ component extends="coldbox.system.testing.BaseTestCase" appMapping="/root" {
/*********************************** LIFE CYCLE Methods ***********************************/

// executes before all suites+specs in the run() method
function beforeAll() {
function beforeAll(){
super.beforeAll();
}

// executes after all suites+specs in the run() method
function afterAll() {
function afterAll(){
super.afterAll();
structDelete( server, getLoader().getStaticIDKey() );
}

/*********************************** BDD SUITES ***********************************/

function run() {
function run(){
// all your suites go here.
describe( "JavaLoader Module", function() {
beforeEach( function( currentSpec ) {
describe( "JavaLoader Module", function(){
beforeEach( function( currentSpec ){
setup();
} );

it( "should register loader proxy", function() {
it( "should register loader proxy", function(){
var loader = getLoader();
expect( loader ).toBeComponent();
} );

it( "should class load jar files", function() {
it( "should class load jar files", function(){
var event = execute( "main.index" );
var prc = event.getCollection( private = true );
expect( prc.hello ).toBe( "Hello World" );
} );

it( "should get loaded URLs", function() {
it( "should get loaded URLs", function(){
var loader = getLoader();
expect( loader.getLoadedURls() ).toBeArray();
expect( loader.getLoadedURLs() ).toHaveLength( 2 );
} );

it( "should retrieve via custom DSL", function() {
it( "should retrieve via custom DSL", function(){
var hello = getWireBox().getInstance( dsl = "javaloader:HelloWorld" );
expect( isObject( hello ) ).toBeTrue();
} );
} );
}

private function getLoader() {
private function getLoader(){
return getWireBox().getInstance( "loader@cbjavaloader" );
}

Expand Down

0 comments on commit 1575d3b

Please sign in to comment.