@Test public void testConsumer() throws Exception { URL url = new URL(url("foo")); HttpURLConnection conn = (HttpURLConnection) url.openConnection(); conn.setDoOutput(true); byte[] pattern = new byte[64]; for (int i = 0; i < pattern.length; i++) { pattern[i] = (byte) (33 + i); } int count = 1024 * 1024 * 16; count = 16; int targetSize = count * pattern.length; conn.setFixedLengthStreamingMode(targetSize); conn.connect(); OutputStream out = conn.getOutputStream(); int total = 0; for (int i = 0; i < count; i++) { out.write(pattern); total += pattern.length; } out.flush(); out.close(); assertEquals(200, conn.getResponseCode()); conn.disconnect(); assertEquals(total, targetSize); assertEquals(total, behaviour().getTotal()); }
public int getTotal() { int ret = total; total = 0; return ret; }
Consumer extends BehaviourSupport { public int getTotal() { int ret = total; total = 0; return ret; } }
Consumer extends BehaviourSupport { public int getTotal() { int ret = total; total = 0; return ret; }  }
Consumer extends BehaviourSupport { public int getTotal() { int ret = total; total = 0; return ret; }  boolean execute(HttpServletRequest request, HttpServletResponse response, Map<Object, Object> ctx); int getTotal(); }
Consumer extends BehaviourSupport { public int getTotal() { int ret = total; total = 0; return ret; }  boolean execute(HttpServletRequest request, HttpServletResponse response, Map<Object, Object> ctx); int getTotal();  }