use of io.reactivex.ObservableTransformer in project sqlbrite by square.
the class BriteDatabaseTest method setUp.
@Before
public void setUp() throws IOException {
Configuration configuration = Configuration.builder(InstrumentationRegistry.getContext()).callback(testDb).name(dbFolder.newFile().getPath()).build();
Factory factory = new FrameworkSQLiteOpenHelperFactory();
SupportSQLiteOpenHelper helper = factory.create(configuration);
real = helper.getWritableDatabase();
SqlBrite.Logger logger = new SqlBrite.Logger() {
@Override
public void log(String message) {
logs.add(message);
}
};
ObservableTransformer<Query, Query> queryTransformer = new ObservableTransformer<Query, Query>() {
@Override
public ObservableSource<Query> apply(Observable<Query> upstream) {
return upstream.takeUntil(killSwitch);
}
};
db = new BriteDatabase(helper, logger, scheduler, queryTransformer);
}
Aggregations