Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
SDK
/
exoplayer
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
4419a26b
authored
May 28, 2020
by
tonihei
Committed by
Oliver Woodman
May 29, 2020
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
Use assertThrows in CacheWriterTest.
PiperOrigin-RevId: 313556143
parent
a01fd007
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
15 deletions
library/core/src/test/java/com/google/android/exoplayer2/upstream/cache/CacheWriterTest.java
library/core/src/test/java/com/google/android/exoplayer2/upstream/cache/CacheWriterTest.java
View file @
4419a26b
...
@@ -17,7 +17,7 @@ package com.google.android.exoplayer2.upstream.cache;
...
@@ -17,7 +17,7 @@ package com.google.android.exoplayer2.upstream.cache;
import
static
com
.
google
.
android
.
exoplayer2
.
testutil
.
CacheAsserts
.
assertCachedData
;
import
static
com
.
google
.
android
.
exoplayer2
.
testutil
.
CacheAsserts
.
assertCachedData
;
import
static
com
.
google
.
common
.
truth
.
Truth
.
assertThat
;
import
static
com
.
google
.
common
.
truth
.
Truth
.
assertThat
;
import
static
org
.
junit
.
Assert
.
fail
;
import
static
org
.
junit
.
Assert
.
assertThrows
;
import
android.net.Uri
;
import
android.net.Uri
;
import
androidx.test.core.app.ApplicationProvider
;
import
androidx.test.core.app.ApplicationProvider
;
...
@@ -254,20 +254,19 @@ public final class CacheWriterTest {
...
@@ -254,20 +254,19 @@ public final class CacheWriterTest {
Uri
testUri
=
Uri
.
parse
(
"test_data"
);
Uri
testUri
=
Uri
.
parse
(
"test_data"
);
DataSpec
dataSpec
=
new
DataSpec
(
testUri
,
/* position= */
0
,
/* length= */
1000
);
DataSpec
dataSpec
=
new
DataSpec
(
testUri
,
/* position= */
0
,
/* length= */
1000
);
try
{
IOException
exception
=
CacheWriter
cacheWriter
=
assertThrows
(
new
CacheWriter
(
IOException
.
class
,
new
CacheDataSource
(
cache
,
dataSource
),
()
->
dataSpec
,
new
CacheWriter
(
/* allowShortContent= */
false
,
new
CacheDataSource
(
cache
,
dataSource
),
/* isCanceled= */
null
,
dataSpec
,
/* temporaryBuffer= */
null
,
/* allowShortContent= */
false
,
/* progressListener= */
null
);
/* isCanceled= */
null
,
cacheWriter
.
cache
();
/* temporaryBuffer= */
null
,
fail
();
/* progressListener= */
null
)
}
catch
(
IOException
e
)
{
.
cache
());
assertThat
(
DataSourceException
.
isCausedByPositionOutOfRange
(
e
)).
isTrue
();
assertThat
(
DataSourceException
.
isCausedByPositionOutOfRange
(
exception
)).
isTrue
();
}
}
}
@Test
@Test
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment