Examples of advanceTimeBy()


Examples of rx.schedulers.TestScheduler.advanceTimeBy()

    @Test(expected = IllegalStateException.class)
    public void testNoSubscriptions() throws Exception {
        TestScheduler testScheduler = Schedulers.test();
        UnicastContentSubject<String> subject = UnicastContentSubject.create(1, TimeUnit.DAYS, testScheduler);
        subject.onNext("Start the timeout now."); // Since the timeout is scheduled only after content arrival.
        testScheduler.advanceTimeBy(1, TimeUnit.DAYS);
        subject.toBlocking().last(); // Should immediately throw an error.
    }

    @Test(expected = IllegalStateException.class)
    public void testNoSubscriptionsWithOnUnsubscribeAction() throws Exception {
View Full Code Here

Examples of rx.schedulers.TestScheduler.advanceTimeBy()

        TestScheduler testScheduler = Schedulers.test();
        OnUnsubscribeAction onUnsub = new OnUnsubscribeAction();
        UnicastContentSubject<String> subject = UnicastContentSubject.create(1, TimeUnit.DAYS, testScheduler,
                                                                             onUnsub);
        subject.onNext("Start the timeout now."); // Since the timeout is scheduled only after content arrival.
        testScheduler.advanceTimeBy(1, TimeUnit.DAYS);
        Assert.assertTrue("On unsubscribe action not called on dispose.", onUnsub.isCalled());
        subject.toBlocking().last(); // Should immediately throw an error.
    }

    @Test(expected = IllegalStateException.class)
View Full Code Here

Examples of rx.schedulers.TestScheduler.advanceTimeBy()

            public void call() {
                latch.countDown();
            }
        });

        testScheduler.advanceTimeBy(1, TimeUnit.DAYS);
        subject.onCompleted();

        latch.await(1, TimeUnit.MINUTES);

        Assert.assertNull("Subscription got an error.", errorOnSubscribe.get());
View Full Code Here

Examples of rx.schedulers.TestScheduler.advanceTimeBy()

                    // and we skip the first 8 to get past those
                    throw new IllegalStateException("Expect the count to always be 4");
                }
            }).subscribe(ts);

        scheduler.advanceTimeBy(200, TimeUnit.MILLISECONDS);

        ts.awaitTerminalEvent();

        System.out.println("---------> OnErrorEvents: " + ts.getOnErrorEvents());
        if (ts.getOnErrorEvents().size() > 0) {
View Full Code Here

Examples of rx.schedulers.TestScheduler.advanceTimeBy()

        }).subscribe(ts);

        stream.onNext(getCinematchCommandInstanceStream(12345, scheduler), 5);
        stream.onCompleted(100);

        scheduler.advanceTimeBy(100, TimeUnit.MILLISECONDS);

        ts.awaitTerminalEvent();

        System.out.println("---------> OnErrorEvents: " + ts.getOnErrorEvents());
        if (ts.getOnErrorEvents().size() > 0) {
View Full Code Here

Examples of rx.schedulers.TestScheduler.advanceTimeBy()

        stream.onNext(getCinematchCommandInstanceStream(12345, scheduler), 0);
        stream.onNext(getCinematchCommandInstanceStream(23456, scheduler), 5);
        stream.onCompleted(100);

        scheduler.advanceTimeBy(100, TimeUnit.MILLISECONDS);

        ts.awaitTerminalEvent();

        System.out.println("---------> OnErrorEvents: " + ts.getOnErrorEvents());
        if (ts.getOnErrorEvents().size() > 0) {
View Full Code Here

Examples of rx.schedulers.TestScheduler.advanceTimeBy()

        }).subscribe(ts);

        stream.onNext(getCinematchCommandInstanceStream(12345, scheduler), 5);
        stream.onCompleted(100);

        scheduler.advanceTimeBy(100, TimeUnit.MILLISECONDS);

        ts.awaitTerminalEvent();

        System.out.println("---------> OnErrorEvents: " + ts.getOnErrorEvents());
        if (ts.getOnErrorEvents().size() > 0) {
View Full Code Here

Examples of rx.schedulers.TestScheduler.advanceTimeBy()

        }).subscribe(ts);

        stream.onNext(getSubscriberAndCinematchCommandInstanceStream(12345, scheduler), 0);
        stream.onCompleted(100);

        scheduler.advanceTimeBy(100, TimeUnit.MILLISECONDS);

        ts.awaitTerminalEvent();

        System.out.println("---------> OnErrorEvents: " + ts.getOnErrorEvents());
        if (ts.getOnErrorEvents().size() > 0) {
View Full Code Here

Examples of rx.schedulers.TestScheduler.advanceTimeBy()

        stream.onNext(getCinematchCommandInstanceStream(12345, scheduler), 0);
        stream.onNext(getCinematchCommandInstanceStream(23456, scheduler), 0);
        stream.onCompleted(100);

        scheduler.advanceTimeBy(100, TimeUnit.MILLISECONDS);

        ts.awaitTerminalEvent();

        System.out.println("---------> OnErrorEvents: " + ts.getOnErrorEvents());
        if (ts.getOnErrorEvents().size() > 0) {
View Full Code Here

Examples of rx.schedulers.TestScheduler.advanceTimeBy()

        stream.onNext(getSubscriberAndCinematchCommandInstanceStream(12345, scheduler), 0);
        stream.onNext(getSubscriberAndCinematchCommandInstanceStream(23456, scheduler), 5);
        stream.onCompleted(100);

        scheduler.advanceTimeBy(100, TimeUnit.MILLISECONDS);

        ts.awaitTerminalEvent();

        System.out.println("---------> OnErrorEvents: " + ts.getOnErrorEvents());
        if (ts.getOnErrorEvents().size() > 0) {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.