diff --git a/.travis.yml b/.travis.yml
index 1d48943..a3e83f4 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -4,17 +4,17 @@ sudo: false
env:
matrix:
- - ANDROID_TARGET=android-26
+ - ANDROID_TARGET=android-28
global:
- GRADLE_OPTS="-Xms128m"
android:
components:
# needed build tools
- - build-tools-27.0.3
+ - build-tools-28.0.3
# The SDK version used to compile your project
- - android-26
+ - android-28
# extra needed components
- extra-android-m2repository
diff --git a/app/build.gradle b/app/build.gradle
index bec4602..55d78a3 100644
--- a/app/build.gradle
+++ b/app/build.gradle
@@ -11,13 +11,13 @@ def getVersionName = { ->
android {
- compileSdkVersion 26
- buildToolsVersion "27.0.3"
+ compileSdkVersion 28
+ buildToolsVersion "28.0.3"
defaultConfig {
applicationId "org.xbmc.kore"
minSdkVersion 15
- targetSdkVersion 26
+ targetSdkVersion 28
versionCode 25
versionName = getVersionName()
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
@@ -39,19 +39,11 @@ android {
}
}
-// sourceSets {
-// test {
-// java.srcDirs += 'src/testUtils/java'
-// assets.srcDirs += 'src/testUtils/assets'
-// }
-// androidTest {
-// java.srcDirs += 'src/testUtils/java'
-// assets.srcDirs += 'src/testUtils/assets'
-// }
-// }
-
testOptions {
execution 'ANDROID_TEST_ORCHESTRATOR'
+ unitTests {
+ includeAndroidResources = true
+ }
}
buildTypes {
@@ -92,7 +84,7 @@ android {
}
ext {
- supportLibVersion = '26.1.0'
+ supportLibVersion = '28.0.0'
}
dependencies {
@@ -116,16 +108,18 @@ dependencies {
implementation 'com.sothree.slidinguppanel:library:3.3.1'
implementation 'com.simplecityapps:recyclerview-fastscroll:1.0.20'
- androidTestImplementation 'com.android.support.test:runner:1.0.1'
- androidTestImplementation 'com.android.support.test:rules:1.0.1'
- androidTestUtil 'com.android.support.test:orchestrator:1.0.1'
+ androidTestImplementation 'com.android.support.test:runner:1.0.2'
+ androidTestImplementation 'com.android.support.test:rules:1.0.2'
+ androidTestUtil 'com.android.support.test:orchestrator:1.0.2'
androidTestImplementation 'org.hamcrest:hamcrest-library:1.3'
- androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
- androidTestImplementation 'com.android.support.test.espresso:espresso-contrib:3.0.1'
+ androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
+ androidTestImplementation 'com.android.support.test.espresso:espresso-contrib:3.0.2'
androidTestImplementation "com.android.support:support-v13:${supportLibVersion}"
androidTestImplementation 'junit:junit:4.12'
- testImplementation 'org.robolectric:robolectric:3.1.1'
+ testImplementation 'org.robolectric:robolectric:4.3'
+ testImplementation "androidx.test:core:1.2.0"
+ testImplementation "androidx.test.ext:junit:1.1.1"
debugImplementation 'junit:junit:4.12'
implementation fileTree(dir: 'libs', include: ['*.jar'])
}
diff --git a/app/src/androidTest/java/org/xbmc/kore/tests/ui/movies/RestoreSearchQueryListFragmentTest.java b/app/src/androidTest/java/org/xbmc/kore/tests/ui/movies/RestoreSearchQueryListFragmentTest.java
index 3196e9d..5d79213 100644
--- a/app/src/androidTest/java/org/xbmc/kore/tests/ui/movies/RestoreSearchQueryListFragmentTest.java
+++ b/app/src/androidTest/java/org/xbmc/kore/tests/ui/movies/RestoreSearchQueryListFragmentTest.java
@@ -18,9 +18,9 @@ package org.xbmc.kore.tests.ui.movies;
import android.content.Context;
import android.support.test.espresso.Espresso;
+import android.support.test.filters.LargeTest;
import android.support.test.rule.ActivityTestRule;
import android.support.test.runner.AndroidJUnit4;
-import android.test.suitebuilder.annotation.LargeTest;
import org.junit.Rule;
import org.junit.Test;
diff --git a/app/src/androidTest/java/org/xbmc/kore/tests/ui/music/RestoreSearchQueryViewPagerTest.java b/app/src/androidTest/java/org/xbmc/kore/tests/ui/music/RestoreSearchQueryViewPagerTest.java
index bc9ecf7..148231f 100644
--- a/app/src/androidTest/java/org/xbmc/kore/tests/ui/music/RestoreSearchQueryViewPagerTest.java
+++ b/app/src/androidTest/java/org/xbmc/kore/tests/ui/music/RestoreSearchQueryViewPagerTest.java
@@ -19,9 +19,9 @@ package org.xbmc.kore.tests.ui.music;
import android.app.Activity;
import android.content.Context;
import android.support.test.espresso.Espresso;
+import android.support.test.filters.LargeTest;
import android.support.test.rule.ActivityTestRule;
import android.support.test.runner.AndroidJUnit4;
-import android.test.suitebuilder.annotation.LargeTest;
import org.junit.Rule;
import org.junit.Test;
diff --git a/app/src/main/res/layout/grid_item_playlist.xml b/app/src/main/res/layout/grid_item_playlist.xml
index 9dfb9e3..126066c 100644
--- a/app/src/main/res/layout/grid_item_playlist.xml
+++ b/app/src/main/res/layout/grid_item_playlist.xml
@@ -73,8 +73,8 @@
android:layout_below="@id/title"
android:layout_toRightOf="@id/art"
android:layout_toEndOf="@id/art"
- android:layout_toLeftOf="@id/meta_info"
- android:layout_toStartOf="@id/size_duration"
+ android:layout_toLeftOf="@id/list_context_menu"
+ android:layout_toStartOf="@id/list_context_menu"
style="@style/TextAppearance.Playlist.Details"/>
\ No newline at end of file
diff --git a/app/src/main/res/values/dimens.xml b/app/src/main/res/values/dimens.xml
index ba33584..46f539c 100644
--- a/app/src/main/res/values/dimens.xml
+++ b/app/src/main/res/values/dimens.xml
@@ -53,6 +53,9 @@
48dp
12dp
+ 67dp
+ 202dp
+
24dp
8dp
diff --git a/app/src/test/java/org/xbmc/kore/provider/mediaprovider/AbstractTestClass.java b/app/src/test/java/org/xbmc/kore/provider/mediaprovider/AbstractTestClass.java
index acd5206..602fdce 100644
--- a/app/src/test/java/org/xbmc/kore/provider/mediaprovider/AbstractTestClass.java
+++ b/app/src/test/java/org/xbmc/kore/provider/mediaprovider/AbstractTestClass.java
@@ -17,39 +17,42 @@
package org.xbmc.kore.provider.mediaprovider;
+import android.content.ContentProviderClient;
import android.content.ContentResolver;
+import android.content.pm.ProviderInfo;
+
+import androidx.test.core.app.ApplicationProvider;
+import androidx.test.ext.junit.runners.AndroidJUnit4;
import org.junit.Before;
import org.junit.Ignore;
import org.junit.runner.RunWith;
-import org.robolectric.RobolectricTestRunner;
-import org.robolectric.RuntimeEnvironment;
-import org.robolectric.Shadows;
-import org.robolectric.annotation.Config;
-import org.robolectric.shadows.ShadowContentResolver;
-import org.xbmc.kore.BuildConfig;
+import org.robolectric.Robolectric;
import org.xbmc.kore.host.HostInfo;
import org.xbmc.kore.provider.MediaProvider;
import org.xbmc.kore.testutils.Database;
-@RunWith(RobolectricTestRunner.class)
-@Config(constants = BuildConfig.class, sdk = 23)
+@RunWith(AndroidJUnit4.class)
@Ignore
public class AbstractTestClass {
protected static HostInfo hostInfo;
- protected static ShadowContentResolver shadowContentResolver;
+ private static ContentResolver contentResolver = ApplicationProvider.getApplicationContext().getContentResolver();
+ private static final String AUTHORITY = "org.xbmc.kore.provider";
+ ContentProviderClient client;
@Before
public void setUp() throws Exception {
MediaProvider provider = new MediaProvider();
- ContentResolver contentResolver = RuntimeEnvironment.application.getContentResolver();
- provider.onCreate();
- shadowContentResolver = Shadows.shadowOf(contentResolver);
- ShadowContentResolver.registerProvider("org.xbmc.kore.provider", provider);
provider.onCreate();
- hostInfo = Database.addHost(RuntimeEnvironment.application);
+ ProviderInfo info = new ProviderInfo();
+ info.authority = AUTHORITY;
+ Robolectric.buildContentProvider(MediaProvider.class).create(info);
- Database.fill(hostInfo, RuntimeEnvironment.application, contentResolver);
+ client = contentResolver.acquireContentProviderClient(AUTHORITY);
+
+ hostInfo = Database.addHost(ApplicationProvider.getApplicationContext());
+
+ Database.fill(hostInfo, ApplicationProvider.getApplicationContext(), contentResolver);
}
}
diff --git a/app/src/test/java/org/xbmc/kore/provider/mediaprovider/AlbumsTest.java b/app/src/test/java/org/xbmc/kore/provider/mediaprovider/AlbumsTest.java
index 1dd8b8f..cb32efa 100644
--- a/app/src/test/java/org/xbmc/kore/provider/mediaprovider/AlbumsTest.java
+++ b/app/src/test/java/org/xbmc/kore/provider/mediaprovider/AlbumsTest.java
@@ -31,10 +31,10 @@ import static org.junit.Assert.assertTrue;
public class AlbumsTest extends AbstractTestClass {
@Test
- public void queryAllAlbumsTest() {
+ public void queryAllAlbumsTest() throws Exception {
Uri uri = MediaContract.Albums.buildAlbumsListUri(hostInfo.getId());
- Cursor cursor = shadowContentResolver.query(uri, TestValues.Album.PROJECTION, null, null, null);
+ Cursor cursor = client.query(uri, TestValues.Album.PROJECTION, null, null, null);
assertNotNull(cursor);
assertEquals("cursor size ", 235, cursor.getCount());
@@ -45,10 +45,10 @@ public class AlbumsTest extends AbstractTestClass {
}
@Test
- public void queryAlbumTest() {
+ public void queryAlbumTest() throws Exception {
Uri uri = MediaContract.Albums.buildAlbumUri(hostInfo.getId(), TestValues.Album.albumId);
- Cursor cursor = shadowContentResolver.query(uri, TestValues.Album.PROJECTION, null, null, null);
+ Cursor cursor = client.query(uri, TestValues.Album.PROJECTION, null, null, null);
assertNotNull(cursor);
assertEquals("cursor size ", 1, cursor.getCount());
@@ -57,11 +57,11 @@ public class AlbumsTest extends AbstractTestClass {
}
@Test
- public void queryAlbumsForArtistTest() {
+ public void queryAlbumsForArtistTest() throws Exception {
Uri uri = MediaContract.AlbumArtists.buildAlbumsForArtistListUri(hostInfo.getId(),
TestValues.Artist.artistId);
- Cursor cursor = shadowContentResolver.query(uri, TestValues.Album.PROJECTION, null, null, null);
+ Cursor cursor = client.query(uri, TestValues.Album.PROJECTION, null, null, null);
assertNotNull(cursor);
assertEquals("cursor size ", 1, cursor.getCount());
@@ -70,11 +70,11 @@ public class AlbumsTest extends AbstractTestClass {
}
@Test
- public void queryAlbumsForArtistWithVariousArtistsTest() {
+ public void queryAlbumsForArtistWithVariousArtistsTest() throws Exception {
Uri uri = MediaContract.AlbumArtists.buildAlbumsForArtistListUri(hostInfo.getId(),
TestValues.AlbumWithVariousArtists.artistId);
- Cursor cursor = shadowContentResolver.query(uri, TestValues.AlbumWithVariousArtists.PROJECTION, null, null, null);
+ Cursor cursor = client.query(uri, TestValues.AlbumWithVariousArtists.PROJECTION, null, null, null);
assertNotNull(cursor);
assertEquals("cursor size ", 2, cursor.getCount());
@@ -92,11 +92,11 @@ public class AlbumsTest extends AbstractTestClass {
}
@Test
- public void queryAlbumWithoutArtist() {
+ public void queryAlbumWithoutArtist() throws Exception {
Uri uri = MediaContract.Albums.buildAlbumUri(hostInfo.getId(),
TestValues.AlbumWithoutArtist.albumId);
- Cursor cursor = shadowContentResolver.query(uri, TestValues.AlbumWithoutArtist.PROJECTION, null, null, null);
+ Cursor cursor = client.query(uri, TestValues.AlbumWithoutArtist.PROJECTION, null, null, null);
assertNotNull(cursor);
assertEquals("cursor size ", 1, cursor.getCount());
@@ -105,11 +105,11 @@ public class AlbumsTest extends AbstractTestClass {
}
@Test
- public void queryAlbumWithMultipleArtists() {
+ public void queryAlbumWithMultipleArtists() throws Exception {
Uri uri = MediaContract.Albums.buildAlbumUri(hostInfo.getId(),
TestValues.AlbumWithMultipleArtists.albumId);
- Cursor cursor = shadowContentResolver.query(uri, TestValues.AlbumWithMultipleArtists.PROJECTION,
+ Cursor cursor = client.query(uri, TestValues.AlbumWithMultipleArtists.PROJECTION,
null, null, null);
assertNotNull(cursor);
diff --git a/app/src/test/java/org/xbmc/kore/provider/mediaprovider/ArtistsTest.java b/app/src/test/java/org/xbmc/kore/provider/mediaprovider/ArtistsTest.java
index 6e08fbf..e4c1a3c 100644
--- a/app/src/test/java/org/xbmc/kore/provider/mediaprovider/ArtistsTest.java
+++ b/app/src/test/java/org/xbmc/kore/provider/mediaprovider/ArtistsTest.java
@@ -31,10 +31,10 @@ import static org.junit.Assert.assertTrue;
public class ArtistsTest extends AbstractTestClass {
@Test
- public void queryAllArtistsTest() {
+ public void queryAllArtistsTest() throws Exception {
Uri uri = MediaContract.Artists.buildArtistsListUri(hostInfo.getId());
- Cursor cursor = shadowContentResolver.query(uri, TestValues.Artist.PROJECTION, null, null, null);
+ Cursor cursor = client.query(uri, TestValues.Artist.PROJECTION, null, null, null);
assertNotNull(cursor);
assertEquals("cursor size ", 229, cursor.getCount());
@@ -46,10 +46,10 @@ public class ArtistsTest extends AbstractTestClass {
}
@Test
- public void queryArtistTest() {
+ public void queryArtistTest() throws Exception {
Uri uri = MediaContract.Artists.buildArtistUri(hostInfo.getId(), TestValues.Artist.artistId);
- Cursor cursor = shadowContentResolver.query(uri, TestValues.Artist.PROJECTION, null, null, null);
+ Cursor cursor = client.query(uri, TestValues.Artist.PROJECTION, null, null, null);
assertNotNull(cursor);
assertEquals("cursor size ", 1, cursor.getCount());
diff --git a/app/src/test/java/org/xbmc/kore/provider/mediaprovider/GenresTest.java b/app/src/test/java/org/xbmc/kore/provider/mediaprovider/GenresTest.java
index 4b39fae..a5a33c6 100644
--- a/app/src/test/java/org/xbmc/kore/provider/mediaprovider/GenresTest.java
+++ b/app/src/test/java/org/xbmc/kore/provider/mediaprovider/GenresTest.java
@@ -28,12 +28,12 @@ import static org.junit.Assert.assertNotNull;
public class GenresTest extends AbstractTestClass {
@Test
- public void queryAllGenresTest() {
+ public void queryAllGenresTest() throws Exception {
Uri uri = MediaContract.AudioGenres.buildAudioGenresListUri(hostInfo.getId());
- Cursor cursor = shadowContentResolver.query(uri,
- new String[] {MediaContract.AudioGenresColumns.GENREID},
- null, null, null);
+ Cursor cursor = client.query(uri,
+ new String[] {MediaContract.AudioGenresColumns.GENREID},
+ null, null, null);
assertNotNull(cursor);
assertEquals("cursor size ", 39, cursor.getCount());
@@ -43,11 +43,11 @@ public class GenresTest extends AbstractTestClass {
}
@Test
- public void queryAlbumsForGenreTest() {
+ public void queryAlbumsForGenreTest() throws Exception {
int genreId = 13;
Uri uri = MediaContract.AlbumGenres.buildAlbumsForGenreListUri(hostInfo.getId(), genreId);
- Cursor cursor = shadowContentResolver.query(uri, TestValues.Album.PROJECTION, null, null, null);
+ Cursor cursor = client.query(uri, TestValues.Album.PROJECTION, null, null, null);
assertNotNull(cursor);
assertEquals("cursor size ", 31, cursor.getCount());
diff --git a/app/src/test/java/org/xbmc/kore/provider/mediaprovider/SongsTest.java b/app/src/test/java/org/xbmc/kore/provider/mediaprovider/SongsTest.java
index ed04213..85cc871 100644
--- a/app/src/test/java/org/xbmc/kore/provider/mediaprovider/SongsTest.java
+++ b/app/src/test/java/org/xbmc/kore/provider/mediaprovider/SongsTest.java
@@ -31,10 +31,10 @@ import static org.junit.Assert.assertTrue;
public class SongsTest extends AbstractTestClass {
@Test
- public void queryAlbumSongsTest() {
+ public void queryAlbumSongsTest() throws Exception {
Uri uri = MediaContract.Songs.buildAlbumSongsListUri(hostInfo.getId(), TestValues.Album.albumId);
- Cursor cursor = shadowContentResolver.query(uri, new String[] {MediaProvider.Qualified.SONGS_SONGID}, null, null, null);
+ Cursor cursor = client.query(uri, new String[] {MediaProvider.Qualified.SONGS_SONGID}, null, null, null);
assertNotNull(cursor);
assertEquals("cursor size ", 17, cursor.getCount());
@@ -43,10 +43,10 @@ public class SongsTest extends AbstractTestClass {
}
@Test
- public void queryArtistSongsTest() {
+ public void queryArtistSongsTest() throws Exception {
Uri uri = MediaContract.Songs.buildArtistSongsListUri(hostInfo.getId(), TestValues.ArtistSong.artistId);
- Cursor cursor = shadowContentResolver.query(uri, TestValues.ArtistSong.PROJECTION, null, null, null);
+ Cursor cursor = client.query(uri, TestValues.ArtistSong.PROJECTION, null, null, null);
assertNotNull(cursor);
assertEquals("cursor size ", 17, cursor.getCount());
@@ -65,12 +65,12 @@ public class SongsTest extends AbstractTestClass {
}
@Test
- public void queryArtistsSongWithArtistWithoutAlbumTest() {
+ public void queryArtistsSongWithArtistWithoutAlbumTest() throws Exception {
Uri uri = MediaContract.Songs.buildArtistSongsListUri(hostInfo.getId(),
TestValues.SongWithArtistWithoutAlbum.artistId);
- Cursor cursor = shadowContentResolver.query(uri, TestValues.SongWithArtistWithoutAlbum.PROJECTION,
- null, null, null);
+ Cursor cursor = client.query(uri, TestValues.SongWithArtistWithoutAlbum.PROJECTION,
+ null, null, null);
assertNotNull(cursor);
assertEquals("cursor size ", 1, cursor.getCount());
@@ -79,30 +79,30 @@ public class SongsTest extends AbstractTestClass {
}
@Test
- public void queryFirstArtistSongWithMultipleArtistsTest() {
+ public void queryFirstArtistSongWithMultipleArtistsTest()throws Exception {
testMultipleArtistInArtistSongsList(TestValues.SongWithMultipleArtists.firstArtistId,
TestValues.SongWithMultipleArtists.songId);
}
@Test
- public void querySecondArtistSongWithMultipleArtistsTest() {
+ public void querySecondArtistSongWithMultipleArtistsTest() throws Exception {
testMultipleArtistInArtistSongsList(TestValues.SongWithMultipleArtists.secondArtistId,
TestValues.SongWithMultipleArtists.songId);
}
@Test
- public void queryThirdArtistSongWithMultipleArtistsTest() {
+ public void queryThirdArtistSongWithMultipleArtistsTest() throws Exception {
testMultipleArtistInArtistSongsList(TestValues.SongWithMultipleArtists.thirdArtistId,
TestValues.SongWithMultipleArtists.songId);
}
@Test
- public void queryAllSongsTest() {
+ public void queryAllSongsTest() throws Exception {
Uri uri = MediaContract.Songs.buildSongsListUri(hostInfo.getId());
- Cursor cursor = shadowContentResolver.query(uri,
- TestValues.ArtistSong.PROJECTION,
- null, null, null);
+ Cursor cursor = client.query(uri,
+ TestValues.ArtistSong.PROJECTION,
+ null, null, null);
assertNotNull(cursor);
assertEquals("cursor size ", 1817, cursor.getCount());
@@ -111,12 +111,12 @@ public class SongsTest extends AbstractTestClass {
}
@Test
- public void queryAllSongsSongWithAlbumAndArtistTest() {
+ public void queryAllSongsSongWithAlbumAndArtistTest() throws Exception {
Uri uri = MediaContract.Songs.buildSongsListUri(hostInfo.getId());
- Cursor cursor = shadowContentResolver.query(uri,
- TestValues.ArtistSong.PROJECTION,
- null, null, null);
+ Cursor cursor = client.query(uri,
+ TestValues.ArtistSong.PROJECTION,
+ null, null, null);
assertTrue(CursorUtils.moveCursorToFirstOccurrence(cursor, cursor.getColumnIndex(MediaContract.Songs.SONGID),
TestValues.SongWithAlbumAndArtist.songId));
@@ -124,12 +124,12 @@ public class SongsTest extends AbstractTestClass {
}
@Test
- public void queryAllSongsSongWithArtistWithoutAlbumTest() {
+ public void queryAllSongsSongWithArtistWithoutAlbumTest() throws Exception {
Uri uri = MediaContract.Songs.buildSongsListUri(hostInfo.getId());
- Cursor cursor = shadowContentResolver.query(uri,
- TestValues.ArtistSong.PROJECTION,
- null, null, null);
+ Cursor cursor = client.query(uri,
+ TestValues.ArtistSong.PROJECTION,
+ null, null, null);
assertTrue(CursorUtils.moveCursorToFirstOccurrence(cursor, cursor.getColumnIndex(MediaContract.Songs.SONGID),
TestValues.SongWithArtistWithoutAlbum.songId));
@@ -137,12 +137,12 @@ public class SongsTest extends AbstractTestClass {
}
@Test
- public void queryAllSongsSongWithAlbumWithoutArtistTest() {
+ public void queryAllSongsSongWithAlbumWithoutArtistTest() throws Exception {
Uri uri = MediaContract.Songs.buildSongsListUri(hostInfo.getId());
- Cursor cursor = shadowContentResolver.query(uri,
- TestValues.ArtistSong.PROJECTION,
- null, null, null);
+ Cursor cursor = client.query(uri,
+ TestValues.ArtistSong.PROJECTION,
+ null, null, null);
assertTrue(CursorUtils.moveCursorToFirstOccurrence(cursor, cursor.getColumnIndex(MediaContract.Songs.SONGID),
TestValues.SongWithAlbumWithoutArtist.songId));
@@ -150,12 +150,12 @@ public class SongsTest extends AbstractTestClass {
}
@Test
- public void queryAllSongsSongWithMultipleArtistsTest() {
+ public void queryAllSongsSongWithMultipleArtistsTest() throws Exception {
Uri uri = MediaContract.Songs.buildSongsListUri(hostInfo.getId());
- Cursor cursor = shadowContentResolver.query(uri,
- TestValues.ArtistSong.PROJECTION,
- null, null, null);
+ Cursor cursor = client.query(uri,
+ TestValues.ArtistSong.PROJECTION,
+ null, null, null);
assertTrue(CursorUtils.moveCursorToFirstOccurrence(cursor, cursor.getColumnIndex(MediaContract.Songs.SONGID),
TestValues.SongWithMultipleArtists.songId));
@@ -164,12 +164,12 @@ public class SongsTest extends AbstractTestClass {
@Test
- public void queryMultidiscAlbumSongsTest() {
+ public void queryMultidiscAlbumSongsTest() throws Exception {
Uri uri = MediaContract.Songs.buildAlbumSongsListUri(hostInfo.getId(),
TestValues.MultidiscAlbumSongs.albumId);
- Cursor cursor = shadowContentResolver.query(uri, TestValues.MultidiscAlbumSongs.PROJECTION,
- null, null, null);
+ Cursor cursor = client.query(uri, TestValues.MultidiscAlbumSongs.PROJECTION,
+ null, null, null);
assertNotNull(cursor);
assertEquals("cursor size ", 7, cursor.getCount());
@@ -177,12 +177,12 @@ public class SongsTest extends AbstractTestClass {
1811, 1817);
}
- private void testMultipleArtistInArtistSongsList(int artistId, int songId) {
+ private void testMultipleArtistInArtistSongsList(int artistId, int songId) throws Exception {
Uri uri = MediaContract.Songs.buildArtistSongsListUri(hostInfo.getId(),
artistId);
- Cursor cursor = shadowContentResolver.query(uri, TestValues.SongWithMultipleArtists.PROJECTION,
- null, null, null);
+ Cursor cursor = client.query(uri, TestValues.SongWithMultipleArtists.PROJECTION,
+ null, null, null);
assertNotNull(cursor);
assertEquals("cursor size ", 2, cursor.getCount());
diff --git a/app/src/test/java/org/xbmc/kore/tests/jsonrpc/method/ApplicationTest.java b/app/src/test/java/org/xbmc/kore/tests/jsonrpc/method/ApplicationTest.java
index b901085..014bc4d 100644
--- a/app/src/test/java/org/xbmc/kore/tests/jsonrpc/method/ApplicationTest.java
+++ b/app/src/test/java/org/xbmc/kore/tests/jsonrpc/method/ApplicationTest.java
@@ -18,13 +18,14 @@ package org.xbmc.kore.tests.jsonrpc.method;
import android.os.Handler;
+import androidx.test.ext.junit.runners.AndroidJUnit4;
+
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.robolectric.RobolectricTestRunner;
import org.robolectric.annotation.Config;
-import org.xbmc.kore.BuildConfig;
import org.xbmc.kore.host.HostInfo;
import org.xbmc.kore.jsonrpc.ApiCallback;
import org.xbmc.kore.jsonrpc.HostConnection;
@@ -35,13 +36,11 @@ import org.xbmc.kore.testutils.tcpserver.handlers.ApplicationHandler;
import org.xbmc.kore.testutils.tcpserver.handlers.JSONConnectionHandlerManager;
import org.xbmc.kore.utils.RoboThreadRunner;
-import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
-@RunWith(RobolectricTestRunner.class)
-@Config(constants = BuildConfig.class, sdk = 23)
+@RunWith(AndroidJUnit4.class)
public class ApplicationTest {
private HostConnection hostConnection;
diff --git a/app/src/test/java/org/xbmc/kore/tests/jsonrpc/notifications/ApplicationTest.java b/app/src/test/java/org/xbmc/kore/tests/jsonrpc/notifications/ApplicationTest.java
index de40cf9..f8e5847 100644
--- a/app/src/test/java/org/xbmc/kore/tests/jsonrpc/notifications/ApplicationTest.java
+++ b/app/src/test/java/org/xbmc/kore/tests/jsonrpc/notifications/ApplicationTest.java
@@ -18,6 +18,8 @@ package org.xbmc.kore.tests.jsonrpc.notifications;
import android.os.Handler;
+import androidx.test.ext.junit.runners.AndroidJUnit4;
+
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
@@ -25,7 +27,6 @@ import org.junit.runner.RunWith;
import org.robolectric.RobolectricTestRunner;
import org.robolectric.annotation.Config;
import org.robolectric.shadows.ShadowLog;
-import org.xbmc.kore.BuildConfig;
import org.xbmc.kore.host.HostInfo;
import org.xbmc.kore.jsonrpc.ApiCallback;
import org.xbmc.kore.jsonrpc.HostConnection;
@@ -39,8 +40,7 @@ import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
-@RunWith(RobolectricTestRunner.class)
-@Config(constants = BuildConfig.class, sdk = 23)
+@RunWith(AndroidJUnit4.class)
public class ApplicationTest {
private HostConnection hostConnection;
diff --git a/build.gradle b/build.gradle
index c6db9aa..2d387cb 100644
--- a/build.gradle
+++ b/build.gradle
@@ -6,7 +6,7 @@ buildscript {
jcenter()
}
dependencies {
- classpath 'com.android.tools.build:gradle:3.1.2'
+ classpath 'com.android.tools.build:gradle:3.4.1'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties
index 4566db8..c20e1f1 100644
--- a/gradle/wrapper/gradle-wrapper.properties
+++ b/gradle/wrapper/gradle-wrapper.properties
@@ -1,6 +1,6 @@
-#Thu Apr 19 08:59:44 CEST 2018
+#Thu May 16 19:46:49 CEST 2019
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
-distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip
+distributionUrl=https\://services.gradle.org/distributions/gradle-5.1.1-all.zip