Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 60 for tearDown (0.17 sec)

  1. regression-test/src/androidTest/java/okhttp/regression/compare/ApacheHttpClientTest.kt

     *
     * https://hc.apache.org/httpcomponents-client-5.0.x/index.html
     */
    @RunWith(AndroidJUnit4::class)
    class ApacheHttpClientTest {
      private var httpClient = HttpClients.createDefault()
    
      @After fun tearDown() {
        httpClient.close()
      }
    
      @Test fun get() {
        val request = HttpGet("https://google.com/robots.txt")
    
        httpClient.execute(request).use { response ->
          assertEquals(200, response.code)
    Plain Text
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 1.5K bytes
    - Viewed (0)
  2. mockwebserver-junit5/src/test/java/mockwebserver3/junit5/internal/ExtensionMultipleInstancesTest.kt

        assertThat(instanceB.started).isTrue()
        assertThat(defaultInstancePort).isNotEqualTo(instanceAPort)
        assertThat(defaultInstancePort).isNotEqualTo(instanceBPort)
      }
    
      @AfterEach
      fun tearDown(
        defaultInstance: MockWebServer,
        @MockWebServerInstance("A") instanceA: MockWebServer,
        @MockWebServerInstance("B") instanceB: MockWebServer,
      ) {
    Plain Text
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Sun Jan 14 10:20:09 GMT 2024
    - 2.3K bytes
    - Viewed (0)
  3. samples/compare/src/test/kotlin/okhttp3/compare/ApacheHttpClientTest.kt

     *
     * Baseline test if we ned to validate OkHttp behaviour against other popular clients.
     */
    class ApacheHttpClientTest {
      private val httpClient = HttpClients.createDefault()
    
      @AfterEach fun tearDown() {
        httpClient.close()
      }
    
      @Test fun get(server: MockWebServer) {
        server.enqueue(
          MockResponse.Builder()
            .body("hello, Apache HttpClient 5.x")
            .build(),
        )
    
    Plain Text
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 2.1K bytes
    - Viewed (0)
  4. okhttp/src/test/java/okhttp3/internal/http/ThreadInterruptTest.kt

                  socket.setReceiveBufferSize(SOCKET_BUFFER_SIZE)
                  return socket
                }
              },
            )
            .build()
      }
    
      @AfterEach
      fun tearDown() {
        Thread.interrupted() // Clear interrupted state.
      }
    
      @Test
      fun interruptWritingRequestBody() {
        server.enqueue(MockResponse())
        server.start()
        val call =
          client.newCall(
    Plain Text
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 4.6K bytes
    - Viewed (0)
  5. ci/official/containers/linux_arm64/devel.usertools/code_check_changed_files.bats

            python -m pylint --rcfile=tensorflow/tools/ci_build/pylintrc --score false \
            | grep -v "**** Module" \
            | tee $BATS_TEST_TMPDIR/needs_help.txt
        [[ ! -s $BATS_TEST_TMPDIR/needs_help.txt ]]
    }
    
    teardown_file() {
        bazel shutdown
    Plain Text
    - Registered: Tue Apr 30 12:39:09 GMT 2024
    - Last Modified: Mon Sep 18 14:52:45 GMT 2023
    - 3.6K bytes
    - Viewed (0)
  6. mockwebserver/README.md

      // Shut down the server. Instances cannot be reused.
      server.shutdown();
    }
    ```
    
    Your unit tests might move the `server` into a field so you can shut it down
    from your test's `tearDown()`.
    
    ### API
    
    #### MockResponse
    
    Mock responses default to an empty response body and a `200` status code.
    You can set a custom body with a string, input stream or byte array. Also
    Plain Text
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Sun Dec 17 15:34:10 GMT 2023
    - 5K bytes
    - Viewed (1)
  7. okhttp/src/test/java/okhttp3/internal/http/HttpDateTest.kt

        // something else.
        TimeZone.setDefault(TimeZone.getTimeZone("America/Los_Angeles"))
      }
    
      @AfterEach
      @Throws(Exception::class)
      fun tearDown() {
        TimeZone.setDefault(originalDefault)
      }
    
      @Test
      @Throws(Exception::class)
      fun parseStandardFormats() {
        // RFC 822, updated by RFC 1123 with GMT.
    Plain Text
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 3.9K bytes
    - Viewed (0)
  8. okhttp/src/test/java/okhttp3/OkHttpClientTest.kt

      @RegisterExtension
      val clientTestRule = OkHttpClientTestRule()
    
      private var server: MockWebServer? = null
    
      @BeforeEach fun setUp(server: MockWebServer?) {
        this.server = server
      }
    
      @AfterEach fun tearDown() {
        ProxySelector.setDefault(DEFAULT_PROXY_SELECTOR)
        CookieManager.setDefault(DEFAULT_COOKIE_HANDLER)
        ResponseCache.setDefault(DEFAULT_RESPONSE_CACHE)
      }
    
      @Test fun durationDefaults() {
    Plain Text
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Sun Mar 31 17:16:15 GMT 2024
    - 13.2K bytes
    - Viewed (0)
  9. ci/official/utilities/code_check_changed_files.bats

        echo "You have to re-generate the TF API goldens and have the API changes reviewed."
        echo "Look at the instructions for ':api_compatibility_test -- --update_goldens=True'"
    }
    
    teardown_file() {
        bazel shutdown
    Plain Text
    - Registered: Tue Apr 30 12:39:09 GMT 2024
    - Last Modified: Wed Jan 10 19:39:41 GMT 2024
    - 4K bytes
    - Viewed (0)
  10. okhttp/src/test/java/okhttp3/AddressTest.kt

    import org.junit.jupiter.api.Test
    
    class AddressTest {
      private val factory =
        TestValueFactory().apply {
          uriHost = "example.com"
          uriPort = 80
        }
    
      @AfterEach fun tearDown() {
        factory.close()
      }
    
      @Test fun equalsAndHashcode() {
        val a = factory.newAddress()
        val b = factory.newAddress()
        assertThat(b).isEqualTo(a)
        assertThat(b.hashCode()).isEqualTo(a.hashCode())
    Plain Text
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 1.8K bytes
    - Viewed (0)
Back to top