Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Learning Reactive Programming With Java 8

You're reading from   Learning Reactive Programming With Java 8 Learn how to use RxJava and its reactive Observables to build fast, concurrent, and powerful applications through detailed examples

Arrow left icon
Product type Paperback
Published in Jun 2015
Publisher Packt
ISBN-13 9781785288722
Length 182 pages
Edition 1st Edition
Languages
Arrow right icon
Author (1):
Arrow left icon
Nickolay Tzvetinov Nickolay Tzvetinov
Author Profile Icon Nickolay Tzvetinov
Nickolay Tzvetinov
Arrow right icon
View More author details
Toc

Table of Contents (10) Chapters Close

Preface 1. An Introduction to Reactive Programming 2. Using the Functional Constructions of Java 8 FREE CHAPTER 3. Creating and Connecting Observables, Observers, and Subjects 4. Transforming, Filtering, and Accumulating Your Data 5. Combinators, Conditionals, and Error Handling 6. Using Concurrency and Parallelism with Schedulers 7. Testing Your RxJava Application 8. Resource Management and Extending RxJava Index

Testing asynchronous Observable instances with the help of the TestScheduler class


There is one last type of predefined scheduler that we didn't mention in Chapter 6, Using Concurrency and Parallelism with Schedulers. This is the TestScheduler scheduler, a scheduler designed to be used in unit tests. All the actions scheduled on it are wrapped in objects containing the time they should be executed at, and won't be executed before the triggerActions() method of the Scheduler instance is called. This method executes all of the actions that are not executed and are scheduled to be executed at or before the Scheduler instance's present time. This time is virtual. This means that it is set by us and we can advance to any moment in the future using the special methods of this scheduler.

In order to demonstrate it, we'll want to develop another method for creating a new type of observable. The implementation of the method itself won't be discussed in this chapter, but you can find it in the source...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image