X-Git-Url: https://gerrit.akraino.org/r/gitweb?a=blobdiff_plain;f=src%2Ffoundation%2Fapi%2Frevel%2Fcache%2Finmemory_test.go;fp=src%2Ffoundation%2Fapi%2Frevel%2Fcache%2Finmemory_test.go;h=1f9cf1f24503eb35f52d46dd2ec4cb046c53db3d;hb=1d1ee6961c93781e1187d8c7faa868da6b2f01f4;hp=0000000000000000000000000000000000000000;hpb=56dd5e0f2164b37b40ac1daa188ccc618b4cbd19;p=iec.git diff --git a/src/foundation/api/revel/cache/inmemory_test.go b/src/foundation/api/revel/cache/inmemory_test.go new file mode 100644 index 0000000..1f9cf1f --- /dev/null +++ b/src/foundation/api/revel/cache/inmemory_test.go @@ -0,0 +1,44 @@ +// Copyright (c) 2012-2016 The Revel Framework Authors, All rights reserved. +// Revel Framework source code and usage is governed by a MIT style +// license that can be found in the LICENSE file. + +package cache + +import ( + "testing" + "time" +) + +var newInMemoryCache = func(_ *testing.T, defaultExpiration time.Duration) Cache { + return NewInMemoryCache(defaultExpiration) +} + +// Test typical cache interactions +func TestInMemoryCache_TypicalGetSet(t *testing.T) { + typicalGetSet(t, newInMemoryCache) +} + +// Test the increment-decrement cases +func TestInMemoryCache_IncrDecr(t *testing.T) { + incrDecr(t, newInMemoryCache) +} + +func TestInMemoryCache_Expiration(t *testing.T) { + expiration(t, newInMemoryCache) +} + +func TestInMemoryCache_EmptyCache(t *testing.T) { + emptyCache(t, newInMemoryCache) +} + +func TestInMemoryCache_Replace(t *testing.T) { + testReplace(t, newInMemoryCache) +} + +func TestInMemoryCache_Add(t *testing.T) { + testAdd(t, newInMemoryCache) +} + +func TestInMemoryCache_GetMulti(t *testing.T) { + testGetMulti(t, newInMemoryCache) +}