@Test public void testNoDotHeaderBody() throws IOException { String data = "Subject: test\r\n\r\nABCD\r\n"; checkRead(new ExtraDotInputStream(new ByteArrayInputStream(data.getBytes())), data); checkReadViaArray(new ExtraDotInputStream(new ByteArrayInputStream(data.getBytes())), data); }
@Test public void testExtraDotOnDotWithText() throws IOException { String data = "This\r\n.TestText\r\nThis.\r\n"; String expected = "This\r\n..TestText\r\nThis.\r\n"; checkRead(new ExtraDotInputStream(new ByteArrayInputStream(data.getBytes())), expected); checkReadViaArray(new ExtraDotInputStream(new ByteArrayInputStream(data.getBytes())), expected); }
@Test public void testExtraDot() throws IOException { String data = "This\r\n.\r\nThis.\r\n"; String expectedOutput = "This\r\n..\r\nThis.\r\n"; checkRead(new ExtraDotInputStream(new ByteArrayInputStream(data.getBytes())), expectedOutput); checkReadViaArray(new ExtraDotInputStream(new ByteArrayInputStream(data.getBytes())), expectedOutput); }
@Test public void testExtraDotOnDoubleDot() throws IOException { String data = "This\r\n..\r\nThis.\r\n"; String expectedOutput = "This\r\n...\r\nThis.\r\n"; checkRead(new ExtraDotInputStream(new ByteArrayInputStream(data.getBytes())), expectedOutput); checkReadViaArray(new ExtraDotInputStream(new ByteArrayInputStream(data.getBytes())), expectedOutput); }
@Test public void testNoDot() throws IOException { String data = "ABCD"; checkRead(new ExtraDotInputStream(new ByteArrayInputStream(data.getBytes())), data); checkReadViaArray(new ExtraDotInputStream(new ByteArrayInputStream(data.getBytes())), data); }
@Test public void testNoDotCLRF() throws IOException { String data = "ABCD\r\n"; checkRead(new ExtraDotInputStream(new ByteArrayInputStream(data.getBytes())), data); checkReadViaArray(new ExtraDotInputStream(new ByteArrayInputStream(data.getBytes())), data); }
@Test public void testNoDotHeaderBody() throws IOException { String data = "Subject: test\r\n\r\nABCD\r\n"; checkRead(new ExtraDotInputStream(new ByteArrayInputStream(data.getBytes())), data); checkReadViaArray(new ExtraDotInputStream(new ByteArrayInputStream(data.getBytes())), data); }
@Test public void testExtraDotOnDotWithText() throws IOException { String data = "This\r\n.TestText\r\nThis.\r\n"; String expected = "This\r\n..TestText\r\nThis.\r\n"; checkRead(new ExtraDotInputStream(new ByteArrayInputStream(data.getBytes())), expected); checkReadViaArray(new ExtraDotInputStream(new ByteArrayInputStream(data.getBytes())), expected); }
@Test public void testExtraDot() throws IOException { String data = "This\r\n.\r\nThis.\r\n"; String expectedOutput = "This\r\n..\r\nThis.\r\n"; checkRead(new ExtraDotInputStream(new ByteArrayInputStream(data.getBytes())), expectedOutput); checkReadViaArray(new ExtraDotInputStream(new ByteArrayInputStream(data.getBytes())), expectedOutput); }
@Test public void testNoDotCLRF() throws IOException { String data = "ABCD\r\n"; checkRead(new ExtraDotInputStream(new ByteArrayInputStream(data.getBytes())), data); checkReadViaArray(new ExtraDotInputStream(new ByteArrayInputStream(data.getBytes())), data); }
@Test public void testExtraDotOnDoubleDot() throws IOException { String data = "This\r\n..\r\nThis.\r\n"; String expectedOutput = "This\r\n...\r\nThis.\r\n"; checkRead(new ExtraDotInputStream(new ByteArrayInputStream(data.getBytes())), expectedOutput); checkReadViaArray(new ExtraDotInputStream(new ByteArrayInputStream(data.getBytes())), expectedOutput); }
@Test public void testNoDot() throws IOException { String data = "ABCD"; checkRead(new ExtraDotInputStream(new ByteArrayInputStream(data.getBytes())), data); checkReadViaArray(new ExtraDotInputStream(new ByteArrayInputStream(data.getBytes())), data); }