\r
public class JU_DoubleOutputStreamTest {\r
\r
- @Mock\r
- private OutputStream stream1;\r
+ @Mock\r
+ private OutputStream stream1;\r
\r
- @Mock\r
- private OutputStream stream2;\r
+ @Mock\r
+ private OutputStream stream2;\r
\r
- private DoubleOutputStream doubleOutputStream;\r
+ private DoubleOutputStream doubleOutputStream;\r
\r
- @Before\r
- public void setup() {\r
- stream1 = mock(OutputStream.class);\r
- stream2 = mock(OutputStream.class);\r
- }\r
+ @Before\r
+ public void setup() {\r
+ stream1 = mock(OutputStream.class);\r
+ stream2 = mock(OutputStream.class);\r
+ }\r
\r
- @Test\r
- public void testWriteInt() throws IOException {\r
- doubleOutputStream = new DoubleOutputStream(stream1, true, stream2, true);\r
+ @Test\r
+ public void testWriteInt() throws IOException {\r
+ doubleOutputStream = new DoubleOutputStream(stream1, true, stream2, true);\r
\r
- doubleOutputStream.write(123);\r
+ doubleOutputStream.write(123);\r
\r
- verify(stream1, only()).write(123);\r
- verify(stream2, only()).write(123);\r
- }\r
+ verify(stream1, only()).write(123);\r
+ verify(stream2, only()).write(123);\r
+ }\r
\r
- @Test\r
- public void testWriteByteArray() throws IOException {\r
- doubleOutputStream = new DoubleOutputStream(stream1, true, stream2, true);\r
+ @Test\r
+ public void testWriteByteArray() throws IOException {\r
+ doubleOutputStream = new DoubleOutputStream(stream1, true, stream2, true);\r
\r
- byte[] bytes = { 1, 2, 3, 4 };\r
+ byte[] bytes = { 1, 2, 3, 4 };\r
\r
- doubleOutputStream.write(bytes);\r
+ doubleOutputStream.write(bytes);\r
\r
- verify(stream1, only()).write(bytes);\r
- verify(stream2, only()).write(bytes);\r
+ verify(stream1, only()).write(bytes);\r
+ verify(stream2, only()).write(bytes);\r
\r
- }\r
+ }\r
\r
- @Test\r
- public void testWriteByteArrayWithOffset() throws IOException {\r
- doubleOutputStream = new DoubleOutputStream(stream1, true, stream2, true);\r
+ @Test\r
+ public void testWriteByteArrayWithOffset() throws IOException {\r
+ doubleOutputStream = new DoubleOutputStream(stream1, true, stream2, true);\r
\r
- byte[] bytes = { 1, 2, 3, 4 };\r
+ byte[] bytes = { 1, 2, 3, 4 };\r
\r
- doubleOutputStream.write(bytes, 1, 3);\r
- verify(stream1, only()).write(bytes, 1, 3);\r
- verify(stream2, only()).write(bytes, 1, 3);\r
- }\r
+ doubleOutputStream.write(bytes, 1, 3);\r
+ verify(stream1, only()).write(bytes, 1, 3);\r
+ verify(stream2, only()).write(bytes, 1, 3);\r
+ }\r
\r
- @Test\r
- public void testFlush() throws IOException {\r
- doubleOutputStream = new DoubleOutputStream(stream1, true, stream2, true);\r
+ @Test\r
+ public void testFlush() throws IOException {\r
+ doubleOutputStream = new DoubleOutputStream(stream1, true, stream2, true);\r
\r
- doubleOutputStream.flush();\r
+ doubleOutputStream.flush();\r
\r
- verify(stream1, only()).flush();\r
- verify(stream2, only()).flush();\r
- }\r
+ verify(stream1, only()).flush();\r
+ verify(stream2, only()).flush();\r
+ }\r
\r
- @Test\r
- public void testClose() throws IOException {\r
- doubleOutputStream = new DoubleOutputStream(stream1, true, stream2, false);\r
+ @Test\r
+ public void testClose() throws IOException {\r
+ doubleOutputStream = new DoubleOutputStream(stream1, true, stream2, false);\r
\r
- doubleOutputStream.close();\r
+ doubleOutputStream.close();\r
\r
- verify(stream1, only()).close();\r
- verify(stream2, never()).close();\r
- }\r
+ verify(stream1, only()).close();\r
+ verify(stream2, never()).close();\r
+ }\r
}\r