Skip to content

Commit

Permalink
Temp commit to debug the github issue mk3
Browse files Browse the repository at this point in the history
  • Loading branch information
nand4011 committed Jul 10, 2024
1 parent 3c1b979 commit 187221c
Showing 1 changed file with 4 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,30 +38,18 @@ class CacheClientScalarTest: BaseAndroidTestClass() {
val key = "cache-key"
val value = "cache-value"

var getResponse = cacheClient.get(cacheName, key)
if (getResponse is GetResponse.Error) {
val error = getResponse.fillInStackTrace()
println(error)
println("error cause:")
println(error.cause)
println("error cause cause:")
println(error.cause?.cause)
println("error cause cause cause:")
println(error.cause?.cause?.cause)
}
// var getResponse = cacheClient.get(cacheName, key)
// assert(getResponse is GetResponse.Miss) { "expected Miss, got $getResponse" }
when (val response = cacheClient.get(cacheName, key)) {
is GetResponse.Error -> fail("expected Miss, got Error: ${response.cause}\n" +
"cause: ${response.cause?.cause}\n" +
"grandcause: ${response.cause?.cause?.cause}")
is GetResponse.Error -> fail("current time: ${System.currentTimeMillis()} expected Miss, got Error: ${response.fillInStackTrace().cause?.cause?.cause}")
is GetResponse.Hit -> fail("expected Miss, got Hit.")
GetResponse.Miss -> Unit
}
assert(getResponse is GetResponse.Miss) { "expected Miss, got $getResponse" }

val setResponse = cacheClient.set(cacheName, key, value)
assert(setResponse is SetResponse.Success) { "expected Success, got $setResponse" }

getResponse = cacheClient.get(cacheName, key)
var getResponse = cacheClient.get(cacheName, key)
assert((getResponse as GetResponse.Hit).value == value)

val deleteResponse = cacheClient.delete(cacheName, key)
Expand Down

0 comments on commit 187221c

Please sign in to comment.