[Android] Tests: Fixed LibVLC refactored references
Shivansh Saini
git at videolan.org
Mon Dec 16 17:52:36 CET 2019
vlc-android | branch: master | Shivansh Saini <shivanshs9 at gmail.com> | Sat Jun 29 01:33:45 2019 +0530| [f3ce0cc0e1f1b50b97459677ba4501f3d1d0eeb6] | committer: Geoffrey Métais
Tests: Fixed LibVLC refactored references
> https://code.videolan.org/videolan/vlc-android/commit/f3ce0cc0e1f1b50b97459677ba4501f3d1d0eeb6
---
vlc-android/test-common/org/videolan/vlc/util/TestUtil.kt | 3 ++-
vlc-android/test/org/videolan/vlc/VLCTestApplication.kt | 12 ++++++------
.../videolan/vlc/viewmodels/browser/FileBrowserModelTest.kt | 6 +++---
.../videolan/vlc/viewmodels/browser/FilePickerModelTest.kt | 5 +++--
.../org/videolan/vlc/viewmodels/browser/StorageModelTest.kt | 6 +++---
5 files changed, 17 insertions(+), 15 deletions(-)
diff --git a/vlc-android/test-common/org/videolan/vlc/util/TestUtil.kt b/vlc-android/test-common/org/videolan/vlc/util/TestUtil.kt
index 7be3d2a91..5d45e02dc 100644
--- a/vlc-android/test-common/org/videolan/vlc/util/TestUtil.kt
+++ b/vlc-android/test-common/org/videolan/vlc/util/TestUtil.kt
@@ -22,6 +22,7 @@ package org.videolan.vlc.util
import android.net.Uri
import org.videolan.libvlc.Media
+import org.videolan.libvlc.interfaces.IMedia
import org.videolan.vlc.api.OpenSubtitle
import org.videolan.vlc.api.QueryParameters
import org.videolan.vlc.database.models.BrowserFav
@@ -86,7 +87,7 @@ object TestUtil {
}
fun createSubtitleSlave(mediaPath: String, uri: String): Slave {
- return Slave(mediaPath, Media.Slave.Type.Subtitle, 2, uri)
+ return Slave(mediaPath, IMedia.Slave.Type.Subtitle, 2, uri)
}
fun createSubtitleSlavesForMedia(mediaName: String, count: Int): List<Slave> {
diff --git a/vlc-android/test/org/videolan/vlc/VLCTestApplication.kt b/vlc-android/test/org/videolan/vlc/VLCTestApplication.kt
index 8b03b52a7..611f51363 100644
--- a/vlc-android/test/org/videolan/vlc/VLCTestApplication.kt
+++ b/vlc-android/test/org/videolan/vlc/VLCTestApplication.kt
@@ -4,10 +4,10 @@ import android.app.Application
import kotlinx.coroutines.ExperimentalCoroutinesApi
import kotlinx.coroutines.ObsoleteCoroutinesApi
import org.videolan.libvlc.FactoryManager
-import org.videolan.libvlc.ILibVLCFactory
-import org.videolan.libvlc.IMediaFactory
-import org.videolan.libvlc.test.TestLibVLCFactory
-import org.videolan.libvlc.test.TestMediaFactory
+import org.videolan.libvlc.interfaces.ILibVLCFactory
+import org.videolan.libvlc.interfaces.IMediaFactory
+import org.videolan.libvlc.stubs.StubLibVLCFactory
+import org.videolan.libvlc.stubs.StubMediaFactory
import org.videolan.medialibrary.MLServiceLocator
@ExperimentalCoroutinesApi
@@ -15,7 +15,7 @@ import org.videolan.medialibrary.MLServiceLocator
class VLCTestApplication : Application() {
init {
MLServiceLocator.setLocatorMode(MLServiceLocator.LocatorMode.TESTS)
- FactoryManager.registerFactory(IMediaFactory.factoryId, TestMediaFactory())
- FactoryManager.registerFactory(ILibVLCFactory.factoryId, TestLibVLCFactory())
+ FactoryManager.registerFactory(IMediaFactory.factoryId, StubMediaFactory())
+ FactoryManager.registerFactory(ILibVLCFactory.factoryId, StubLibVLCFactory())
}
}
\ No newline at end of file
diff --git a/vlc-android/test/org/videolan/vlc/viewmodels/browser/FileBrowserModelTest.kt b/vlc-android/test/org/videolan/vlc/viewmodels/browser/FileBrowserModelTest.kt
index 2d42af4e3..462c149db 100644
--- a/vlc-android/test/org/videolan/vlc/viewmodels/browser/FileBrowserModelTest.kt
+++ b/vlc-android/test/org/videolan/vlc/viewmodels/browser/FileBrowserModelTest.kt
@@ -14,8 +14,8 @@ import org.junit.Rule
import org.junit.Test
import org.junit.rules.TemporaryFolder
import org.videolan.libvlc.LibVLC
-import org.videolan.libvlc.Media
-import org.videolan.libvlc.test.TestMedia
+import org.videolan.libvlc.interfaces.IMedia
+import org.videolan.libvlc.stubs.StubMedia
import org.videolan.libvlc.util.MediaBrowser
import org.videolan.medialibrary.interfaces.media.AbstractMediaWrapper
import org.videolan.vlc.BaseTest
@@ -79,7 +79,7 @@ class FileBrowserModelTest : BaseTest() {
}
private fun addFileToProvider(i: Int, file: File) {
- val t = TestMedia(mockedLibVlc, "file://${file.path}").apply { if (!file.name.endsWith(".mp4")) type = Media.Type.Directory }
+ val t = StubMedia(mockedLibVlc, "file://${file.path}").apply { if (!file.name.endsWith(".mp4")) type = IMedia.Type.Directory }
browserProvider.onMediaAdded(i, t)
}
diff --git a/vlc-android/test/org/videolan/vlc/viewmodels/browser/FilePickerModelTest.kt b/vlc-android/test/org/videolan/vlc/viewmodels/browser/FilePickerModelTest.kt
index 467aefa41..9e6dada7b 100644
--- a/vlc-android/test/org/videolan/vlc/viewmodels/browser/FilePickerModelTest.kt
+++ b/vlc-android/test/org/videolan/vlc/viewmodels/browser/FilePickerModelTest.kt
@@ -12,7 +12,8 @@ import org.junit.Test
import org.junit.rules.TemporaryFolder
import org.videolan.libvlc.LibVLC
import org.videolan.libvlc.Media
-import org.videolan.libvlc.test.TestMedia
+import org.videolan.libvlc.interfaces.IMedia
+import org.videolan.libvlc.stubs.StubMedia
import org.videolan.libvlc.util.MediaBrowser
import org.videolan.vlc.BaseTest
import org.videolan.vlc.providers.BrowserProvider
@@ -64,7 +65,7 @@ class FilePickerModelTest : BaseTest() {
}
private fun addFileToProvider(i: Int, file: File) {
- val t = TestMedia(mockedLibVlc, "file://${file.path}").apply { if (!file.name.endsWith(".mp4")) type = Media.Type.Directory }
+ val t = StubMedia(mockedLibVlc, "file://${file.path}").apply { if (!file.name.endsWith(".mp4")) type = IMedia.Type.Directory }
browserProvider.onMediaAdded(i, t)
}
diff --git a/vlc-android/test/org/videolan/vlc/viewmodels/browser/StorageModelTest.kt b/vlc-android/test/org/videolan/vlc/viewmodels/browser/StorageModelTest.kt
index aeb93036f..884696c95 100644
--- a/vlc-android/test/org/videolan/vlc/viewmodels/browser/StorageModelTest.kt
+++ b/vlc-android/test/org/videolan/vlc/viewmodels/browser/StorageModelTest.kt
@@ -14,8 +14,8 @@ import org.junit.Rule
import org.junit.Test
import org.junit.rules.TemporaryFolder
import org.videolan.libvlc.LibVLC
-import org.videolan.libvlc.Media
-import org.videolan.libvlc.test.TestMedia
+import org.videolan.libvlc.interfaces.IMedia
+import org.videolan.libvlc.stubs.StubMedia
import org.videolan.libvlc.util.MediaBrowser
import org.videolan.medialibrary.Medialibrary
import org.videolan.vlc.BaseTest
@@ -92,7 +92,7 @@ class StorageModelTest : BaseTest() {
private fun addFileToProvider(i: Int, file: File) {
if (file.name.startsWith(".") && !showHiddenFiles)
return
- val t = TestMedia(mockedLibVlc, "file://${file.path}").apply { if (!file.name.endsWith(".mp4")) type = Media.Type.Directory }
+ val t = StubMedia(mockedLibVlc, "file://${file.path}").apply { if (!file.name.endsWith(".mp4")) type = IMedia.Type.Directory }
browserProvider.onMediaAdded(i, t)
}
More information about the Android
mailing list