本文整理汇总了Java中org.apache.hadoop.hbase.rest.filter.GZIPResponseStream类的典型用法代码示例。如果您正苦于以下问题:Java GZIPResponseStream类的具体用法?Java GZIPResponseStream怎么用?Java GZIPResponseStream使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
GZIPResponseStream类属于org.apache.hadoop.hbase.rest.filter包,在下文中一共展示了GZIPResponseStream类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testResetBuffer
import org.apache.hadoop.hbase.rest.filter.GZIPResponseStream; //导入依赖的package包/类
@Test
public void testResetBuffer() throws IOException {
when(response.isCommitted()).thenReturn(false);
ServletOutputStream out = mock(ServletOutputStream.class);
when(response.getOutputStream()).thenReturn(out);
ServletOutputStream servletOutput = wrapper.getOutputStream();
assertEquals(GZIPResponseStream.class, servletOutput.getClass());
wrapper.resetBuffer();
verify(response).setHeader("Content-Encoding", null);
when(response.isCommitted()).thenReturn(true);
servletOutput = wrapper.getOutputStream();
assertEquals(out.getClass(), servletOutput.getClass());
assertNotNull(wrapper.getWriter());
}
示例2: testReset
import org.apache.hadoop.hbase.rest.filter.GZIPResponseStream; //导入依赖的package包/类
@Test
public void testReset() throws IOException {
when(response.isCommitted()).thenReturn(false);
ServletOutputStream out = mock(ServletOutputStream.class);
when(response.getOutputStream()).thenReturn(out);
ServletOutputStream servletOutput = wrapper.getOutputStream();
verify(response).addHeader("Content-Encoding", "gzip");
assertEquals(GZIPResponseStream.class, servletOutput.getClass());
wrapper.reset();
verify(response).setHeader("Content-Encoding", null);
when(response.isCommitted()).thenReturn(true);
servletOutput = wrapper.getOutputStream();
assertEquals(out.getClass(), servletOutput.getClass());
}
示例3: testResetBuffer
import org.apache.hadoop.hbase.rest.filter.GZIPResponseStream; //导入依赖的package包/类
@Test
public void testResetBuffer() throws IOException {
HttpServletResponse response = mock(HttpServletResponse.class);
when(response.isCommitted()).thenReturn(false);
ServletOutputStream out = mock(ServletOutputStream.class);
when(response.getOutputStream()).thenReturn(out);
GZIPResponseWrapper test = new GZIPResponseWrapper(response);
ServletOutputStream servletOutput = test.getOutputStream();
assertEquals(org.apache.hadoop.hbase.rest.filter.GZIPResponseStream.class,
servletOutput.getClass());
test.resetBuffer();
verify(response).setHeader("Content-Encoding", null);
when(response.isCommitted()).thenReturn(true);
servletOutput = test.getOutputStream();
assertEquals(out.getClass(), servletOutput.getClass());
assertNotNull(test.getWriter());
}
示例4: testReset
import org.apache.hadoop.hbase.rest.filter.GZIPResponseStream; //导入依赖的package包/类
@Test
public void testReset() throws IOException {
HttpServletResponse response = mock(HttpServletResponse.class);
when(response.isCommitted()).thenReturn(false);
ServletOutputStream out = mock(ServletOutputStream.class);
when(response.getOutputStream()).thenReturn(out);
GZIPResponseWrapper test = new GZIPResponseWrapper(response);
ServletOutputStream servletOutput = test.getOutputStream();
assertEquals(org.apache.hadoop.hbase.rest.filter.GZIPResponseStream.class,
servletOutput.getClass());
test.reset();
verify(response).setHeader("Content-Encoding", null);
when(response.isCommitted()).thenReturn(true);
servletOutput = test.getOutputStream();
assertEquals(out.getClass(), servletOutput.getClass());
}
示例5: testGZIPResponseStream
import org.apache.hadoop.hbase.rest.filter.GZIPResponseStream; //导入依赖的package包/类
@Test
public void testGZIPResponseStream() throws IOException {
HttpServletResponse httpResponce = mock(HttpServletResponse.class);
ServletOutputStream out = mock(ServletOutputStream.class);
when(httpResponce.getOutputStream()).thenReturn(out);
GZIPResponseStream test = new GZIPResponseStream(httpResponce);
verify(httpResponce).addHeader("Content-Encoding", "gzip");
test.close();
test.resetBuffer();
verify(httpResponce).setHeader("Content-Encoding", null);
}