Examples of StorageTestUtil


Examples of org.apache.aurora.scheduler.storage.testing.StorageTestUtil

  private SchedulerLifecycle schedulerLifecycle;

  @Before
  public void setUp() {
    storageUtil = new StorageTestUtil(this);
    shutdownRegistry = createMock(ShutdownSystem.class);
    driver = createMock(Driver.class);
    leaderControl = createMock(LeaderControl.class);
    delayedActions = createMock(DelayedActions.class);
    eventSink = createMock(EventSink.class);
View Full Code Here

Examples of org.apache.aurora.scheduler.storage.testing.StorageTestUtil

  private TaskVars vars;
  private Map<String, Supplier<Long>> globalCounters;

  @Before
  public void setUp() {
    storageUtil = new StorageTestUtil(this);
    trackedProvider = createMock(StatsProvider.class);
    untrackedProvider = createMock(StatsProvider.class);
    expect(trackedProvider.untracked()).andReturn(untrackedProvider);
    storageUtil.expectOperations();
    globalCounters = Maps.newHashMap();
View Full Code Here

Examples of org.apache.aurora.scheduler.storage.testing.StorageTestUtil

  public void runTest() {
    FakeClock clock = new FakeClock();
    StatsProvider statsProvider = createMock(StatsProvider.class);
    StatsProvider untracked = createMock(StatsProvider.class);
    MetricCalculatorSettings settings = new MetricCalculatorSettings(10000);
    StorageTestUtil storageUtil = new StorageTestUtil(this);
    MetricCalculator calculator = new MetricCalculator(
        storageUtil.storage,
        clock,
        settings,
        statsProvider);

    expect(statsProvider.untracked()).andReturn(untracked).anyTimes();

    Capture<String> names = new Capture<>(CaptureType.ALL);
    expect(untracked.makeGauge(EasyMock.capture(names), EasyMock.<Supplier<Number>>anyObject()))
        .andReturn(EasyMock.<Stat<Number>>anyObject())
        .anyTimes();

    IScheduledTask task1 = makeTask(ImmutableMap.of(clock.nowMillis() - 1000, PENDING), 0);
    IScheduledTask task2 = makeTask(ImmutableMap.of(clock.nowMillis() - 2000, PENDING), 1);
    IScheduledTask task3 = makeTask(ImmutableMap.of(clock.nowMillis() - 3000, PENDING), 2);
    IScheduledTask task4 = makeTask(ImmutableMap.of(clock.nowMillis() - 4000, PENDING), 3, false);

    clock.advance(Amount.of(10L, Time.SECONDS));
    storageUtil.expectTaskFetch(Query.unscoped(), task1, task2, task3, task4);
    storageUtil.expectOperations();

    control.replay();
    calculator.run();

    Set<String> metricNames = generateMetricNames(
View Full Code Here

Examples of org.apache.aurora.scheduler.storage.testing.StorageTestUtil

  private StatsProvider statsProvider;
  private SlaModule module;

  @Before
  public void setUp() throws Exception {
    storageUtil = new StorageTestUtil(this);
    clock = new FakeClock();
    statsProvider = createMock(StatsProvider.class);
    module = new SlaModule(Amount.of(5L, Time.MILLISECONDS));
    injector = Guice.createInjector(
        ImmutableList.<Module>builder()
View Full Code Here

Examples of org.apache.aurora.scheduler.storage.testing.StorageTestUtil

            bindMock(ShutdownRegistry.class);
            bindMock(StateManager.class);
            bindMock(TaskIdGenerator.class);
            bindMock(UUIDGenerator.class);
            bindMock(JobUpdateController.class);
            storageTestUtil = new StorageTestUtil(ThriftIT.this);
            bind(Storage.class).toInstance(storageTestUtil.storage);
            bind(NonVolatileStorage.class).toInstance(storageTestUtil.storage);
            bindMock(StorageBackup.class);
            bind(QuotaManager.class).toInstance(quotaManager);
            bind(SessionValidator.class).toInstance(validator);
View Full Code Here

Examples of org.apache.aurora.scheduler.storage.testing.StorageTestUtil

  @Before
  public void setUp() {
    FakeClock clock = new FakeClock();
    clock.setNowMillis(NOW);
    storageUtil = new StorageTestUtil(this);
    snapshotStore = new SnapshotStoreImpl(clock, storageUtil.storage);
  }
View Full Code Here

Examples of org.apache.aurora.scheduler.storage.testing.StorageTestUtil

  private EventSink eventSink;
  private AttributeAggregate emptyJob;

  @Before
  public void setUp() throws Exception {
    storageUtil = new StorageTestUtil(this);
    stateManager = createMock(StateManager.class);
    assigner = createMock(TaskAssigner.class);
    offerQueue = createMock(OfferQueue.class);
    reservationDuration = Amount.of(2L, Time.MINUTES);
    halfReservationDuration = Amount.of(1L, Time.MINUTES);
View Full Code Here

Examples of org.apache.aurora.scheduler.storage.testing.StorageTestUtil

  private StorageTestUtil storageUtil;

  @Before
  public void setUp() {
    statsProvider = new FakeStatsProvider();
    storageUtil = new StorageTestUtil(this);
    storageUtil.expectOperations();
  }
View Full Code Here

Examples of org.apache.aurora.scheduler.storage.testing.StorageTestUtil

  private FakeStatsProvider statsProvider;

  @Before
  public void setUp() throws Exception {
    driver = createMock(Driver.class);
    storageUtil = new StorageTestUtil(this);
    storageUtil.expectOperations();
    backoffStrategy = createMock(BackoffStrategy.class);
    final ScheduledExecutorService executorMock = createMock(ScheduledExecutorService.class);
    clock = FakeScheduledExecutor.scheduleExecutor(executorMock);
    addTearDown(new TearDown() {
View Full Code Here

Examples of org.apache.aurora.scheduler.storage.testing.StorageTestUtil

  private OfferQueue offerQueue;
  private AttributeAggregate emptyJob;

  @Before
  public void setUp() {
    storageUtil = new StorageTestUtil(this);
    storageUtil.expectOperations();
    stateManager = createMock(StateManager.class);
    clock = new FakeClock();
    statsProvider = new FakeStatsProvider();
    offerQueue = createMock(OfferQueue.class);
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.