Class RequestHandlerTestDriver.MockResponseHandler

  • All Implemented Interfaces:
    com.yahoo.jdisc.handler.ResponseHandler
    Enclosing class:
    RequestHandlerTestDriver

    public static class RequestHandlerTestDriver.MockResponseHandler
    extends Object
    implements com.yahoo.jdisc.handler.ResponseHandler
    • Constructor Detail

      • MockResponseHandler

        public MockResponseHandler()
    • Method Detail

      • read

        public String read()
        Read the next piece of data from this channel, blocking if needed. If all data is already read, this returns null.
      • available

        public int available()
        Returns the number of bytes available in the handler right now
      • readAll

        public String readAll()
        Reads all data that will ever be produced by the channel attached to this, blocking as necessary. Returns an empty string if there is no data.
      • readIfAvailable

        public String readIfAvailable()
        Consumes all currently available data, or returns "" if no data is available right now. Never blocks.
      • handleResponse

        public com.yahoo.jdisc.handler.ContentChannel handleResponse​(com.yahoo.jdisc.Response response)
        Specified by:
        handleResponse in interface com.yahoo.jdisc.handler.ResponseHandler
      • clientClose

        public void clientClose()
      • getStatus

        public int getStatus()
        Returns the status code. Throws an exception if handleResponse is not called prior to calling this
      • getResponse

        public com.yahoo.jdisc.Response getResponse()