diff --git a/.cfformat.json b/.cfformat.json new file mode 100644 index 0000000..0166a9f --- /dev/null +++ b/.cfformat.json @@ -0,0 +1,29 @@ +{ + "brackets.padding": true, + "strings.quote": "double", + "strings.attributes.quote": "double", + "function_call.empty_padding": false, + "function_call.padding": true, + "function_declaration.padding": true, + "function_call.multiline.leading_comma.padding": true, + "function_declaration.multiline.leading_comma.padding" : true, + "function_declaration.empty_padding": false, + "function_declaration.group_to_block_spacing": "compact", + "struct.padding": true, + "struct.empty_padding": false, + "struct.multiline.leading_comma.padding" : true, + "array.empty_padding":false, + "array.padding":true, + "array.multiline.leading_comma.padding":true, + "binary_operators.padding":true, + "for_loop_semicolons.padding":true, + "indent_size":4, + "parentheses.padding":true, + "struct.separator":" : ", + "tab_indent":true, + "keywords.block_to_keyword_spacing" : "spaced", + "keywords.group_to_block_spacing" : "spaced", + "keywords.padding_inside_group" : true, + "keywords.spacing_to_block" : "compact", + "keywords.spacing_to_group" : true +} \ No newline at end of file diff --git a/.cflintrc b/.cflintrc new file mode 100644 index 0000000..396a0b3 --- /dev/null +++ b/.cflintrc @@ -0,0 +1,61 @@ +{ + "rule": [], + "includes": [ + { "code": "AVOID_USING_CFINCLUDE_TAG" }, + { "code": "AVOID_USING_CFABORT_TAG" }, + { "code": "AVOID_USING_CFEXECUTE_TAG" }, + { "code": "AVOID_USING_DEBUG_ATTR" }, + { "code": "AVOID_USING_ABORT" }, + { "code": "AVOID_USING_ISDATE" }, + { "code": "AVOID_USING_ISDEBUGMODE" }, + { "code": "AVOID_USING_CFINSERT_TAG" }, + { "code": "AVOID_USING_CFUPDATE_TAG" }, + { "code": "ARG_VAR_CONFLICT" }, + { "code": "ARG_HINT_MISSING" }, + { "code": "ARG_HINT_MISSING_SCRIPT" }, + { "code" : "ARGUMENT_INVALID_NAME" }, + { "code" : "ARGUMENT_ALLCAPS_NAME" }, + { "code" : "ARGUMENT_TOO_WORDY" }, + { "code" : "ARGUMENT_IS_TEMPORARY" }, + { "code": "CFQUERYPARAM_REQ" }, + { "code": "COMPARE_INSTEAD_OF_ASSIGN" }, + { "code": "COMPONENT_HINT_MISSING" }, + { "code" : "COMPONENT_INVALID_NAME" }, + { "code" : "COMPONENT_ALLCAPS_NAME" }, + { "code" : "COMPONENT_TOO_SHORT" }, + { "code" : "COMPONENT_TOO_LONG" }, + { "code" : "COMPONENT_TOO_WORDY" }, + { "code" : "COMPONENT_IS_TEMPORARY" }, + { "code" : "COMPONENT_HAS_PREFIX_OR_POSTFIX" }, + { "code": "COMPLEX_BOOLEAN_CHECK" }, + { "code": "EXCESSIVE_FUNCTION_LENGTH" }, + { "code": "EXCESSIVE_COMPONENT_LENGTH" }, + { "code": "EXCESSIVE_ARGUMENTS" }, + { "code": "EXCESSIVE_FUNCTIONS" }, + { "code": "EXPLICIT_BOOLEAN_CHECK" }, + { "code": "FUNCTION_TOO_COMPLEX" }, + { "code": "FUNCTION_HINT_MISSING" }, + { "code": "FILE_SHOULD_START_WITH_LOWERCASE" }, + { "code": "LOCAL_LITERAL_VALUE_USED_TOO_OFTEN" }, + { "code": "GLOBAL_LITERAL_VALUE_USED_TOO_OFTEN" }, + { "code": "MISSING_VAR" }, + { "code" : "METHOD_INVALID_NAME" }, + { "code" : "METHOD_ALLCAPS_NAME" }, + { "code" : "METHOD_IS_TEMPORARY" }, + { "code": "NESTED_CFOUTPUT" }, + { "code": "NEVER_USE_QUERY_IN_CFM" }, + { "code": "OUTPUT_ATTR" }, + { "code" : "QUERYPARAM_REQ" }, + { "code": "UNUSED_LOCAL_VARIABLE" }, + { "code": "UNUSED_METHOD_ARGUMENT" }, + { "code": "SQL_SELECT_STAR" }, + { "code": "SCOPE_ALLCAPS_NAME" }, + { "code": "VAR_ALLCAPS_NAME" }, + { "code": "VAR_INVALID_NAME" }, + { "code": "VAR_TOO_WORDY" } + ], + "inheritParent": false, + "parameters": { + "TooManyFunctionsChecker.maximum" : 20 + } +} \ No newline at end of file diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..a2c8081 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,20 @@ +# http://editorconfig.org + +root = true + +[*] +end_of_line = lf +charset = utf-8 +trim_trailing_whitespace = true +insert_final_newline = false +indent_style = tab +indent_size = 4 +tab_width = 4 + +[*.yml] +indent_style = space +indent_size = 2 + +[*.{md,markdown}] +trim_trailing_whitespace = false +insert_final_newline = false \ No newline at end of file diff --git a/.gitignore b/.gitignore index c1d6548..ddc3087 100644 --- a/.gitignore +++ b/.gitignore @@ -1,21 +1,14 @@ -.DS_Store -Thumbs.db -.settings -logs/* -settings.xml -.vscode/* -.netbeans -/bower_components/* -/bower_components -/node_modules/* -/node_modules -tests/results/* -apidocs/docbox/ -artifacts/ -workbench/build.number -build/* -modules/* -!modules/cbi18n -!modules/test1 -coldbox -testbox +.vscode + +.artifacts/** +.tmp/** + +test-harness/.engine/** +test-harness/coldbox/** +test-harness/docbox/** +test-harness/testbox/** +test-harness/logs/** +test-harness/modules/** + +# log files +logs/** \ No newline at end of file diff --git a/.module.properties b/.module.properties deleted file mode 100644 index 6e9c3d8..0000000 --- a/.module.properties +++ /dev/null @@ -1,3 +0,0 @@ -project.name=cbi18n -project.version=1.4.0 -module.name=cbi18n \ No newline at end of file diff --git a/.travis.yml b/.travis.yml index 8dbb9ae..0e8555c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,98 +1,109 @@ language: java -sudo: required - notifications: slack: secure: FIHlTn/YO7Wgumm1uIqmoEsqjQA7fV0AE94Rjc5yKzM3AquQa8HicgDVVk0d2GrKRnl0xt3j4ZJV//VJyIjlCd/QVKuj48R2ChjEY2im3+99HFPafCUI5/S2uyowKU6mJTFonH9v6p41eqxdbiAxJdDGOT0V2Gpt3UBSNuHz8ED9/aIHqv+P7M+VD6Xd2XYwctPniWlaSWx57sWcnG/VkFG45qFQAyha64uxOOe4M3ZmG/n5FfauZ8cBVLiRKEIr+CyNhh1ujfzi7+4uzMlSNL5t/BbZamAQuZzqGzGQ9RVvIlyPgUGNJtDEE/hWS09aagXF5T6EMj00szizErh4J1/x4qZwml5+TcBN31E0QmAhCtZe85sr3tYgic+hEz9XX1yymQzf/C7n4to2yNvq0r4g51xDk8IuP95WEh7zaqLlvFZvBFgxpHZBMYlRvhytjOYDeIFRMcGwHZcXosaG2ejqDwcGq/LC4oeG4sSwmg9sdRrtcmcanrNqrBka86WYO6LntI3JdZ86/1ACEUHzhCCwvrKELc9Ji1xxGAgS7QKH+s2/hnJuiMyv73gOVLKYC+wPMLt+fvOmPLSEl+PJiAIlToBq1KUBg03RSQLfPOLD7OrJ8VvDZsEPwejqlGDyc4wRglS9OTi7SnN5LYHSDNDdGdREegWqq9qDHEYEVLI= env: + # Fill out these global variables for build process global: - MODULE_ID=cbi18n matrix: - - ENGINE=lucee@4.5 - ENGINE=lucee@5 - ENGINE=adobe@11 - ENGINE=adobe@2016 + - ENGINE=adobe@2018 branches: only: - development - master +dist: trusty + +sudo: required + before_install: # CommandBox Keys - - sudo apt-key adv --keyserver keys.gnupg.net --recv 6DA70622 + - curl -fsSl https://downloads.ortussolutions.com/debs/gpg | sudo apt-key add - - sudo echo "deb http://downloads.ortussolutions.com/debs/noarch /" | sudo tee -a /etc/apt/sources.list.d/commandbox.list install: # Install Commandbox - sudo apt-get update && sudo apt-get --assume-yes install rsync jq commandbox - # Test that the box binary is available and ready for our tests - - box version + # Install CommandBox Supporting Librarires + - box install commandbox-cfconfig,commandbox-dotenv,commandbox-docbox # If using auto-publish, you will need to provide your API token with this line: - box config set endpoints.forgebox.APIToken=$FORGEBOX_API_TOKEN > /dev/null - # Setup for our tests - - mkdir tests/results - - sudo chmod -R 775 tests/results -# Build script - note module versioning is passed to ANT script: + # Set Current Version + - TARGET_VERSION=`cat $TRAVIS_BUILD_DIR/box.json | jq '.version' -r` + - echo "Starting build for ${MODULE_ID} v${TARGET_VERSION}" + # Replace version so builder can issue it + - box package set version=@build.version@+@build.number@ + # Startup the harness + - cd test-harness # run our dependency install to ensure the workbench is in place - box install - # add our module-specific build properties - - printf "\nmodule.name=$MODULE_ID" >> workbench/build.properties - - printf "\ncfengine=$ENGINE" >> workbench/build.properties - # execute our build - - ant -DisTravis=true -Dbuild.number=$TRAVIS_BUILD_NUMBER -Dbuild.branch=$TRAVIS_BRANCH -f workbench/build.xml + # run our matrix server + - box server start serverConfigFile="server-${ENGINE}.json" + # Startup the app + - curl http://localhost:60299 + # Debugging of tests + #- curl http://localhost:60299/tests/runner.cfm?reporter=json -o testresults.json && cat testresults.json + # move back to build dir to build it + - cd $TRAVIS_BUILD_DIR + # Build Project + - box task run taskfile=build/Build target=run :version=${TARGET_VERSION} :projectName=${MODULE_ID} :buildID=${TRAVIS_BUILD_NUMBER} :branch=${TRAVIS_BRANCH} + # Cat results for debugging + - cat build/results.json after_failure: - - cd $TRAVIS_BUILD_DIR + - cd $TRAVIS_BUILD_DIR/test-harness # Display the contents of our root directory # Spit out our Commandbox log in case we need to debug - - box server log name=$ENGINE + - box server log server-${ENGINE}.json - cat `box system-log` -# Only executed when merging to master -before_deploy: - - cd $TRAVIS_BUILD_DIR - - mkdir -p s3deploy - - rsync -av ./artifacts/$MODULE_ID/ ./s3deploy/ - - rm -f ./s3deploy/box-repo.json - deploy: - #Module Deployment + # Module Deployment - provider: s3 on: - branch: + branch: - master - development - condition: "$ENGINE = lucee@4.5" + condition: "$ENGINE = lucee@5" skip_cleanup: true #AWS Credentials need to be set in Travis access_key_id: $AWS_ACCESS_KEY secret_access_key: $AWS_ACCESS_SECRET + # Destination bucket: "downloads.ortussolutions.com" - local-dir: s3deploy + local-dir: $TRAVIS_BUILD_DIR/.artifacts/$MODULE_ID upload-dir: ortussolutions/coldbox-modules/$MODULE_ID acl: public_read - #API Docs Deployment + + # API Docs Deployment - provider: s3 on: - branch: + branch: - master - development - condition: "$ENGINE = lucee@4.5" + condition: "$ENGINE = lucee@5" skip_cleanup: true #AWS Credentials need to be set in Travis access_key_id: $AWS_ACCESS_KEY secret_access_key: $AWS_ACCESS_SECRET bucket: "apidocs.ortussolutions.com" - local-dir: build/apidocs - upload-dir: coldbox-modules/$MODULE_ID + local-dir: $TRAVIS_BUILD_DIR/.tmp/apidocs + upload-dir: coldbox-modules/$MODULE_ID/$TARGET_VERSION acl: public_read - after_deploy: - - cd $TRAVIS_BUILD_DIR/build && box forgebox publish + # Move to build out artifact + - cd ${TRAVIS_BUILD_DIR}/.tmp/${MODULE_ID} + - cat box.json + # Only publish once + - if [ ${ENGINE} = 'lucee@5' ]; then box forgebox publish; fi diff --git a/modules/cbi18n/ModuleConfig.cfc b/ModuleConfig.cfc similarity index 83% rename from modules/cbi18n/ModuleConfig.cfc rename to ModuleConfig.cfc index 6b2003a..2a6c050 100644 --- a/modules/cbi18n/ModuleConfig.cfc +++ b/ModuleConfig.cfc @@ -1,15 +1,15 @@ /** -********************************************************************************* -* Copyright Since 2005 ColdBox Framework by Luis Majano and Ortus Solutions, Corp -* www.ortussolutions.com -******************************************************************************** -*/ + ********************************************************************************* + * Copyright Since 2005 ColdBox Framework by Luis Majano and Ortus Solutions, Corp + * www.ortussolutions.com + ******************************************************************************** + */ component { // Module Properties this.title = "cbi18n"; this.author = "Luis Majano"; - this.webURL = "http://www.ortussolutions.com"; + this.webURL = "https://www.ortussolutions.com"; this.description = "Gives i18n and localization capabilities to applications"; this.version = "@build.version@+@build.number@"; // If true, looks for views in the parent first, if not found, then in the module. Else vice-versa @@ -24,21 +24,23 @@ component { this.cfmapping = "cbi18n"; /** - * Configure Module - */ + * Configure Module + */ function configure(){ - // Mixin our own methods on handlers, interceptors and views via the ColdBox UDF Library File setting - arrayAppend( controller.getSetting( "ApplicationHelper" ), "#moduleMapping#/models/Mixins.cfm" ); + // cb4 style + arrayAppend( controller.getSetting( "ApplicationHelper" ), "#moduleMapping#/helpers/Mixins.cfm" ); } /** - * Fired when the module is registered and activated. - */ + * Fired when the module is registered and activated. + */ function onLoad(){ parseParentSettings(); + // Remap Resource Service if settings allow it if( len( controller.getSetting( "customResourceService" ) ) ){ - binder.map( "resourceService@cbi18n", true ).to( controller.getSetting( "customResourceService" ) ); + binder.map( "resourceService@cbi18n", true ) + .to( controller.getSetting( "customResourceService" ) ); } } @@ -49,7 +51,7 @@ component { var appHelperArray = controller.getSetting( "ApplicationHelper" ); var mixinToRemove = "#moduleMapping#/models/Mixins.cfm"; var mixinIndex = arrayFindNoCase( appHelperArray, mixinToRemove ); - + // If the mixin is in the array if( mixinIndex ) { // Remove it @@ -60,18 +62,19 @@ component { } /** - * Listen when modules are activated to load their i18n capabilities - */ - function afterConfigurationLoad( event, interceptData ){ + * Listen when modules are activated to load their i18n capabilities + */ + function afterAspectsLoad( event, interceptData ){ var modules = controller.getSetting( "modules" ); var moduleService = controller.getModuleService(); var moduleConfigCache = moduleService.getModuleConfigCache(); + for( var thisModule in modules ){ // get module config object var oConfig = moduleConfigCache[ thisModule ]; // Get i18n Settings - var i18nSettings = oConfig.getPropertyMixin( "i18n", "variables", structnew() ); + var i18nSettings = oConfig.getPropertyMixin( "i18n", "variables", {} ); // Verify it exists and use it, else ignore. if( structCount( i18nSettings ) ){ @@ -112,7 +115,7 @@ component { structAppend( controller.getSetting( "resourceBundles" ), modules[ thisModule ].i18n.resourceBundles, true ); flagi18n = true; } - + if( flagi18n ){ controller.setSetting( "using_i18N", true ); } @@ -131,7 +134,7 @@ component { private function parseParentSettings(){ // Read parent application config var oConfig = controller.getSetting( "ColdBoxConfig" ); - var i18n = oConfig.getPropertyMixin( "i18N", "variables", structnew() ); + var i18n = oConfig.getPropertyMixin( "i18N", "variables", {} ); var configStruct = controller.getConfigSettings(); // Defaults @@ -141,8 +144,8 @@ component { configStruct[ "unknownTranslation" ] = ""; configStruct[ "logUnknownTranslation" ] = false; configStruct[ "using_i18N" ] = false; - configStruct[ "resourceBundles" ] = structNew(); - configStruct[ "RBundles" ] = structNew(); + configStruct[ "resourceBundles" ] = {}; + configStruct[ "RBundles" ] = {}; configStruct[ "customResourceService" ] = ""; // Check if empty @@ -167,9 +170,11 @@ component { if ( structKeyExists( i18n, "localeStorage" ) AND len( i18n.localeStorage ) ){ configStruct[ "localeStorage" ] = i18n.localeStorage; if( NOT reFindNoCase( "^(session|cookie|client|request)$",configStruct[ "localeStorage" ]) ){ - throw(message="Invalid local storage scope: #configStruct[ "localeStorage" ]#", - detail="Valid scopes are session,client, cookie, or request", - type="InvalidLocaleStorage" ); + throw( + message="Invalid local storage scope: #configStruct[ "localeStorage" ]#", + detail="Valid scopes are session,client, cookie, or request", + type="InvalidLocaleStorage" + ); } } @@ -190,13 +195,12 @@ component { //Check for custom ResourceService if( structKeyExists( i18n, "customResourceService" ) AND len( i18n.customResourceService ) ){ - configStruct[ "customResourceService" ] = i18n.customResourceService; + configStruct[ "customResourceService" ] = i18n.customResourceService; } // set i18n being used configStruct[ "using_i18N" ] = true; } - return configStruct[ "using_i18N" ]; } } diff --git a/apidocs/Application.cfc b/apidocs/Application.cfc deleted file mode 100755 index 7d4b70a..0000000 --- a/apidocs/Application.cfc +++ /dev/null @@ -1,16 +0,0 @@ -component{ - - this.name = "APIDocs" & hash(getCurrentTemplatePath()); - this.sessionManagement = true; - this.sessionTimeout = createTimeSpan(0,0,1,0); - - // API Root - API_ROOT = getDirectoryFromPath( getCurrentTemplatePath() ); - rootPath = REReplaceNoCase( API_ROOT, "apidocs(\\|\/)$", "" ); - - this.mappings[ "/docbox" ] = API_ROOT & "docbox"; - this.mappings[ "/root" ] = rootPath; - this.mappings[ "/coldbox" ] = rootPath & "coldbox"; - this.mappings[ "/cbi18n" ] = rootPath & "modules/cbi18n/models"; - -} \ No newline at end of file diff --git a/apidocs/box.json b/apidocs/box.json deleted file mode 100644 index 2875065..0000000 --- a/apidocs/box.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "name":"API Docs", - "version":"1.0.0", - "slug":"module-apidocs", - "private":true, - "dependencies":{ - "docbox":"^2.2.1+27" - }, - "devDependencies":{}, - "installPaths":{ - "docbox":"docbox" - } -} \ No newline at end of file diff --git a/apidocs/index.cfm b/apidocs/index.cfm deleted file mode 100644 index e196917..0000000 --- a/apidocs/index.cfm +++ /dev/null @@ -1,22 +0,0 @@ - - - - docName = "cbi18n-APIDocs"; - base = expandPath( "/cbi18n" ); - docbox = new docbox.DocBox( properties = { - projectTitle = "cbi18n v#url.version#", - outputDir = url.path - } ); - docbox.generate( source=base, mapping="cbi18n" ); - - - - - -

Done!

-Go to Docs! -
- diff --git a/apidocs/server.json b/apidocs/server.json deleted file mode 100644 index c37e697..0000000 --- a/apidocs/server.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "force":true, - "openbrowser":"false", - "web":{ - "http":{ - "port":"8511" - } - } -} \ No newline at end of file diff --git a/box.json b/box.json index 363e7b9..7a6cdf6 100644 --- a/box.json +++ b/box.json @@ -1,24 +1,29 @@ { - "name":"CBi18n Builder", - "version":"1.3.2", - "slug":"cbi18n-shell", - "private":false, - "dependencies":{ - "coldbox":"^4.3.0", - "workbench":"git+https://github.com/Ortus-Solutions/unified-workbench.git" - }, - "devDependencies":{ - "testbox":"^2.6.0+156" - }, - "installPaths":{ - "coldbox":"coldbox", - "workbench":"workbench", - "testbox":"testbox" - }, - "testbox":{ - "runner":"http://localhost:49616" - }, + "name" : "ColdBox i18n Support", + "author" : "Ortus Solutions ", + "version" : "1.5.0", + "location" : "http://downloads.ortussolutions.com/ortussolutions/coldbox-modules/cbi18n/@build.version@/cbi18n-@build.version@.zip", + "slug" : "cbi18n", + "type" : "modules", + "keywords" : "i18n,internationalization,localization,language support", + "homepage" : "https://github.com/coldbox-modules/cbi18n", + "documentation" : "https://github.com/coldbox-modules/cbi18n/wiki", + "repository" : { "type" : "git", "url" : "https://github.com/coldbox-modules/cbi18n" }, + "shortDescription" : "This module will enhance your ColdBox applications with i18n capabilities, resource bundles and localization.", + "license" : [ + { "type" : "Apache2", "url" : "http://www.apache.org/licenses/LICENSE-2.0.html" } + ], + "contributors" : [ + "Brad Wood ", + "Curt Gratz ", + "Jon Clausen " + ], + "ignore":[ + "**/.*", + "tests/*", + ".git*" + ], "scripts":{ - "postVersion":"recipe workbench/bump.boxr" + "toMaster":"recipe build/toMaster.boxr" } } \ No newline at end of file diff --git a/build/Build.cfc b/build/Build.cfc new file mode 100644 index 0000000..e9cb6e9 --- /dev/null +++ b/build/Build.cfc @@ -0,0 +1,246 @@ +/** + * Build process for ColdBox Modules + * Adapt to your needs. + */ +component{ + + /** + * Constructor + */ + function init(){ + // Setup Pathing + variables.cwd = getCWD().reReplace( "\.$", "" ); + variables.artifactsDir = cwd & "/.artifacts"; + variables.buildDir = cwd & "/.tmp"; + variables.apiDocsURL = "http://localhost:60299/apidocs/"; + variables.testRunner = "http://localhost:60299/tests/runner.cfm"; + + // Source Excludes Not Added to final binary + variables.excludes = [ + ".gitignore", + ".travis.yml", + ".artifacts", + ".tmp", + "build", + "test-harness", + ".DS_Store", + ".git" + ]; + + // Cleanup + Init Build Directories + [ variables.buildDir, variables.artifactsDir ].each( function( item ){ + if( directoryExists( item ) ){ + directoryDelete( item, true ); + } + // Create directories + directoryCreate( item, true, true ); + } ); + + // Create Mappings + fileSystemUtil.createMapping( "coldbox", variables.cwd & "test-harness/coldbox" ); + + return this; + } + + /** + * Run the build process: test, build source, docs, checksums + * + * @projectName The project name used for resources and slugs + * @version The version you are building + * @buldID The build identifier + * @branch The branch you are building + */ + function run( + required projectName, + version="1.0.0", + buildID=createUUID(), + branch="development" + ){ + + // Run the tests + runTests(); + + // Build the source + buildSource( argumentCollection=arguments ); + + // Build Docs + arguments.outputDir = variables.buildDir & "/apidocs"; + docs( argumentCollection=arguments ); + + // checksums + buildChecksums(); + + // Finalize Message + print.line() + .boldMagentaLine( "Build Process is done! Enjoy your build!" ) + .toConsole(); + } + + /** + * Run the test suites + */ + function runTests(){ + // Tests First, if they fail then exit + print.blueLine( "Testing the package, please wait..." ).toConsole(); + + command( 'testbox run' ) + .params( + runner = variables.testRunner, + verbose = true, + outputFile = "build/results.json" + ) + .run(); + + // Check Exit Code? + if( shell.getExitCode() ){ + return error( "Cannot continue building, tests failed!" ); + } + } + + /** + * Build the source + * + * @projectName The project name used for resources and slugs + * @version The version you are building + * @buldID The build identifier + * @branch The branch you are building + */ + function buildSource( + required projectName, + version="1.0.0", + buildID=createUUID(), + branch="development" + ){ + // Build Notice ID + print.line() + .boldMagentaLine( "Building #arguments.projectName# v#arguments.version#+#arguments.buildID# from #cwd# using the #arguments.branch# branch." ) + .toConsole(); + + // Prepare exports directory + variables.exportsDir = variables.artifactsDir & "/#projectName#/#arguments.version#"; + directoryCreate( variables.exportsDir, true, true ); + + // Project Build Dir + variables.projectBuildDir = variables.buildDir & "/#projectName#"; + directoryCreate( variables.projectBuildDir, true, true ); + + // Copy source + print.blueLine( "Copying source to build folder..." ).toConsole(); + copy( variables.cwd, variables.projectBuildDir ); + + // Create build ID + fileWrite( "#variables.projectBuildDir#/#projectName#-#version#+#buildID#", "Built with love on #dateTimeFormat( now(), "full")#" ); + + // Updating Placeholders + print.greenLine( "Updating version identifier to #arguments.version#" ).toConsole(); + command( 'tokenReplace' ) + .params( + path = "/#variables.projectBuildDir#/**", + token = "@build.version@", + replacement = arguments.version + ) + .run(); + + print.greenLine( "Updating build identifier to #arguments.buildID#" ).toConsole(); + command( 'tokenReplace' ) + .params( + path = "/#variables.projectBuildDir#/**", + token = ( arguments.branch == "master" ? "@build.number@" : "+@build.number@" ), + replacement = ( arguments.branch == "master" ? arguments.buildID : "-snapshot" ) + ) + .run(); + + // zip up source + var destination = "#variables.exportsDir#/#projectName#-#version#.zip"; + print.greenLine( "Zipping code to #destination#" ).toConsole(); + cfzip( + action="zip", + file="#destination#", + source="#variables.projectBuildDir#", + overwrite=true, + recurse=true + ); + + // Copy box.json for convenience + fileCopy( "#variables.projectBuildDir#/box.json", variables.exportsDir ); + } + + /** + * Produce the API Docs + */ + function docs( required projectName, version="1.0.0", outputDir=".tmp/apidocs" ){ + // Generate Docs + print.greenLine( "Generating API Docs, please wait..." ).toConsole(); + directoryCreate( arguments.outputDir, true, true ); + + command( 'docbox generate' ) + .params( + "source" = "models", + "mapping" = "models", + "strategy-projectTitle" = "#arguments.projectName# v#arguments.version#", + "strategy-outputDir" = arguments.outputDir + ) + .run(); + + print.greenLine( "API Docs produced at #arguments.outputDir#" ).toConsole(); + + var destination = "#variables.exportsDir#/#projectName#-docs-#version#.zip"; + print.greenLine( "Zipping apidocs to #destination#" ).toConsole(); + cfzip( + action="zip", + file="#destination#", + source="#arguments.outputDir#", + overwrite=true, + recurse=true + ); + } + + /********************************************* PRIVATE HELPERS *********************************************/ + + /** + * Build Checksums + */ + private function buildChecksums(){ + print.greenLine( "Building checksums" ).toConsole(); + command( 'checksum' ) + .params( path = '#variables.exportsDir#/*.zip', algorithm = 'SHA-512', extension="sha512", write=true ) + .run(); + command( 'checksum' ) + .params( path = '#variables.exportsDir#/*.zip', algorithm = 'md5', extension="md5", write=true ) + .run(); + } + + /** + * DirectoryCopy is broken in lucee + */ + private function copy( src, target, recurse=true ){ + // process paths with excludes + directoryList( src, false, "path", function( path ){ + var isExcluded = false; + variables.excludes.each( function( item ){ + if( path.replaceNoCase( variables.cwd, "", "all" ).findNoCase( item ) ){ + isExcluded = true; + } + } ); + return !isExcluded; + }).each( function( item ){ + // Copy to target + if( fileExists( item ) ){ + print.blueLine( "Copying #item#" ).toConsole(); + fileCopy( item, target ); + } else { + print.greenLine( "Copying directory #item#" ).toConsole(); + directoryCopy( item, target & "/" & item.replace( src, "" ), true ); + } + } ); + } + + /** + * Gets the last Exit code to be used + **/ + private function getExitCode() { + return (createObject( 'java', 'java.lang.System' ).getProperty( 'cfml.cli.exitCode' ) ?: 0); + + } + +} \ No newline at end of file diff --git a/build/toMaster.boxr b/build/toMaster.boxr new file mode 100755 index 0000000..ec73706 --- /dev/null +++ b/build/toMaster.boxr @@ -0,0 +1,19 @@ +# This recipe signifies a new release of the module by doing merges and bumps accordingly + +# Check out master +!git checkout -f master +# Merge development into it +!git merge --no-ff development +# Tag the master repo with the version in box.json +!git tag v`box package show version` +# Push all branches +!git push origin --all +# Push all tags +!git push origin --tags +# Check development again +!git checkout -f development +# Bump to prepare for a new release, do minor, change if needed and don't tag +bump --minor --!tagVersion +# Send it out +!git commit -a -m "version bump" +!git push origin development \ No newline at end of file diff --git a/changelog.md b/changelog.md index 66b9a75..08552ec 100644 --- a/changelog.md +++ b/changelog.md @@ -1,38 +1,53 @@ -CHANGELOG -========= +# CHANGELOG + +## 1.5.0 + +* `Improvement` : Updated to new template style +* `Improvement` : ColdBox 5 updates +* `Improvement` : Moved i18n listener to afterAspectsLoad to avoid module loading collisions +* `Bug` : Invalid `instance` scope usage in models ## 1.4.0 + * Few docuementation fixes * Fix implementation of `getTZoffset()` thanks to Seb Duggan * CCM-47 Case sensitivity resolved for resource service thanks to @wpdebruin * Updated TestBox version ## 1.3.2 + * Unified workbench * Encapsulation of module bundle resources ## 1.3.1 + * Varscoping fixes * Travis updates ## 1.3.0 + * Implements the ability to add a custom Resource Service for distributed i18n * Fixes issues with non-ISO characters in properties files ## 1.2.0 + * New configuration setting for logging when no translation is found `logUnknownTranslation` * Adding Travis CI support ## 1.1.0 + * Updated build process * Updated docs and instructions -##1.0.2 +## 1.0.2 + * Fixes on `getRBKeys()` and `getRBString()` to load correct file paths. -##1.0.1 +## 1.0.1 + * production ignore lists * Unloading of helpers -##1.0.0 +## 1.0.0 + * Create first module version \ No newline at end of file diff --git a/config/.htaccess b/config/.htaccess deleted file mode 100644 index 3d45d68..0000000 --- a/config/.htaccess +++ /dev/null @@ -1,4 +0,0 @@ -#apache access file to protect the config.xml.cfm file. Delete this if you do not use apache. -authtype Basic -deny from all -Options -Indexes \ No newline at end of file diff --git a/config/Application.cfm b/config/Application.cfm deleted file mode 100644 index 50762fb..0000000 --- a/config/Application.cfm +++ /dev/null @@ -1,9 +0,0 @@ - - \ No newline at end of file diff --git a/config/Routes.cfm b/config/Routes.cfm deleted file mode 100644 index 9acad99..0000000 --- a/config/Routes.cfm +++ /dev/null @@ -1,20 +0,0 @@ - - // Allow unique URL or combination (false) - setUniqueURLS(false); - // Auto reload configuration, true in dev makes sense - //setAutoReload(false); - // Sets automatic route extension detection and places the extension in the rc.format - // setExtensionDetection(true) - // setValidExtensions('xml,json,jsont,rss,html,htm'); - - // Base URL - if( len(getSetting('AppMapping') ) lte 1){ - setBaseURL("http://#cgi.HTTP_HOST#/index.cfm"); - } - else{ - setBaseURL("http://#cgi.HTTP_HOST#/#getSetting('AppMapping')#/index.cfm"); - } - - // Your Application Routes - addRoute(pattern=":handler/:action?"); - \ No newline at end of file diff --git a/modules/cbi18n/models/Mixins.cfm b/helpers/Mixins.cfm similarity index 100% rename from modules/cbi18n/models/Mixins.cfm rename to helpers/Mixins.cfm diff --git a/layouts/Main.cfm b/layouts/Main.cfm deleted file mode 100644 index 8849863..0000000 --- a/layouts/Main.cfm +++ /dev/null @@ -1,11 +0,0 @@ - - - - -<cfoutput>#getSetting( "appName" )#</cfoutput> - - - -#renderView()# - - diff --git a/modules/cbi18n/models/ResourceService.cfc b/models/ResourceService.cfc similarity index 98% rename from modules/cbi18n/models/ResourceService.cfc rename to models/ResourceService.cfc index bf141f3..213f2b1 100755 --- a/modules/cbi18n/models/ResourceService.cfc +++ b/models/ResourceService.cfc @@ -11,6 +11,8 @@ Inspired by Paul Hastings + + @@ -154,21 +156,21 @@ Inspired by Paul Hastings // Check if resource does NOT exists? if( NOT structKeyExists( thisBundle, arguments.resource ) ){ - // if logging enable + // if logging enable if( instance.logUnknownTranslation ){ log.error( instance.unknownTranslation & " key: #arguments.resource#" ); } // Check default and return if sent - if( structKeyExists( arguments, "default" ) ){ - return arguments.default; + if( structKeyExists( arguments, "default" ) ){ + return arguments.default; } - + // Check unknown translation setting - if( len( instance.unknownTranslation ) ){ - return instance.unknownTranslation & " key: #arguments.resource#"; + if( len( instance.unknownTranslation ) ){ + return instance.unknownTranslation & " key: #arguments.resource#"; } - + // Else return nasty unknown string. return "_UNKNOWNTRANSLATION_FOR_#arguments.resource#_"; } diff --git a/modules/cbi18n/models/i18n.cfc b/models/i18n.cfc similarity index 99% rename from modules/cbi18n/models/i18n.cfc rename to models/i18n.cfc index b3e7ea4..8f95c5c 100755 --- a/modules/cbi18n/models/i18n.cfc +++ b/models/i18n.cfc @@ -14,6 +14,8 @@ www.ortussolutions.com + + // Internal Java Objects diff --git a/modules/cbi18n/box.json b/modules/cbi18n/box.json deleted file mode 100644 index 8805592..0000000 --- a/modules/cbi18n/box.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "name" : "ColdBox i18n Support", - "version" : "@build.version@+@build.number@", - "author" : "Luis Majano ", - "Curt Gratz ", - "Jon Clausen " - ], - "engines" : [ - { "type" : "lucee", "version" : ">4.5" }, - { "type" : "adobe", "version" : ">11" } - ], - "ignore":[ - "**/.*", - "tests", - "apidocs", - "*/.md" - ] -} \ No newline at end of file diff --git a/server.json b/server.json deleted file mode 100644 index 80a955d..0000000 --- a/server.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "force":true, - "app":{ - "cfengine":"lucee@4.5" - }, - "openbrowser":"false", - "web":{ - "http":{ - "port":"50680" - } - } -} \ No newline at end of file diff --git a/test-harness/.cfconfig.json b/test-harness/.cfconfig.json new file mode 100644 index 0000000..bd49f5d --- /dev/null +++ b/test-harness/.cfconfig.json @@ -0,0 +1,8 @@ +{ + "debuggingEnabled":true, + "debuggingReportExecutionTimes":false, + "disableInternalCFJavaComponents":false, + "inspectTemplate":"always", + "requestTimeout":"0,0,0,90", + "robustExceptionEnabled":true +} \ No newline at end of file diff --git a/test-harness/.cflintrc b/test-harness/.cflintrc new file mode 100644 index 0000000..9e26dfe --- /dev/null +++ b/test-harness/.cflintrc @@ -0,0 +1 @@ +{} \ No newline at end of file diff --git a/Application.cfc b/test-harness/Application.cfc similarity index 50% rename from Application.cfc rename to test-harness/Application.cfc index 8b828a9..56d965b 100644 --- a/Application.cfc +++ b/test-harness/Application.cfc @@ -1,24 +1,53 @@ /** ******************************************************************************** Copyright 2005-2007 ColdBox Framework by Luis Majano and Ortus Solutions, Corp -www.coldboxframework.com | www.luismajano.com | www.ortussolutions.com +www.ortussolutions.com ******************************************************************************** */ component{ + + // UPDATE THE NAME OF THE MODULE IN TESTING BELOW + request.MODULE_NAME = "cbi18n"; + // Application properties - this.name = hash( getCurrentTemplatePath() ); + this.name = hash( getCurrentTemplatePath() ); this.sessionManagement = true; - this.sessionTimeout = createTimeSpan(0,0,30,0); - this.setClientCookies = true; + this.sessionTimeout = createTimeSpan(0,0,15,0); + this.setClientCookies = true; + + /************************************** + LUCEE Specific Settings + **************************************/ + // buffer the output of a tag/function body to output in case of a exception + this.bufferOutput = true; + // Activate Gzip Compression + this.compression = false; + // Turn on/off white space managemetn + this.whiteSpaceManagement = "smart"; + // Turn on/off remote cfc content whitespace + this.suppressRemoteComponentContent = false; // COLDBOX STATIC PROPERTY, DO NOT CHANGE UNLESS THIS IS NOT THE ROOT OF YOUR COLDBOX APP - COLDBOX_APP_ROOT_PATH = getDirectoryFromPath( getCurrentTemplatePath() ); + COLDBOX_APP_ROOT_PATH = getDirectoryFromPath( getCurrentTemplatePath() ); // The web server mapping to this application. Used for remote purposes or static purposes - COLDBOX_APP_MAPPING = ""; + COLDBOX_APP_MAPPING = ""; // COLDBOX PROPERTIES - COLDBOX_CONFIG_FILE = ""; + COLDBOX_CONFIG_FILE = ""; // COLDBOX APPLICATION KEY OVERRIDE - COLDBOX_APP_KEY = ""; + COLDBOX_APP_KEY = ""; + + // Mappings + this.mappings[ "/root" ] = COLDBOX_APP_ROOT_PATH; + + // Map back to its root + moduleRootPath = REReplaceNoCase( this.mappings[ "/root" ], "#request.MODULE_NAME#(\\|/)test-harness(\\|/)", "" ); + modulePath = REReplaceNoCase( this.mappings[ "/root" ], "test-harness(\\|/)", "" ); + + // Module Root + Path Mappings + this.mappings[ "/moduleroot" ] = moduleRootPath; + this.mappings[ "/#request.MODULE_NAME#" ] = modulePath; + + this.mappings[ "/cbi18n" ] = COLDBOX_APP_ROOT_PATH & "modules/cbi18n"; // application start public boolean function onApplicationStart(){ @@ -29,6 +58,7 @@ component{ // request start public boolean function onRequestStart(String targetPage){ + // Process ColdBox Request application.cbBootstrap.onRequestStart( arguments.targetPage ); diff --git a/test-harness/box.json b/test-harness/box.json new file mode 100644 index 0000000..87e0631 --- /dev/null +++ b/test-harness/box.json @@ -0,0 +1,20 @@ +{ + "name":"Tester", + "version":"0.0.0", + "slug":"tester", + "private":true, + "description":"", + "dependencies":{ + "coldbox":"^5.0.0" + }, + "devDependencies":{ + "testbox":"^3.0.0" + }, + "installPaths":{ + "coldbox":"coldbox/", + "testbox":"testbox/" + }, + "testbox":{ + "runner":"http://localhost:60299/tests/runner.cfm" + } +} \ No newline at end of file diff --git a/test-harness/config/Application.cfc b/test-harness/config/Application.cfc new file mode 100644 index 0000000..23c5ad0 --- /dev/null +++ b/test-harness/config/Application.cfc @@ -0,0 +1,7 @@ +/** +* This is a protection Application cfm for the config file. You do not +* need to modify this file +*/ +component{ + abort; +} \ No newline at end of file diff --git a/config/Coldbox.cfc b/test-harness/config/Coldbox.cfc similarity index 54% rename from config/Coldbox.cfc rename to test-harness/config/Coldbox.cfc index ce3659b..5122bc6 100644 --- a/config/Coldbox.cfc +++ b/test-harness/config/Coldbox.cfc @@ -1,4 +1,4 @@ -component{ +component{ // Configure ColdBox Application function configure(){ @@ -6,52 +6,43 @@ component{ // coldbox directives coldbox = { //Application Setup - appName = "Development Shell", + appName = "Module Tester", //Development Settings reinitPassword = "", handlersIndexAutoReload = true, + modulesExternalLocation = [], //Implicit Events - defaultEvent = "main.index", + defaultEvent = "", requestStartHandler = "", requestEndHandler = "", - applicationStartHandler = "main.onAppInit", + applicationStartHandler = "", applicationEndHandler = "", sessionStartHandler = "", sessionEndHandler = "", missingTemplateHandler = "", - //Extension Points - ApplicationHelper = "", - coldboxExtensionsLocation = "", - modulesExternalLocation = [], - pluginsExternalLocation = "", - viewsExternalLocation = "", - layoutsExternalLocation = "", - handlersExternalLocation = "", - requestContextDecorator = "", - //Error/Exception Handling exceptionHandler = "", onInvalidEvent = "", - customErrorTemplate = "/coldbox/system/includes/BugReport.cfm", + customErrorTemplate = "/coldbox/system/includes/BugReport.cfm", //Application Aspects handlerCaching = false, - eventCaching = false, - proxyReturnCollection = false + eventCaching = false }; - // custom settings - settings = { + // environment settings, create a detectEnvironment() method to detect it yourself. + // create a function with the name of the environment so it can be executed if that environment is detected + // the value of the environment is a list of regex patterns to match the cgi.http_host. + environments = { + development = "localhost,127\.0\.0\.1" }; - // Module Directives - modules = { - //Turn to false in production, on for dev - autoReload = false - }; + //Register interceptors as an array, we need order + interceptors = [ + ]; //i18n & Localization i18n = { @@ -63,34 +54,36 @@ component{ localeStorage = "cookie", unknownTranslation = "**NOT FOUND**", logUnknownTranslation = true, - customResourceService = "#len( appMapping ) ? appMapping & "." : ''#models.CustomResourceService" + customResourceService = "root.models.CustomResourceService" }; - //LogBox DSL logBox = { // Define Appenders appenders = { files={class="coldbox.system.logging.appenders.RollingFileAppender", properties = { - filename = coldbox.appName, filePath="/#appMapping#/logs" + filename = "tester", filePath="/#appMapping#/logs" } } }, // Root Logger - root = { levelmax="ERROR", appenders="*" }, + root = { levelmax="DEBUG", appenders="*" }, // Implicit Level Categories info = [ "coldbox.system" ] }; - //Register interceptors as an array, we need order - interceptors = [ - //SES - {class="coldbox.system.interceptors.SES", - properties={} - } - ]; + } + /** + * Load the Module you are testing + */ + function afterConfigurationLoad( event, interceptData, rc, prc ){ + controller.getModuleService() + .registerAndActivateModule( + moduleName = request.MODULE_NAME, + invocationPath = "moduleroot" + ); } } \ No newline at end of file diff --git a/test-harness/config/Router.cfc b/test-harness/config/Router.cfc new file mode 100644 index 0000000..535febd --- /dev/null +++ b/test-harness/config/Router.cfc @@ -0,0 +1,34 @@ +component{ + + function configure(){ + // Set Full Rewrites + setFullRewrites( true ); + + /** + * -------------------------------------------------------------------------- + * App Routes + * -------------------------------------------------------------------------- + * + * Here is where you can register the routes for your web application! + * Go get Funky! + * + */ + + // A nice healthcheck route example + route("/healthcheck",function(event,rc,prc){ + return "Ok!"; + }); + + // A nice RESTFul Route example + route( "/api/echo", function( event, rc, prc ){ + return { + "error" : false, + "data" : "Welcome to my awesome API!" + }; + } ); + + // Conventions based routing + route( ":handler/:action?" ).end(); + } + +} \ No newline at end of file diff --git a/test-harness/config/WireBox.cfc b/test-harness/config/WireBox.cfc new file mode 100644 index 0000000..3aafc01 --- /dev/null +++ b/test-harness/config/WireBox.cfc @@ -0,0 +1,46 @@ +component extends="coldbox.system.ioc.config.Binder"{ + + /** + * 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" + }, + + // DSL Namespace registrations + customDSL = { + // namespace = "mapping name" + }, + + // Custom Storage Scopes + customScopes = { + // annotationName = "mapping name" + }, + + // Package scan locations + scanLocations = [], + + // Stop Recursions + stopRecursions = [], + + // Parent Injector to assign to the configured injector, this must be an object reference + parentInjector = "", + + // Register all event listeners here, they are created in the specified order + listeners = [ + // { class="", name="", properties={} } + ] + }; + + // Map Bindings below + } + +} \ No newline at end of file diff --git a/handlers/Main.cfc b/test-harness/handlers/Main.cfc similarity index 98% rename from handlers/Main.cfc rename to test-harness/handlers/Main.cfc index dbfb625..b6d34ea 100644 --- a/handlers/Main.cfc +++ b/test-harness/handlers/Main.cfc @@ -1,4 +1,4 @@ -/** +/** * My Event Handler Hint */ component{ diff --git a/includes/i18n/i18n_goes_here.txt b/test-harness/includes/i18n/i18n_goes_here.txt similarity index 100% rename from includes/i18n/i18n_goes_here.txt rename to test-harness/includes/i18n/i18n_goes_here.txt diff --git a/includes/i18n/main_en_US.properties b/test-harness/includes/i18n/main_en_US.properties similarity index 100% rename from includes/i18n/main_en_US.properties rename to test-harness/includes/i18n/main_en_US.properties diff --git a/includes/i18n/main_es_SV.properties b/test-harness/includes/i18n/main_es_SV.properties similarity index 100% rename from includes/i18n/main_es_SV.properties rename to test-harness/includes/i18n/main_es_SV.properties diff --git a/includes/i18n/support_en_US.properties b/test-harness/includes/i18n/support_en_US.properties similarity index 100% rename from includes/i18n/support_en_US.properties rename to test-harness/includes/i18n/support_en_US.properties diff --git a/includes/i18n/support_es_SV.properties b/test-harness/includes/i18n/support_es_SV.properties similarity index 100% rename from includes/i18n/support_es_SV.properties rename to test-harness/includes/i18n/support_es_SV.properties diff --git a/index.cfm b/test-harness/index.cfm similarity index 89% rename from index.cfm rename to test-harness/index.cfm index be3dc78..7331009 100644 --- a/index.cfm +++ b/test-harness/index.cfm @@ -1,4 +1,4 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + #testbox.init( directory=rootMapping & url.path ).run()# + +

Invalid incoming directory: #rootMapping & url.path#

+
+ + +
+ + + + + + + + + + + + + + + + + + + TestBox Browser + + + + + + + + + + + + + +
+
+
+ +
+ v#testbox.getVersion()# +
+ +
+
+
+
+
+ +

TestBox Test Browser:

+

+ Below is a listing of the files and folders starting from your root #rootPath#. You can click on individual tests in order to execute them + or click on the Run All button on your left and it will execute a directory runner from the visible folder. +

+ +
+ Contents: #executePath# + +

+
+ + + + + + + + ✚ #qResults.name#
+ + target="_blank"
>#qResults.name#
+ + target="_blank">#qResults.name#
+ + #qResults.name#
+ + +
+
+
+
+
+
+ + + +
\ No newline at end of file diff --git a/tests/resources/main_en_US.properties b/test-harness/tests/resources/main_en_US.properties similarity index 100% rename from tests/resources/main_en_US.properties rename to test-harness/tests/resources/main_en_US.properties diff --git a/tests/resources/main_es_SV.properties b/test-harness/tests/resources/main_es_SV.properties similarity index 100% rename from tests/resources/main_es_SV.properties rename to test-harness/tests/resources/main_es_SV.properties diff --git a/tests/runner.cfm b/test-harness/tests/runner.cfm similarity index 94% rename from tests/runner.cfm rename to test-harness/tests/runner.cfm index 7b0a23b..f5ec955 100644 --- a/tests/runner.cfm +++ b/test-harness/tests/runner.cfm @@ -1,4 +1,4 @@ - + diff --git a/tests/specs/integration/i18n.cfc b/test-harness/tests/specs/integration/i18n.cfc similarity index 97% rename from tests/specs/integration/i18n.cfc rename to test-harness/tests/specs/integration/i18n.cfc index c41f355..ffa7747 100644 --- a/tests/specs/integration/i18n.cfc +++ b/test-harness/tests/specs/integration/i18n.cfc @@ -63,7 +63,7 @@ component extends="coldbox.system.testing.BaseTestCase" appMapping="/root"{ }); it( "can load from modules", function(){ - var event = execute( event="test1:test.i18n", renderResults=true ); + var event = execute( route="test1/test/i18n", renderResults=true ); expect( event.getValue( "cbox_rendered_content" ) ).toInclude( "Welcome to my awesome multi-lingual module" ); }); diff --git a/tests/specs/unit/ResourceServiceTest.cfc b/test-harness/tests/specs/unit/ResourceServiceTest.cfc similarity index 100% rename from tests/specs/unit/ResourceServiceTest.cfc rename to test-harness/tests/specs/unit/ResourceServiceTest.cfc diff --git a/tests/specs/unit/i18nTest.cfc b/test-harness/tests/specs/unit/i18nTest.cfc similarity index 100% rename from tests/specs/unit/i18nTest.cfc rename to test-harness/tests/specs/unit/i18nTest.cfc diff --git a/test-harness/views/main/index.cfm b/test-harness/views/main/index.cfm new file mode 100644 index 0000000..54d06ac --- /dev/null +++ b/test-harness/views/main/index.cfm @@ -0,0 +1,19 @@ + +

i18n

+ +

homebutton

+ #getResource( resource='homebutton' )# +
+ +

bogus

+ #getResource( resource="bogus", defaultValue="BogusNotFound" )# +
+ +

homebutton

+ #getResource( resource='homebutton', locale="es_SV" )# +
+ +

helptext

+ #getResource( resource="helptext", bundle="support" )# +
+
\ No newline at end of file diff --git a/tests/Application.cfc b/tests/Application.cfc deleted file mode 100644 index b6f53ab..0000000 --- a/tests/Application.cfc +++ /dev/null @@ -1,24 +0,0 @@ -/** -* Copyright Since 2005 Ortus Solutions, Corp -* www.coldbox.org | www.luismajano.com | www.ortussolutions.com | www.gocontentbox.org -************************************************************************************** -*/ -component{ - this.name = "A TestBox Runner Suite " & hash( getCurrentTemplatePath() ); - // any other application.cfc stuff goes below: - this.sessionManagement = true; - // Turn on/off white space managemetn - this.whiteSpaceManagement = "smart"; - - // any mappings go here, we create one that points to the root called test. - this.mappings[ "/tests" ] = getDirectoryFromPath( getCurrentTemplatePath() ); - rootPath = REReplaceNoCase( this.mappings[ "/tests" ], "tests(\\|/)", "" ); - this.mappings[ "/root" ] = rootPath; - - // any orm definitions go here. - - // request start - public boolean function onRequestStart( String targetPage ){ - return true; - } -} \ No newline at end of file diff --git a/tests/specs/put_test_bundles_here.txt b/tests/specs/put_test_bundles_here.txt deleted file mode 100644 index e69de29..0000000 diff --git a/tests/test-auto.properties b/tests/test-auto.properties deleted file mode 100644 index 98b13fe..0000000 --- a/tests/test-auto.properties +++ /dev/null @@ -1 +0,0 @@ -url.runners.default=http://integration.stg.ortussolutions.com/codedepot/cbox-i18n/tests/runner.cfm? \ No newline at end of file diff --git a/tests/test.properties b/tests/test.properties deleted file mode 100644 index 6e00f38..0000000 --- a/tests/test.properties +++ /dev/null @@ -1,5 +0,0 @@ -url.runners.lucee@4.5=http://127.0.0.1:50680/tests/runner.cfm? -url.runners.lucee@5=http://127.0.0.1:50685/tests/runner.cfm? -url.runners.adobe@10=http://127.0.0.1:49610/tests/runner.cfm? -url.runners.adobe@11=http://127.0.0.1:49611/tests/runner.cfm? -url.runners.adobe@2016=http://127.0.0.1:49616/tests/runner.cfm? \ No newline at end of file diff --git a/tests/test.xml b/tests/test.xml deleted file mode 100644 index ea2608e..0000000 --- a/tests/test.xml +++ /dev/null @@ -1,238 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Loading properties from environment: ${environment} - - - - - Loading base properties - - - - - - - - - - - - Tests ran at ${start.TODAY} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/views/main/index.cfm b/views/main/index.cfm deleted file mode 100644 index 0fa9ef1..0000000 --- a/views/main/index.cfm +++ /dev/null @@ -1,19 +0,0 @@ - -

i18n

- -

homebutton

-#getResource( resource='homebutton' )# -
- -

bogus

-#getResource( resource="bogus", defaultValue="BogusNotFound" )# -
- -

homebutton

-#getResource( resource='homebutton', locale="es_SV" )# -
- -

helptext

-#getResource( resource="helptext", bundle="support" )# -
-
\ No newline at end of file