-
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
lots of improvements but still way to go
- Loading branch information
Showing
12 changed files
with
129 additions
and
51 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,46 +1,50 @@ | ||
{ | ||
"name":"BoxLang Compat Module", | ||
"version":"@build.version@+@build.number@", | ||
"location" : "https://downloads.ortussolutions.com/ortussolutions/boxlang-modules/bx-compat/@build.version@/bx-compat-@build.version@.zip", | ||
"author":"Ortus Solutions", | ||
"homepage":"https://github.com/boxlang-modules/bx-compat", | ||
"documentation":"https://github.com/boxlang-modules/bx-compat", | ||
"repository":{ | ||
"type":"git", | ||
"URL":"https://github.com/boxlang-modules/bx-compat" | ||
}, | ||
"bugs":"https://github.com/boxlang-modules/bx-compat/issues", | ||
"slug":"bx-compat", | ||
"shortDescription":"Module template for BoxLang modules", | ||
"type":"boxlang-modules", | ||
"keywords":[ | ||
"boxlang" | ||
], | ||
"private":false, | ||
"license":[ | ||
{ | ||
"type":"Apache-2.0", | ||
"URL":"https://www.apache.org/licenses/LICENSE-2.0" | ||
} | ||
], | ||
"devDependencies" :{ | ||
"commandbox-cfformat":"*", | ||
"commandbox-docbox":"*", | ||
"commandbox-dotenv":"*", | ||
"commandbox-cfconfig":"*", | ||
"name": "BoxLang Compat Module", | ||
"version": "@build.version@+@build.number@", | ||
"location": "https://downloads.ortussolutions.com/ortussolutions/boxlang-modules/bx-compat/@build.version@/bx-compat-@build.version@.zip", | ||
"author": "Ortus Solutions", | ||
"homepage": "https://github.com/ortus-boxlang/bx-compat", | ||
"documentation": "https://github.com/ortus-boxlang/bx-compat", | ||
"repository": { | ||
"type": "git", | ||
"URL": "https://github.com/ortus-boxlang/bx-compat" | ||
}, | ||
"bugs": "https://github.com/ortus-boxlang/bx-compat/issues", | ||
"slug": "bx-compat", | ||
"shortDescription": "Module template for BoxLang modules", | ||
"type": "boxlang-modules", | ||
"keywords": [ | ||
"boxlang" | ||
], | ||
"private": false, | ||
"license": [ | ||
{ | ||
"type": "Apache-2.0", | ||
"URL": "https://www.apache.org/licenses/LICENSE-2.0" | ||
} | ||
], | ||
"devDependencies": { | ||
"commandbox-cfformat": "*", | ||
"commandbox-docbox": "*", | ||
"commandbox-dotenv": "*", | ||
"commandbox-cfconfig": "*", | ||
"testbox": "*" | ||
}, | ||
"ignore": [ | ||
"**/.*", | ||
"settings.gradle", | ||
"gradlew.bat", | ||
"gradlew", | ||
"build.gradle", | ||
"/src/**", | ||
"gradle/**" | ||
], | ||
"scripts":{ | ||
"ignore": [ | ||
"**/.*", | ||
"settings.gradle", | ||
"gradlew.bat", | ||
"gradlew", | ||
"build.gradle", | ||
"/src/**", | ||
"gradle/**" | ||
], | ||
"scripts": { | ||
"setupTemplate": "task run taskFile=src/build/SetupTemplate.cfc", | ||
"onRelease":"publish" | ||
} | ||
"onRelease": "publish" | ||
}, | ||
"boxlang": { | ||
"moduleName": "compat", | ||
"minimumVersion": "1.0.0" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
75 changes: 75 additions & 0 deletions
75
src/test/java/ortus/boxlang/modules/compat/IntegrationTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
package ortus.boxlang.modules.compat; | ||
|
||
import static com.google.common.truth.Truth.assertThat; | ||
|
||
import java.nio.file.Paths; | ||
|
||
import org.junit.jupiter.api.DisplayName; | ||
import org.junit.jupiter.api.Test; | ||
|
||
import ortus.boxlang.runtime.BoxRuntime; | ||
import ortus.boxlang.runtime.context.IBoxContext; | ||
import ortus.boxlang.runtime.context.ScriptingRequestBoxContext; | ||
import ortus.boxlang.runtime.modules.ModuleRecord; | ||
import ortus.boxlang.runtime.scopes.IScope; | ||
import ortus.boxlang.runtime.scopes.Key; | ||
import ortus.boxlang.runtime.scopes.VariablesScope; | ||
import ortus.boxlang.runtime.services.ModuleService; | ||
|
||
/** | ||
* This loads the module and runs an integration test on the module. | ||
*/ | ||
public class IntegrationTest { | ||
|
||
@DisplayName( "Test the module loads in BoxLang" ) | ||
@Test | ||
public void testModuleLoads() { | ||
// Given | ||
Key moduleName = new Key( "compat" ); | ||
String physicalPath = Paths.get( "./build/module" ).toAbsolutePath().toString(); | ||
ModuleRecord moduleRecord = new ModuleRecord( physicalPath ); | ||
IBoxContext context = new ScriptingRequestBoxContext(); | ||
BoxRuntime runtime = BoxRuntime.getInstance( true ); | ||
ModuleService moduleService = runtime.getModuleService(); | ||
IScope variables = context.getScopeNearby( VariablesScope.name ); | ||
|
||
// When | ||
moduleRecord | ||
.loadDescriptor( context ) | ||
.register( context ) | ||
.activate( context ); | ||
|
||
moduleService.getRegistry().put( moduleName, moduleRecord ); | ||
|
||
// Then | ||
assertThat( moduleService.getRegistry().containsKey( moduleName ) ).isTrue(); | ||
|
||
// Verify things got registered | ||
// assertThat( datasourceService.hasDriver( Key.of( "derby" ) ) ).isTrue(); | ||
|
||
// Register a named datasource | ||
// runtime.getConfiguration().runtime.datasources.put( | ||
// Key.of( "derby" ), | ||
// DatasourceConfig.fromStruct( Struct.of( | ||
// "name", "derby", | ||
// "driver", "derby", | ||
// "properties", Struct.of( | ||
// "database", "testDB", | ||
// "protocol", "memory" | ||
// ) | ||
// ) ) | ||
// ); | ||
|
||
// @formatter:off | ||
runtime.executeSource( | ||
""" | ||
// Testing code here | ||
""", | ||
context | ||
); | ||
// @formatter:on | ||
|
||
// Asserts here | ||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.