Search in sources :

Example 1 with StorIOContentResolver

use of com.pushtorefresh.storio3.contentresolver.StorIOContentResolver in project storio by pushtorefresh.

the class DeleteOperationDesignTest method deleteByQuerySingle.

@Test
public void deleteByQuerySingle() {
    final DeleteQuery deleteQuery = DeleteQuery.builder().uri(mock(Uri.class)).where("some_field = ?").whereArgs("someValue").build();
    Single<DeleteResult> deleteResultSingle = storIOContentResolver().delete().byQuery(deleteQuery).prepare().asRxSingle();
}
Also used : DeleteQuery(com.pushtorefresh.storio3.contentresolver.queries.DeleteQuery) DeleteResult(com.pushtorefresh.storio3.contentresolver.operations.delete.DeleteResult) Test(org.junit.Test)

Example 2 with StorIOContentResolver

use of com.pushtorefresh.storio3.contentresolver.StorIOContentResolver in project storio by pushtorefresh.

the class DeleteOperationDesignTest method deleteObjectBlocking.

@Test
public void deleteObjectBlocking() {
    Article article = mock(Article.class);
    DeleteResult deleteResult = storIOContentResolver().delete().object(article).withDeleteResolver(ArticleMeta.DELETE_RESOLVER).prepare().executeAsBlocking();
}
Also used : DeleteResult(com.pushtorefresh.storio3.contentresolver.operations.delete.DeleteResult) Test(org.junit.Test)

Example 3 with StorIOContentResolver

use of com.pushtorefresh.storio3.contentresolver.StorIOContentResolver in project storio by pushtorefresh.

the class DeleteOperationDesignTest method deleteByQueryCompletable.

@Test
public void deleteByQueryCompletable() {
    final DeleteQuery deleteQuery = DeleteQuery.builder().uri(mock(Uri.class)).where("some_field = ?").whereArgs("someValue").build();
    Completable completable = storIOContentResolver().delete().byQuery(deleteQuery).prepare().asRxCompletable();
}
Also used : Completable(io.reactivex.Completable) DeleteQuery(com.pushtorefresh.storio3.contentresolver.queries.DeleteQuery) Test(org.junit.Test)

Example 4 with StorIOContentResolver

use of com.pushtorefresh.storio3.contentresolver.StorIOContentResolver in project storio by pushtorefresh.

the class DeleteOperationDesignTest method deleteByQueryBlocking.

@Test
public void deleteByQueryBlocking() {
    final DeleteQuery deleteQuery = DeleteQuery.builder().uri(mock(Uri.class)).where("some_field = ?").whereArgs("someValue").build();
    DeleteResult deleteResult = storIOContentResolver().delete().byQuery(deleteQuery).prepare().executeAsBlocking();
}
Also used : DeleteQuery(com.pushtorefresh.storio3.contentresolver.queries.DeleteQuery) DeleteResult(com.pushtorefresh.storio3.contentresolver.operations.delete.DeleteResult) Test(org.junit.Test)

Example 5 with StorIOContentResolver

use of com.pushtorefresh.storio3.contentresolver.StorIOContentResolver in project storio by pushtorefresh.

the class PutOperationDesignTest method putContentValuesFlowable.

@Test
public void putContentValuesFlowable() {
    ContentValues contentValues = mock(ContentValues.class);
    Flowable<PutResult> putResultFlowable = storIOContentResolver().put().contentValues(contentValues).withPutResolver(putResolverForContentValues).prepare().asRxFlowable(BackpressureStrategy.MISSING);
}
Also used : ContentValues(android.content.ContentValues) PutResult(com.pushtorefresh.storio3.contentresolver.operations.put.PutResult) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)31 StorIOContentResolver (com.pushtorefresh.storio3.contentresolver.StorIOContentResolver)23 Query (com.pushtorefresh.storio3.contentresolver.queries.Query)11 ContentResolver (android.content.ContentResolver)9 NonNull (android.support.annotation.NonNull)9 ContentValues (android.content.ContentValues)8 Cursor (android.database.Cursor)7 Uri (android.net.Uri)7 DeleteQuery (com.pushtorefresh.storio3.contentresolver.queries.DeleteQuery)6 TypeMappingFinder (com.pushtorefresh.storio3.TypeMappingFinder)5 InsertQuery (com.pushtorefresh.storio3.contentresolver.queries.InsertQuery)5 UpdateQuery (com.pushtorefresh.storio3.contentresolver.queries.UpdateQuery)5 DeleteResult (com.pushtorefresh.storio3.contentresolver.operations.delete.DeleteResult)4 PutResult (com.pushtorefresh.storio3.contentresolver.operations.put.PutResult)4 StorIOException (com.pushtorefresh.storio3.StorIOException)3 GetResolver (com.pushtorefresh.storio3.contentresolver.operations.get.GetResolver)3 Handler (android.os.Handler)2 TypeMappingFinderImpl (com.pushtorefresh.storio3.internal.TypeMappingFinderImpl)2 Completable (io.reactivex.Completable)2 ContentObserver (android.database.ContentObserver)1