congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
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

  • Reading from database using SQL prepared statement
  • getResourceAsStream (ClassLoader)
  • addToBackStack (FragmentTransaction)
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • Runnable (java.lang)
    Represents a command that can be executed. Often used to run code in a different Thread.
  • Thread (java.lang)
    A thread is a thread of execution in a program. The Java Virtual Machine allows an application to ha
  • SSLHandshakeException (javax.net.ssl)
    The exception that is thrown when a handshake could not be completed successfully.
  • HttpServlet (javax.servlet.http)
    Provides an abstract class to be subclassed to create an HTTP servlet suitable for a Web site. A sub
  • JTable (javax.swing)
  • Logger (org.slf4j)
    The org.slf4j.Logger interface is the main user entry point of SLF4J API. It is expected that loggin
  • Top plugins for Android Studio
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