Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 11 for Rule (0.29 sec)

  1. okhttp/src/test/java/okhttp3/internal/publicsuffix/PublicSuffixListGenerator.kt

            while (!source.exhausted()) {
              var rule: ByteString = source.readUtf8LineStrict().toRule() ?: continue
    
              if (rule.startsWith(EXCEPTION_RULE_MARKER)) {
                rule = rule.substring(1)
                // We use '\n' for end of value.
                totalExceptionRuleBytes += rule.size + 1
                sortedExceptionRules.add(rule)
              } else {
                totalRuleBytes += rule.size + 1 // We use '\n' for end of value.
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Thu Apr 18 01:24:38 GMT 2024
    - 6K bytes
    - Viewed (0)
  2. okhttp/src/main/kotlin/okhttp3/internal/-HostnamesCommon.kt

        val c = this[i]
        // The WHATWG Host parsing rules accepts some character codes which are invalid by
        // definition for OkHttp's host header checks (and the WHATWG Host syntax definition). Here
        // we rule out characters that would cause problems in host headers.
        if (c <= '\u001f' || c >= '\u007f') {
          return true
        }
        // Check for the characters mentioned in the WHATWG Host parsing spec:
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 11.2K bytes
    - Viewed (0)
  3. mockwebserver-junit4/README.md

    ```
    @Rule public final MockWebServerRule serverRule = new MockWebServerRule();
    ```
    
    The `serverRule` field has a `server` field. It is an instance of `MockWebServer`. That instance
    will be shut down automatically after the test runs.
    
    For Kotlin, the `@JvmField` annotation is also necessary:
    
    ```
    @JvmField @Rule val serverRule = MockWebServerRule()
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Sun Dec 17 15:34:10 GMT 2023
    - 707 bytes
    - Viewed (1)
  4. mockwebserver-junit4/src/main/kotlin/mockwebserver3/junit4/MockWebServerRule.kt

     *
     * In Java JUnit 4 tests (ie. tests annotated `@org.junit.Test`), use this by defining a field with
     * the `@Rule` annotation:
     *
     * ```java
     * @Rule public final MockWebServerRule serverRule = new MockWebServerRule();
     * ```
     *
     * For Kotlin the `@JvmField` annotation is also necessary:
     *
     * ```kotlin
     * @JvmField @Rule val serverRule = MockWebServerRule()
     * ```
     */
    @ExperimentalOkHttpApi
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Tue Jan 23 14:31:42 GMT 2024
    - 1.8K bytes
    - Viewed (1)
  5. okhttp/src/main/kotlin/okhttp3/internal/publicsuffix/PublicSuffixDatabase.kt

        val rule = findMatchingRule(domainLabels)
        if (domainLabels.size == rule.size && rule[0][0] != EXCEPTION_MARKER) {
          return null // The domain is a public suffix.
        }
    
        val firstLabelOffset =
          if (rule[0][0] == EXCEPTION_MARKER) {
            // Exception rules hold the effective TLD plus one.
            domainLabels.size - rule.size
          } else {
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 11.7K bytes
    - Viewed (0)
  6. mockwebserver-junit4/src/test/java/mockwebserver3/junit4/MockWebServerRuleTest.kt

    class MockWebServerRuleTest {
      @Test fun statementStartsAndStops() {
        val rule = MockWebServerRule()
        val called = AtomicBoolean()
        val statement: Statement =
          rule.apply(
            object : Statement() {
              override fun evaluate() {
                called.set(true)
                rule.server.url("/").toUrl().openConnection().connect()
              }
            },
            Description.EMPTY,
          )
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 1.5K bytes
    - Viewed (1)
  7. okhttp-android/src/androidTest/kotlin/okhttp3/android/AndroidAsyncDnsTest.kt

    import org.junit.AssumptionViolatedException
    import org.junit.Before
    import org.junit.Ignore
    import org.junit.Rule
    import org.junit.Test
    
    /**
     * Run with "./gradlew :android-test:connectedCheck -PandroidBuild=true" and make sure ANDROID_SDK_ROOT is set.
     */
    class AndroidAsyncDnsTest {
      @JvmField @Rule
      val serverRule = MockWebServerRule()
      private lateinit var client: OkHttpClient
    
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 5.7K bytes
    - Viewed (0)
  8. docs/contribute/concurrency.md

    Similarly, the reader thread must never block on writing because this can deadlock the connection. Consider a client and server that both violate this rule. If you get unlucky, they could fill up their TCP buffers (so that writes block) and then use their reader threads to write a frame. Nobody is reading on either end, and the buffers are never drained.
    
    #### Do-stuff-later pool
    
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Sun Feb 06 16:35:36 GMT 2022
    - 7K bytes
    - Viewed (0)
  9. okhttp-testing-support/src/main/kotlin/okhttp3/OkHttpClientTestRule.kt

    import org.junit.jupiter.api.extension.AfterEachCallback
    import org.junit.jupiter.api.extension.BeforeEachCallback
    import org.junit.jupiter.api.extension.ExtensionContext
    
    /**
     * Apply this rule to all tests. It adds additional checks for leaked resources and uncaught
     * exceptions.
     *
     * Use [newClient] as a factory for a OkHttpClient instances. These instances are specifically
     * configured for testing.
     */
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 10.5K bytes
    - Viewed (0)
  10. okhttp/src/test/java/okhttp3/internal/publicsuffix/PublicSuffixDatabaseTest.kt

            buffer.write(source, length.toLong())
          }
        }
        while (!buffer.exhausted()) {
          var publicSuffix = buffer.readUtf8LineStrict()
          if (publicSuffix.contains("*")) {
            // A wildcard rule, let's replace the wildcard with a value.
            publicSuffix = publicSuffix.replace("\\*".toRegex(), "square")
          }
          assertThat(publicSuffixDatabase.getEffectiveTldPlusOne(publicSuffix)).isNull()
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 11.3K bytes
    - Viewed (0)
Back to top