Exemplo n.º 1
0
 @Test
 public void testCopyFromString() throws IOException {
   String content = "content";
   StringWriter out = new StringWriter();
   copy(content, out);
   assertThat(out.toString(), equalTo(content));
 }
Exemplo n.º 2
0
 @Test
 public void testCopyFromReader() throws IOException {
   String content = "content";
   StringReader in = new StringReader(content);
   StringWriter out = new StringWriter();
   int count = copy(in, out);
   assertThat(content.length(), equalTo(count));
   assertThat(out.toString(), equalTo(content));
 }