congrats Icon
New! Announcing our next generation AI code completions
Read here
Tabnine Logo
SoftExpiringCacheTest.makeSoftExpiringCache
Code IndexAdd Tabnine to your IDE (free)

How to use
makeSoftExpiringCache
method
in
org.apache.shindig.common.cache.SoftExpiringCacheTest

Best Java code snippets using org.apache.shindig.common.cache.SoftExpiringCacheTest.makeSoftExpiringCache (Showing top 10 results out of 315)

origin: org.gatein.shindig/shindig-common

 @Test
 public void testMissingValue() {
  SoftExpiringCache<String, String> expiringCache = makeSoftExpiringCache();
  assertNull(expiringCache.getElement("not set"));
 }
}
origin: com.lmco.shindig/shindig-common

 @Test
 public void testMissingValue() {
  SoftExpiringCache<String, String> expiringCache = makeSoftExpiringCache();
  assertNull(expiringCache.getElement("not set"));
 }
}
origin: org.apache.shindig/shindig-common

 @Test
 public void testMissingValue() {
  SoftExpiringCache<String, String> expiringCache = makeSoftExpiringCache();
  assertNull(expiringCache.getElement("not set"));
 }
}
origin: org.wso2.org.apache.shindig/shindig-common

 @Test
 public void testMissingValue() {
  SoftExpiringCache<String, String> expiringCache = makeSoftExpiringCache();
  assertNull(expiringCache.getElement("not set"));
 }
}
origin: apache/shindig

 @Test
 public void testMissingValue() {
  SoftExpiringCache<String, String> expiringCache = makeSoftExpiringCache();
  assertNull(expiringCache.getElement("not set"));
 }
}
origin: org.apache.shindig/shindig-common

@Test
public void testGeneralCacheExpiration() {
 SoftExpiringCache<String, String> expiringCache = makeSoftExpiringCache();
 String key = "key1", val = "val1";
 expiringCache.addElement(key, val, 240 * 1000);
 // Time is still 0: should be in the cache.
 assertEquals(val, expiringCache.getElement(key).obj);
 assertFalse(expiringCache.getElement(key).isExpired);
 // Time = 300 seconds: out of cache.
 timeSource.setCurrentTimeMillis(300 * 1000);
 assertEquals(val, expiringCache.getElement(key).obj);
 assertTrue(expiringCache.getElement(key).isExpired);
}
origin: org.gatein.shindig/shindig-common

@Test
public void testGeneralCacheExpiration() {
 SoftExpiringCache<String, String> expiringCache = makeSoftExpiringCache();
 String key = "key1", val = "val1";
 expiringCache.addElement(key, val, 240 * 1000);
 // Time is still 0: should be in the cache.
 assertEquals(val, expiringCache.getElement(key).obj);
 assertFalse(expiringCache.getElement(key).isExpired);
 // Time = 300 seconds: out of cache.
 timeSource.setCurrentTimeMillis(300 * 1000);
 assertEquals(val, expiringCache.getElement(key).obj);
 assertTrue(expiringCache.getElement(key).isExpired);
}
origin: org.wso2.org.apache.shindig/shindig-common

@Test
public void testGeneralCacheExpiration() {
 SoftExpiringCache<String, String> expiringCache = makeSoftExpiringCache();
 String key = "key1", val = "val1";
 expiringCache.addElement(key, val, 240 * 1000);
 // Time is still 0: should be in the cache.
 assertEquals(val, expiringCache.getElement(key).obj);
 assertFalse(expiringCache.getElement(key).isExpired);
 // Time = 300 seconds: out of cache.
 timeSource.setCurrentTimeMillis(300 * 1000);
 assertEquals(val, expiringCache.getElement(key).obj);
 assertTrue(expiringCache.getElement(key).isExpired);
}
origin: com.lmco.shindig/shindig-common

@Test
public void testGeneralCacheExpiration() {
 SoftExpiringCache<String, String> expiringCache = makeSoftExpiringCache();
 String key = "key1", val = "val1";
 expiringCache.addElement(key, val, 240 * 1000);
 // Time is still 0: should be in the cache.
 assertEquals(val, expiringCache.getElement(key).obj);
 assertFalse(expiringCache.getElement(key).isExpired);
 // Time = 300 seconds: out of cache.
 timeSource.setCurrentTimeMillis(300 * 1000);
 assertEquals(val, expiringCache.getElement(key).obj);
 assertTrue(expiringCache.getElement(key).isExpired);
}
origin: apache/shindig

@Test
public void testGeneralCacheExpiration() {
 SoftExpiringCache<String, String> expiringCache = makeSoftExpiringCache();
 String key = "key1", val = "val1";
 expiringCache.addElement(key, val, 240 * 1000);
 // Time is still 0: should be in the cache.
 assertEquals(val, expiringCache.getElement(key).obj);
 assertFalse(expiringCache.getElement(key).isExpired);
 // Time = 300 seconds: out of cache.
 timeSource.setCurrentTimeMillis(300 * 1000);
 assertEquals(val, expiringCache.getElement(key).obj);
 assertTrue(expiringCache.getElement(key).isExpired);
}
org.apache.shindig.common.cacheSoftExpiringCacheTestmakeSoftExpiringCache

Popular methods of SoftExpiringCacheTest

  • assertEquals
  • assertFalse
  • assertNull
  • assertTrue

Popular in Java

  • Finding current android device location
  • putExtra (Intent)
  • getSharedPreferences (Context)
  • getContentResolver (Context)
  • BorderLayout (java.awt)
    A border layout lays out a container, arranging and resizing its components to fit in five regions:
  • Container (java.awt)
    A generic Abstract Window Toolkit(AWT) container object is a component that can contain other AWT co
  • HashMap (java.util)
    HashMap is an implementation of Map. All optional operations are supported.All elements are permitte
  • SortedSet (java.util)
    SortedSet is a Set which iterates over its elements in a sorted order. The order is determined eithe
  • Runner (org.openjdk.jmh.runner)
  • Option (scala)
  • Top 12 Jupyter Notebook Extensions
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyStudentsTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now