@Test public void testRLFormattingInvalidInput() throws Exception { final CharArrayBuffer buf = new CharArrayBuffer(64); final RequestLine requestline = new RequestLine(Method.GET.name(), "/stuff", HttpVersion.HTTP_1_1); try { this.formatter.formatRequestLine(null, requestline); Assert.fail("NullPointerException should habe been thrown"); } catch (final NullPointerException ex) { } try { this.formatter.formatRequestLine(buf, null); Assert.fail("NullPointerException should habe been thrown"); } catch (final NullPointerException ex) { } }
@Override public void formatRequestLine(final CharArrayBuffer buffer, final RequestLine reqline) { Args.notNull(buffer, "Char array buffer"); Args.notNull(reqline, "Request line"); buffer.append(reqline.getMethod()); buffer.append(' '); buffer.append(reqline.getUri()); buffer.append(' '); formatProtocolVersion(buffer, reqline.getProtocolVersion()); }
BasicLineFormatter implements LineFormatter { @Override public void formatRequestLine(final CharArrayBuffer buffer, final RequestLine reqline) { Args.notNull(buffer, "Char array buffer"); Args.notNull(reqline, "Request line"); buffer.append(reqline.getMethod()); buffer.append(' '); buffer.append(reqline.getUri()); buffer.append(' '); formatProtocolVersion(buffer, reqline.getProtocolVersion()); } }
BasicLineFormatter implements LineFormatter { @Override public void formatRequestLine(final CharArrayBuffer buffer, final RequestLine reqline) { Args.notNull(buffer, "Char array buffer"); Args.notNull(reqline, "Request line"); buffer.append(reqline.getMethod()); buffer.append(' '); buffer.append(reqline.getUri()); buffer.append(' '); formatProtocolVersion(buffer, reqline.getProtocolVersion()); } BasicLineFormatter(); }
BasicLineFormatter implements LineFormatter { @Override public void formatRequestLine(final CharArrayBuffer buffer, final RequestLine reqline) { Args.notNull(buffer, "Char array buffer"); Args.notNull(reqline, "Request line"); buffer.append(reqline.getMethod()); buffer.append(' '); buffer.append(reqline.getUri()); buffer.append(' '); formatProtocolVersion(buffer, reqline.getProtocolVersion()); } BasicLineFormatter(); @Override void formatRequestLine(final CharArrayBuffer buffer, final RequestLine reqline); @Override void formatStatusLine(final CharArrayBuffer buffer, final StatusLine statusLine); @Override void formatHeader(final CharArrayBuffer buffer, final Header header); }
BasicLineFormatter implements LineFormatter { @Override public void formatRequestLine(final CharArrayBuffer buffer, final RequestLine reqline) { Args.notNull(buffer, "Char array buffer"); Args.notNull(reqline, "Request line"); buffer.append(reqline.getMethod()); buffer.append(' '); buffer.append(reqline.getUri()); buffer.append(' '); formatProtocolVersion(buffer, reqline.getProtocolVersion()); } BasicLineFormatter(); @Override void formatRequestLine(final CharArrayBuffer buffer, final RequestLine reqline); @Override void formatStatusLine(final CharArrayBuffer buffer, final StatusLine statusLine); @Override void formatHeader(final CharArrayBuffer buffer, final Header header); final static BasicLineFormatter INSTANCE; }