Examples of FakeTimeSource


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

    privateToken.setAppUrl(GADGET_URL);

    stateCrypter = new BasicBlobCrypter("abcdefghijklmnop".getBytes());
    clientState = new OAuthClientState(stateCrypter);
    responseParams = new OAuthResponseParams(socialToken, null, stateCrypter);
    fetcherConfig = new OAuthFetcherConfig(stateCrypter, store, new FakeTimeSource(), null, false);
  }
View Full Code Here

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

    assertEquals("1.2.3.4", request.getParam(ServletUtil.REMOTE_ADDR_KEY));
  }
 
  @Test
  public void testCopyResponseToServlet() throws Exception {
    FakeTimeSource fakeTime = new FakeTimeSource();
    HttpUtil.setTimeSource(fakeTime);

    HttpResponse response = new HttpResponseBuilder()
        .setResponseString("response string").setHttpStatusCode(200).addHeader("h1", "v1")
        .addHeader("h2", "v2").setCacheTtl(1000).create();
View Full Code Here

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

        .addHeader("h2", "v2").setStrictNoCache().create();

    HttpServletResponse servletResponse = EasyMock.createMock(HttpServletResponse.class);
    HttpServletResponseRecorder recorder = new HttpServletResponseRecorder(servletResponse);
   
    FakeTimeSource fakeTime = new FakeTimeSource();
    HttpUtil.setTimeSource(fakeTime);
    ServletUtil.copyResponseToServlet(response, recorder);
   
    assertEquals(200, recorder.getHttpStatusCode());
    assertEquals("response string", recorder.getResponseAsString());
View Full Code Here

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

  }
 
  @Before
  public void setUp() {
    loader = new TestFeatureResourceLoader();
    timeSource = new FakeTimeSource();
    timeSource.setCurrentTimeMillis(0);
    loader.setTimeSource(timeSource);
  }
View Full Code Here

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

  }

  @Before
  public void setUp() {
    fetcher = createMock(HttpFetcher.class);
    timeSource = new FakeTimeSource();
    timeSource.setCurrentTimeMillis(0);
    loader = new TestFeatureResourceLoader(fetcher, timeSource, new DefaultFeatureFileSystem());
  }
View Full Code Here

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

  private BasicBlobCrypter crypter;
  private FakeTimeSource timeSource;

  public BlobCrypterTest() {
    crypter = new BasicBlobCrypter("0123456789abcdef".getBytes());
    timeSource = new FakeTimeSource();
    crypter.timeSource = timeSource;
  }
View Full Code Here

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

  private BasicBlobCrypter crypter;

  @Before
  public void setUp() throws Exception {
    crypter = new BasicBlobCrypter("abcdefghijklmnop".getBytes());
    timeSource = new FakeTimeSource();
    crypter.timeSource = timeSource;
  }
View Full Code Here

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

  }

  @Before
  public void setUp() {
    fetcher = createMock(HttpFetcher.class);
    timeSource = new FakeTimeSource();
    timeSource.setCurrentTimeMillis(0);
    loader = new TestFeatureResourceLoader(fetcher, timeSource, new DefaultFeatureFileSystem());
  }
View Full Code Here

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

  private BasicBlobCrypter crypter;
 
  @Before
  public void setUp() throws Exception {
    crypter = new BasicBlobCrypter("abcdefghijklmnop".getBytes());
    timeSource = new FakeTimeSource();
    crypter.timeSource = timeSource;
  }
View Full Code Here

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

    assertEquals("1.2.3.4", request.getParam(ServletUtil.REMOTE_ADDR_KEY));
  }

  @Test
  public void testCopyToServletResponseAndOverrideCacheHeadersForPublic() throws Exception {
    FakeTimeSource fakeTime = new FakeTimeSource();
    HttpUtil.setTimeSource(fakeTime);

    HttpResponse response = new HttpResponseBuilder()
        .setResponseString("response string").setHttpStatusCode(200).addHeader("h1", "v1")
        .addHeader("h2", "v2").setCacheTtl(1000).create();
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.