Examples of TimeSource


Examples of org.apache.shindig.common.util.TimeSource

  public void testOAuthFetcherConfig() {
    BlobCrypter crypter = mock(BlobCrypter.class);
    mock(HttpCache.class);
    GadgetOAuthTokenStore tokenStore = mock(GadgetOAuthTokenStore.class);
    OAuthCallbackGenerator callbackGenerator = mock(OAuthCallbackGenerator.class);
    OAuthFetcherConfig config = new OAuthFetcherConfig(crypter, tokenStore, new TimeSource(),
        callbackGenerator, false);
    assertEquals(crypter, config.getStateCrypter());
    assertEquals(tokenStore, config.getTokenStore());
    assertEquals(callbackGenerator, config.getOAuthCallbackGenerator());
    assertFalse(config.isViewerAccessTokensEnabled());
View Full Code Here

Examples of org.apache.shindig.common.util.TimeSource

        .andReturn(badResponse).once();
    replay(pipeline);

    final AtomicLong time = new AtomicLong();

    bundleFactory.cache.setTimeSource(new TimeSource() {
      @Override
      public long currentTimeMillis() {
        return time.get();
      }
    });
View Full Code Here

Examples of org.apache.shindig.common.util.TimeSource

  @Test
  public void testOAuthFetcherConfig() {
    BlobCrypter crypter = mock(BlobCrypter.class);
    HttpCache cache = mock(HttpCache.class);
    GadgetOAuthTokenStore tokenStore = mock(GadgetOAuthTokenStore.class);
    OAuthFetcherConfig config = new OAuthFetcherConfig(crypter, tokenStore, cache, new TimeSource());
    assertEquals(crypter, config.getStateCrypter());
    assertEquals(cache, config.getHttpCache());
    assertEquals(tokenStore, config.getTokenStore());
  }
View Full Code Here

Examples of org.apache.shindig.common.util.TimeSource

   * @param cache The underlying cache that will store actual data.
   */
  public SoftExpiringCache(Cache<K, V>  cache) {
    this.cache = cache;
    expirationTimes = new MapMaker().weakKeys().makeMap();
    timeSource = new TimeSource();
  }
View Full Code Here

Examples of org.apache.shindig.common.util.TimeSource

        .andReturn(badResponse).once();
    replay(pipeline);

    final AtomicLong time = new AtomicLong();

    bundleFactory.cache.setTimeSource(new TimeSource() {
      @Override
      public long currentTimeMillis() {
        return time.get();
      }
    });
View Full Code Here

Examples of org.apache.shindig.common.util.TimeSource

  public void testOAuthFetcherConfig() {
    BlobCrypter crypter = mock(BlobCrypter.class);
    mock(HttpCache.class);
    GadgetOAuthTokenStore tokenStore = mock(GadgetOAuthTokenStore.class);
    OAuthCallbackGenerator callbackGenerator = mock(OAuthCallbackGenerator.class);
    OAuthFetcherConfig config = new OAuthFetcherConfig(crypter, tokenStore, new TimeSource(),
        callbackGenerator, false);
    assertEquals(crypter, config.getStateCrypter());
    assertEquals(tokenStore, config.getTokenStore());
    assertEquals(callbackGenerator, config.getOAuthCallbackGenerator());
    assertFalse(config.isViewerAccessTokensEnabled());
View Full Code Here

Examples of org.apache.shindig.common.util.TimeSource

  private static class TestFeatureResourceLoader extends FeatureResourceLoader {
    private final ResourceMock resourceMock;
    private Map<String, String> lastAttribs;

    private TestFeatureResourceLoader(ResourceMock resourceMock) {
      super(null, new TimeSource(), new DefaultFeatureFileSystem());
      this.resourceMock = resourceMock;
    }
View Full Code Here

Examples of org.apache.shindig.common.util.TimeSource

        .andReturn(badResponse).once();
    replay(fetcher);

    final AtomicLong time = new AtomicLong();

    bundleFactory.cache.setTimeSource(new TimeSource() {
      @Override
      public long currentTimeMillis() {
        return time.get();
      }
    });
View Full Code Here

Examples of org.apache.shindig.common.util.TimeSource

   * @param cache The underlying cache that will store actual data.
   */
  public SoftExpiringCache(Cache<K, V>  cache) {
    this.cache = cache;
    expirationTimes = new ReferenceMap<V, Long>(ReferenceType.WEAK, ReferenceType.STRONG);
    timeSource = new TimeSource();
  }
View Full Code Here

Examples of org.waveprotocol.wave.crypto.TimeSource

  private SignerInfo getSignerInfo() throws Exception {
    return getSigner().getSignerInfo();
  }

  private TimeSource getFakeTimeSource() {
    return new TimeSource() {
      @Override
      public Date now() {
        return new Date(currentTimeMillis());
      }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.