-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add test case for RedisCommand type handling
- Loading branch information
1 parent
23e0dd3
commit 0d61898
Showing
1 changed file
with
60 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,60 @@ | ||
component extends="org.lucee.cfml.test.LuceeTestCase" labels="redis" { | ||
|
||
variables.sleepInterval = 10; // ms, used for sleep()s | ||
|
||
public function beforeAll(){ | ||
defineCache(); | ||
// Setup code if needed | ||
cacheName = "testRedis"; | ||
keyName = "test:intKey"; | ||
initialValue = 100; | ||
redisCommand(arguments: ["SET", keyName, initialValue], cache: cacheName); | ||
|
||
} | ||
|
||
public function afterAll(){ | ||
application action="update" caches={}; | ||
} | ||
|
||
private string function defineCache(){ | ||
var redis = server.getDatasource("redis"); | ||
if ( structCount(redis) eq 0 ) | ||
throw "Redis is not configured?"; | ||
var caches ={ | ||
"testRedis":{ | ||
"class":"lucee.extension.io.cache.redis.simple.RedisCache", | ||
"bundleName":"redis.extension", | ||
"custom":{ | ||
"minIdle":8, | ||
"maxTotal":40, | ||
"maxIdle":24, | ||
"host":redis.server, | ||
"port":redis.port, | ||
"socketTimeout":2000, | ||
"liveTimeout":3600000, | ||
"idleTimeout":60000, | ||
"timeToLiveSeconds":0, | ||
"testOnBorrow":true, | ||
"rnd":1 | ||
}, | ||
"readOnly":false, | ||
"storage":false, | ||
"default":"" | ||
} | ||
}; | ||
|
||
application action="update" caches=#caches#; | ||
return true; | ||
} | ||
|
||
|
||
function run( testResults , testBox ) { | ||
describe( "Redis tests", function() { | ||
|
||
|
||
|
||
|
||
|
||
}); | ||
} | ||
} |