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

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

Best Java code snippets using org.apache.shindig.common.cache.SoftExpiringCacheTest.assertTrue (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.cacheSoftExpiringCacheTestassertTrue

Popular methods of SoftExpiringCacheTest

  • assertEquals
  • assertFalse
  • assertNull
  • makeSoftExpiringCache

Popular in Java

  • Finding current android device location
  • getSupportFragmentManager (FragmentActivity)
  • compareTo (BigDecimal)
  • scheduleAtFixedRate (Timer)
  • InputStreamReader (java.io)
    A class for turning a byte stream into a character stream. Data read from the source input stream is
  • SocketException (java.net)
    This SocketException may be thrown during socket creation or setting options, and is the superclass
  • SQLException (java.sql)
    An exception that indicates a failed JDBC operation. It provides the following information about pro
  • Timestamp (java.sql)
    A Java representation of the SQL TIMESTAMP type. It provides the capability of representing the SQL
  • Executor (java.util.concurrent)
    An object that executes submitted Runnable tasks. This interface provides a way of decoupling task s
  • Cipher (javax.crypto)
    This class provides access to implementations of cryptographic ciphers for encryption and decryption
  • Best plugins for Eclipse
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