public void setBodyContent(byte[] data) { bodyContent = new MockServletInputStream(data); }
public void setBodyContent(byte[] data) { bodyContent = new MockServletInputStream(data); }
public void setBodyContent(byte[] data) { bodyContent = new MockServletInputStream(data); }
/** * Resets the state of this object to the default values */ public void resetAll() { attributes = new HashMap(); parameters = new HashMap(); locales = new Vector(); requestDispatchers = new HashMap(); method = "GET"; headers = new CaseAwareMap(); requestedSessionIdIsFromCookie = true; protocol = "HTTP/1.1"; serverName = "localhost"; serverPort = 8080; scheme = "http"; remoteHost = "localhost"; remoteAddr = "127.0.0.1"; roles = new HashMap(); contentLength = -1; cookies = new ArrayList(); localAddr = "127.0.0.1"; localName = "localhost"; localPort = 8080; remotePort = 5000; sessionCreated = false; //attributeListener = new ArrayList(); bodyContent = new MockServletInputStream(new byte[0]); }
/** * Resets the state of this object to the default values */ public void resetAll() { attributes = new HashMap(); parameters = new HashMap(); locales = new Vector(); requestDispatchers = new HashMap(); method = "GET"; headers = new CaseAwareMap(); requestedSessionIdIsFromCookie = true; protocol = "HTTP/1.1"; serverName = "localhost"; serverPort = 8080; scheme = "http"; remoteHost = "localhost"; remoteAddr = "127.0.0.1"; roles = new HashMap(); contentLength = -1; cookies = null; localAddr = "127.0.0.1"; localName = "localhost"; localPort = 8080; remotePort = 5000; sessionCreated = false; attributeListener = new ArrayList(); bodyContent = new MockServletInputStream(new byte[0]); isAsyncSupported = false; }
/** * Resets the state of this object to the default values */ public void resetAll() { attributes = new HashMap(); parameters = new HashMap(); locales = new Vector(); requestDispatchers = new HashMap(); method = "GET"; headers = new CaseAwareMap(); requestedSessionIdIsFromCookie = true; protocol = "HTTP/1.1"; serverName = "localhost"; serverPort = 8080; scheme = "http"; remoteHost = "localhost"; remoteAddr = "127.0.0.1"; roles = new HashMap(); contentLength = -1; cookies = new ArrayList(); localAddr = "127.0.0.1"; localName = "localhost"; localPort = 8080; remotePort = 5000; sessionCreated = false; //attributeListener = new ArrayList(); bodyContent = new MockServletInputStream(new byte[0]); }
public void testInputStreamMaxSizeZero() throws Exception { byte[] data = data(); MockServletInputStream mock = new MockServletInputStream(data); MonitorInputStream in = new MonitorInputStream(mock, 0); byte[] read = read(in); assertEquals(data.length, read.length); byte[] buffer = in.getData(); assertEquals(0, buffer.length); // ? why does this report 1 off ? assertEquals(data.length - 1, in.getBytesRead()); }
public void testInputStream() throws Exception { byte[] data = data(); MockServletInputStream mock = new MockServletInputStream(data); MonitorInputStream in = new MonitorInputStream(mock, 1024); byte[] read = read(in); assertEquals(data.length, read.length); byte[] buffer = in.getData(); assertEquals(1024, buffer.length); for (int i = 0; i < buffer.length; i++) { assertEquals(data[i], buffer[i]); } // ? why does this report 1 off ? assertEquals(data.length - 1, in.getBytesRead()); }