Examples of Clock


Examples of com.google.api.client.util.Clock

        new GooglePublicKeysManagerTest.PublicCertsMockHttpTransport(), new JacksonFactory()).setIssuer(
        ISSUER).setAudience(TRUSTED_CLIENT_IDS);
    assertEquals(Clock.SYSTEM, builder.getClock());
    assertEquals(ISSUER, builder.getIssuer());
    assertTrue(TRUSTED_CLIENT_IDS.equals(builder.getAudience()));
    Clock clock = new FixedClock(4);
    builder.setClock(clock);
    assertEquals(clock, builder.getClock());
    IdTokenVerifier verifier = builder.build();
    assertEquals(clock, verifier.getClock());
    assertEquals(ISSUER, verifier.getIssuer());
View Full Code Here

Examples of com.google.appengine.tools.appstats.Recorder.Clock

  }

  public AppstatsServlet() {
    this(
        new MemcacheWriter(
            new Clock(), MemcacheServiceFactory.getMemcacheService(MemcacheWriter.STATS_NAMESPACE)),
        new Renderer());
  }
View Full Code Here

Examples of com.google.enterprise.connector.util.Clock

    byte[] output = new byte[4 + ((input.length * 4) / 3)];
    // Force these arrays to be paged in before starting the clock.
    System.arraycopy(input, 0, output, 0, input.length);
    System.arraycopy(input, 0, output, input.length,
                     output.length - input.length);
    Clock clock = new SystemClock();
    long start = clock.getTimeMillis();
    Base64.encode(input, 0, input.length, output, 0, Base64.ALPHABET,
                  Integer.MAX_VALUE);
    long duration = clock.getTimeMillis() - start;
    System.out.println("testSpeed: " + duration + " millisecs");
    // OriginalBase64Encoder used to run 20x longer than this one.
    // TODO: This threshold is already 10x longer than this test
    // takes on my machine, so I don't think this is a valid
    // regression test.  Fails on code coverage and Pulse.
View Full Code Here

Examples of com.hp.hpl.jena.gvs.Clock

    final Date cannedVersionDate = ((XSDDateTime) cannedVersionDateStmt
        .getLiteral().getValue()).asCalendar().getTime();
    cannedVersionDateStmt.remove();
   
    if (isDefaultConfigLoadingNeeded(store, cannedVersionDate)) {
      Clock origClock = store.getClock();
      store.setClock(new Clock() {

        public Date getTime() {
          return cannedVersionDate;
        }
       
View Full Code Here

Examples of com.hp.hpl.jena.gvs.Clock

   */
  @Override
  protected void execute(Store store, DownloadRemoteCommandArgumets arguments) {
    URL remoteService = arguments.getRemoteServiceURL();
    log.info("Remote Service: " + remoteService);
    Clock origClock = store.getClock();
    ToyClock toyClock = new ToyClock();
    store.setClock(toyClock);
    Set<String> sources = getSources(remoteService);
    for (String omitSource : arguments.getOmitSourceURLs()) {
      if (!sources.contains(omitSource)) {
View Full Code Here

Examples of com.hp.hpl.jena.gvs.Clock

   * -MetaStore
   *
   *
   */
  protected BaseStoreImpl() {
    this(new Clock() {

      public Date getTime() {
        return new Date();
      }

View Full Code Here

Examples of com.hp.hpl.jena.gvs.Clock

     * @param store
     * @param clock
     */
    public void storeIn(Store store) {
      log.info(source + " asserted something at " + date);
      Clock oldClock = store.getClock();
      store.setClock(new Clock() {

        public Date getTime() {
          return date;
        }
       
View Full Code Here

Examples of com.jitcaforwin.extended.impl.internal.factories.trackbuffering.Clock

public class TrackBufferTest {

  @Test
  public void testTrackBuffer(){
    IITTrackCollection collectionMock = EasyMock.createMock(IITTrackCollection.class);
    Clock clockMock = EasyMock.createMock(Clock.class);
   
    EasyMock.expect(clockMock.currentTime()).andReturn(System.currentTimeMillis()).anyTimes();
    EasyMock.replay(collectionMock);
    EasyMock.replay(clockMock);
   
    TrackBuffering buffer = new TrackBuffering(clockMock);
    buffer.put("Test-Collection", collectionMock);
View Full Code Here

Examples of com.jitcaforwin.extended.internal.factories.trackbuffering.Clock

  private TrackBuffering tracksAlbum;

  public SearchService(IITPlaylist itPlaylist, Source source) {
    this.itPlaylist = itPlaylist;
    this.source = source;
    this.tracksArtist = new TrackBuffering(new Clock());
    this.tracksComposer = new TrackBuffering(new Clock());
    this.tracksAlbum = new TrackBuffering(new Clock());
  }
View Full Code Here

Examples of com.linkedin.util.clock.Clock

  public void testClient() throws URISyntaxException
  {
    URI uri = URI.create("http://test.qa.com:1234/foo");
    double weight = 3d;
    TestClient wrappedClient = new TestClient();
    Clock clock = new SettableClock();
    Map<Integer, PartitionData> partitionDataMap = new HashMap<Integer, PartitionData>(2);
    partitionDataMap.put(DefaultPartitionAccessor.DEFAULT_PARTITION_ID, new PartitionData(3d));
    TrackerClient client = new TrackerClient(uri, partitionDataMap, wrappedClient, clock, null);

    assertEquals(client.getUri(), uri);
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.