Skip to content
Permalink
Browse files
Remove trailing white spaces on all lines.
  • Loading branch information
garydgregory committed Dec 18, 2019
1 parent ade390e commit e1c6c7626db139189d834bff7597d68ed1691c19
Show file tree
Hide file tree
Showing 8 changed files with 27 additions and 27 deletions.
@@ -519,7 +519,7 @@ private byte[] getMessageBodyBytes(final MimeMessage mimeMessage)
protected boolean isMailServerStopped(final Wiser fakeMailServer) {
return !fakeMailServer.getServer().isRunning();
}

/**
* Create a mocked URL object which always throws an IOException
* when the openStream() method is called.
@@ -533,7 +533,7 @@ protected URL createInvalidURL() throws Exception {
final URL url = createMock(URL.class);
expect(url.openStream()).andThrow(new IOException());
replay(url);

return url;
}
}
@@ -235,7 +235,7 @@ public void testHtmlMailMimeLayout() throws Exception
htmlEmail4.setHtmlMsg(htmlMsg);
htmlEmail4.attach(attachment);

EmailUtils.writeMimeMessage( new File("./target/test-emails/htmlemail4.eml"), send(htmlEmail4).getMimeMessage());
EmailUtils.writeMimeMessage( new File("./target/test-emails/htmlemail4.eml"), send(htmlEmail4).getMimeMessage());
}

/**
@@ -343,7 +343,7 @@ public void testSetFromBadEncoding() throws Exception {
email.setFrom("me@home.com", "me@home.com", "bad.encoding\uc5ec\n");
}

@Test
@Test
public void testAddTo() throws Exception
{
// ====================================================================
@@ -913,7 +913,7 @@ public void testGetHeaders()

assertEquals(ht.size(), email.getHeaders().size());
}

@Test
public void testFoldingHeaders() throws Exception
{
@@ -925,23 +925,23 @@ public void testFoldingHeaders() throws Exception

final String headerValue = "1234567890 1234567890 123456789 01234567890 123456789 0123456789 01234567890 01234567890";
email.addHeader("X-LongHeader", headerValue);

assertTrue(email.getHeaders().size() == 1);
// the header should not yet be folded -> will be done by buildMimeMessage()
assertFalse(email.getHeaders().get("X-LongHeader").contains("\r\n"));

email.buildMimeMessage();

final MimeMessage msg = email.getMimeMessage();
msg.saveChanges();

final String[] values = msg.getHeader("X-LongHeader");
assertEquals(1, values.length);

// the header should be split in two lines
final String[] lines = values[0].split("\\r\\n");
assertEquals(2, lines.length);

// there should only be one line-break
assertTrue(values[0].indexOf("\n") == values[0].lastIndexOf("\n"));
}
@@ -599,7 +599,7 @@ public void testAddZipUrl() throws Exception
this.email.getCcAddresses(),
this.email.getBccAddresses(),
false);

// make sure that no double dots show up
assertTrue(this.email.getHtmlMsg().contains("3DTZC268X93337.zip"));
assertFalse(this.email.getHtmlMsg().contains("3DTZC268X93337..zip"));
@@ -476,7 +476,7 @@ public void testEmail127() throws Exception {
email.getFromAddress(), email.getToAddresses(),
email.getCcAddresses(), email.getBccAddresses(), true);
}

private String loadUrlContent(final URL url) throws IOException {
final InputStream stream = url.openStream();
final StringBuilder html = new StringBuilder();
@@ -490,7 +490,7 @@ private String loadUrlContent(final URL url) throws IOException {
}
return html.toString();
}

private static final class MockDataSourceClassPathResolver extends DataSourceClassPathResolver {

public MockDataSourceClassPathResolver(final String classPathBase, final boolean lenient) {
@@ -504,6 +504,6 @@ public DataSource resolve(final String resourceLocation, final boolean isLenient
ds.setName(null);
return ds;
}

}
}
@@ -327,15 +327,15 @@ public void testAttachFileLocking() throws Exception {
// ====================================================================

final File tmpFile = File.createTempFile("attachment", ".eml");

this.email.attach(
new FileDataSource(tmpFile),
"Test Attachment",
"Test Attachment Desc");

assertTrue(tmpFile.delete());
}

@Test
public void testAddPart() throws Exception
{
@@ -69,14 +69,14 @@ public void testExternalModification() throws Exception
final DataSourceCompositeResolver dataSourceResolver = new DataSourceCompositeResolver(dataSourceResolvers, true);

final DataSourceResolver[] arr = dataSourceResolver.getDataSourceResolvers();

// modify an element in the returned array
arr[0] = null;

final DataSourceResolver[] arr2 = dataSourceResolver.getDataSourceResolvers();

// assert that the external modification is not propagated to the internal array
assertNotNull(arr2[0]);
assertNotNull(arr2[0]);
}

}
@@ -159,7 +159,7 @@ public void testParseHtmlEmailWithAttachmentAndEncodedFilename() throws Exceptio
*
* @throws Exception the test failed
*/
@Test
@Test
public void testParseMultipartReport() throws Exception
{
DataSource dataSource;
@@ -197,7 +197,7 @@ public void testParseMultipartReport() throws Exception
*
* @throws Exception the test failed
*/
@Test
@Test
public void testAttachmentOnly() throws Exception
{
DataSource dataSource;
@@ -227,15 +227,15 @@ public void testAttachmentOnly() throws Exception
assertNotNull(dataSource);
assertEquals("application/pdf", dataSource.getContentType());
}

/**
* This test parses an eml file published with issue EMAIL-110.
* This eml file has a corrupted attachment but should not create
* an OutOfMemoryException.
*
*
* @throws Exception the test failed
*/
@Test
@Test
public void testParseNoHeaderSeperatorWithOutOfMemory() throws Exception
{
final Session session = Session.getDefaultInstance(new Properties());
@@ -261,7 +261,7 @@ public void testParseNoHeaderSeperatorWithOutOfMemory() throws Exception
*
* @throws Exception the test failed
*/
@Test
@Test
public void testMultipartTextAttachment() throws Exception
{
DataSource dataSource;
@@ -297,7 +297,7 @@ public void testMultipartTextAttachment() throws Exception
*
* @throws Exception the test failed
*/
@Test
@Test
public void testMultipartTextAttachmentOnly() throws Exception
{
DataSource dataSource;

0 comments on commit e1c6c76

Please sign in to comment.