Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 20 for Robolectric (0.04 sec)

  1. android-test/src/test/kotlin/okhttp/android/test/NonRobolectricOkHttpClientTest.kt

          cause().isNotNull().all {
            hasMessage(
              "Platform applicationContext not initialized. " +
                "Possibly running Android unit test without Robolectric. " +
                "Android tests should run with Robolectric " +
                "and call OkHttp.initialize before test",
            )
            hasClass<IOException>()
          }
        }
      }
    Registered: Fri Sep 05 11:42:10 UTC 2025
    - Last Modified: Mon Jul 28 07:33:49 UTC 2025
    - 1.6K bytes
    - Viewed (0)
  2. android-test/src/test/kotlin/okhttp/android/test/RobolectricOkHttpClientTest.kt

    import org.junit.Before
    import org.junit.runner.RunWith
    import org.robolectric.RobolectricTestRunner
    import org.robolectric.annotation.Config
    
    @RunWith(RobolectricTestRunner::class)
    @Config(
      sdk = [23, 26, 30, 33, 35],
    )
    class RobolectricOkHttpClientTest : BaseOkHttpClientUnitTest() {
      @Before
      fun setContext() {
        // This is awkward because Robolectric won't run our initializers and we don't want test deps
    Registered: Fri Sep 05 11:42:10 UTC 2025
    - Last Modified: Sat Aug 30 16:25:39 UTC 2025
    - 1.2K bytes
    - Viewed (0)
  3. okhttp/src/androidMain/kotlin/okhttp3/internal/platform/PlatformRegistry.kt

            ?: AndroidPlatform.buildIfSupported()
        if (androidPlatform != null) return androidPlatform
    
        // If the API version is 0, assume this is the Android artifact, but running on the JVM without Robolectric.
        if (Build.VERSION.SDK_INT == 0) {
          return Jdk9Platform.buildIfSupported()
            ?: Platform()
        }
    
        throw IllegalStateException("Expected Android API level 21+ but was ${Build.VERSION.SDK_INT}")
      }
    Registered: Fri Sep 05 11:42:10 UTC 2025
    - Last Modified: Mon Jul 28 07:33:49 UTC 2025
    - 1.6K bytes
    - Viewed (0)
  4. android-test/src/test/kotlin/okhttp/android/test/ShadowDnsResolver.kt

    import android.net.DnsResolver
    import android.net.Network
    import android.os.CancellationSignal
    import java.net.InetAddress
    import java.util.concurrent.Executor
    import org.robolectric.annotation.Implementation
    import org.robolectric.annotation.Implements
    import org.robolectric.shadow.api.Shadow
    
    @Implements(DnsResolver::class)
    class ShadowDnsResolver {
      var responder: (Request) -> Unit = {
        it.callback.onAnswer(listOf(), 0)
      }
    
    Registered: Fri Sep 05 11:42:10 UTC 2025
    - Last Modified: Mon Dec 30 23:28:56 UTC 2024
    - 1.7K bytes
    - Viewed (0)
  5. android-test/build.gradle.kts

      testImplementation(libs.assertk)
      testImplementation(projects.okhttpTls)
      "friendsTestImplementation"(projects.loggingInterceptor)
      testImplementation(libs.androidx.test.runner)
      testImplementation(libs.robolectric)
      testImplementation(libs.androidx.espresso.core)
      testImplementation(libs.squareup.okio.fakefilesystem)
      testImplementation(projects.okhttpTestingSupport)
      testImplementation(rootProject.libs.conscrypt.openjdk)
    Registered: Fri Sep 05 11:42:10 UTC 2025
    - Last Modified: Tue Jul 29 20:01:04 UTC 2025
    - 3.8K bytes
    - Viewed (2)
  6. okhttp-testing-support/build.gradle.kts

        classifier("linux-x86_64")
      })
    
      api(libs.hamcrestLibrary)
      api(libs.junit.jupiter.api)
      api(libs.junit.jupiter.params)
    
      api(libs.junit.pioneer)
    
      compileOnly(libs.robolectric.android)
    
      testImplementation(libs.kotlin.test.common)
      testImplementation(libs.kotlin.test.junit)
    }
    
    animalsniffer {
      isIgnoreFailures = true
    Registered: Fri Sep 05 11:42:10 UTC 2025
    - Last Modified: Sat Jun 14 16:09:26 UTC 2025
    - 800 bytes
    - Viewed (0)
  7. okhttp/build.gradle.kts

        }
        if (name.matches("test.*UnitTest".toRegex()) && javaLauncher.get().metadata.languageVersion.asInt() < 17) {
          // Work around robolectric requirements and limitations
          // https://github.com/robolectric/robolectric/issues/10419
          filter {
            excludeTest("okhttp3.internal.publicsuffix.PublicSuffixDatabaseTest", null)
          }
        }
      }
    }
    
    Registered: Fri Sep 05 11:42:10 UTC 2025
    - Last Modified: Thu Jul 03 03:59:03 UTC 2025
    - 9.4K bytes
    - Viewed (0)
  8. okhttp/src/androidMain/kotlin/okhttp3/internal/publicsuffix/AssetPublicSuffixList.kt

          if (Build.FINGERPRINT == null) {
            throw IOException(
              "Platform applicationContext not initialized. " +
                "Possibly running Android unit test without Robolectric. " +
                "Android tests should run with Robolectric " +
                "and call OkHttp.initialize before test",
            )
          } else {
            throw IOException(
              "Platform applicationContext not initialized. " +
    Registered: Fri Sep 05 11:42:10 UTC 2025
    - Last Modified: Mon Jul 28 07:33:49 UTC 2025
    - 1.7K bytes
    - Viewed (0)
  9. android-test/src/test/kotlin/okhttp/android/test/DisabledInitialiserTest.kt

    import okhttp3.internal.platform.PlatformRegistry
    import org.junit.AfterClass
    import org.junit.Before
    import org.junit.Test
    import org.junit.runner.RunWith
    import org.robolectric.RobolectricTestRunner
    import org.robolectric.annotation.Config
    
    @RunWith(RobolectricTestRunner::class)
    @Config(
      sdk = [23, 26, 30, 33, 35],
    )
    class DisabledInitialiserTest {
      @Before
      fun setContext() {
    Registered: Fri Sep 05 11:42:10 UTC 2025
    - Last Modified: Sat Aug 30 16:25:39 UTC 2025
    - 2.1K bytes
    - Viewed (0)
  10. android-test/src/test/kotlin/okhttp/android/test/AndroidSocketAdapterTest.kt

    import org.junit.Assert.assertTrue
    import org.junit.Assume.assumeFalse
    import org.junit.Assume.assumeTrue
    import org.junit.Test
    import org.junit.runner.RunWith
    import org.robolectric.ParameterizedRobolectricTestRunner
    import org.robolectric.ParameterizedRobolectricTestRunner.Parameters
    
    @RunWith(ParameterizedRobolectricTestRunner::class)
    class AndroidSocketAdapterTest(
      val adapter: SocketAdapter,
    ) {
    Registered: Fri Sep 05 11:42:10 UTC 2025
    - Last Modified: Wed Mar 19 19:25:20 UTC 2025
    - 3.6K bytes
    - Viewed (0)
Back to top