Tabnine Logo
SoftExpiringCacheTest.assertEquals
Code IndexAdd Tabnine to your IDE (free)

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

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

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.cacheSoftExpiringCacheTestassertEquals

Popular methods of SoftExpiringCacheTest

  • assertFalse
  • assertNull
  • assertTrue
  • makeSoftExpiringCache

Popular in Java

  • Reading from database using SQL prepared statement
  • runOnUiThread (Activity)
  • setContentView (Activity)
  • getContentResolver (Context)
  • BufferedReader (java.io)
    Wraps an existing Reader and buffers the input. Expensive interaction with the underlying reader is
  • InputStreamReader (java.io)
    A class for turning a byte stream into a character stream. Data read from the source input stream is
  • ReentrantLock (java.util.concurrent.locks)
    A reentrant mutual exclusion Lock with the same basic behavior and semantics as the implicit monitor
  • Modifier (javassist)
    The Modifier class provides static methods and constants to decode class and member access modifiers
  • JLabel (javax.swing)
  • Logger (org.slf4j)
    The org.slf4j.Logger interface is the main user entry point of SLF4J API. It is expected that loggin
  • CodeWhisperer alternatives
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

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