public void testWriteLines_withDefaultSeparator() throws IOException { sink.writeLines(ImmutableList.of("foo", "bar", "baz")); String separator = System.getProperty("line.separator"); assertEquals("foo" + separator + "bar" + separator + "baz" + separator, sink.getString()); }
public void testWriteLines_stream() throws IOException { sink.writeLines(ImmutableList.of("foo", "bar", "baz").stream()); String separator = System.getProperty("line.separator"); assertEquals("foo" + separator + "bar" + separator + "baz" + separator, sink.getString()); }
public void testWriteLines_stream_separator() throws IOException { sink.writeLines(ImmutableList.of("foo", "bar", "baz").stream(), "!"); assertEquals("foo!bar!baz!", sink.getString()); }
public void testWriteLines_withSpecificSeparator() throws IOException { sink.writeLines(ImmutableList.of("foo", "bar", "baz"), "\n"); assertEquals("foo\nbar\nbaz\n", sink.getString()); }
public void testCopyTo_charSink() throws IOException { TestCharSink sink = new TestCharSink(); assertEquals(expected.length(), source.copyTo(sink)); assertExpectedString(sink.getString()); }
public void testWriteFrom_reader() throws IOException { StringReader reader = new StringReader(STRING); sink.writeFrom(reader); assertTrue(sink.wasStreamOpened() && sink.wasStreamClosed()); assertEquals(STRING, sink.getString()); }
public void testOpenBufferedStream() throws IOException { Writer writer = sink.openBufferedStream(); assertTrue(sink.wasStreamOpened()); assertFalse(sink.wasStreamClosed()); writer.write(STRING); writer.close(); assertTrue(sink.wasStreamClosed()); assertEquals(STRING, sink.getString()); }
public void testCopyTo_charSink() throws IOException { TestCharSink sink = new TestCharSink(); assertFalse(sink.wasStreamOpened() || sink.wasStreamClosed()); assertEquals(STRING.length(), source.copyTo(sink)); assertTrue(source.wasStreamOpened() && source.wasStreamClosed()); assertTrue(sink.wasStreamOpened() && sink.wasStreamClosed()); assertEquals(STRING, sink.getString()); }
public void testWriteLines_stream() throws IOException { sink.writeLines(ImmutableList.of("foo", "bar", "baz").stream()); String separator = System.getProperty("line.separator"); assertEquals("foo" + separator + "bar" + separator + "baz" + separator, sink.getString()); }
public void testWriteLines_stream_separator() throws IOException { sink.writeLines(ImmutableList.of("foo", "bar", "baz").stream(), "!"); assertEquals("foo!bar!baz!", sink.getString()); }
public void testWriteLines_withDefaultSeparator() throws IOException { sink.writeLines(ImmutableList.of("foo", "bar", "baz")); String separator = System.getProperty("line.separator"); assertEquals("foo" + separator + "bar" + separator + "baz" + separator, sink.getString()); }
public void testWriteLines_withSpecificSeparator() throws IOException { sink.writeLines(ImmutableList.of("foo", "bar", "baz"), "\n"); assertEquals("foo\nbar\nbaz\n", sink.getString()); }
public void testCopyTo_charSink() throws IOException { TestCharSink sink = new TestCharSink(); assertEquals(expected.length(), source.copyTo(sink)); assertExpectedString(sink.getString()); }
public void testWriteFrom_reader() throws IOException { StringReader reader = new StringReader(STRING); sink.writeFrom(reader); assertTrue(sink.wasStreamOpened() && sink.wasStreamClosed()); assertEquals(STRING, sink.getString()); }
public void testOpenBufferedStream() throws IOException { Writer writer = sink.openBufferedStream(); assertTrue(sink.wasStreamOpened()); assertFalse(sink.wasStreamClosed()); writer.write(STRING); writer.close(); assertTrue(sink.wasStreamClosed()); assertEquals(STRING, sink.getString()); }
public void testCopyTo_charSink() throws IOException { TestCharSink sink = new TestCharSink(); assertFalse(sink.wasStreamOpened() || sink.wasStreamClosed()); assertEquals(STRING.length(), source.copyTo(sink)); assertTrue(source.wasStreamOpened() && source.wasStreamClosed()); assertTrue(sink.wasStreamOpened() && sink.wasStreamClosed()); assertEquals(STRING, sink.getString()); }