Search in sources :

Example 11 with Completable

use of rx.Completable in project storio by pushtorefresh.

the class PreparedPutContentValuesIterableTest method putMultipleCompletableWithTransaction.

@Test
public void putMultipleCompletableWithTransaction() {
    final PutContentValuesStub putStub = PutContentValuesStub.newPutStubForMultipleContentValues(true);
    final Completable completable = putStub.storIOSQLite.put().contentValues(putStub.contentValues).withPutResolver(putStub.putResolver).useTransaction(true).prepare().asRxCompletable();
    putStub.verifyBehaviorForMultipleContentValues(completable);
}
Also used : Completable(rx.Completable) Test(org.junit.Test)

Example 12 with Completable

use of rx.Completable in project storio by pushtorefresh.

the class PreparedPutContentValuesIterableTest method putMultipleCompletableWithoutTransaction.

@Test
public void putMultipleCompletableWithoutTransaction() {
    final PutContentValuesStub putStub = PutContentValuesStub.newPutStubForMultipleContentValues(false);
    final Completable completable = putStub.storIOSQLite.put().contentValues(putStub.contentValues).withPutResolver(putStub.putResolver).useTransaction(false).prepare().asRxCompletable();
    putStub.verifyBehaviorForMultipleContentValues(completable);
}
Also used : Completable(rx.Completable) Test(org.junit.Test)

Example 13 with Completable

use of rx.Completable in project azure-sdk-for-java by Azure.

the class SqlServerImpl method deleteChildResources.

private void deleteChildResources() {
    Completable deleteFirewallRules = deleteFirewallRule();
    Completable deleteDatabasesAndElasticPools = deleteDatabasesAndElasticPools();
    Completable.merge(deleteFirewallRules, deleteDatabasesAndElasticPools).await();
}
Also used : Completable(rx.Completable)

Example 14 with Completable

use of rx.Completable in project azure-sdk-for-java by Azure.

the class SqlServerImpl method deleteDatabasesAndElasticPools.

private Completable deleteDatabasesAndElasticPools() {
    List<Completable> deleteDBList = new ArrayList<>();
    for (String databaseName : this.databasesToDelete) {
        deleteDBList.add(this.databases().deleteAsync(databaseName));
    }
    Completable deleteDBs = Completable.merge(deleteDBList);
    List<Completable> deleteElasticPoolList = new ArrayList<>();
    for (String elasticPoolName : this.elasticPoolsToDelete) {
        deleteElasticPoolList.add(this.elasticPools().deleteAsync(elasticPoolName));
    }
    Completable deletePools = Completable.merge(deleteElasticPoolList);
    return Completable.concat(deleteDBs, deletePools);
}
Also used : Completable(rx.Completable) ArrayList(java.util.ArrayList)

Example 15 with Completable

use of rx.Completable in project azure-sdk-for-java by Azure.

the class QueueImpl method createChildResourceAsync.

@Override
protected Observable<Queue> createChildResourceAsync() {
    Completable createQueueCompletable = this.manager().inner().queues().createOrUpdateAsync(this.resourceGroupName(), this.parentName, this.name(), this.inner()).map(new Func1<QueueInner, QueueInner>() {

        @Override
        public QueueInner call(QueueInner inner) {
            setInner(inner);
            return inner;
        }
    }).toCompletable();
    Completable childrenOperationsCompletable = submitChildrenOperationsAsync();
    final Queue self = this;
    return Completable.concat(createQueueCompletable, childrenOperationsCompletable).doOnTerminate(new Action0() {

        @Override
        public void call() {
            initChildrenOperationsCache();
        }
    }).andThen(Observable.just(self));
}
Also used : Completable(rx.Completable) Action0(rx.functions.Action0) Func1(rx.functions.Func1) Queue(com.microsoft.azure.management.servicebus.Queue)

Aggregations

Completable (rx.Completable)31 Test (org.junit.Test)24 ArrayList (java.util.ArrayList)6 TestSubscriber (rx.observers.TestSubscriber)6 MockResponse (okhttp3.mockwebserver.MockResponse)4 Func1 (rx.functions.Func1)4 ContentValues (android.content.ContentValues)3 Action0 (rx.functions.Action0)3 CheckResult (android.support.annotation.CheckResult)2 NonNull (android.support.annotation.NonNull)2 PreparedWriteOperation (com.pushtorefresh.storio.operations.PreparedWriteOperation)2 OnSubscribeExecuteAsBlockingCompletable (com.pushtorefresh.storio.operations.internal.OnSubscribeExecuteAsBlockingCompletable)2 CloudException (com.microsoft.azure.CloudException)1 Network (com.microsoft.azure.management.network.Network)1 NetworkInterface (com.microsoft.azure.management.network.NetworkInterface)1 ResourceGroup (com.microsoft.azure.management.resources.ResourceGroup)1 Region (com.microsoft.azure.management.resources.fluentcore.arm.Region)1 Resource (com.microsoft.azure.management.resources.fluentcore.arm.models.Resource)1 Creatable (com.microsoft.azure.management.resources.fluentcore.model.Creatable)1 Indexable (com.microsoft.azure.management.resources.fluentcore.model.Indexable)1