Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 28 for 500 (0.17 sec)

  1. mockwebserver/README.md

    testing everything. You can even copy & paste HTTP responses from your real web
    server to create representative test cases. Or test that your code survives in
    awkward-to-reproduce situations like 500 errors or slow-loading responses.
    
    
    ### Example
    
    Use MockWebServer the same way that you use mocking frameworks like
    [Mockito](https://github.com/mockito/mockito):
    
    1. Script the mocks.
    2. Run application code.
    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)
  2. okhttp/src/test/java/okhttp3/WholeOperationTimeoutTest.kt

      }
    
      @Test
      fun timeoutWritingRequest() {
        server.enqueue(MockResponse())
        val request =
          Request.Builder()
            .url(server.url("/"))
            .post(sleepingRequestBody(500))
            .build()
        val call = client.newCall(request)
        call.timeout().timeout(250, TimeUnit.MILLISECONDS)
        assertFailsWith<IOException> {
          call.execute()
        }.also { expected ->
    Plain Text
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 10.5K bytes
    - Viewed (0)
  3. okhttp/src/test/java/okhttp3/URLConnectionTest.kt

        assertThat(server.takeRequest().sequenceNumber).isEqualTo(0)
    
        // Give the server time to enact the socket policy if it's one that could happen after the
        // client has received the response.
        Thread.sleep(500)
        val response2 = getResponse(newRequest("/b"))
        response1.body.source().timeout().timeout(100, TimeUnit.MILLISECONDS)
        assertContent("This comes after a busted connection", response2)
    
    Plain Text
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Sat Jan 20 10:30:28 GMT 2024
    - 131.7K bytes
    - Viewed (0)
  4. okhttp/src/test/java/okhttp3/internal/ws/WebSocketHttpTest.kt

      private val serverListener = WebSocketRecorder("server")
      private val random = Random(0)
      private var client =
        clientTestRule.newClientBuilder()
          .writeTimeout(Duration.ofMillis(500))
          .readTimeout(Duration.ofMillis(500))
          .addInterceptor(
            Interceptor { chain: Interceptor.Chain ->
              val response = chain.proceed(chain.request())
              // Ensure application interceptors never see a null body.
    Plain Text
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Sun Mar 31 17:16:15 GMT 2024
    - 35.2K bytes
    - Viewed (1)
  5. okhttp/src/test/java/okhttp3/internal/http/ThreadInterruptTest.kt

            .throttleBody((64 * 1024).toLong(), 125, TimeUnit.MILLISECONDS),
        ) // 500 Kbps
        server.start()
        val call =
          client.newCall(
            Request.Builder()
              .url(server.url("/"))
              .build(),
          )
        val response = call.execute()
        interruptLater(500)
        val responseBody = response.body.byteStream()
        val buffer = ByteArray(1024)
    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)
  6. okhttp/src/test/java/okhttp3/internal/ws/RealWebSocketTest.kt

        client.listener.assertFailure(IOException::class.java, "source is closed")
        assertThat(client.closed).isTrue()
      }
    
      @Test
      fun pingOnInterval() {
        client.initWebSocket(random, pingIntervalMillis = 500)
        taskFaker.advanceUntil(ns(500L))
        server.processNextFrame() // Ping.
        client.processNextFrame() // Pong.
        taskFaker.advanceUntil(ns(1000L))
        server.processNextFrame() // Ping.
    Plain Text
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Thu Apr 11 01:59:58 GMT 2024
    - 18.5K bytes
    - Viewed (0)
  7. okhttp/src/test/java/okhttp3/internal/concurrent/TaskRunnerRealBackendTest.kt

          throw RuntimeException("boom!")
        }
    
        queue.schedule("task", TimeUnit.MILLISECONDS.toNanos(200)) {
          log.put("normal task running")
          return@schedule -1L
        }
    
        queue.idleLatch().await(500, TimeUnit.MILLISECONDS)
    
        assertThat(log.take()).isEqualTo("failing task running")
        assertThat(log.take()).isEqualTo("uncaught exception: java.lang.RuntimeException: boom!")
    Plain Text
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 3.5K bytes
    - Viewed (0)
  8. okhttp/src/test/java/okhttp3/internal/http2/HttpOverHttp2Test.kt

      fun pingsTransmitted(
        protocol: Protocol,
        mockWebServer: MockWebServer,
      ) {
        setUp(protocol, mockWebServer)
        // Ping every 500 ms, starting at 500 ms.
        client =
          client.newBuilder()
            .pingInterval(Duration.ofMillis(500))
            .build()
    
        // Delay the response to give 1 ping enough time to be sent and replied to.
        server.enqueue(
          MockResponse.Builder()
    Plain Text
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Thu Apr 11 22:09:35 GMT 2024
    - 75.3K bytes
    - Viewed (0)
  9. okhttp-sse/src/test/java/okhttp3/sse/internal/EventSourceHttpTest.kt

        client =
          client.newBuilder()
            .callTimeout(250, TimeUnit.MILLISECONDS)
            .build()
        server.enqueue(
          MockResponse.Builder()
            .bodyDelay(500, TimeUnit.MILLISECONDS)
            .setHeader("content-type", "text/event-stream")
            .body("data: hey\n\n")
            .build(),
        )
        val source = newEventSource()
    Plain Text
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Sun Jan 14 10:20:09 GMT 2024
    - 6.6K bytes
    - Viewed (0)
  10. okhttp/src/test/java/okhttp3/DuplexTest.kt

      }
    
      @Test
      fun fullCallTimeoutAppliesToSetup() {
        enableProtocol(Protocol.HTTP_2)
        server.enqueue(
          MockResponse.Builder()
            .headersDelay(500, TimeUnit.MILLISECONDS)
            .build(),
        )
        val request =
          Request.Builder()
            .url(server.url("/"))
            .post(AsyncRequestBody())
            .build()
    Plain Text
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Sat Jan 20 10:30:28 GMT 2024
    - 23.9K bytes
    - Viewed (0)
Back to top