Back to Exoplayer

CacheAsserts (ExoPlayer library)

docs/doc/reference/com/google/android/exoplayer2/testutil/CacheAsserts.html

latest4.6 KB
Original Source

Package com.google.android.exoplayer2.testutil

Class CacheAsserts


public final classCacheAssertsextends[Object](https://developer.android.com/reference/java/lang/Object.html "class or interface in java.lang")

Assertion methods for Cache.

Nested Class Summary

Nested Classes | Modifier and Type | Class | Description | | --- | --- | --- | | static class | CacheAsserts.RequestSet | Defines a set of data requests. |

Method Summary

All Methods Static Methods Concrete Methods | Modifier and Type | Method | Description | | --- | --- | --- | | static void | assertCachedData​(Cache cache, CacheAsserts.RequestSet requestSet) | Asserts that the cache contains necessary data for the requestSet. | | static void | assertCachedData​(Cache cache, FakeDataSet fakeDataSet) | Asserts that the cache content is equal to the data in the fakeDataSet. | | static void | assertCacheEmpty​(Cache cache) | Asserts that the cache is empty. | | static void | assertDataCached​(Cache cache, DataSpec dataSpec, byte[] expected) | Asserts that the cache contains the given data for dataSpec. | | static void | assertReadData​(DataSource dataSource, DataSpec dataSpec, byte[] expected) | Asserts that the read data from dataSource specified by dataSpec is equal to expected or not. |

- 

Methods inherited from class java.lang.Object

clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Method Detail

- 

assertCachedData

public static void assertCachedData​([Cache](../upstream/cache/Cache.html "interface in com.google.android.exoplayer2.upstream.cache")cache,[CacheAsserts.RequestSet](CacheAsserts.RequestSet.html "class in com.google.android.exoplayer2.testutil")requestSet)
                             throws[IOException](https://developer.android.com/reference/java/io/IOException.html "class or interface in java.io")

Asserts that the cache contains necessary data for the requestSet. Throws:IOException - If an error occurred reading from the Cache.

- 

assertCachedData

public static void assertCachedData​([Cache](../upstream/cache/Cache.html "interface in com.google.android.exoplayer2.upstream.cache")cache,[FakeDataSet](FakeDataSet.html "class in com.google.android.exoplayer2.testutil")fakeDataSet)
                             throws[IOException](https://developer.android.com/reference/java/io/IOException.html "class or interface in java.io")

Asserts that the cache content is equal to the data in the fakeDataSet. Throws:IOException - If an error occurred reading from the Cache.

- 

assertDataCached

public static void assertDataCached​([Cache](../upstream/cache/Cache.html "interface in com.google.android.exoplayer2.upstream.cache")cache,[DataSpec](../upstream/DataSpec.html "class in com.google.android.exoplayer2.upstream")dataSpec,
                                    byte[] expected)
                             throws[IOException](https://developer.android.com/reference/java/io/IOException.html "class or interface in java.io")

Asserts that the cache contains the given data for dataSpec. Throws:IOException - If an error occurred reading from the Cache.

- 

assertReadData

public static void assertReadData​([DataSource](../upstream/DataSource.html "interface in com.google.android.exoplayer2.upstream")dataSource,[DataSpec](../upstream/DataSpec.html "class in com.google.android.exoplayer2.upstream")dataSpec,
                                  byte[] expected)
                           throws[IOException](https://developer.android.com/reference/java/io/IOException.html "class or interface in java.io")

Asserts that the read data from dataSource specified by dataSpec is equal to expected or not. Throws:IOException - If an error occurred reading from the Cache.

- 

assertCacheEmpty

public static void assertCacheEmpty​([Cache](../upstream/cache/Cache.html "interface in com.google.android.exoplayer2.upstream.cache")cache)

Asserts that the cache is empty.