@Test public void testNingRequestEquals() throws Exception { Assert.assertTrue( ParsecEqualsUtil.ningRequestEquals( new RequestBuilder().setUrl("http: new RequestBuilder().setUrl("http: ) ); Assert.assertFalse( ParsecEqualsUtil.ningRequestEquals( new RequestBuilder().setUrl("http: .setBody(Arrays.asList(new byte[] {1,2,3})) .build(), new RequestBuilder().setUrl("http: .build() ) ); Assert.assertFalse( ParsecEqualsUtil.ningRequestEquals( new RequestBuilder().setUrl("http: .addBodyPart(new StringPart("abc", "def")) .build(), new RequestBuilder().setUrl("http: .build() ) ); Assert.assertFalse( ParsecEqualsUtil.ningRequestEquals( new RequestBuilder().setUrl("http: .setProxyServer(new ProxyServer("localhost", 8080)) .build(), new RequestBuilder().setUrl("http: .build() ) ); Assert.assertFalse( ParsecEqualsUtil.ningRequestEquals( new RequestBuilder().setUrl("http: .build(), new RequestBuilder().setUrl("http: .setBody(Arrays.asList(new byte[] {1,2,3})) .build() ) ); Assert.assertFalse( ParsecEqualsUtil.ningRequestEquals( new RequestBuilder().setUrl("http: .build(), new RequestBuilder().setUrl("http: .addBodyPart(new StringPart("abc", "def")) .build() ) ); Assert.assertFalse( ParsecEqualsUtil.ningRequestEquals( new RequestBuilder().setUrl("http: .build(), new RequestBuilder().setUrl("http: .setProxyServer(new ProxyServer("localhost", 8080)) .build() ) ); }
static boolean ningRequestEquals(final Request lhs, final Request rhs) { if (!toStringEquals(lhs.getProxyServer(), rhs.getProxyServer())) { return false; } if (!byteArrayListEquals(lhs.getCompositeByteData(), rhs.getCompositeByteData())) { return false; } if (!partListEquals(lhs.getParts(), rhs.getParts())) { return false; } return new EqualsBuilder() .append(lhs.getBodyEncoding(), rhs.getBodyEncoding()) .append(lhs.getByteData(), rhs.getByteData()) .append(lhs.getContentLength(), rhs.getContentLength()) .append(lhs.getFollowRedirect(), rhs.getFollowRedirect()) .append(lhs.getMethod(), rhs.getMethod()) .append(lhs.getRangeOffset(), rhs.getRangeOffset()) .append(lhs.getRequestTimeout(), rhs.getRequestTimeout()) .append(lhs.getStringData(), rhs.getStringData()) .append(lhs.getUrl(), rhs.getUrl()) .append(lhs.getVirtualHost(), rhs.getVirtualHost()) .isEquals(); }
ParsecEqualsUtil { static boolean ningRequestEquals(final Request lhs, final Request rhs) { if (!toStringEquals(lhs.getProxyServer(), rhs.getProxyServer())) { return false; } if (!byteArrayListEquals(lhs.getCompositeByteData(), rhs.getCompositeByteData())) { return false; } if (!partListEquals(lhs.getParts(), rhs.getParts())) { return false; } return new EqualsBuilder() .append(lhs.getBodyEncoding(), rhs.getBodyEncoding()) .append(lhs.getByteData(), rhs.getByteData()) .append(lhs.getContentLength(), rhs.getContentLength()) .append(lhs.getFollowRedirect(), rhs.getFollowRedirect()) .append(lhs.getMethod(), rhs.getMethod()) .append(lhs.getRangeOffset(), rhs.getRangeOffset()) .append(lhs.getRequestTimeout(), rhs.getRequestTimeout()) .append(lhs.getStringData(), rhs.getStringData()) .append(lhs.getUrl(), rhs.getUrl()) .append(lhs.getVirtualHost(), rhs.getVirtualHost()) .isEquals(); } }
ParsecEqualsUtil { static boolean ningRequestEquals(final Request lhs, final Request rhs) { if (!toStringEquals(lhs.getProxyServer(), rhs.getProxyServer())) { return false; } if (!byteArrayListEquals(lhs.getCompositeByteData(), rhs.getCompositeByteData())) { return false; } if (!partListEquals(lhs.getParts(), rhs.getParts())) { return false; } return new EqualsBuilder() .append(lhs.getBodyEncoding(), rhs.getBodyEncoding()) .append(lhs.getByteData(), rhs.getByteData()) .append(lhs.getContentLength(), rhs.getContentLength()) .append(lhs.getFollowRedirect(), rhs.getFollowRedirect()) .append(lhs.getMethod(), rhs.getMethod()) .append(lhs.getRangeOffset(), rhs.getRangeOffset()) .append(lhs.getRequestTimeout(), rhs.getRequestTimeout()) .append(lhs.getStringData(), rhs.getStringData()) .append(lhs.getUrl(), rhs.getUrl()) .append(lhs.getVirtualHost(), rhs.getVirtualHost()) .isEquals(); } private  ParsecEqualsUtil(); }
ParsecEqualsUtil { static boolean ningRequestEquals(final Request lhs, final Request rhs) { if (!toStringEquals(lhs.getProxyServer(), rhs.getProxyServer())) { return false; } if (!byteArrayListEquals(lhs.getCompositeByteData(), rhs.getCompositeByteData())) { return false; } if (!partListEquals(lhs.getParts(), rhs.getParts())) { return false; } return new EqualsBuilder() .append(lhs.getBodyEncoding(), rhs.getBodyEncoding()) .append(lhs.getByteData(), rhs.getByteData()) .append(lhs.getContentLength(), rhs.getContentLength()) .append(lhs.getFollowRedirect(), rhs.getFollowRedirect()) .append(lhs.getMethod(), rhs.getMethod()) .append(lhs.getRangeOffset(), rhs.getRangeOffset()) .append(lhs.getRequestTimeout(), rhs.getRequestTimeout()) .append(lhs.getStringData(), rhs.getStringData()) .append(lhs.getUrl(), rhs.getUrl()) .append(lhs.getVirtualHost(), rhs.getVirtualHost()) .isEquals(); } private  ParsecEqualsUtil();  }
ParsecEqualsUtil { static boolean ningRequestEquals(final Request lhs, final Request rhs) { if (!toStringEquals(lhs.getProxyServer(), rhs.getProxyServer())) { return false; } if (!byteArrayListEquals(lhs.getCompositeByteData(), rhs.getCompositeByteData())) { return false; } if (!partListEquals(lhs.getParts(), rhs.getParts())) { return false; } return new EqualsBuilder() .append(lhs.getBodyEncoding(), rhs.getBodyEncoding()) .append(lhs.getByteData(), rhs.getByteData()) .append(lhs.getContentLength(), rhs.getContentLength()) .append(lhs.getFollowRedirect(), rhs.getFollowRedirect()) .append(lhs.getMethod(), rhs.getMethod()) .append(lhs.getRangeOffset(), rhs.getRangeOffset()) .append(lhs.getRequestTimeout(), rhs.getRequestTimeout()) .append(lhs.getStringData(), rhs.getStringData()) .append(lhs.getUrl(), rhs.getUrl()) .append(lhs.getVirtualHost(), rhs.getVirtualHost()) .isEquals(); } private  ParsecEqualsUtil();   }