Search Options

Display Count
Sort
Preferred Language
Advanced Search

Results 1 - 10 of 20 for Robolectric (0.06 seconds)

  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>()
          }
        }
      }
    Created: Fri Dec 26 11:42:13 GMT 2025
    - Last Modified: Mon Jul 28 07:33:49 GMT 2025
    - 1.6K bytes
    - Click Count (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
    Created: Fri Dec 26 11:42:13 GMT 2025
    - Last Modified: Sat Aug 30 16:25:39 GMT 2025
    - 1.2K bytes
    - Click Count (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)
      }
    
    Created: Fri Dec 26 11:42:13 GMT 2025
    - Last Modified: Mon Dec 30 23:28:56 GMT 2024
    - 1.7K bytes
    - Click Count (0)
  4. 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
    Created: Fri Dec 26 11:42:13 GMT 2025
    - Last Modified: Tue Nov 04 18:33:48 GMT 2025
    - 1.2K bytes
    - Click Count (1)
  5. 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}")
      }
    Created: Fri Dec 26 11:42:13 GMT 2025
    - Last Modified: Mon Jul 28 07:33:49 GMT 2025
    - 1.6K bytes
    - Click Count (0)
  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. " +
    Created: Fri Dec 26 11:42:13 GMT 2025
    - Last Modified: Mon Jul 28 07:33:49 GMT 2025
    - 1.7K bytes
    - Click Count (0)
  7. 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()
        }
      }
    
    Created: Fri Dec 26 11:42:13 GMT 2025
    - Last Modified: Sat Oct 25 11:16:17 GMT 2025
    - 4.3K bytes
    - Click Count (0)
  8. 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() {
    Created: Fri Dec 26 11:42:13 GMT 2025
    - Last Modified: Sat Aug 30 16:25:39 GMT 2025
    - 2.1K bytes
    - Click Count (0)
  9. 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)
          }
        }
      }
    }
    
    Created: Fri Dec 26 11:42:13 GMT 2025
    - Last Modified: Sat Nov 01 12:18:11 GMT 2025
    - 12.3K bytes
    - Click Count (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,
    ) {
    Created: Fri Dec 26 11:42:13 GMT 2025
    - Last Modified: Wed Mar 19 19:25:20 GMT 2025
    - 3.6K bytes
    - Click Count (0)
Back to Top