コード例 #1
0
  private static HttpArtifactCacheEvent.Finished.Builder createBuilder() {

    HttpArtifactCacheEvent.Scheduled scheduledEvent =
        HttpArtifactCacheEvent.newStoreScheduledEvent(
            Optional.of("target"), ImmutableSet.<RuleKey>of());
    HttpArtifactCacheEvent.Started startedEvent =
        HttpArtifactCacheEvent.newStoreStartedEvent(scheduledEvent);
    configureEvent(startedEvent);
    return HttpArtifactCacheEvent.newFinishedEventBuilder(startedEvent);
  }
コード例 #2
0
ファイル: ConsoleTestUtils.java プロジェクト: sdwilsh/buck
  public static HttpArtifactCacheEvent.Scheduled postStoreScheduled(
      BuckEventBus eventBus, long threadId, String target, long timeInMs) {
    HttpArtifactCacheEvent.Scheduled storeScheduled =
        HttpArtifactCacheEvent.newStoreScheduledEvent(Optional.of(target), ImmutableSet.of());

    eventBus.postWithoutConfiguring(
        configureTestEventAtTime(storeScheduled, timeInMs, TimeUnit.MILLISECONDS, threadId));
    return storeScheduled;
  }
コード例 #3
0
ファイル: ConsoleTestUtils.java プロジェクト: sdwilsh/buck
  public static HttpArtifactCacheEvent.Started postStoreStarted(
      BuckEventBus eventBus,
      long threadId,
      long timeInMs,
      HttpArtifactCacheEvent.Scheduled storeScheduled) {
    HttpArtifactCacheEvent.Started storeStartedOne =
        HttpArtifactCacheEvent.newStoreStartedEvent(storeScheduled);

    eventBus.postWithoutConfiguring(
        configureTestEventAtTime(storeStartedOne, timeInMs, TimeUnit.MILLISECONDS, threadId));
    return storeStartedOne;
  }
コード例 #4
0
ファイル: ConsoleTestUtils.java プロジェクト: sdwilsh/buck
  public static void postStoreFinished(
      BuckEventBus eventBus,
      long threadId,
      long artifactSizeInBytes,
      long timeInMs,
      boolean success,
      HttpArtifactCacheEvent.Started storeStartedOne) {
    HttpArtifactCacheEvent.Finished storeFinished =
        HttpArtifactCacheEvent.newFinishedEventBuilder(storeStartedOne)
            .setWasUploadSuccessful(success)
            .setArtifactSizeBytes(artifactSizeInBytes)
            .build();

    eventBus.postWithoutConfiguring(
        configureTestEventAtTime(storeFinished, timeInMs, TimeUnit.MILLISECONDS, threadId));
  }