Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 9 of 9 for enqueueResponse (0.19 sec)

  1. mockwebserver-deprecated/src/main/kotlin/okhttp3/mockwebserver/QueueDispatcher.kt

        throw UnsupportedOperationException("unexpected call")
      }
    
      override fun peek(): MockResponse {
        throw UnsupportedOperationException("unexpected call")
      }
    
      fun enqueueResponse(response: MockResponse) {
        delegate.enqueueResponse(response.wrap())
      }
    
      override fun shutdown() {
        delegate.shutdown()
      }
    
      fun setFailFast(failFast: Boolean) {
        delegate.setFailFast(failFast)
      }
    
    Registered: Fri Nov 01 11:42:11 UTC 2024
    - Last Modified: Sun Oct 18 12:55:43 UTC 2020
    - 1.3K bytes
    - Viewed (0)
  2. 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)
  3. 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)
  4. 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)
  5. mockwebserver-deprecated/api/mockwebserver.api

    	public fun <init> ()V
    	public fun dispatch (Lokhttp3/mockwebserver/RecordedRequest;)Lokhttp3/mockwebserver/MockResponse;
    	public final fun enqueueResponse (Lokhttp3/mockwebserver/MockResponse;)V
    	public fun peek ()Lokhttp3/mockwebserver/MockResponse;
    	public final fun setFailFast (Lokhttp3/mockwebserver/MockResponse;)V
    	public final fun setFailFast (Z)V
    Registered: Fri Nov 01 11:42:11 UTC 2024
    - Last Modified: Sat Jul 22 12:28:51 UTC 2023
    - 10.2K bytes
    - Viewed (0)
  6. mockwebserver/api/mockwebserver3.api

    	public static final field Companion Lmockwebserver3/QueueDispatcher$Companion;
    	public fun <init> ()V
    	public fun clear ()V
    	public fun dispatch (Lmockwebserver3/RecordedRequest;)Lmockwebserver3/MockResponse;
    	public fun enqueueResponse (Lmockwebserver3/MockResponse;)V
    	protected final fun getResponseQueue ()Ljava/util/concurrent/BlockingQueue;
    	public fun peek ()Lmockwebserver3/MockResponse;
    	public fun setFailFast (Lmockwebserver3/MockResponse;)V
    Registered: Fri Nov 01 11:42:11 UTC 2024
    - Last Modified: Tue Jan 03 21:59:45 UTC 2023
    - 12.7K bytes
    - Viewed (0)
  7. 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)
  8. 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)
  9. 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