Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Bump robolectric to 4.14 (#98) #99

Merged
merged 1 commit into from
Nov 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions buildSrc/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,9 @@ task downloadAarDepsPlugin {
final url = from[i]
final targetFile = to[i]
try {
new URL(url).withInputStream { inputStream -> targetFile.withOutputStream { it << inputStream } }
URI.create(url).toURL().withInputStream { inputStream -> targetFile.withOutputStream { it << inputStream } }
} catch (IOException e) {
logger.debug("Error during downloading ${url.name}. Keep the stored version.\n$e")
logger.debug("Error during downloading ${url}. Keep the stored version.\n$e")
warnyul marked this conversation as resolved.
Show resolved Hide resolved
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jvmToolchainMin = "11"
jvmToolchain = "17"
kotlin = "2.0.21"
kover = "0.8.3"
robolectric = "4.13"
robolectric = "4.14"
robolectricExtensionGradlePlugin = "0.8.0"
# Use when bom also added to the dependencies
sources = "sources"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
package tech.apter.junit.jupiter.robolectric.internal

import org.robolectric.ApkLoader
import org.robolectric.annotation.ResourcesMode
import org.robolectric.annotation.SQLiteMode
import org.robolectric.internal.AndroidSandbox
import org.robolectric.internal.ResourcesMode
import org.robolectric.internal.bytecode.ShadowProviders
import org.robolectric.pluginapi.Sdk
import java.util.concurrent.ThreadFactory
Expand All @@ -13,8 +12,7 @@ import java.util.concurrent.atomic.AtomicLong
internal class JUnit5RobolectricAndroidSandbox(
runtimeSdk: Sdk,
compileSdk: Sdk,
resourcesMode: ResourcesMode,
apkLoader: ApkLoader,
resourcesMode: ResourcesMode.Mode,
@Suppress("VisibleForTests")
testEnvironmentSpec: TestEnvironmentSpec,
sdkSandboxClassLoader: SdkSandboxClassLoader,
Expand All @@ -24,7 +22,6 @@ internal class JUnit5RobolectricAndroidSandbox(
runtimeSdk,
compileSdk,
resourcesMode,
apkLoader,
testEnvironmentSpec,
sdkSandboxClassLoader,
shadowProviders,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
package tech.apter.junit.jupiter.robolectric.internal

import org.robolectric.ApkLoader
import org.robolectric.annotation.ResourcesMode
import org.robolectric.annotation.SQLiteMode
import org.robolectric.internal.AndroidSandbox
import org.robolectric.internal.AndroidSandbox.SdkSandboxClassLoader
import org.robolectric.internal.ResourcesMode
import org.robolectric.internal.SandboxManager
import org.robolectric.internal.bytecode.ClassInstrumentor
import org.robolectric.internal.bytecode.InstrumentationConfiguration
Expand All @@ -17,7 +16,6 @@ import javax.inject.Inject

internal class JUnit5RobolectricSandboxBuilder @Inject constructor(
private val testClassContainer: TestClassContainer,
private val apkLoader: ApkLoader,
@Suppress("VisibleForTests")
private val testEnvironmentSpec: AndroidSandbox.TestEnvironmentSpec,
private val shadowProviders: ShadowProviders,
Expand All @@ -29,7 +27,7 @@ internal class JUnit5RobolectricSandboxBuilder @Inject constructor(
instrumentationConfig: InstrumentationConfiguration,
runtimeSdk: Sdk,
compileSdk: Sdk,
resourcesMode: ResourcesMode,
resourcesMode: ResourcesMode.Mode,
sqLiteMode: SQLiteMode.Mode,
): AndroidSandbox {
val testClass = testClassContainer.testClass
Expand All @@ -39,7 +37,6 @@ internal class JUnit5RobolectricSandboxBuilder @Inject constructor(
runtimeSdk,
compileSdk,
resourcesMode,
apkLoader,
testEnvironmentSpec,
sdkSandboxClassLoader,
shadowProviders,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ package tech.apter.junit.jupiter.robolectric.internal

import org.robolectric.annotation.GraphicsMode
import org.robolectric.annotation.LooperMode
import org.robolectric.annotation.ResourcesMode
import org.robolectric.annotation.SQLiteMode
import org.robolectric.internal.AndroidSandbox
import org.robolectric.internal.ResourcesMode
import org.robolectric.internal.SandboxManager
import org.robolectric.internal.bytecode.InstrumentationConfiguration
import org.robolectric.pluginapi.Sdk
Expand All @@ -23,7 +23,7 @@ internal class JUnit5RobolectricSandboxManager @Inject constructor(
override fun getAndroidSandbox(
instrumentationConfig: InstrumentationConfiguration,
sdk: Sdk,
resourcesMode: ResourcesMode,
resourcesMode: ResourcesMode.Mode,
looperMode: LooperMode.Mode,
sqliteMode: SQLiteMode.Mode,
graphicsMode: GraphicsMode.Mode,
Expand All @@ -50,7 +50,7 @@ internal class JUnit5RobolectricSandboxManager @Inject constructor(
private val testClassName: String,
private val instrumentationConfiguration: InstrumentationConfiguration,
private val sdk: Sdk,
private val resourcesMode: ResourcesMode,
private val resourcesMode: ResourcesMode.Mode,
private val graphicsMode: GraphicsMode.Mode,
)

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package tech.apter.junit.jupiter.robolectric.internal

import org.robolectric.annotation.ResourcesMode
import org.robolectric.annotation.SQLiteMode
import org.robolectric.internal.AndroidSandbox
import org.robolectric.internal.ResourcesMode
import org.robolectric.internal.SandboxManager.SandboxBuilder
import org.robolectric.internal.bytecode.InstrumentationConfiguration
import org.robolectric.pluginapi.Sdk
Expand All @@ -24,7 +24,7 @@ class JUnit5RobolectricSandboxBuilderTest {
val instrumentationConfiguration = createInstrumentationConfiguration()
val runtimeSdk: Sdk = TestUtil.sdkCollection.getSdk(33)
val compileSdk: Sdk = TestUtil.sdkCollection.getSdk(33)
val resourcesMode: ResourcesMode = ResourcesMode.BINARY
val resourcesMode: ResourcesMode.Mode = ResourcesMode.Mode.BINARY
val sqLiteMode: SQLiteMode.Mode = SQLiteMode.Mode.NATIVE

subjectUnderTest {
Expand All @@ -50,7 +50,7 @@ class JUnit5RobolectricSandboxBuilderTest {
val instrumentationConfiguration2 = createInstrumentationConfiguration()
val runtimeSdk2: Sdk = TestUtil.sdkCollection.getSdk(32)
val compileSdk2: Sdk = TestUtil.sdkCollection.getSdk(32)
val resourcesMode: ResourcesMode = ResourcesMode.BINARY
val resourcesMode: ResourcesMode.Mode = ResourcesMode.Mode.BINARY
val sqLiteMode: SQLiteMode.Mode = SQLiteMode.Mode.NATIVE

subjectUnderTest {
Expand Down
Loading