public void testInputInputStream() throws Exception { HttpWire wire = setUp(); InputStream in = wire.input(new ByteArrayInputStream("foo".getBytes())); String compare = Strings2.toStringAndClose(in); Thread.sleep(100); assertEquals(compare, "foo"); assertEquals(((BufferLogger) wire.getWireLog()).buff.toString(), "<< \"foo\""); }
public HttpWire setUpSynch() throws Exception { BufferLogger bufferLogger = new BufferLogger(); HttpWire wire = new HttpWire(); wire.wireLog = (bufferLogger); return wire; }
public void testOutputString() throws Exception { HttpWire wire = setUp(); wire.output("foo"); assertEquals(((BufferLogger) wire.getWireLog()).buff.toString(), ">> \"foo\""); } }
public void testInputInputStreamSynch() throws Exception { HttpWire wire = setUpSynch(); InputStream in = wire.input(new ByteArrayInputStream("foo".getBytes())); String compare = Strings2.toStringAndClose(in); assertEquals(compare, "foo"); assertEquals(((BufferLogger) wire.getWireLog()).buff.toString(), "<< \"foo\""); }
public void testOutputBytes() throws Exception { HttpWire wire = setUp(); wire.output("foo".getBytes()); assertEquals(((BufferLogger) wire.getWireLog()).buff.toString(), ">> \"foo\""); }
public HttpWire setUpSynch() throws Exception { BufferLogger bufferLogger = new BufferLogger(); HttpWire wire = new HttpWire(); wire.wireLog = bufferLogger; return wire; }
public Void call() throws Exception { HttpWire wire = setUp(); InputStream in = wire.input(fromServer); ByteArrayOutputStream out = new ByteArrayOutputStream();// TODO copy(in, out); byte[] compare = md5().hashBytes(out.toByteArray()).asBytes(); Thread.sleep(100); assertEquals(base16().lowerCase().encode(compare), checkNotNull(sysHttpStreamMd5, sysHttpStreamMd5)); assertEquals(((BufferLogger) wire.getWireLog()).buff.toString().getBytes().length, 3331484); return null; } }
public void testOutputString() throws Exception { HttpWire wire = setUp(); wire.output("foo"); assertEquals(((BufferLogger) wire.getWireLog()).buff.toString(), ">> \"foo\""); }
public HttpWire setUp() throws Exception { BufferLogger bufferLogger = new BufferLogger(); HttpWire wire = new HttpWire(); wire.wireLog = (bufferLogger); return wire; }
public void testInputInputStream() throws Exception { HttpWire wire = setUp(); InputStream in = wire.input(new ByteArrayInputStream("foo".getBytes())); String compare = Strings2.toStringAndClose(in); Thread.sleep(100); assertEquals(compare, "foo"); assertEquals(((BufferLogger) wire.getWireLog()).buff.toString(), "<< \"foo\""); }
public void testOutputBytes() throws Exception { HttpWire wire = setUp(); wire.output("foo".getBytes()); assertEquals(((BufferLogger) wire.getWireLog()).buff.toString(), ">> \"foo\""); }
public HttpWire setUpSynch() throws Exception { BufferLogger bufferLogger = new BufferLogger(); HttpWire wire = new HttpWire(); wire.wireLog = (bufferLogger); return wire; }
public void testInputInputStreamSynch() throws Exception { HttpWire wire = setUpSynch(); InputStream in = wire.input(new ByteArrayInputStream("foo".getBytes())); String compare = Strings2.toStringAndClose(in); assertEquals(compare, "foo"); assertEquals(((BufferLogger) wire.getWireLog()).buff.toString(), "<< \"foo\""); }
public void testOutputInputStream() throws Exception { HttpWire wire = setUp(); InputStream in = wire.output(new ByteArrayInputStream("foo".getBytes())); String compare = Strings2.toStringAndClose(in); Thread.sleep(100); assertEquals(compare, "foo"); assertEquals(((BufferLogger) wire.getWireLog()).buff.toString(), ">> \"foo\""); }