Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LDEV-4096 update to testbox 6.0.1 #2422

Open
wants to merge 15 commits into
base: 6.2
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 16 additions & 6 deletions ant/build-core.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,13 @@
<property name="bundleName" value="Lucee Core"/>
<property name="bundleSymbolicName" value="lucee.core"/>

<property name="testboxVersion" value="3.2.0"/>
<property name="testboxVersion" value="6.0.1"/>
<property name="testboxURL"
value="https://downloads.ortussolutions.com/ortussolutions/testbox/${testboxVersion}/testbox-${testboxVersion}.zip"/>
<property name="extURL" value="https://extension.lucee.org/rest/extension/provider/full/"/>

<property name="globberURL"
value="https://github.com/Ortus-Solutions/globber/archive/refs/tags/v3.1.5.zip"/>

<property name="extMongo" value="E6634E1A-4CC5-4839-A83C67549ECA8D5B"/>
<property name="extH2" value="465E1E35-2425-4F4E-8B3FAB638BD7280A;version=2.1.214.0001L"/>
<property name="extOracle" value="D4EDFDBD-A9A3-E9AF-597322D767E0C949;version=19.12.0.0-ojdbc8"/>
Expand Down Expand Up @@ -248,7 +250,7 @@
</sequential>
</macrodef>

<target name="check" depends="check-mysql,check-mssql,check-postgre,check-jdts,check-s3,check-ehcache,check-pdf,check-admin,check-doc,check-image,check-esapi,check-compress,check-testbox,check-lucee-loader-jar,download-lucee-loader-jar">
<target name="check" depends="check-mysql,check-mssql,check-postgre,check-jdts,check-s3,check-ehcache,check-pdf,check-admin,check-doc,check-image,check-esapi,check-compress,check-testbox,check-testbox-globber,check-lucee-loader-jar,download-lucee-loader-jar">
<mkdir dir="${temp}/loader/extensions/"/>
</target>

Expand Down Expand Up @@ -565,7 +567,7 @@

<jvmarg value="-Dsrc=${tmpContext}"/>
<jvmarg value="-Dtemp=${temp}/archive"/>
<jvmarg value="-Dtestbox=${temp}/testbox/testbox"/>
<jvmarg value="-Dtestbox=${temp}/testbox/"/>
<jvmarg value="-DcompileTestBox=${compileTestBox}"/>
<jvmarg value="-Dlucee.base.dir=${temp}/archive/base"/>
<jvmarg value="-Dlucee.web.dir=${temp}/archive/webroot"/>
Expand All @@ -588,8 +590,15 @@
<copy
file="${cache}/testbox-${testboxVersion}.zip"
todir="${temp}"/>
<!-- testbox -->
<!-- testbox -->
<unzip src="${temp}/testbox-${testboxVersion}.zip" dest="${temp}/testbox"/>

<!-- hack avoid needing all of commandbox for just one module -->
<copy
file="${cache}/globber.zip"
todir="${temp}"/>
<unzip src="${temp}/globber.zip" dest="${temp}/testbox/system/modules"/>
<move file="${temp}/testbox/system/modules/globber-3.1.5" tofile="${temp}/testbox/system/modules/globber"/>
<delete dir="${temp}/testbox-${testboxVersion}.zip"/>
</target>
<!--
Expand Down Expand Up @@ -627,8 +636,9 @@
<jvmarg value="-Dtemp=${temp}"/>
<jvmarg value="-Dbasedir=${baseDir}"/>
<jvmarg value="-Dsrcall=${srcAll}"/>
<!--
<jvmarg value="-Dlucee.allow.reflection=true"/>
<!-- <jvmarg value="-Djdk.attach.allowAttachSelf=true"/> -->
<jvmarg value="-Djdk.attach.allowAttachSelf=true"/> -->
<jvmarg value="-DtestboxArchive=${temp}/archive/testbox.lar"/>
<jvmarg value="-Dexecute=${testcases}"/>
<jvmarg value="-DindividualStorageKeys=false"/>
Expand Down
5 changes: 4 additions & 1 deletion ant/build-extensions.xml
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@

<target name="check-cache">
<available file="${cache}/testbox-${testboxVersion}.zip" property="testbox.present"/>

<available file="${cache}/globber.zip" property="globber.present"/>
<available file="${cache}/${extMySQL}-${extMySQLVersion}.lex" property="mysql.present"/>
<available file="${cache}/${extMSSQL}-${extMSSQLVersion}.lex" property="mssql.present"/>
<available file="${cache}/${extPostgreSQL}-${extPostgreSQLVersion}.lex" property="postgre.present"/>
Expand Down Expand Up @@ -196,6 +196,9 @@
</target>
<target name="check-testbox" depends="check-cache" unless="testbox.present">
<get src="${testboxURL}" dest="${cache}/testbox-${testboxVersion}.zip"/>
</target>
<target name="check-testbox-globber" depends="check-cache" unless="globber.present">
<get src="${globberURL}" dest="${cache}/globber.zip"/>
</target>
<target name="addExtensions" if="buildLoaderJar">
<echots message="add extensions"/>
Expand Down
5 changes: 4 additions & 1 deletion test/_testRunner.cfc
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
component {
// track which request variables exist before running tests, used for cleanup between tests
variables.requestKeys = ArrayToStruct( StructKeyArray( request ), true );
variables.requestKeys["$testId"] = ""; // used by testbox
variables.requestKeys["testbox"] = ""; // used by testbox

public function init (){
return this;
Expand Down Expand Up @@ -90,7 +92,8 @@ component {
onBundleStart = function( cfc, testResults ){
var meta = getComponentMetadata( cfc );
systemOutput( "" , true );
systemOutput(structKeyList(getApplicationSettings().mappings), true );
application name="testBundle-#meta.name#";
//systemOutput(structKeyList(getApplicationSettings().mappings), true );
SystemOut.setOut( out );
//SystemOut.setErr(err);
//"============================================================="
Expand Down
6 changes: 4 additions & 2 deletions test/datasource/MongoDB.cfc
Original file line number Diff line number Diff line change
Expand Up @@ -114,9 +114,11 @@ component extends="org.lucee.cfml.test.LuceeTestCase" labels="mongodb" {
assertEquals(isNull(byid),true)
}

public void function testMongoDBID() skip="isNotSupported" {
public void function testMongoDBID_orig() skip="isNotSupported" {
if(isNotSupported()) return;
var id = MongoDBID();
var _id = MongoDBID();
var id = {}; // workaround https://ortussolutions.atlassian.net/browse/TESTBOX-370
structAppend(id, _id);
$assert.key(id,"date");
$assert.key(id,"timestamp");
$assert.key(id,"id");
Expand Down
8 changes: 4 additions & 4 deletions test/jira/Jira2718.cfc
Original file line number Diff line number Diff line change
Expand Up @@ -63,17 +63,17 @@
function testScriptFunctionCreateTimespan(){
var initVal=scriptFunctionCreateTimespan();
sleep(1);
assertEquals(true,initVal == scriptFunctionCreateTimespan());
expect(initVal).toBe(scriptFunctionCreateTimespan());
sleep(25);
assertEquals(false,initVal == scriptFunctionCreateTimespan());
expect(initVal).notToBe(scriptFunctionCreateTimespan());
}

function testTagFunctionCreateTimespan(){
var initVal=tagFunctionCreateTimespan();
sleep(1);
assertEquals(true,initVal == tagFunctionCreateTimespan());
expect(initVal).toBe(tagFunctionCreateTimespan());
sleep(25);
assertEquals(false,initVal == tagFunctionCreateTimespan());
expect(initVal).notToBe(tagFunctionCreateTimespan());
}

// createTimeSpan(0,0,0,0,25)
Expand Down
43 changes: 28 additions & 15 deletions test/tags/Query.cfc
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ component extends="org.lucee.cfml.test.LuceeTestCase" {
//processingdirective pageencoding="UTF-8";
variables.suffix="Query";

function afterAll(){
structDelete( server, "query_testAsynUDF");
}

public function beforeTests(){
defineDatasource();

Expand Down Expand Up @@ -223,17 +227,24 @@ component extends="org.lucee.cfml.test.LuceeTestCase" {
testAsyn(new query.QueryListener2(tbl),tbl,1);
}


/*
Async Query Listener UDFs get the current application scope
but get the default name="" application scope instead
https://luceeserver.atlassian.net/browse/LDEV-5187
*/
public void function testAsynUDF() {
server.query_testAsynUDF=false;
var udf=function (caller,args,result,meta) {
arguments.args.sql="insert into QueryTestAsync(id,i,dec) values('6',1,1.0)"; // change SQL
application.query_testAsynUDF=true;
server.query_testAsynUDF=true;
return arguments;
};
var tbl="QueryTestAsync";
application.query_testAsynUDF=false;
expect(server.query_testAsynUDF).toBeFalse();
testAsyn(udf,tbl,0);
assertTrue(application.query_testAsynUDF);
sleep(800); // allow the async test to complete
expect(server.query_testAsynUDF).toBeTrue();
structDelete( server, "query_testAsynUDF");
}

public void function testAsynStructUDF() {
Expand Down Expand Up @@ -272,8 +283,10 @@ component extends="org.lucee.cfml.test.LuceeTestCase" {
query name="local.qry" {
echo("select * from "&tbl);
}
assertTrue(qry.recordcount==1);
assertEquals(res,qry.id);
expect( qry.recordcount ).toBe ( 1 );
expect( res ).toBe(qry.id);
} catch( e ){
systemOutput( e, true );
}
finally {
dropTable(tbl);
Expand All @@ -293,9 +306,8 @@ component extends="org.lucee.cfml.test.LuceeTestCase" {

echo("select id from T"&suffix);
}
assertEquals(1,qry.recordcount);
assertEquals("1234",qry.id);

expect( qry.recordcount ).toBe( 1 );
expect( qry.id ).toBe( "1234" );

query name="local.qry" listener={
after=function (caller,args,result,meta) {
Expand All @@ -305,9 +317,9 @@ component extends="org.lucee.cfml.test.LuceeTestCase" {
} {

echo("select id from T"&suffix);
}
assertEquals(3,qry.recordcount);
assertEquals("A",qry.columnlist);
}
expect( qry.recordcount ).toBe( 3 );
expect( qry.columnlist ).toBe( "A" );

}

Expand All @@ -329,9 +341,10 @@ component extends="org.lucee.cfml.test.LuceeTestCase" {

{
echo("insert into T"&suffix&"(id,i,dec) values('2',1,1.0)");
}
assertEquals(3,qry.recordcount);
assertEquals("A",qry.columnlist);
}

expect( qry.recordcount ).toBe( 3 );
expect( qry.columnlist ).toBe( "A" );

}

Expand Down
1 change: 0 additions & 1 deletion test/tickets/LDEV3116.cfc
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ component extends="org.lucee.cfml.test.LuceeTestCase" labels="thread" {
thread.testing = 'blah';
}
thread action="join" name="test_without";
//systemOutput(cfthread.test_without,1,1);
expect( cfthread.test_without ).notToHaveKey( "error", cfthread.test_without.error.stacktrace?: '???' );
expect( cfthread.test_without.testing ).toBe( "blah" );
} );
Expand Down
Loading