@Test public void testCookie() throws ProtocolException { String cookie1 = "SID=31d4d96e407aad42; lang=en-US"; List<HttpCookie> cookies = cookieDecoder.decode(cookie1.getBytes()); Assert.assertEquals(2, cookies.size()); for (HttpCookie cookie : cookies) { LOG.debug("[CRAFT-ATOM-PROTOCOL-HTTP] Encoded cookie={}", new String(encoder.encode(cookie))); } String cookie2 = "test=test123"; cookies = cookieDecoder.decode(cookie2.getBytes()); Assert.assertEquals(1, cookies.size()); for (HttpCookie cookie : cookies) { LOG.debug("[CRAFT-ATOM-PROTOCOL-HTTP] Encoded cookie={}", new String(encoder.encode(cookie))); } System.out.println(String.format("[CRAFT-ATOM-PROTOCOL-HTTP] (^_^) <%s> Case -> test cookie. ", CaseCounter.incr(2))); }
@Override public List<HttpCookie> decode(byte[] bytes) throws ProtocolException { try { if (setCookie) { return decode4setCookie(bytes); } else { return decode4cookie(bytes); } } catch (Exception e) { if (e instanceof ProtocolException) { throw (ProtocolException) e; } throw new ProtocolException(e); } }
HttpCookieDecoder extends AbstractProtocolCodec implements ProtocolDecoder<HttpCookie> { @Override public List<HttpCookie> decode(byte[] bytes) throws ProtocolException { try { if (setCookie) { return decode4setCookie(bytes); } else { return decode4cookie(bytes); } } catch (Exception e) { if (e instanceof ProtocolException) { throw (ProtocolException) e; } throw new ProtocolException(e); } } }
HttpCookieDecoder extends AbstractProtocolCodec implements ProtocolDecoder<HttpCookie> { @Override public List<HttpCookie> decode(byte[] bytes) throws ProtocolException { try { if (setCookie) { return decode4setCookie(bytes); } else { return decode4cookie(bytes); } } catch (Exception e) { if (e instanceof ProtocolException) { throw (ProtocolException) e; } throw new ProtocolException(e); } } HttpCookieDecoder();  HttpCookieDecoder(Charset charset);  HttpCookieDecoder(Charset charset, boolean setCookie); }
HttpCookieDecoder extends AbstractProtocolCodec implements ProtocolDecoder<HttpCookie> { @Override public List<HttpCookie> decode(byte[] bytes) throws ProtocolException { try { if (setCookie) { return decode4setCookie(bytes); } else { return decode4cookie(bytes); } } catch (Exception e) { if (e instanceof ProtocolException) { throw (ProtocolException) e; } throw new ProtocolException(e); } } HttpCookieDecoder();  HttpCookieDecoder(Charset charset);  HttpCookieDecoder(Charset charset, boolean setCookie); @Override void reset(); @Override List<HttpCookie> decode(byte[] bytes); }
HttpCookieDecoder extends AbstractProtocolCodec implements ProtocolDecoder<HttpCookie> { @Override public List<HttpCookie> decode(byte[] bytes) throws ProtocolException { try { if (setCookie) { return decode4setCookie(bytes); } else { return decode4cookie(bytes); } } catch (Exception e) { if (e instanceof ProtocolException) { throw (ProtocolException) e; } throw new ProtocolException(e); } } HttpCookieDecoder();  HttpCookieDecoder(Charset charset);  HttpCookieDecoder(Charset charset, boolean setCookie); @Override void reset(); @Override List<HttpCookie> decode(byte[] bytes);  }