Skip to content

Commit

Permalink
lots of improvements but still way to go
Browse files Browse the repository at this point in the history
  • Loading branch information
lmajano committed May 7, 2024
1 parent 1580f49 commit 96c648b
Show file tree
Hide file tree
Showing 12 changed files with 129 additions and 51 deletions.
2 changes: 1 addition & 1 deletion .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ IMPORTANT: Please review the [CONTRIBUTING.md](../CONTRIBUTING.md) file for deta
All PRs must have an accompanied Jira issue. Please make sure you created it and linked it here.

BoxLang Jira: https://ortussolutions.atlassian.net/browse/BL/issues
Module Issues: https://github.com/boxlang-modules/bx-compat/issues
Module Issues: https://github.com/ortus-boxlang/bx-compat/issues


## Type of change
Expand Down
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,11 @@ build/**
### IntelliJ IDEA ###
.idea/



### Mac OS ###
.DS_Store

### BOXLANG ###
grapher/**
/libs/
src/test/resources/libs/
grapher/*
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ This project is open source, and as such, the maintainers give their free time t
BoxLang tracks its issues in Jira and each module track it's own issues in its repo.

- BoxLang JIra : https://ortussolutions.atlassian.net/browse/BL/issues
- Module Issues: https://github.com/boxlang-modules/bx-compat/issues
- Module Issues: https://github.com/ortus-boxlang/bx-compat/issues

If you file a bug report, your issue should contain a title, a clear description of the issue, a way to replicate the issue, and any support files that we might need to replicate your issue. The goal of a bug report is to make it easy for yourself - and others - to replicate the bug and develop a fix for it. All issues that do not contain a way to replicate will not be addressed.

Expand Down
86 changes: 45 additions & 41 deletions box.json
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"
}
}
2 changes: 1 addition & 1 deletion readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

This module will allow your ColdFusion (CFML) applications under Adobe or Lucee to run under BoxLang. This module will provide the necessary compatibility layer to run your applications under BoxLang.

If there are any issues, please report them to the [BoxLang JIRA](https://ortussolutions.atlassian.net/browse/BL/issues) or the [Module Issues](https://github.com/boxlang-modules/bx-compat/issues) repository.
If there are any issues, please report them to the [BoxLang JIRA](https://ortussolutions.atlassian.net/browse/BL/issues) or the [Module Issues](https://github.com/ortus-boxlang/bx-compat/issues) repository.

## Ortus Sponsors

Expand Down
2 changes: 1 addition & 1 deletion src/main/bx/interceptors/AdobeServerScope.bx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import java:ortus.boxlang.runtime.scopes.Key;
/**
* Adds collaborations to the server scope as per the Adobe server
*/
component{
class{

function configure(){
// Nothing to do here
Expand Down
2 changes: 1 addition & 1 deletion src/main/bx/interceptors/LuceeServerScope.bx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import java:ortus.boxlang.runtime.scopes.Key;
/**
* Adds collaborations to the server scope as per the lucee server
*/
component{
class{

function configure(){
// Nothing to do here
Expand Down
75 changes: 75 additions & 0 deletions src/test/java/ortus/boxlang/modules/compat/IntegrationTest.java
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

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package ortus.boxlang.compat.bifs.cache;
package ortus.boxlang.modules.compat.bifs.cache;

import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.api.BeforeAll;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package ortus.boxlang.compat.bifs.cache;
package ortus.boxlang.modules.compat.bifs.cache;

import static com.google.common.truth.Truth.assertThat;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package ortus.boxlang.compat.bifs.cache;
package ortus.boxlang.modules.compat.bifs.cache;

import static com.google.common.truth.Truth.assertThat;

Expand Down

0 comments on commit 96c648b

Please sign in to comment.