Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 19 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 Dec 26 11:42:13 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 Dec 26 11:42:13 UTC 2025
    - Last Modified: Sat Aug 30 16:25:39 UTC 2025
    - 1.2K bytes
    - Viewed (0)
  3. 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 Dec 26 11:42:13 UTC 2025
    - Last Modified: Mon Dec 30 23:28:56 UTC 2024
    - 1.7K bytes
    - Viewed (0)
  4. 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 Dec 26 11:42:13 UTC 2025
    - Last Modified: Mon Jul 28 07:33:49 UTC 2025
    - 1.6K bytes
    - Viewed (0)
  5. okhttp-testing-support/build.gradle.kts

          }
        )
      })
    
      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 Dec 26 11:42:13 UTC 2025
    - Last Modified: Tue Nov 04 18:33:48 UTC 2025
    - 1.2K bytes
    - Viewed (1)
  6. 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 Dec 26 11:42:13 UTC 2025
    - Last Modified: Mon Jul 28 07:33:49 UTC 2025
    - 1.7K bytes
    - Viewed (0)
  7. 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 Dec 26 11:42:13 UTC 2025
    - Last Modified: Fri Nov 21 12:33:41 UTC 2025
    - 3.9K bytes
    - Viewed (2)
  8. okhttp/src/androidMain/kotlin/okhttp3/internal/platform/android/AndroidLog.kt

        } catch (re: RuntimeException) {
          // Happens with non-robolectric unit tests
          System.err.println("Possibly running android unit test without robolectric")
          re.printStackTrace()
        } catch (ule: UnsatisfiedLinkError) {
          // Happens with Paparazzi - with Android classes on the classpath
          System.err.println("Possibly running android unit test without robolectric")
          ule.printStackTrace()
        }
      }
    
    Registered: Fri Dec 26 11:42:13 UTC 2025
    - Last Modified: Sat Oct 25 11:16:17 UTC 2025
    - 4.3K 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 Dec 26 11:42:13 UTC 2025
    - Last Modified: Sat Aug 30 16:25:39 UTC 2025
    - 2.1K bytes
    - Viewed (0)
  10. 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 Dec 26 11:42:13 UTC 2025
    - Last Modified: Sat Nov 01 12:18:11 UTC 2025
    - 12.3K bytes
    - Viewed (0)
Back to top