-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added a testcase to check EHCache with "distributed":"automatic" for …
…LDEV-4429 (#3) * Added a testcase to check EHCache with "distributed":"automatic" for LDEV-4429 * debug * Make try without query * enable * Revert back * Altered the test to use dbtype query with return type instead of database query
- Loading branch information
Showing
1 changed file
with
59 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
component extends="org.lucee.cfml.test.LuceeTestCase" labels="ehcache,cache" { | ||
|
||
public function testCachePutEHCache() { | ||
createEHCache(); | ||
testCachePut(); | ||
} | ||
|
||
private function testCachePut() localMode="modern" { | ||
var qry = queryNew("foo", "varchar",[["foo1"],["foo2"]]); | ||
|
||
// jsonbColl is a QueryStruct, not a ordinary struct | ||
var jsonbColl = queryExecute("SELECT foo FROM qry", {}, {dbtype="query", returnType="struct", columnKey="foo"}); | ||
|
||
cachePut("def",jsonbColl,createTimespan(0,0,0,30),createTimespan(0,0,0,30),"testCache4429") | ||
var cachedval = cacheGet(id ="def", region="testCache4429"); | ||
|
||
// after cache the result should be a QueryStruct, not StructImpl | ||
expect(cachedval.getClass().getName()).toBe("lucee.runtime.type.query.QueryStruct"); | ||
expect(cachedval.getRecordCount()).toBe(2); // should support method getRecordCount | ||
} | ||
|
||
private function createEHCache() { | ||
var cacheConn = { | ||
class: 'org.lucee.extension.cache.eh.EHCache' | ||
, storage: false | ||
, custom: { | ||
"bootstrapAsynchronously":"true", | ||
"automatic_hostName":"", | ||
"bootstrapType":"on", | ||
"maxelementsinmemory":"10000", | ||
"manual_rmiUrls":"", | ||
"distributed":"automatic", | ||
"automatic_multicastGroupAddress":"230.0.0.1", | ||
"memoryevictionpolicy":"LRU", | ||
"timeToIdleSeconds":"86400", | ||
"maximumChunkSizeBytes":"5000000", | ||
"automatic_multicastGroupPort":"4446", | ||
"listener_socketTimeoutMillis":"120000", | ||
"timeToLiveSeconds":"86400", | ||
"diskpersistent":"true", | ||
"manual_addional":"", | ||
"replicateRemovals":"true", | ||
"automatic_addional":"", | ||
"overflowtodisk":"true", | ||
"replicateAsynchronously":"true", | ||
"maxelementsondisk":"10000000", | ||
"listener_remoteObjectPort":"", | ||
"asynchronousReplicationIntervalMillis":"1000", | ||
"listener_hostName":"", | ||
"replicateUpdates":"true", | ||
"manual_hostName":"", | ||
"automatic_timeToLive":"unrestricted", | ||
"listener_port":"" | ||
} | ||
, default: '' | ||
}; | ||
application name="LDEV-4429" action="update" caches={"testCache4429":cacheConn}; | ||
} | ||
} |