本文整理匯總了Java中rx.observers.TestSubscriber.assertNoTerminalEvent方法的典型用法代碼示例。如果您正苦於以下問題:Java TestSubscriber.assertNoTerminalEvent方法的具體用法?Java TestSubscriber.assertNoTerminalEvent怎麽用?Java TestSubscriber.assertNoTerminalEvent使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類rx.observers.TestSubscriber
的用法示例。
在下文中一共展示了TestSubscriber.assertNoTerminalEvent方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: states_should_stopObservingStateChanges
import rx.observers.TestSubscriber; //導入方法依賴的package包/類
@Test
public void states_should_stopObservingStateChanges() {
//GIVEN
Store<Integer> store = new Store<>(0);
TestSubscriber<Integer> testSubscriber = new TestSubscriber<>();
final Subscription subscription = states(store).subscribe(testSubscriber);
//WHEN
subscription.unsubscribe();
store.dispatch(integer -> integer + 1);
final Integer state = store.getState();
//THEN
testSubscriber.assertNoTerminalEvent();
testSubscriber.assertValue(0);
testSubscriber.assertUnsubscribed();
assertThat(state, is(1));
}
示例2: testAggregatedStream
import rx.observers.TestSubscriber; //導入方法依賴的package包/類
@Test
public void testAggregatedStream() {
TestSubscriber<HystrixCommandCompletion> subscriber = new TestSubscriber<>();
new AggregatedHystrixCommandCompletionStream(notifier, t -> true).observe().subscribe(subscriber);
Command.from(GROUP_KEY, COMMAND_1, SUCCESS, 10).execute();
Command.from(GROUP_KEY, COMMAND_1, SUCCESS, 10).execute();
Command.from(GROUP_KEY, COMMAND_1, FAILURE, 10).execute();
Command.from(GROUP_KEY, COMMAND_1, SUCCESS, 10).execute();
Command.from(GROUP_KEY, COMMAND_2, SUCCESS, 10).execute();
Command.from(GROUP_KEY, COMMAND_2, FAILURE, 10).execute();
Command.from(GROUP_KEY, COMMAND_2, SUCCESS, 10).execute();
subscriber.assertValueCount(7);
subscriber.assertNoErrors();
subscriber.assertNoTerminalEvent();
}
開發者ID:ringcentral,項目名稱:hystrix-addons,代碼行數:17,代碼來源:AggregatedHystrixCommandCompletionStreamTest.java
示例3: testAggregatedStreamWithFilter
import rx.observers.TestSubscriber; //導入方法依賴的package包/類
@Test
public void testAggregatedStreamWithFilter() {
TestSubscriber<HystrixCommandCompletion> subscriber = new TestSubscriber<>();
new AggregatedHystrixCommandCompletionStream(notifier, c -> c.getCommandKey() == COMMAND_1).observe().subscribe(subscriber);
Command.from(GROUP_KEY, COMMAND_1, SUCCESS, 10).execute();
Command.from(GROUP_KEY, COMMAND_2, FAILURE, 10).execute();
Command.from(GROUP_KEY, COMMAND_1, FAILURE, 10).execute();
Command.from(GROUP_KEY, COMMAND_1, SUCCESS, 10).execute();
subscriber.assertValueCount(3);
Command.from(GROUP_KEY, COMMAND_2, SUCCESS, 10).execute();
Command.from(GROUP_KEY, COMMAND_2, SUCCESS, 10).execute();
subscriber.assertValueCount(3);
subscriber.assertNoErrors();
subscriber.assertNoTerminalEvent();
}
開發者ID:ringcentral,項目名稱:hystrix-addons,代碼行數:19,代碼來源:AggregatedHystrixCommandCompletionStreamTest.java
示例4: states_should_observeInitialState
import rx.observers.TestSubscriber; //導入方法依賴的package包/類
@Test
public void states_should_observeInitialState() {
//GIVEN
Store<Integer> store = new Store<>(0);
TestSubscriber<Integer> testSubscriber = new TestSubscriber<>();
//WHEN
states(store).subscribe(testSubscriber);
//THEN
testSubscriber.assertNoTerminalEvent();
testSubscriber.assertValue(0);
}
示例5: states_should_observeStateChanges
import rx.observers.TestSubscriber; //導入方法依賴的package包/類
@Test
public void states_should_observeStateChanges() {
//GIVEN
Store<Integer> store = new Store<>(0);
TestSubscriber<Integer> testSubscriber = new TestSubscriber<>();
states(store).subscribe(testSubscriber);
//WHEN
store.dispatch(integer -> integer + 1);
//THEN
testSubscriber.assertNoTerminalEvent();
testSubscriber.assertValues(0, 1);
}