com.google.android.agera.Observables.updateDispatcher

Here are the examples of the java api class com.google.android.agera.Observables.updateDispatcher taken from open source projects.

1. RepositoryAdapterTest#setUp()

Project: agera
File: RepositoryAdapterTest.java
@Before
public void setUp() {
    initMocks(this);
    updateDispatcher = updateDispatcher();
    repository = mutableRepository(REPOSITORY_ITEM);
    secondRepository = repository(REPOSITORY_LIST);
    when(activity.getApplication()).thenReturn(application);
    when(viewGroup.getContext()).thenReturn(context);
    when(context.getSystemService(Context.LAYOUT_INFLATER_SERVICE)).thenReturn(layoutInflater);
    when(layoutInflater.inflate(LAYOUT_ID, viewGroup, false)).thenReturn(view);
    when(repositoryPresenter.getItemCount(REPOSITORY_ITEM)).thenReturn(1);
    when(secondRepositoryPresenter.getItemCount(REPOSITORY_LIST)).thenReturn(3);
    repositoryAdapter = repositoryAdapter().add(repository, repositoryPresenter).add(secondRepository, secondRepositoryPresenter).addAdditionalObservable(updateDispatcher).build();
}

2. RepositoriesTest#setUp()

Project: agera
File: RepositoriesTest.java
@Before
public void setUp() {
    initMocks(this);
    when(mockIntegerListSupplier.get()).thenReturn(LIST);
    when(mockStringSupplier.get()).thenReturn(STRING_VALUE);
    when(mockResultStringSupplier.get()).thenReturn(RESULT_STRING_VALUE);
    when(mockFailedResultStringSupplier.get()).thenReturn(Result.<String>failure());
    when(mockResultStringFunction.apply(INITIAL_STRING_VALUE)).thenReturn(RESULT_STRING_VALUE);
    when(mockFailedResultStringFunction.apply(INITIAL_STRING_VALUE)).thenReturn(Result.<String>failure());
    when(mockResultStringMerger.merge(INITIAL_STRING_VALUE, STRING_VALUE)).thenReturn(RESULT_STRING_VALUE);
    when(mockFailedResultStringMerger.merge(INITIAL_STRING_VALUE, STRING_VALUE)).thenReturn(Result.<String>failure());
    when(mockIntegerListToIntValueFunction.apply(Matchers.<List<Integer>>any())).thenReturn(INT_VALUE);
    updateDispatcher = updateDispatcher();
    listSource = mutableRepository(LIST);
    otherListSource = mutableRepository(OTHER_LIST);
    updatable = mockUpdatable();
}

3. ObservablesTest#setUp()

Project: agera
File: ObservablesTest.java
@Before
public void setUp() {
    initMocks(this);
    //noinspection ConstantConditions
    scheduler = ((ShadowLooper) extract(myLooper())).getScheduler();
    updateDispatcherWithUpdatablesChanged = updateDispatcher(mockActivationHandler);
    updateDispatcher = updateDispatcher();
    firstUpdateDispatcher = updateDispatcher();
    secondUpdateDispatcher = updateDispatcher();
    thirdUpdateDispatcher = updateDispatcher();
    trueConditionalObservable = conditionalObservable(trueCondition(), firstUpdateDispatcher);
    falseConditionalObservable = conditionalObservable(falseCondition(), firstUpdateDispatcher);
    compositeObservableOfMany = compositeObservable(firstUpdateDispatcher, secondUpdateDispatcher);
    chainedCompositeObservableOfOne = compositeObservable(compositeObservable(firstUpdateDispatcher));
    chainedCompositeObservable = compositeObservable(compositeObservable(firstUpdateDispatcher, secondUpdateDispatcher), thirdUpdateDispatcher);
    chainedDupeCompositeObservable = compositeObservable(firstUpdateDispatcher, compositeObservable(firstUpdateDispatcher, secondUpdateDispatcher), secondUpdateDispatcher, thirdUpdateDispatcher);
    updatable = mockUpdatable();
    secondUpdatable = mockUpdatable();
    looper = getShadowMainLooper();
}

4. RepositoryConfigTest#setUp()

Project: agera
File: RepositoryConfigTest.java
@Before
public void setUp() {
    initMocks(this);
    updatable = mockUpdatable();
    updateDispatcher = updateDispatcher();
    delayedExecutor = new SingleSlotDelayedExecutor();
    monitoredSupplier = new InterruptibleMonitoredSupplier();
    when(mockSupplier.get()).thenReturn(UPDATED_VALUE);
    looper = getShadowMainLooper();
}