Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 6 of 6 for enqueueResponse (0.11 sec)

  1. mockwebserver/src/main/kotlin/mockwebserver3/QueueDispatcher.kt

    import java.util.concurrent.LinkedBlockingQueue
    import java.util.logging.Logger
    import okhttp3.ExperimentalOkHttpApi
    
    /**
     * Default dispatcher that processes a script of responses. Populate the script by calling [enqueueResponse].
     */
    @ExperimentalOkHttpApi
    open class QueueDispatcher : Dispatcher() {
      protected val responseQueue: BlockingQueue<MockResponse> = LinkedBlockingQueue()
      private var failFastResponse: MockResponse? = null
    
    Registered: Fri Nov 01 11:42:11 UTC 2024
    - Last Modified: Tue Jan 23 14:31:42 UTC 2024
    - 3K bytes
    - Viewed (0)
  2. okhttp/src/test/java/okhttp3/internal/http2/HttpOverHttp2Test.kt

        val queueDispatcher = QueueDispatcher()
        queueDispatcher.enqueueResponse(MockResponse(inTunnel = true))
        queueDispatcher.enqueueResponse(MockResponse(inTunnel = true))
        queueDispatcher.enqueueResponse(MockResponse(body = "call2 response"))
        queueDispatcher.enqueueResponse(MockResponse(body = "call1 response"))
    
    Registered: Fri Nov 01 11:42:11 UTC 2024
    - Last Modified: Thu Apr 11 22:09:35 UTC 2024
    - 75.3K bytes
    - Viewed (0)
  3. mockwebserver-deprecated/src/test/java/okhttp3/mockwebserver/KotlinSourceModernTest.kt

          queueDispatcher.dispatch(
            RecordedRequest("", headersOf(), listOf(), 0L, Buffer(), 0, Socket()),
          )
        mockResponse = queueDispatcher.peek()
        queueDispatcher.enqueueResponse(MockResponse())
        queueDispatcher.shutdown()
        queueDispatcher.setFailFast(false)
        queueDispatcher.setFailFast(MockResponse())
      }
    
      @Test @Ignore
      fun recordedRequest() {
    Registered: Fri Nov 01 11:42:11 UTC 2024
    - Last Modified: Mon Jan 08 01:13:22 UTC 2024
    - 7.3K bytes
    - Viewed (0)
  4. mockwebserver/src/main/kotlin/mockwebserver3/MockWebServer.kt

       * so on.
       *
       * @throws ClassCastException if the default dispatcher has been
       * replaced with [setDispatcher][dispatcher].
       */
      fun enqueue(response: MockResponse) = (dispatcher as QueueDispatcher).enqueueResponse(response)
    
      /**
       * Starts the server on the loopback interface for the given port.
       *
       * @param port the port to listen to, or 0 for any available port. Automated tests should always
    Registered: Fri Nov 01 11:42:11 UTC 2024
    - Last Modified: Sun Mar 31 17:16:15 UTC 2024
    - 37.4K bytes
    - Viewed (0)
  5. okhttp/src/test/java/okhttp3/CallTest.kt

                requestFinished.await()
              }
              return super.dispatch(request)
            }
          }
        dispatcher.enqueueResponse(MockResponse(body = "seed connection pool"))
        dispatcher.enqueueResponse(MockResponse(socketPolicy = DisconnectAfterRequest))
        dispatcher.enqueueResponse(MockResponse(body = "retry success"))
        server.dispatcher = dispatcher
        listener =
          object : RecordingEventListener() {
    Registered: Fri Nov 01 11:42:11 UTC 2024
    - Last Modified: Wed Apr 10 19:46:48 UTC 2024
    - 142.5K bytes
    - Viewed (0)
  6. okhttp/src/test/java/okhttp3/KotlinSourceModernTest.kt

          queueDispatcher.dispatch(
            RecordedRequest("", headersOf(), listOf(), 0L, Buffer(), 0, Socket()),
          )
        mockResponse = queueDispatcher.peek()
        queueDispatcher.enqueueResponse(MockResponse())
        queueDispatcher.shutdown()
        queueDispatcher.setFailFast(false)
        queueDispatcher.setFailFast(MockResponse())
      }
    
      @Test
      fun recordedRequest() {
    Registered: Fri Nov 01 11:42:11 UTC 2024
    - Last Modified: Mon Apr 01 14:21:25 UTC 2024
    - 46.5K bytes
    - Viewed (0)
Back to top