Skip to content

Commit

Permalink
Merge branch '6.0' of https://github.com/lucee/Lucee into 6.0
Browse files Browse the repository at this point in the history
  • Loading branch information
michaeloffner committed Oct 2, 2023
2 parents 7da61c9 + 6ac00e4 commit aac1d23
Show file tree
Hide file tree
Showing 66 changed files with 539 additions and 391 deletions.
14 changes: 7 additions & 7 deletions core/src/main/cfml/context/admin/resources/language/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -550,11 +550,11 @@
"newpassword": "New password",
"newpassworddescription": "The new password for the administrator",
"newpasswordmissing": "Please enter a value for the new password",
"newtooshort": "The new password is to short, its length must be at least 6 characters",
"newtooshort": "The new password is too short, its length must be at least 6 characters",
"oldpassword": "Old password",
"oldpassworddescription": "The old password to change",
"oldpasswordmissing": "Please enter a value for the old password",
"oldtooshort": "The old password is to short, its length must be at least 6 characters",
"oldtooshort": "The old password is too short, its length must be at least 6 characters",
"password": "Password",
"passwordmissing": "Please enter a value for the field password",
"rememberme": "Remember\u0026nbsp;Me for",
Expand Down Expand Up @@ -762,7 +762,7 @@
"contextcount": "Context count",
"contexts": {
"config_file": "Configuration File",
"desc": "You can label your web contexts here, so they are more clear distinguishable for use with extensions etc. The default label of a web context is the MD5 hash of its webroot.",
"desc": "You can label your web contexts here, so they are more clearly distinguishable for use with extensions etc. The default label of a web context is the MD5 hash of its webroot.",
"label": "Label",
"title": "Web contexts",
"url": "URL",
Expand Down Expand Up @@ -1561,7 +1561,7 @@
"dbStorage": "Storage",
"dbStorageDesc": "Allow using this datasource for client/session/log storage.",
"dbtimezone": "Timezone",
"dbtimezoneDesc": "When you define a date as a string (not with cfqueryparam) inside cfquery, there is normally no timezone information with it and the date string is based on the locale timezone. Therefore the database will interpret this date string based on it\u0027s own timezone.\r\nIf the timezone of your Lucee instance and your database is different, this can lead to problems. Because of that Lucee now allows you to define a timezone for a specific datasource definition. Be aware that you should only define a specific timezone, if you are a 100% sure that this timezone is used on the database server and it is different from the timezone of the Lucee instance. This setting can be overwritten by the cfquery attribute \"timezone\".",
"dbtimezoneDesc": "When you define a date as a string (not with cfqueryparam) inside cfquery, there is normally no timezone information with it and the date string is based on the locale timezone. Therefore the database will interpret this date string based on it\u0027s own timezone.\r\nIf the timezone of your Lucee instance and your database is different, this can lead to problems. Because of that Lucee now allows you to define a timezone for a specific datasource definition. Be aware that you should only define a specific timezone, if you are 100% sure that this timezone is used on the database server and it is different from the timezone of the Lucee instance. This setting can be overwritten by the cfquery attribute \"timezone\".",
"dbtimezoneSame": "Same as Lucee Instance",
"dbuser": "Username",
"dbuserdesc": "The username for the database",
Expand Down Expand Up @@ -1645,7 +1645,7 @@
"schema": "Schema",
"schemaDesc": "Specifies the default Schema that should be used by ORM. This setting can be overwritten in Application.cfc as follows [this.ormsettings.schema\u003d\u0027sch\u0027]",
"sqlscript": "SQL Script",
"sqlscriptDesc": "Path to the SQL script file that gets executed after ORM is initialized. This applies if dbcreate is set to dropcreate. This must be the absolute file path or the path relative to the application.The SQL script file lets you populate the tables before the application is accessed. This setting can be overwritten in Application.cfc as follows [this.ormsettings.sqlscript\u003d\u0027...\u0027]",
"sqlscriptDesc": "Path to the SQL script file that gets executed after ORM is initialized. This applies if dbcreate is set to dropcreate. This must be the absolute file path or the path relative to the application. The SQL script file lets you populate the tables before the application is accessed. This setting can be overwritten in Application.cfc as follows [this.ormsettings.sqlscript\u003d\u0027...\u0027]",
"title": "Settings",
"useDBForMapping": "Use DB for mapping",
"useDBForMappingDesc": "Specifies whether the database has to be inspected to identify the missing information required to generate the Hibernate mapping. The database is inspected to get the column data type, primary key and foreign key information. This setting can be overwritten in Application.cfc as follows [this.ormsettings.useDBForMapping\u003dtrue]"
Expand Down Expand Up @@ -1677,8 +1677,8 @@
"uploadmissing": "Missing upload definition",
"web": {
"installed": "The video components are installed on your system.",
"installedbut": "The video components are installed but they can not be executed properly.Just switch to the Lucee Server Administrator, in order to repair it:"
"installedbut": "The video components are installed but they can not be executed properly. Just switch to the Lucee Server Administrator, in order to repair it:"
}
}
}
}
}
2 changes: 1 addition & 1 deletion core/src/main/java/lucee/runtime/tag/Application.java
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,7 @@ public void setLogs(Struct logs) {
this.logs = logs;
}

public void setMails(Array mails) {
public void setMailservers(Array mails) {
this.mails = mails;
}

Expand Down
10 changes: 8 additions & 2 deletions test/_testRunner.cfc
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,14 @@ component {
if ( bundle.totalPass eq 0 && ( bundle.totalFail + bundle.totalError ) eq 0 ){
systemOutput( TAB & " (skipped)", true );
} else {
var skippedSummary = (bundle.totalSkipped gt 0) ? ", #bundle.totalSkipped# skipped" : "";
systemOutput( TAB & " (#bundle.totalPass# tests passed in #NumberFormat(bundle.totalDuration)# ms#skippedSummary#)", true );
var didntPassSummary = (bundle.totalSkipped gt 0) ? ", #bundle.totalSkipped# skipped" : "";
if ( bundle.totalError > 0 ){
didntPassSummary &= ", #bundle.totalError# ERRORED";
}
if ( bundle.totalFail > 0 ){
didntPassSummary &= ", #bundle.totalFail# FAILED";
}
systemOutput( TAB & " (#bundle.totalPass# tests passed in #NumberFormat(bundle.totalDuration)# ms#didntPassSummary#)", true );
}
//mem("non_heap");
//mem("heap");
Expand Down
File renamed without changes.
58 changes: 23 additions & 35 deletions test/general/_JSR223.cfc → test/general/JSR223.cfc
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
component extends="org.lucee.cfml.test.LuceeTestCase" {
component extends="org.lucee.cfml.test.LuceeTestCase" skip=true {

public function beforeTests(){
ScriptEngineManager=createObject('java','javax.script.ScriptEngineManager');
Expand All @@ -11,67 +11,50 @@ component extends="org.lucee.cfml.test.LuceeTestCase" {

local.engine =manager.getEngineByName("CFML");
assertEquals("cfml",engine.factory.languageName);

local.engine =manager.getEngineByName("Lucee");
assertEquals("lucee",engine.factory.languageName);


}

public void function testGetEngineByExtension(){
local.engine =manager.getEngineByExtension("cfm");
assertEquals("cfml",engine.factory.languageName);

local.engine =manager.getEngineByExtension("lucee");
assertEquals("lucee",engine.factory.languageName);

// reference
local.engine =manager.getEngineByExtension("js");
assertEquals("ECMAScript",engine.factory.languageName);
if (getJavaVersion() lte 11){
// reference
local.engine =manager.getEngineByExtension("js");
assertEquals("ECMAScript",engine.factory.languageName);
}
}

public void function testGetEngineByMimeType(){
local.engine =manager.getEngineByMimeType("application/cfml");
assertEquals("cfml",engine.factory.languageName);

local.engine =manager.getEngineByMimeType("application/lucee");
assertEquals("lucee",engine.factory.languageName);

// reference
local.engine =manager.getEngineByMimeType("application/javascript");
assertEquals("ECMAScript",engine.factory.languageName);
if (getJavaVersion() lte 11) {
// reference
local.engine =manager.getEngineByMimeType("application/javascript");
assertEquals("ECMAScript",engine.factory.languageName);
}
}


public void function testGetEngineFactories(){
local.names=[];
loop array="#manager.getEngineFactories()#" item="local.factory" {
names.append(factory.languageName);

}

assertTrue(names.contains("lucee"));
assertTrue(names.contains("cfml"));
assertTrue(names.contains("ECMAScript"));
if (getJavaVersion() lte 11)
assertTrue(names.contains("ECMAScript"));
}

public void function testPutGet(){
local.testValue="Susi #now()#";

local.engine =manager.getEngineByName("CFML");
engine.put('test',testValue);
assertEquals(testValue,engine.get('test'));

local.engine =manager.getEngineByName("Lucee");
engine.put('test',testValue);
assertEquals(testValue,engine.get('test'));
}



public void function testEvalReturnValue(){
_testEvalReturnValue(manager.getEngineByName("CFML"));
_testEvalReturnValue(manager.getEngineByName("Lucee"));
}
private void function _testEvalReturnValue(required engine){
engine.put('cont',false);
Expand All @@ -82,9 +65,8 @@ component extends="org.lucee.cfml.test.LuceeTestCase" {

}

public void function testEvalScopes(){
public void function testEvalScopes() skip=true{
_testEvalScopes(manager.getEngineByName("CFML"));
_testEvalScopes(manager.getEngineByName("Lucee"));
}
private void function _testEvalScopes(required engine){
engine.eval('url.test=1;');
Expand All @@ -95,7 +77,6 @@ component extends="org.lucee.cfml.test.LuceeTestCase" {

public void function testEvalInterpreter(){
_testEvalInterpreter(manager.getEngineByName("CFML"));
_testEvalInterpreter(manager.getEngineByName("Lucee"));
}
private void function _testEvalInterpreter(required engine){
engine.eval('susi.sorglos=1;');
Expand All @@ -105,15 +86,22 @@ component extends="org.lucee.cfml.test.LuceeTestCase" {

public void function testEvalFunction(){
_testEvalFunction(manager.getEngineByName("CFML"));
_testEvalFunction(manager.getEngineByName("Lucee"));
}
private void function _testEvalFunction(required engine){
// udf
assertEquals("udf",engine.eval('function test(){return "udf";}; x=test();'));
// closure
assertEquals("closure",engine.eval('test=function (){return "closure";}; x=test();'));
// lambda
assertEquals("lambda",engine.eval('test=()->"lambda"; x=test();'));
// assertEquals("lambda",engine.eval('test=()->"lambda"; x=test();'));
}

private function getJavaVersion() {
var raw=server.java.version;
var arr=listToArray(raw,'.');
if(arr[1]==1) // version 1-9
return arr[2];
return arr[1];
}

}
Expand Down
16 changes: 8 additions & 8 deletions test/general/_Parser.cfc → test/general/Parser.cfc
Original file line number Diff line number Diff line change
Expand Up @@ -6,31 +6,31 @@ component extends="org.lucee.cfml.test.LuceeTestCase"{
function run( testResults , testBox ) {
describe( "Test suite for Parser", function() {
describe( "Checking array and structure with invalid variable notation", function() {
it( title='Checking array value with invalid variable notation', body=function( currentSpec ) {
xit( title='Checking array value with invalid variable notation', body=function( currentSpec ) {
local.result = _InternalRequest(
template:"#variables.uri#/test.cfm",
forms:{Scene=1}
);
expect(local.result.filecontent.trim()).toBe("invalid identifier");
});

it( title='Checking array variable with invalid variable notation', body=function( currentSpec ) {
xit( title='Checking array variable with invalid variable notation', body=function( currentSpec ) {
local.result = _InternalRequest(
template:"#variables.uri#/test.cfm",
forms:{Scene=2}
);
expect(local.result.filecontent.trim()).toBe("invalid identifier");
});

it( title='Checking structure value with invalid variable notation', body=function( currentSpec ) {
xit( title='Checking structure value with invalid variable notation', body=function( currentSpec ) {
local.result = _InternalRequest(
template:"#variables.uri#/test.cfm",
forms:{Scene=3}
);
expect(local.result.filecontent.trim()).toBe("invalid identifier");
});

it( title='Checking structure variable with invalid variable notation', body=function( currentSpec ) {
xit( title='Checking structure variable with invalid variable notation', body=function( currentSpec ) {
local.result = _InternalRequest(
template:"#variables.uri#/test.cfm",
forms:{Scene=4}
Expand All @@ -40,31 +40,31 @@ component extends="org.lucee.cfml.test.LuceeTestCase"{
});

describe( "Checking with interpreter", function() {
it( title='array value with evaluate function', body=function( currentSpec ) {
xit( title='array value with evaluate function', body=function( currentSpec ) {
local.result = _InternalRequest(
template:"#variables.uri#/test.cfm",
forms:{Scene=5}
);
expect(local.result.filecontent.trim()).toBe("Syntax Error, invalid Expression [['a','b','c'].3]");
});

it( title='Checking array variable with invalid variable notation', body=function( currentSpec ) {
xit( title='Checking array variable with invalid variable notation', body=function( currentSpec ) {
local.result = _InternalRequest(
template:"#variables.uri#/test.cfm",
forms:{Scene=6}
);
expect(local.result.filecontent.trim()).toBe("invalid identifier");
});

it( title='Checking structure value with invalid variable notation', body=function( currentSpec ) {
xit( title='Checking structure value with invalid variable notation', body=function( currentSpec ) {
local.result = _InternalRequest(
template:"#variables.uri#/test.cfm",
forms:{Scene=7}
);
expect(local.result.filecontent.trim()).toBe("Syntax Error, invalid Expression [{'3':'C'}.3]");
});

it( title='Checking structure variable with invalid variable notation', body=function( currentSpec ) {
xit( title='Checking structure variable with invalid variable notation', body=function( currentSpec ) {
local.result = _InternalRequest(
template:"#variables.uri#/test.cfm",
forms:{Scene=8}
Expand Down
2 changes: 1 addition & 1 deletion test/tickets/_LDEV0228.cfc → test/tickets/LDEV0228.cfc
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
component extends="org.lucee.cfml.test.LuceeTestCase" labels="xml" {
function run( testResults , testBox ) {
describe( "Checking XMLTransform()", function() {
it('With xsl:include', function( currentSpec ) {
xit('With xsl:include', function( currentSpec ) {
try {
uri=createURI("LDEV0228/test.cfm");
local.result = _InternalRequest(
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion test/tickets/_LDEV0240.cfc → test/tickets/LDEV0240.cfc
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
component extends="org.lucee.cfml.test.LuceeTestCase"{
public function run( testResults , testBox ) {
describe( title="Test suite for LDEV-240 ( checking with the files in same folders )", body=function() {
it(title="Creating object for a component which has an init() with package access, from a cfm file of same folder", body=function( currentSpec ) {
xit(title="Creating object for a component which has an init() with package access, from a cfm file of same folder", body=function( currentSpec ) {
uri = createURI("LDEV0240/test.cfm");
result = _InternalRequest(
template:uri,
Expand Down
File renamed without changes.
File renamed without changes.
61 changes: 61 additions & 0 deletions test/tickets/LDEV0389.cfc
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
component extends="org.lucee.cfml.test.LuceeTestCase" {
function beforeAll(){
variables.tempDir = getTempDirectory() & createUUID();
if ( !DirectoryExists( tempDir ) ){
DirectoryCreate( tempDir );
}

variables.testFile = '#tempDir##server.separator.file#ldev0389.txt';
if ( !FileExists( variables.testFile ) ){
FileWrite( variables.testFile, "hello world");
}
}

function afterAll(){
if ( FileExists( variables.testFile ) ){
FileDelete( variables.testFile );
}
if ( !DirectoryExists( tempDir ) ){
DirectoryDelete( tempDir );
}
}

function run( testResults , testBox ) {
describe( "Test suite for LDEV-389", function() {
it("Checking directoryList, callback function with no arguments", function( currentSpec ) {
try {
result = directoryList( variables.tempDir, true, "array", function(){
return true;
});
} catch ( any e ){
result[1] = e.stacktrace;
}
expect( result[ 1 ] ).toBe( variables.testFile );
});

it("Checking directoryList, callback function with single argument", function( currentSpec ) {
try {
result = directoryList( variables.tempDir, true, "array", function(a){
return true;
});
} catch ( any e ){
result[1] = e.stacktrace;
}
expect( result[ 1 ] ).toBe( variables.testFile );
});

// this isn't supported, throws UDF filter has too many arguments [2], should have at maximum 1 argument
it(title="Checking directoryList, callback function with two arguments", skip=true, body=function( currentSpec ) {
try {
result = directoryList( variables.tempDir, true, "array", function( a, b ){
return true;
});
} catch ( any e ){
result[1] = e.stacktrace;
}
expect( result[ 1 ] ).toBe( variables.testFile );
});
});
}

}
4 changes: 2 additions & 2 deletions test/tickets/_LDEV0406.cfc → test/tickets/LDEV0406.cfc
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ component extends="org.lucee.cfml.test.LuceeTestCase"{

function run(){
describe( title="Test suite for restInitApplication()", body=function(){
it(title="Without password argument", body=function(){
xit(title="Without password argument", body=function(){
restInitApplication( dirPath=expandPath("./LDEV0406/api1/"), serviceMapping="api1" );
});

Expand All @@ -26,7 +26,7 @@ component extends="org.lucee.cfml.test.LuceeTestCase"{
});

describe( title="Test suite for restDeleteApplication()", body=function(){
it(title="Without password argument", body=function(){
xit(title="Without password argument", body=function(){
restDeleteApplication( dirPath=expandPath("./LDEV0406/api2/") );
});

Expand Down
Loading

0 comments on commit aac1d23

Please sign in to comment.