当前位置: 首页>>代码示例>>Java>>正文


Java TestObserver.assertNoValues方法代码示例

本文整理汇总了Java中io.reactivex.observers.TestObserver.assertNoValues方法的典型用法代码示例。如果您正苦于以下问题:Java TestObserver.assertNoValues方法的具体用法?Java TestObserver.assertNoValues怎么用?Java TestObserver.assertNoValues使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在io.reactivex.observers.TestObserver的用法示例。


在下文中一共展示了TestObserver.assertNoValues方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: testGetStreamWithProcessor_notSuccessful

import io.reactivex.observers.TestObserver; //导入方法依赖的package包/类
@Test public void testGetStreamWithProcessor_notSuccessful() {
  mockNotSuccessfulResultForTask(mockStreamDownloadTask, new IllegalStateException());
  when(mockStorageReference.getStream(mockStreamProcessor)).thenReturn(mockStreamDownloadTask);

  TestObserver<StreamDownloadTask.TaskSnapshot> obs = TestObserver.create();

  RxFirebaseStorage.getStream(mockStorageReference, mockStreamProcessor).subscribe(obs);
  verifyAddOnCompleteListenerForTask(mockStreamDownloadTask);

  callOnComplete(mockStreamDownloadTask);
  obs.dispose();

  callOnComplete(mockStreamDownloadTask);

  obs.assertError(IllegalStateException.class);
  obs.assertNoValues();
}
 
开发者ID:b3er,项目名称:RxFirebase2,代码行数:18,代码来源:RxFirebaseStorageTest.java

示例2: testPutFileWithMetadata_notSuccessful

import io.reactivex.observers.TestObserver; //导入方法依赖的package包/类
@Test public void testPutFileWithMetadata_notSuccessful() {
  mockNotSuccessfulResultForTask(mockUploadTask, new IllegalStateException());
  when(mockStorageReference.putFile(mockUri, mockStorageMetadata)).thenReturn(mockUploadTask);

  TestObserver<UploadTask.TaskSnapshot> obs = TestObserver.create();

  RxFirebaseStorage.putFile(mockStorageReference, mockUri, mockStorageMetadata).subscribe(obs);
  verifyAddOnCompleteListenerForTask(mockUploadTask);

  callOnComplete(mockUploadTask);
  obs.dispose();

  callOnComplete(mockUploadTask);

  obs.assertError(IllegalStateException.class);
  obs.assertNoValues();
}
 
开发者ID:b3er,项目名称:RxFirebase2,代码行数:18,代码来源:RxFirebaseStorageTest.java

示例3: testGetStream_notSuccessful

import io.reactivex.observers.TestObserver; //导入方法依赖的package包/类
@Test public void testGetStream_notSuccessful() {
  mockNotSuccessfulResultForTask(mockStreamDownloadTask, new IllegalStateException());
  when(mockStorageReference.getStream()).thenReturn(mockStreamDownloadTask);

  TestObserver<StreamDownloadTask.TaskSnapshot> obs = TestObserver.create();

  RxFirebaseStorage.getStream(mockStorageReference).subscribe(obs);
  verifyAddOnCompleteListenerForTask(mockStreamDownloadTask);

  callOnComplete(mockStreamDownloadTask);
  obs.dispose();

  callOnComplete(mockStreamDownloadTask);

  obs.assertError(IllegalStateException.class);
  obs.assertNoValues();
}
 
开发者ID:b3er,项目名称:RxFirebase2,代码行数:18,代码来源:RxFirebaseStorageTest.java

示例4: testPutStream_notSuccessful

import io.reactivex.observers.TestObserver; //导入方法依赖的package包/类
@Test public void testPutStream_notSuccessful() {
  mockNotSuccessfulResultForTask(mockUploadTask, new IllegalStateException());
  when(mockStorageReference.putStream(mockInputStream)).thenReturn(mockUploadTask);

  TestObserver<UploadTask.TaskSnapshot> obs = TestObserver.create();

  RxFirebaseStorage.putStream(mockStorageReference, mockInputStream).subscribe(obs);
  verifyAddOnCompleteListenerForTask(mockUploadTask);

  callOnComplete(mockUploadTask);
  obs.dispose();

  callOnComplete(mockUploadTask);

  obs.assertError(IllegalStateException.class);
  obs.assertNoValues();
}
 
开发者ID:b3er,项目名称:RxFirebase2,代码行数:18,代码来源:RxFirebaseStorageTest.java

示例5: testGetFile_notSuccessful

import io.reactivex.observers.TestObserver; //导入方法依赖的package包/类
@SuppressWarnings("Duplicates") @Test public void testGetFile_notSuccessful() {
  mockNotSuccessfulResultForTask(mockFileDownloadTask, new IllegalStateException());
  when(mockStorageReference.getFile(mockFile)).thenReturn(mockFileDownloadTask);

  TestObserver<FileDownloadTask.TaskSnapshot> obs = TestObserver.create();

  RxFirebaseStorage.getFile(mockStorageReference, mockFile).subscribe(obs);
  verifyAddOnCompleteListenerForTask(mockFileDownloadTask);

  callOnComplete(mockFileDownloadTask);
  obs.dispose();

  callOnComplete(mockFileDownloadTask);

  obs.assertError(IllegalStateException.class);
  obs.assertNoValues();
}
 
开发者ID:b3er,项目名称:RxFirebase2,代码行数:18,代码来源:RxFirebaseStorageTest.java

示例6: testPutBytes_notSuccessful

import io.reactivex.observers.TestObserver; //导入方法依赖的package包/类
@Test public void testPutBytes_notSuccessful() {
  mockNotSuccessfulResultForTask(mockUploadTask, new IllegalStateException());
  when(mockStorageReference.putBytes(new byte[] { 1, 2, 3 })).thenReturn(mockUploadTask);

  TestObserver<UploadTask.TaskSnapshot> obs = TestObserver.create();

  RxFirebaseStorage.putBytes(mockStorageReference, new byte[] { 1, 2, 3 }).subscribe(obs);
  verifyAddOnCompleteListenerForTask(mockUploadTask);

  callOnComplete(mockUploadTask);
  obs.dispose();

  callOnComplete(mockUploadTask);

  obs.assertError(IllegalStateException.class);
  obs.assertNoValues();
}
 
开发者ID:b3er,项目名称:RxFirebase2,代码行数:18,代码来源:RxFirebaseStorageTest.java

示例7: testGetToken_notSuccessful

import io.reactivex.observers.TestObserver; //导入方法依赖的package包/类
@Test public void testGetToken_notSuccessful() {
  mockNotSuccessfulTokenResult(new IllegalStateException());
  when(mockFirebaseUser.getToken(true)).thenReturn(mockGetTokenTaskResult);

  TestObserver<String> obs = TestObserver.create();

  RxFirebaseUser.getToken(mockFirebaseUser, true).subscribe(obs);

  callOnComplete(mockGetTokenTaskResult);
  obs.dispose();

  // Ensure no more values are emitted after unsubscribe
  callOnComplete(mockGetTokenTaskResult);

  obs.assertError(IllegalStateException.class);
  obs.assertNoValues();
}
 
开发者ID:b3er,项目名称:RxFirebase2,代码行数:18,代码来源:RxFirebaseUserTest.java

示例8: oneEvent

import io.reactivex.observers.TestObserver; //导入方法依赖的package包/类
@Test
public void oneEvent() {
    TestObserver<String> testObserver = Single.just("1")
        .delay(1, TimeUnit.MILLISECONDS, testScheduler)
        .compose(RxLifecycle.<String, String>bind(lifecycle))
        .test();

    testObserver.assertNoValues();
    testObserver.assertNoErrors();

    lifecycle.onNext("stop");
    testScheduler.advanceTimeBy(1, TimeUnit.MILLISECONDS);

    testObserver.assertNoValues();
    testObserver.assertError(CancellationException.class);
}
 
开发者ID:xufreshman,项目名称:RxLifeCycle,代码行数:17,代码来源:UntilLifecycleTransformerSingleTest.java

示例9: testGetFileUri_notSuccessful

import io.reactivex.observers.TestObserver; //导入方法依赖的package包/类
@SuppressWarnings("Duplicates") @Test public void testGetFileUri_notSuccessful() {
  mockNotSuccessfulResultForTask(mockFileDownloadTask, new IllegalStateException());
  when(mockStorageReference.getFile(mockUri)).thenReturn(mockFileDownloadTask);

  TestObserver<FileDownloadTask.TaskSnapshot> obs = TestObserver.create();

  RxFirebaseStorage.getFile(mockStorageReference, mockUri).subscribe(obs);
  verifyAddOnCompleteListenerForTask(mockFileDownloadTask);

  callOnComplete(mockFileDownloadTask);
  obs.dispose();

  callOnComplete(mockFileDownloadTask);

  obs.assertError(IllegalStateException.class);
  obs.assertNoValues();
}
 
开发者ID:b3er,项目名称:RxFirebase2,代码行数:18,代码来源:RxFirebaseStorageTest.java

示例10: testPutFile_notSuccessful

import io.reactivex.observers.TestObserver; //导入方法依赖的package包/类
@Test public void testPutFile_notSuccessful() {
  mockNotSuccessfulResultForTask(mockUploadTask, new IllegalStateException());
  when(mockStorageReference.putFile(mockUri)).thenReturn(mockUploadTask);

  TestObserver<UploadTask.TaskSnapshot> obs = TestObserver.create();

  RxFirebaseStorage.putFile(mockStorageReference, mockUri).subscribe(obs);
  verifyAddOnCompleteListenerForTask(mockUploadTask);

  callOnComplete(mockUploadTask);
  obs.dispose();

  callOnComplete(mockUploadTask);

  obs.assertError(IllegalStateException.class);
  obs.assertNoValues();
}
 
开发者ID:b3er,项目名称:RxFirebase2,代码行数:18,代码来源:RxFirebaseStorageTest.java

示例11: mapToOneIgnoresNullCursor

import io.reactivex.observers.TestObserver; //导入方法依赖的package包/类
@Test public void mapToOneIgnoresNullCursor() {
  Query nully = new Query() {
    @Nullable @Override public Cursor run() {
      return null;
    }
  };

  TestObserver<Employee> observer = new TestObserver<>();
  Observable.just(nully)
      .lift(Query.mapToOne(MAPPER))
      .subscribe(observer);

  observer.assertNoValues();
  observer.assertComplete();
}
 
开发者ID:jiechic,项目名称:sqlbrite-sqlcipher,代码行数:16,代码来源:QueryTest.java

示例12: getRemoteTranslationListObservableIssue

import io.reactivex.observers.TestObserver; //导入方法依赖的package包/类
@Test
public void getRemoteTranslationListObservableIssue() throws Exception {
  MockResponse mockResponse = new MockResponse();
  mockResponse.setResponseCode(500);
  this.mockWebServer.enqueue(mockResponse);

  TestObserver<TranslationList> testObserver = new TestObserver<>();
  this.translationManager.getRemoteTranslationListObservable()
      .subscribe(testObserver);
  testObserver.awaitTerminalEvent();
  testObserver.assertNoValues();
  testObserver.assertError(IOException.class);
}
 
开发者ID:Elias33,项目名称:Quran,代码行数:14,代码来源:TranslationManagerPresenterTest.java

示例13: test_never

import io.reactivex.observers.TestObserver; //导入方法依赖的package包/类
@Test
public void test_never() {
	Observable<String> observable = Observable.never();
	TestObserver<String> testObserver = new TestObserver<>();
	observable.subscribe(testObserver);

	testObserver.assertNoValues();
	testObserver.assertTerminated();
	// testObserver.assertComplete();
}
 
开发者ID:PacktPublishing,项目名称:Reactive-Programming-With-Java-9,代码行数:11,代码来源:Modern_Testing.java

示例14: start_noInteraction_shouldObserveAllTheIntentsAndDoNothingWithView

import io.reactivex.observers.TestObserver; //导入方法依赖的package包/类
@Test
public void start_noInteraction_shouldObserveAllTheIntentsAndDoNothingWithView() {
  // given
  TestObserver<SnackbarMessageEvent> snackbarMessage$ = TestObserver.create();
  given(view.openDrawerIntent$()).willReturn(noTriggers());
  given(view.readAboutIntent$()).willReturn(noTriggers());
  given(view.openProjectOnGitHubIntent$()).willReturn(noTriggers());
  given(view.selectLanguageIntent$()).willReturn(noTriggers());

  DrawerPresenter presenter = new DrawerPresenter(
      "http://foo.com",
      Sink.of(snackbarMessage$),
      urlOpener
  );

  // when
  presenter.start(view);

  // then
  verify(view).openDrawerIntent$();
  verify(view).readAboutIntent$();
  verify(view).openProjectOnGitHubIntent$();
  verify(view).selectLanguageIntent$();
  then(view).shouldHaveNoMoreInteractions();
  then(urlOpener).shouldHaveZeroInteractions();
  snackbarMessage$.assertNoValues();
}
 
开发者ID:xemantic,项目名称:github-users,代码行数:28,代码来源:DrawerPresenterTest.java

示例15: start_openDrawerIntent_shouldOpenTheDrawer

import io.reactivex.observers.TestObserver; //导入方法依赖的package包/类
@Test
public void start_openDrawerIntent_shouldOpenTheDrawer() {
  // given
  TestObserver<SnackbarMessageEvent> snackbarMessage$ = new TestObserver<>();
  PublishSubject<Trigger> openDrawerIntent = PublishSubject.create();
  given(view.openDrawerIntent$()).willReturn(openDrawerIntent);
  given(view.readAboutIntent$()).willReturn(noTriggers());
  given(view.openProjectOnGitHubIntent$()).willReturn(noTriggers());
  given(view.selectLanguageIntent$()).willReturn(noTriggers());
  DrawerPresenter presenter = new DrawerPresenter(
      "http://foo.com", Sink.of(snackbarMessage$), urlOpener
  );
  presenter.start(view);

  // when
  fire(openDrawerIntent);

  // then
  verify(view).openDrawerIntent$();
  verify(view).readAboutIntent$();
  verify(view).openProjectOnGitHubIntent$();
  verify(view).selectLanguageIntent$();
  verify(view).openDrawer(true);
  then(view).shouldHaveNoMoreInteractions();
  then(urlOpener).shouldHaveZeroInteractions();
  snackbarMessage$.assertNoValues();
}
 
开发者ID:xemantic,项目名称:github-users,代码行数:28,代码来源:DrawerPresenterTest.java


注:本文中的io.reactivex.observers.TestObserver.assertNoValues方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。